lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  2 Nov 2017 11:15:59 -0700
From:   Stephane Eranian <eranian@...gle.com>
To:     linux-kernel@...r.kernel.org
Cc:     acme@...hat.com, peterz@...radead.org, mingo@...e.hu,
        ak@...ux.intel.com, kan.liang@...el.com, jolsa@...hat.com,
        Stephane Eranian <eranian@...il.com>
Subject: [PATCH v2 5/5] perf/script: add support for skid ip

From: Stephane Eranian <eranian@...il.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@...gle.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

Powered by blists - more mailing lists