{bp-19061} Assert size optimizations#19302
Merged
Merged
Conversation
- Use shared string for "stack pointer out of range" to avoid duplicate in flash - Re-use already calculated stack_used instead of calling up_check_tcbstack again Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
…STACK Add more refined options for sched/misc/assert to control how verbose crash dumps are printed out: - SCHED_DUMP_TASKS - SCHED_DUMP_STACK These default to y unless DEFAULT_SMALL is defined. The options can be undefined to save flash space on a small system. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
…TACK Add documentation for controlling the crash dump verbosity. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
linguini1
approved these changes
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Here is one proposal, how we could save a bit of flash on small systems.
First commit (not too significant one) doesn't change functionality, just cleans up a tiny amount of flash (64 bytes on 32-bit arm) by removing a duplicate string and an extra function call. The duplicate string was not cleaned up by linker because the string was only almost the same, the other one had one extra space.
The second one adds two new CONFIG flags giving more granularity to configure what to dump at crash:
CONFIG_SCHED_DUMP_STACK : Output stack dump at crash, consumes ~1kB flash ( If disabled, it still dumps the current stack, irq stack and kernel stack base and size )
CONFIG_SCHED_DUMP_TASKS : Output tasks dump at crash, consumes ~0.5kB flash
By removing these two, 1.6kB can be saved in flash size.
Both flags are defined !CONFIG_DEFAULT_SMALL, so with normal configurations the functionality is unchanged.
Impact
RELEASE
Testing
CI