Skip to content

perf ui hists / annotate: Remaining fixes for reference counting and annotation

Ian Rogers linux-perf-users lkml sashiko-reviews 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. v7 Latest6 patches 1 replyApplied

Changes in v7 from the cover letter

- Rebased onto latest perf-tools-next (after patches 1-3, 5-6 were merged).
- Move symbol_filter_str teardown to hists_evsel__exit() to allow filter persistence across TUI navigation while preventing memory leaks.
- Add memset zeroing to free_popup_actions() to prevent cross-iteration stale action leakage.
- Placed "Remove duplicated thread in popup_action" as the final patch in the series as requested.

Patches in v7 Applied

#Subject and filesSizeRepliesApplied
1/6perf ui hists: Fix stack use-after-return in symbol_filter_strtools/perf/builtin-report.c tools/perf/ui/browsers/hists.c tools/perf/util/hist.c+10 -30 replies
2/6perf ui hists: Guard against NULL hist_entry in add_script_opt()tools/perf/ui/browsers/hists.c+2 -00 replies
3/6perf ui hists: In report UI ensure thread is set with reference countingtools/perf/ui/browsers/hists.c+87 -480 replies
4/6perf ui hists: Fix dso_filter reference leak and exit zoom cleanuptools/perf/ui/browsers/hists.c+10 -20 replies
5/6perf annotate: Be robust to annotating without a threadtools/perf/ui/browsers/annotate.c tools/perf/util/annotate.c tools/perf/util/annotate.h +1 more+74 -240 replies
6/6perf ui hists: Remove duplicated thread in popup_actiontools/perf/ui/browsers/hists.c+0 -10 replies

Reviews trailers per patch

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

Read the v7 thread

Cover letter [PATCH v7 0/6] perf ui hists / annotate: Remaining fixes for reference counting and annotation

This series contains the remaining 6 unmerged patches from our UI, hists, and annotate fix series. Upstream maintainer Namhyung Kim applied patches 1-6 (except patch 4) from the v6 series into perf-tools-next.

This v7 series includes:
- Fix stack use-after-return for symbol_filter_str by duplicating with strdup() and freeing during evsel destruction in hists_evsel__exit().
- Guard against NULL hist_entry in add_script_opt() when trace is empty.
- Populate map_symbol thread in report UI with proper reference counting (map_symbol__copy, thread__get) and memset zeroing in free_popup_actions().
- Fix dso_filter reference leak and exit zoom cleanup.
- Robust cross-platform disassembly fallback when annotating without a thread.
- Remove duplicated thread member from struct popup_action (placed at the end of the series per reviewer feedback).

v7 Changes:
- Rebased onto latest perf-tools-next (after patches 1-3, 5-6 were merged).
- Move symbol_filter_str teardown to hists_evsel__exit() to allow filter persistence across TUI navigation while preventing memory leaks.
- Add memset zeroing to free_popup_actions() to prevent cross-iteration stale action leakage.
- Placed "Remove duplicated thread in popup_action" as the final patch in the series as requested.

Ian Rogers (6):
perf ui hists: Fix stack use-after-return in symbol_filter_str perf ui hists: Guard against NULL hist_entry in add_script_opt() perf ui hists: In report UI ensure thread is set with reference
counting
perf ui hists: Fix dso_filter reference leak and exit zoom cleanup perf annotate: Be robust to annotating without a thread perf ui hists: Remove duplicated thread in popup_action

 tools/perf/builtin-report.c       |   7 +-
 tools/perf/ui/browsers/annotate.c |   2 +-
 tools/perf/ui/browsers/hists.c    | 153 ++++++++++++++++++++----------
 tools/perf/util/annotate.c        |  51 +++++++---
 tools/perf/util/annotate.h        |   3 +-
 tools/perf/util/capstone.c        |  42 ++++++--
 tools/perf/util/hist.c            |   1 +
 7 files changed, 182 insertions(+), 77 deletions(-)
Signature · 1 line
2.55.0.229.g6434b31f56-goog