Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335429

[PATCH v6 15/25] perf hists: Count number of sort keys

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v6 15/25] perf hists: Count number of sort keys
Date 2016-02-16 15:20 +0100
Message-ID <r2ODU-vy-23@gated-at.bofh.it> (permalink)
References <r2ODT-vy-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


It'll be used for hierarchy output mode to indent entries properly.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/hist.c   | 3 +++
 tools/perf/util/hist.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 1ba4117d9c2d..9921c8e3acdd 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,
 void perf_hpp_list__register_sort_field(struct perf_hpp_list *list,
 					struct perf_hpp_fmt *format)
 {
+	if (perf_hpp__is_sort_entry(format) || perf_hpp__is_dynamic_entry(format))
+		list->nr_sort_keys++;
+
 	list_add_tail(&format->sort_list, &list->sorts);
 }
 
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index dc33193af455..5fc30dc54b5a 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -237,6 +237,7 @@ struct perf_hpp_fmt {
 struct perf_hpp_list {
 	struct list_head fields;
 	struct list_head sorts;
+	int nr_sort_keys;
 };
 
 extern struct perf_hpp_list perf_hpp_list;
-- 
2.7.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v6 15/25] perf hists: Count number of sort keys Namhyung Kim <namhyung@kernel.org> - 2016-02-16 15:20 +0100

csiph-web