linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Stephane Eranian <eranian@google.com>,
	Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 21/23] perf script: Add data_src and weight column definitions
Date: Mon, 15 Feb 2016 09:34:51 +0100	[thread overview]
Message-ID: <1455525293-8671-22-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1455525293-8671-1-git-send-email-jolsa@kernel.org>

Adding data_src and weight column definitions, so it's
displayed for related sample types.

Link: http://lkml.kernel.org/n/tip-d9d387o10v7ega0mbd4b2zpo@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-script.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index c691214d820f..b7f1e8e22dcf 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -58,6 +58,8 @@ enum perf_output_field {
 	PERF_OUTPUT_IREGS	    = 1U << 14,
 	PERF_OUTPUT_BRSTACK	    = 1U << 15,
 	PERF_OUTPUT_BRSTACKSYM	    = 1U << 16,
+	PERF_OUTPUT_DATA_SRC	    = 1U << 17,
+	PERF_OUTPUT_WEIGHT	    = 1U << 18,
 };
 
 struct output_option {
@@ -81,6 +83,8 @@ struct output_option {
 	{.str = "iregs", .field = PERF_OUTPUT_IREGS},
 	{.str = "brstack", .field = PERF_OUTPUT_BRSTACK},
 	{.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM},
+	{.str = "data_src", .field = PERF_OUTPUT_DATA_SRC},
+	{.str = "weight",   .field = PERF_OUTPUT_WEIGHT},
 };
 
 /* default set to maintain compatibility with current format */
@@ -242,6 +246,16 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
 					   PERF_OUTPUT_ADDR, allow_user_set))
 		return -EINVAL;
 
+	if (PRINT_FIELD(DATA_SRC) &&
+		perf_evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC",
+					PERF_OUTPUT_DATA_SRC))
+		return -EINVAL;
+
+	if (PRINT_FIELD(WEIGHT) &&
+		perf_evsel__check_stype(evsel, PERF_SAMPLE_WEIGHT, "WEIGHT",
+					PERF_OUTPUT_WEIGHT))
+		return -EINVAL;
+
 	if (PRINT_FIELD(SYM) && !PRINT_FIELD(IP) && !PRINT_FIELD(ADDR)) {
 		pr_err("Display of symbols requested but neither sample IP nor "
 			   "sample address\nis selected. Hence, no addresses to convert "
@@ -673,6 +687,12 @@ static void process_event(struct perf_script *script, union perf_event *event,
 	if (PRINT_FIELD(ADDR))
 		print_sample_addr(event, sample, thread, attr);
 
+	if (PRINT_FIELD(DATA_SRC))
+		printf("%16" PRIx64, sample->data_src);
+
+	if (PRINT_FIELD(WEIGHT))
+		printf("%16" PRIu64, sample->weight);
+
 	if (PRINT_FIELD(IP)) {
 		if (!symbol_conf.use_callchain)
 			printf(" ");
-- 
2.4.3

  parent reply	other threads:[~2016-02-15  8:36 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15  8:34 [PATCH 00/23] perf tools: Several memory events updates Jiri Olsa
2016-02-15  8:34 ` [PATCH 01/23] perf record: Add --all-user/--all-kernel options Jiri Olsa
2016-02-16 16:56   ` Arnaldo Carvalho de Melo
2016-02-17  3:10     ` Andi Kleen
2016-02-17 14:26       ` Arnaldo Carvalho de Melo
2016-02-17 15:31         ` Andi Kleen
2016-02-17 14:39     ` Jiri Olsa
2016-02-17 14:55       ` Arnaldo Carvalho de Melo
2016-02-20 11:34   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 02/23] perf tools: Make cl_address global Jiri Olsa
2016-02-25  5:42   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 03/23] perf tools: Introduce cl_offset function Jiri Olsa
2016-02-25  5:42   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 04/23] perf tools: Add monitored events array Jiri Olsa
2016-02-23 15:10   ` Arnaldo Carvalho de Melo
2016-02-23 15:18     ` Jiri Olsa
2016-02-25  5:42   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 05/23] perf mem: Add -e record option Jiri Olsa
2016-02-25  5:43   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 06/23] perf mem: Check for memory events support Jiri Olsa
2016-02-23 15:18   ` Arnaldo Carvalho de Melo
2016-02-23 15:24     ` Arnaldo Carvalho de Melo
2016-02-23 15:42       ` Jiri Olsa
2016-02-23 15:29     ` Jiri Olsa
2016-02-23 15:34       ` Arnaldo Carvalho de Melo
2016-02-15  8:34 ` [PATCH 07/23] perf mem: Introduce perf_mem_events__name function Jiri Olsa
2016-02-15  8:34 ` [PATCH 08/23] perf mem: Add -l/--ldlat option Jiri Olsa
2016-02-15  8:34 ` [PATCH 09/23] perf mem: Add -u/-k options Jiri Olsa
2016-02-15  8:34 ` [PATCH 10/23] perf x86 intel: Add DATALA events into sysfs Jiri Olsa
2016-02-15  8:34 ` [PATCH 11/23] perf mem: Add Intel DATALA memory events Jiri Olsa
2016-02-15  8:34 ` [PATCH 12/23] perf tools: Use ARRAY_SIZE in mem sort display functions Jiri Olsa
2016-02-25  5:43   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 13/23] perf tools: Introduce perf_mem__tlb_scnprintf function Jiri Olsa
2016-02-15  8:34 ` [PATCH 14/23] perf tools: Introduce perf_mem__lvl_scnprintf function Jiri Olsa
2016-02-15  8:34 ` [PATCH 15/23] perf tools: Introduce perf_mem__snp_scnprintf function Jiri Olsa
2016-02-15  8:34 ` [PATCH 16/23] perf tools: Introduce perf_mem__lck_scnprintf function Jiri Olsa
2016-02-15  8:34 ` [PATCH 17/23] perf tools: Change perf_mem__tlb_scnprintf to return nb of displayed bytes Jiri Olsa
2016-02-15  8:34 ` [PATCH 18/23] perf tools: Change perf_mem__lvl_scnprintf " Jiri Olsa
2016-02-15  8:34 ` [PATCH 19/23] perf tools: Change perf_mem__snp_scnprintf " Jiri Olsa
2016-02-15  8:34 ` [PATCH 20/23] perf tools: Change perf_mem__lck_scnprintf " Jiri Olsa
2016-02-15  8:34 ` Jiri Olsa [this message]
2016-02-25  5:43   ` [tip:perf/core] perf script: Add data_src and weight column definitions tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 22/23] perf script: Display addr/data_src/weight columns for raw events Jiri Olsa
2016-02-25  5:43   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-02-15  8:34 ` [PATCH 23/23] perf script: Display data_src values Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455525293-8671-22-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).