]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf hist: Correct hist_entry->mem_info refcounts
authorNamhyung Kim <namhyung@kernel.org>
Wed, 31 Jul 2024 23:55:00 +0000 (16:55 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Aug 2024 21:55:55 +0000 (18:55 -0300)
commit96465e0179fa8a7059bd48a81a81889dcad7d543
treea6101da91e4edc889db8c2400372e066e1ea5d3c
parent7c5dd51bbb6767095df8a5e9e2b4528b8af18538
perf hist: Correct hist_entry->mem_info refcounts

The 'struct mem_info' is created by iter_prepare_mem_entry() at the
beginning and destroyed by iter_finish_mem_entry() at the end.

So if it's used in a new hist_entry, it should be cloned.

Simplify (hopefully) the logic by adding some helper functions and by
not holding the refcount in the temporary entry.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20240731235505.710436-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/hist.c
tools/perf/util/map_symbol.c
tools/perf/util/map_symbol.h
tools/perf/util/mem-info.c
tools/perf/util/mem-info.h