Optimize stackdump trace: early-filter static variables via symbol HashMap#38
Open
henautio wants to merge 1 commit intotweedegolf:masterfrom
Open
Optimize stackdump trace: early-filter static variables via symbol HashMap#38henautio wants to merge 1 commit intotweedegolf:masterfrom
henautio wants to merge 1 commit intotweedegolf:masterfrom
Conversation
…bol_filter: Option<&HashMap<&str, Option<SectionKind>>> parameter. When provided, each DW_TAG_variable's linkage name is checked against the HashMap before the expensive read_variable_entry() call (type resolution, location evaluation, data reading). Variables destined to be filtered out (defmt symbols, LTO-removed symbols) are now skipped entirely. 2. O(1) symbol lookups — In trace_inner(), a HashMap<&str, Option<SectionKind>> is built once from all ELF symbols and passed into find_static_variables(), replacing the old O(n×m) elf.symbol_by_name() retain loop. 3. trace_no_statics() / --no-statics flag — Added trace_no_statics() entry point that skips statics entirely for cases where they're not needed.
ayodejiige
reviewed
Mar 14, 2026
There was a problem hiding this comment.
I think the lock file is very intentionally not checked in for this library,
| @@ -1,29 +1,76 @@ | |||
| # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | |||
There was a problem hiding this comment.
I don't see the need to significantly change this file. Preserve the original format.
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.
…bol_filter: Option<&HashMap<&str, Option>> parameter. When provided, each DW_TAG_variable's linkage name is checked against the HashMap before the expensive read_variable_entry() call (type resolution, location evaluation, data reading). Variables destined to be filtered out (defmt symbols, LTO-removed symbols) are now skipped entirely.
O(1) symbol lookups — In trace_inner(), a HashMap<&str, Option> is built once from all ELF symbols and passed into find_static_variables(), replacing the old O(n×m) elf.symbol_by_name() retain loop.
trace_no_statics() / --no-statics flag — Added trace_no_statics() entry point that skips statics entirely for cases where they're not needed.