summaryrefslogtreecommitdiff
path: root/tools/perf/ui/hist.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-01-18 12:24:09 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-02-03 18:24:08 +0300
commit564132f3116cf376fdc04b2380e621f35efbb6c7 (patch)
treebd7e4af6e51d343fc1a41b6c7dfed1651dd1a50a /tools/perf/ui/hist.c
parent12cb4397fb398545207acf772b219bd751786015 (diff)
downloadlinux-564132f3116cf376fdc04b2380e621f35efbb6c7.tar.xz
perf hists: Properly release format fields
With multiple list holding format entries, we need the support properly releasing format output/sort fields. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1453109064-1026-12-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/hist.c')
-rw-r--r--tools/perf/ui/hist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 80d63a997287..2cd1a03bf375 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -583,6 +583,12 @@ next:
}
}
+static void fmt_free(struct perf_hpp_fmt *fmt)
+{
+ if (fmt->free)
+ fmt->free(fmt);
+}
+
void perf_hpp__reset_output_field(void)
{
struct perf_hpp_fmt *fmt, *tmp;
@@ -591,12 +597,14 @@ void perf_hpp__reset_output_field(void)
perf_hpp__for_each_format_safe(fmt, tmp) {
list_del_init(&fmt->list);
list_del_init(&fmt->sort_list);
+ fmt_free(fmt);
}
/* reset sort keys */
perf_hpp__for_each_sort_list_safe(fmt, tmp) {
list_del_init(&fmt->list);
list_del_init(&fmt->sort_list);
+ fmt_free(fmt);
}
}