diff options
author | Jiri Olsa <jolsa@kernel.org> | 2018-03-07 16:50:06 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-03-08 15:30:44 +0100 |
commit | 9f87498f1cb72958c6f8725eb93d2f7ef81fa11e (patch) | |
tree | facec74738cca821c7b7fc7c93c0f860cf74cc17 /tools/perf/util/hist.c | |
parent | perf record: Remove progname from struct record (diff) | |
download | linux-9f87498f1cb72958c6f8725eb93d2f7ef81fa11e.tar.xz linux-9f87498f1cb72958c6f8725eb93d2f7ef81fa11e.zip |
perf tools: Add refcnt into struct mem_info
It's passed along several hists entries in --hierarchy mode, so it's
better we keep track of it.
The current fail I see is that it gets removed in hierarchy --mem-mode
mode, where it's shared in the different hierarchies, but removed from
the template hist entry, so the report crashes.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180307155020.32613-6-jolsa@kernel.org
[ Rename mem_info__aloc() to mem_info__new(), to fix the typo and use the convention for constructors ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r-- | tools/perf/util/hist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 44a8456cea10..7d968892ee39 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -536,7 +536,7 @@ static struct hist_entry *hists__findnew_entry(struct hists *hists, * This mem info was allocated from sample__resolve_mem * and will not be used anymore. */ - zfree(&entry->mem_info); + mem_info__zput(entry->mem_info); /* If the map of an existing hist_entry has * become out-of-date due to an exec() or @@ -1139,7 +1139,7 @@ void hist_entry__delete(struct hist_entry *he) if (he->mem_info) { map__zput(he->mem_info->iaddr.map); map__zput(he->mem_info->daddr.map); - zfree(&he->mem_info); + mem_info__zput(he->mem_info); } zfree(&he->stat_acc); |