diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-02-24 10:13:40 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-24 18:21:11 -0500 |
commit | 1f2d72cf3258eacd667cd1920e64c9b64b9984d5 (patch) | |
tree | 9ddf67a6c23108b0dfb6a825adaa4493e7eabaea | |
parent | 70642850fa581df219d7bc03cd7aca6e1956968c (diff) |
perf hists: Count number of sort keys
It'll be used for hierarchy output mode to indent entries properly.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1456326830-30456-9-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/ui/hist.c | 3 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 12223d791e9f..edbf854e8e1c 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c | |||
@@ -514,6 +514,9 @@ void perf_hpp_list__column_register(struct perf_hpp_list *list, | |||
514 | void perf_hpp_list__register_sort_field(struct perf_hpp_list *list, | 514 | void perf_hpp_list__register_sort_field(struct perf_hpp_list *list, |
515 | struct perf_hpp_fmt *format) | 515 | struct perf_hpp_fmt *format) |
516 | { | 516 | { |
517 | if (perf_hpp__is_sort_entry(format) || perf_hpp__is_dynamic_entry(format)) | ||
518 | list->nr_sort_keys++; | ||
519 | |||
517 | list_add_tail(&format->sort_list, &list->sorts); | 520 | list_add_tail(&format->sort_list, &list->sorts); |
518 | } | 521 | } |
519 | 522 | ||
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 480d2eb26001..d08e4f36f193 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -237,6 +237,7 @@ struct perf_hpp_fmt { | |||
237 | struct perf_hpp_list { | 237 | struct perf_hpp_list { |
238 | struct list_head fields; | 238 | struct list_head fields; |
239 | struct list_head sorts; | 239 | struct list_head sorts; |
240 | int nr_sort_keys; | ||
240 | }; | 241 | }; |
241 | 242 | ||
242 | extern struct perf_hpp_list perf_hpp_list; | 243 | extern struct perf_hpp_list perf_hpp_list; |