From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933956AbdKBSQS (ORCPT ); Thu, 2 Nov 2017 14:16:18 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:50291 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933851AbdKBSQJ (ORCPT ); Thu, 2 Nov 2017 14:16:09 -0400 X-Google-Smtp-Source: ABhQp+RHUAosdHo3NeyuNz82LShLnzgNJ5HqG5qZGz8JhngCrVKW0zUL8AChK8ZBLpquYn/PgkcmIw== From: Stephane Eranian 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 Subject: [PATCH v2 5/5] perf/script: add support for skid ip Date: Thu, 2 Nov 2017 11:15:59 -0700 Message-Id: <1509646559-919-6-git-send-email-eranian@google.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509646559-919-1-git-send-email-eranian@google.com> References: <1509646559-919-1-git-send-email-eranian@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephane Eranian 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 --- 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