All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/4] perf tools: Fix thread cache race, stat per-pkg delta bug, and memory leaks
@ 2026-11-18  7:55 Ian Rogers
  2026-11-18  7:55 ` [PATCH v1 1/4] perf threads: Don't resurrect removed threads in last_match Ian Rogers
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ian Rogers @ 2026-11-18  7:55 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim
  Cc: Jiri Olsa, Ian Rogers, Adrian Hunter, James Clark,
	linux-perf-users, linux-kernel

Four standalone bug fixes for pre-existing issues in perf tools uncovered
during Sashiko review:

1. util/threads.c: Fix a race between threads__find() and
   threads__remove() where dropping table->lock between lookup and
   updating table->last_match could resurrect a removed thread in
   last_match (and avoid taking down_write(&table->lock) on last_match
   cache hits).
2. util/stat.c: Fix process_counter_values() passing a static zero
   struct into evsel__compute_deltas() when skipping per-pkg CPUs, which
   underflowed and corrupted the static struct in place and clobbered
   prev_raw_counts when a previously active CPU was later skipped.
3. util/metricgroup.c: Fix realloc() failure memory leaks of pending in
   resolve_metric() and root_metric->metric_refs in __add_metric().
4. util/pmu.c: Free alias on parse_double() and io__getline() error
   returns in perf_pmu__new_alias().

AI Assistance Disclosure (per Documentation/process/coding-assistants.rst
and Documentation/process/generated-content.rst):
- Tools used: Sashiko automated patch review (sashiko.dev) for bug
  detection, and Google Antigravity / Jetski coding assistant for root
  cause verification and patch drafting.
- Summary of prompts and assistance: Verified four pre-existing issues
  flagged by Sashiko during review of the perf generic hashmap series and
  prepared standalone fixes with Fixes tags against perf-tools-next.
- Testing performed: Built on perf-tools-next (b7ff10b9ddec) with GCC,
  Clang (BUILD_NONDISTRO=1), and DEBUG=1 (REFCNT_CHECKING=1); ran perf
  test (Sysfs PMU, PMU JSON event, Symbols, and perf stat suites) and
  scripts/checkpatch.pl.

Ian Rogers (4):
  perf threads: Don't resurrect removed threads in last_match
  perf stat: Don't corrupt zero or prev_raw_counts on skipped per-pkg
    CPUs
  perf metricgroup: Fix realloc() leaks in resolve_metric() and
    __add_metric()
  perf pmu: Free alias on error paths in perf_pmu__new_alias()

 tools/perf/util/metricgroup.c | 19 +++++++++++++------
 tools/perf/util/pmu.c         |  5 ++++-
 tools/perf/util/stat.c        | 10 +++++-----
 tools/perf/util/threads.c     | 16 +++++++++++-----
 4 files changed, 33 insertions(+), 17 deletions(-)

base-commit: b7ff10b9ddec8da75304c40fe4abf1ee4f9f0a43
-- 
2.56.1.703.gf848ed807c-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-18  8:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  7:55 [PATCH v1 0/4] perf tools: Fix thread cache race, stat per-pkg delta bug, and memory leaks Ian Rogers
2026-11-18  7:55 ` [PATCH v1 1/4] perf threads: Don't resurrect removed threads in last_match Ian Rogers
2026-11-18  8:03   ` sashiko-bot
2026-11-18  7:55 ` [PATCH v1 2/4] perf stat: Don't corrupt zero or prev_raw_counts on skipped per-pkg CPUs Ian Rogers
2026-11-18  8:22   ` sashiko-bot
2026-11-18  7:55 ` [PATCH v1 3/4] perf metricgroup: Fix realloc() leaks in resolve_metric() and __add_metric() Ian Rogers
2026-11-18  7:58   ` sashiko-bot
2026-11-18  7:55 ` [PATCH v1 4/4] perf pmu: Free alias on error paths in perf_pmu__new_alias() Ian Rogers
2026-11-18  7:59   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.