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


Groups > linux.kernel > #1342116 > unrolled thread

[PATCH v7 01/18] perf tools: Add helper functions for some sort keys

Started byNamhyung Kim <namhyung@kernel.org>
First post2016-02-24 16:20 +0100
Last post2016-02-25 08:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v7 01/18] perf tools: Add helper functions for some sort keys Namhyung Kim <namhyung@kernel.org> - 2016-02-24 16:20 +0100
    [tip:perf/core] perf tools: Add helper functions for some sort keys tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-25 08:50 +0100

#1342116 — [PATCH v7 01/18] perf tools: Add helper functions for some sort keys

FromNamhyung Kim <namhyung@kernel.org>
Date2016-02-24 16:20 +0100
Subject[PATCH v7 01/18] perf tools: Add helper functions for some sort keys
Message-ID<r5Jon-6qY-31@gated-at.bofh.it>
The trace, srcline and srcfile sort keys updates hist entry's field
later.  With the hierarchy mode, those fields are passed to a matching
entry so it needs to identify the sort keys.

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

diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 97baa1d6ae5f..044419b3be7c 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -301,6 +301,9 @@ void perf_hpp__append_sort_keys(struct perf_hpp_list *list);
 bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format);
 bool perf_hpp__is_dynamic_entry(struct perf_hpp_fmt *format);
 bool perf_hpp__defined_dynamic_entry(struct perf_hpp_fmt *fmt, struct hists *hists);
+bool perf_hpp__is_trace_entry(struct perf_hpp_fmt *fmt);
+bool perf_hpp__is_srcline_entry(struct perf_hpp_fmt *fmt);
+bool perf_hpp__is_srcfile_entry(struct perf_hpp_fmt *fmt);
 
 static inline bool perf_hpp__should_skip(struct perf_hpp_fmt *format,
 					 struct hists *hists)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 4175b2944ff9..358035c2c327 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1391,6 +1391,39 @@ bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format)
 	return format->header == __sort__hpp_header;
 }
 
+bool perf_hpp__is_trace_entry(struct perf_hpp_fmt *fmt)
+{
+	struct hpp_sort_entry *hse;
+
+	if (!perf_hpp__is_sort_entry(fmt))
+		return false;
+
+	hse = container_of(fmt, struct hpp_sort_entry, hpp);
+	return hse->se == &sort_trace;
+}
+
+bool perf_hpp__is_srcline_entry(struct perf_hpp_fmt *fmt)
+{
+	struct hpp_sort_entry *hse;
+
+	if (!perf_hpp__is_sort_entry(fmt))
+		return false;
+
+	hse = container_of(fmt, struct hpp_sort_entry, hpp);
+	return hse->se == &sort_srcline;
+}
+
+bool perf_hpp__is_srcfile_entry(struct perf_hpp_fmt *fmt)
+{
+	struct hpp_sort_entry *hse;
+
+	if (!perf_hpp__is_sort_entry(fmt))
+		return false;
+
+	hse = container_of(fmt, struct hpp_sort_entry, hpp);
+	return hse->se == &sort_srcfile;
+}
+
 static bool __sort__hpp_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
 {
 	struct hpp_sort_entry *hse_a;
-- 
2.7.1

[toc] | [next] | [standalone]


#1342916 — [tip:perf/core] perf tools: Add helper functions for some sort keys

Fromtip-bot for Namhyung Kim <tipbot@zytor.com>
Date2016-02-25 08:50 +0100
Subject[tip:perf/core] perf tools: Add helper functions for some sort keys
Message-ID<r5YQr-um-27@gated-at.bofh.it>
In reply to#1342116
Commit-ID:  a9c6e46c04ba38925e94c4c2fa9217460338db43
Gitweb:     http://git.kernel.org/tip/a9c6e46c04ba38925e94c4c2fa9217460338db43
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 25 Feb 2016 00:13:33 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 24 Feb 2016 13:05:04 -0300

perf tools: Add helper functions for some sort keys

The 'trace', 'srcline' and 'srcfile' sort keys updates hist entry's
field later.  With the hierarchy mode, those fields are passed to a
matching entry so it needs to identify the sort keys.

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-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.h |  3 +++
 tools/perf/util/sort.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 97baa1d..044419b3 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -301,6 +301,9 @@ void perf_hpp__append_sort_keys(struct perf_hpp_list *list);
 bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format);
 bool perf_hpp__is_dynamic_entry(struct perf_hpp_fmt *format);
 bool perf_hpp__defined_dynamic_entry(struct perf_hpp_fmt *fmt, struct hists *hists);
+bool perf_hpp__is_trace_entry(struct perf_hpp_fmt *fmt);
+bool perf_hpp__is_srcline_entry(struct perf_hpp_fmt *fmt);
+bool perf_hpp__is_srcfile_entry(struct perf_hpp_fmt *fmt);
 
 static inline bool perf_hpp__should_skip(struct perf_hpp_fmt *format,
 					 struct hists *hists)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 4175b29..358035c 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1391,6 +1391,39 @@ bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format)
 	return format->header == __sort__hpp_header;
 }
 
+bool perf_hpp__is_trace_entry(struct perf_hpp_fmt *fmt)
+{
+	struct hpp_sort_entry *hse;
+
+	if (!perf_hpp__is_sort_entry(fmt))
+		return false;
+
+	hse = container_of(fmt, struct hpp_sort_entry, hpp);
+	return hse->se == &sort_trace;
+}
+
+bool perf_hpp__is_srcline_entry(struct perf_hpp_fmt *fmt)
+{
+	struct hpp_sort_entry *hse;
+
+	if (!perf_hpp__is_sort_entry(fmt))
+		return false;
+
+	hse = container_of(fmt, struct hpp_sort_entry, hpp);
+	return hse->se == &sort_srcline;
+}
+
+bool perf_hpp__is_srcfile_entry(struct perf_hpp_fmt *fmt)
+{
+	struct hpp_sort_entry *hse;
+
+	if (!perf_hpp__is_sort_entry(fmt))
+		return false;
+
+	hse = container_of(fmt, struct hpp_sort_entry, hpp);
+	return hse->se == &sort_srcfile;
+}
+
 static bool __sort__hpp_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
 {
 	struct hpp_sort_entry *hse_a;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web