mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: acme@redhat.com, peterz@infradead.org, mingo@elte.hu,
	ak@linux.intel.com, kan.liang@intel.com, jolsa@redhat.com,
	Stephane Eranian <eranian@gmail.com>
Subject: [PATCH v2 5/5] perf/script: add support for skid ip
Date: Thu,  2 Nov 2017 11:15:59 -0700	[thread overview]
Message-ID: <1509646559-919-6-git-send-email-eranian@google.com> (raw)
In-Reply-To: <1509646559-919-1-git-send-email-eranian@google.com>

From: Stephane Eranian <eranian@gmail.com>

This patch adds a skid_ip field to perf script
to dump the raw value of the PERF_SAMPLE_SKID_IP
field in each sample.

$ perf script -F +ip,+skid_ip ......

Signed-off-by: Stephane Eranian <eranian@google.com>
---
 tools/perf/builtin-script.c | 6 ++++++
 tools/perf/util/session.c   | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index a3add2cd7856..a13fbc13373b 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -89,6 +89,7 @@ enum perf_output_field {
 	PERF_OUTPUT_SYNTH           = 1U << 25,
 	PERF_OUTPUT_PHYS_ADDR       = 1U << 26,
 	PERF_OUTPUT_UREGS	    = 1U << 27,
+	PERF_OUTPUT_SKID_IP	    = 1U << 28,
 };
 
 struct output_option {
@@ -123,6 +124,7 @@ struct output_option {
 	{.str = "brstackoff", .field = PERF_OUTPUT_BRSTACKOFF},
 	{.str = "synth", .field = PERF_OUTPUT_SYNTH},
 	{.str = "phys_addr", .field = PERF_OUTPUT_PHYS_ADDR},
+	{.str = "skid_ip", .field = PERF_OUTPUT_SKID_IP},
 };
 
 enum {
@@ -1514,6 +1516,10 @@ static void process_event(struct perf_script *script,
 
 	if (PRINT_FIELD(PHYS_ADDR))
 		printf("%16" PRIx64, sample->phys_addr);
+
+	if (PRINT_FIELD(SKID_IP))
+		printf(" %"PRIx64" ", sample->skid_ip);
+
 	printf("\n");
 }
 
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 9390cedee6f4..802227735a89 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1132,7 +1132,7 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event,
 		sample_read__printf(sample, evsel->attr.read_format);
 
 	if (sample_type & PERF_SAMPLE_SKID_IP)
-		printf("... skid_ip: %" PRIu64 "\n", sample->skid_ip);
+		printf("... skid_ip: 0x%" PRIx64 "\n", sample->skid_ip);
 }
 
 static void dump_read(struct perf_evsel *evsel, union perf_event *event)
-- 
2.7.4

  parent reply	other threads:[~2017-11-02 18:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 18:15 [PATCH v2 0/5] perf: add support for capturing skid IP Stephane Eranian
2017-11-02 18:15 ` [PATCH v2 1/5] perf/core: add PERF_RECORD_SAMPLE_SKID_IP record type Stephane Eranian
2017-11-02 18:59   ` Peter Zijlstra
2017-11-02 19:46     ` Stephane Eranian
2017-11-02 18:15 ` [PATCH v2 2/5] perf/x86: add PERF_SAMPLE_SKID_IP support for X86 PEBS Stephane Eranian
2017-11-03 15:05   ` Jiri Olsa
2017-11-02 18:15 ` [PATCH v2 3/5] perf/tools: add support for PERF_SAMPLE_SKID_IP Stephane Eranian
2017-11-02 18:15 ` [PATCH v2 4/5] perf/record: add support for sampling skid ip Stephane Eranian
2017-11-06 21:25   ` Andi Kleen
2017-11-02 18:15 ` Stephane Eranian [this message]
2017-11-03 15:03   ` [PATCH v2 5/5] perf/script: add support for " 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=1509646559-919-6-git-send-email-eranian@google.com \
    --to=eranian@google.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=eranian@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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

Powered by JetHome