aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/tests/hists_cumulate.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/hists_cumulate.c')
-rw-r--r--tools/perf/tests/hists_cumulate.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index b42d37ff2399..8c0e3f334747 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -112,6 +112,7 @@ static int add_hist_entries(struct hists *hists, struct machine *machine)
}
fake_samples[i].thread = al.thread;
+ map__put(fake_samples[i].map);
fake_samples[i].map = al.map;
fake_samples[i].sym = al.sym;
}
@@ -147,15 +148,23 @@ static void del_hist_entries(struct hists *hists)
}
}
+static void put_fake_samples(void)
+{
+ size_t i;
+
+ for (i = 0; i < ARRAY_SIZE(fake_samples); i++)
+ map__put(fake_samples[i].map);
+}
+
typedef int (*test_fn_t)(struct evsel *, struct machine *);
#define COMM(he) (thread__comm_str(he->thread))
-#define DSO(he) (he->ms.map->dso->short_name)
+#define DSO(he) (map__dso(he->ms.map)->short_name)
#define SYM(he) (he->ms.sym->name)
#define CPU(he) (he->cpu)
#define PID(he) (he->thread->tid)
#define DEPTH(he) (he->callchain->max_depth)
-#define CDSO(cl) (cl->ms.map->dso->short_name)
+#define CDSO(cl) (map__dso(cl->ms.map)->short_name)
#define CSYM(cl) (cl->ms.sym->name)
struct result {
@@ -733,6 +742,7 @@ out:
/* tear down everything */
evlist__delete(evlist);
machines__exit(&machines);
+ put_fake_samples();
return err;
}