summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/stackcollapse-report
diff options
context:
space:
mode:
authorMichael Liang <mliang@purestorage.com>2026-07-28 14:42:15 -0600
committerNamhyung Kim <namhyung@kernel.org>2026-07-31 15:47:28 -0700
commit022bcb6ba2d384d772f68477d11b2684afd6e715 (patch)
treeb48bc2cb201ca6d2caed1cf4e614ce41adaa20bb /tools/perf/scripts/python/bin/stackcollapse-report
parentf2effca1ef5d30b1ead61d74faea5e251f604a26 (diff)
perf libdw: Fix outer-frame name resolution and spurious "(inlined)" tag
cu_walk_functions_at() calls libdw_a2l_cb() with the containing DW_TAG_subprogram DIE first, then each DW_TAG_inlined_subroutine nested inside. The callback treated both the same way, causing two bugs: 1) die_name() returns the unqualified DW_AT_name, so every C++ frame lost its namespace/class prefix (ns::Class::method collapsed to method). 2) new_inline_sym() re-uses base_sym only when funcname matches base_sym->name exactly; otherwise it fabricates a fake symbol tagged "(inlined)". Any mismatch between the DWARF name and the ELF symbol name mis-tags an outer, non-inline frame as inlined. This hits C++ (die_name()'s unqualified output never matches the demangled ELF symbol) and it also hits C functions that GCC IPA-cloned (foo vs foo.isra.0 / .constprop / .part / .cold), since DW_AT_linkage_name doesn't reflect those renames. Fix both: * Prefer die_get_linkage_name() (mangled, fully qualified), falling back to die_name() when absent (C, extern "C"). new_inline_sym() already demangles via dso__demangle_sym(). * For DW_TAG_subprogram DIEs, use base_sym directly -- the DIE tag already tells us it is the outer function, sidestepping the name comparison entirely for both C++ qualification and GCC IPA-clone renames. Fixes: 88c51002d06f9a68 ("perf addr2line: Add a libdw implementation") Signed-off-by: Michael Liang <mliang@purestorage.com> Reviewed-by: James Clark <james.clark@linaro.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions