Skip to content

perf symbols/callchain/annotate: Bug fixes from symbol reference counting review

Ian Rogers linux-perf-users lkml 1 version Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3perf callchain: Fix loss of symbol in merge_chain_branch()tools/perf/util/callchain.c+1 -00 replies
2/3perf symbol-elf: Fix zero-size symbol end calculation across .symtab and .dynsymtools/perf/tests/symbols.c tools/perf/util/symbol-elf.c+190 -150 replies
3/3perf annotate: Fix block_range symbol loss on split and leaks on exittools/perf/builtin-annotate.c tools/perf/util/block-range.c tools/perf/util/block-range.h+22 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] perf symbols/callchain/annotate: Bug fixes from symbol reference counting review

While reviewing the v2 symbol reference counting series [1], Alireza Haghdoost identified three existing bugs in callchain merging, ELF zero-size symbol end calculation across .symtab and .dynsym, and basic block range splitting/cleanup in 'perf annotate'.

Pull these three fixes out ahead of v3 of the main series so they can land for the v7.4 merge window:

1. perf callchain: Fix loss of symbol in merge_chain_branch() Restore .sym = list->ms.sym when constructing the temporary struct map_symbol in merge_chain_branch(), fixing missing symbol names and inlined frames in 'perf report --children'.

2. perf symbol-elf: Fix zero-size symbol end calculation across .symtab and .dynsym
Move symbols__fixup_end(), symbols__fixup_duplicate(), and maps__fixup_end() from dso__load_sym_internal() to dso__load_sym() so zero-size .symtab symbols do not get extended across following .dynsym-only functions before .dynsym is loaded, and add a unit test in 'perf test symbols'.

3. perf annotate: Fix block_range symbol loss on split and leaks on exit Preserve .sym = entry->sym when splitting head/tail basic block ranges in block_range__create(), add block_ranges__exit(), and release resolved branch_info addr_map_symbol references in process_branch_stack().

This series was prepared with the assistance of Antigravity and Gemini 4.

Ian Rogers (3):
perf callchain: Fix loss of symbol in merge_chain_branch() perf symbol-elf: Fix zero-size symbol end calculation across .symtab
and .dynsym
perf annotate: Fix block_range symbol loss on split and leaks on exit

 tools/perf/builtin-annotate.c |   5 +
 tools/perf/tests/symbols.c    | 169 ++++++++++++++++++++++++++++++++++
 tools/perf/util/block-range.c |  16 ++++
 tools/perf/util/block-range.h |   1 +
 tools/perf/util/callchain.c   |   1 +
 tools/perf/util/symbol-elf.c  |  36 +++++---
 6 files changed, 213 insertions(+), 15 deletions(-)
Signature · 1 line
2.56.0.317.g454f8302e1-goog