Repository navigation
zephyr: lib: log per-allocation heap stats at debug level - #11525
Merged
lgirdwood merged 1 commit intoNov 23, 2026
Merged
Conversation
With CONFIG_SYS_HEAP_RUNTIME_STATS every heap and vregion allocation logs the heap usage at info level. These messages are only useful when debugging memory use, but they are the bulk of the boot log: the early init allocations alone fill the 4kB mtrace log slot, before the host starts reading it, so the FW ABI banner, that is logged after them, is lost and the sof-test check-sof-logger test fails to find it. Log the per-allocation heap and vregion statistics and the rbrealloc result at debug level. Allocation failures are still logged as errors and vpage and vregion creation stays at info level. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lgirdwood
requested review from
abonislawski,
dabekjakub,
dbaluta,
iuliana-prodan,
kv2019i and
lyakh
as code owners
November 23, 2026 13:24
PR 11525: test resultsRun date: 2026-11-23 13:45 UTC Tested commit: 99a665e1490d61d4aa3119709e96ba9ebfe9efb5 |
kv2019i
approved these changes
Nov 23, 2026
kv2019i
left a comment
Collaborator
There was a problem hiding this comment.
Ack. This was intended to be used with "-d" debug overlay originally. But with introduction of CONFIG_SOF_TELEMETRY_MEMORY , CONFIG_SYS_HEAP_RUNTIME_STATS is now default.
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.
With
CONFIG_SYS_HEAP_RUNTIME_STATS=yevery heap and vregion allocation logs the heap usage at info level. The early init allocations alone fill the 4 kB mtrace log slot before the host starts reading it. The FW ABI banner, logged after them, is then lost, and sof-testcheck-sof-logger.shfails with "Initial FW ABI banner not found". Whether the banner survives depends on how many allocations a platform does before it, so the failure is intermittent and platform dependent. It reproduces on WCL.This moves the per-allocation statistics to debug level:
zephyr/lib/alloc.c: the twoheap allocated: ...stats lines (L3 heap and normal heap) andrbealloc: new ptrzephyr/lib/vregion.c:lifetime alloc of ...andinterim alloc of ...Allocation failures are still logged as errors. vpage and vregion creation, which happen once per pipeline or region, stay at info level.
Tested on WCL (GCC build), reloading the driver and then reading mtrace as check-sof-logger does:
🤖 Generated with Claude Code