From 9f87498f1cb72958c6f8725eb93d2f7ef81fa11e Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Wed, 7 Mar 2018 16:50:06 +0100 Subject: 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 Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra 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 --- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/perf/util/machine.c') diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 12b7427444a3..43fbbee409ec 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1697,7 +1697,7 @@ static void ip__resolve_data(struct thread *thread, struct mem_info *sample__resolve_mem(struct perf_sample *sample, struct addr_location *al) { - struct mem_info *mi = zalloc(sizeof(*mi)); + struct mem_info *mi = mem_info__new(); if (!mi) return NULL; -- cgit v1.2.3