Skip to content

Optimize stackdump trace: early-filter static variables via symbol HashMap#38

Open
henautio wants to merge 1 commit intotweedegolf:masterfrom
henautio:master
Open

Optimize stackdump trace: early-filter static variables via symbol HashMap#38
henautio wants to merge 1 commit intotweedegolf:masterfrom
henautio:master

Conversation

@henautio
Copy link

…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.

  1. 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.

  2. trace_no_statics() / --no-statics flag — Added trace_no_statics() entry point that skips statics entirely for cases where they're not needed.

…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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need to significantly change this file. Preserve the original format.

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.

2 participants