Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let firmware info be optional to save RAM #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

satur9nine
Copy link

Many projects already have another mechanism for getting firmware info or want to save RAM and do not need firmware info of CmBacktrace.

@satur9nine
Copy link
Author

@armink any thoughts on this?

@armink
Copy link
Owner

armink commented Jun 30, 2024

These version number information seems to be necessary, and optimization is not recommended

@satur9nine
Copy link
Author

I agree that some system to track the version of product HW/SW version is necessary for most embedded systems but for example my company has been using CmBacktrace for many years but we already have our own version number mechanism and prefer not to have a duplicate system, thus it is not necessary for us and probably many other users. CmBacktrace works very well without version number tracking mechanism but your choice to take the PR or not.

@armink
Copy link
Owner

armink commented Jul 2, 2024

You can try to change CMB_USING_FIRMWARE_INFO to CMB_NOT_USING_FIRMWARE_INFO, so that everyone can upgrade without feeling.
Then, you need to check whether the program works properly when this macro is turned on and off.

@satur9nine satur9nine force-pushed the let-firmware-info-be-optional branch 4 times, most recently from d3b4a81 to 60cf01a Compare July 3, 2024 05:13
@BenBE
Copy link

BenBE commented Jul 3, 2024

Why not have a weak symbol cm_version_printinfo which resolves to a blank function if internal version info is disabled or a full function doing the output when enabled. If a user has its own mechanism they simply write their own function of that name without marking it as a weak symbol, thus replacing that function at link time.

Also, why have these version strings live inside of RAM buffers in the first place?

Many projects already have another mechanism for getting firmware info
or want to save RAM and do not need firmware info of CmBacktrace. With
this change user can pass NULL for name and version after setting the
define CMB_NOT_USING_FIRMWARE_INFO.
@satur9nine satur9nine force-pushed the let-firmware-info-be-optional branch from 60cf01a to 38d923b Compare July 3, 2024 19:18
@satur9nine
Copy link
Author

Why not have a weak symbol cm_version_printinfo which resolves to a blank function if internal version info is disabled or a full function doing the output when enabled. If a user has its own mechanism they simply write their own function of that name without marking it as a weak symbol, thus replacing that function at link time.

Also, why have these version strings live inside of RAM buffers in the first place?

Both good points, I can explore making these suggested changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants