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>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
12cb4397fb
commit
564132f311
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user