Skip to content

{bp-19061} Assert size optimizations#19302

Merged
linguini1 merged 3 commits into
apache:releases/13.0from
jerpelea:bp-19061
Jul 4, 2026
Merged

{bp-19061} Assert size optimizations#19302
linguini1 merged 3 commits into
apache:releases/13.0from
jerpelea:bp-19061

Conversation

@jerpelea

@jerpelea jerpelea commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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

jlaitine added 3 commits July 4, 2026 19:00
- 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>
@jerpelea jerpelea requested review from anchao and michallenc and removed request for pussuw, raiden00pl and xiaoxiang781216 July 4, 2026 17:02
@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Size: S The size of the change in this PR is small labels Jul 4, 2026
@linguini1 linguini1 merged commit 3498bf1 into apache:releases/13.0 Jul 4, 2026
40 of 41 checks passed
@jerpelea jerpelea deleted the bp-19061 branch July 4, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants