perf hists: Introduce perf_hpp_list__for_each_sort_list_safe macro
authorJiri Olsa <jolsa@kernel.org>
Mon, 18 Jan 2016 09:24:20 +0000 (10:24 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 3 Feb 2016 15:24:16 +0000 (12:24 -0300)
Introducing perf_hpp_list__for_each_sort_list_safe macro
to iterate perf_hpp_list object's sort entries safely.

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-23-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/hist.c
tools/perf/util/hist.h

index f09eabe1816753138939a353d0a342a0464abbf8..9cda51edfdbd6c2b628410cdc2b164651b192b07 100644 (file)
@@ -604,7 +604,7 @@ void perf_hpp__reset_output_field(void)
        }
 
        /* reset sort keys */
-       perf_hpp__for_each_sort_list_safe(fmt, tmp) {
+       perf_hpp_list__for_each_sort_list_safe(&perf_hpp_list, fmt, tmp) {
                list_del_init(&fmt->list);
                list_del_init(&fmt->sort_list);
                fmt_free(fmt);
index c9b2ea4a4929620d348277ac43691e0f6cb79d86..61d35a9f928b100e8e76482fee90befd930ea3d6 100644 (file)
@@ -257,8 +257,8 @@ static inline void perf_hpp__register_sort_field(struct perf_hpp_fmt *format)
 #define perf_hpp_list__for_each_sort_list(_list, format) \
        list_for_each_entry(format, &(_list)->sorts, sort_list)
 
-#define perf_hpp__for_each_sort_list_safe(format, tmp) \
-       list_for_each_entry_safe(format, tmp, &perf_hpp_list.sorts, sort_list)
+#define perf_hpp_list__for_each_sort_list_safe(_list, format, tmp)     \
+       list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list)
 
 extern struct perf_hpp_fmt perf_hpp__format[];