Received: by 10.223.164.202 with SMTP id h10csp1199035wrb; Tue, 7 Nov 2017 23:58:58 -0800 (PST) X-Google-Smtp-Source: ABhQp+TwyYs77H+O6SyCevCgB0xEWuSw3JaG6/lUwY8Ux2XIkzYxtaXxAFMFjO1udGKVlIdkSsou X-Received: by 10.84.217.142 with SMTP id p14mr1466589pli.313.1510127938238; Tue, 07 Nov 2017 23:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127938; cv=none; d=google.com; s=arc-20160816; b=rwksxJgCZwMHGQHPab8oq9QyV3/JI8ER471c2cnECbisBhudMGzLp23Ldlf/dCIaxi HdgSFpofh9lZKVItg8Xf9MgjP0WDwak0O5RiJz6e6bv5f8+h6I5TnUtDhQU8X/c1Kxvr kiX7EM8aHN5FIGaEnG4lbK8BxHdFMTb6VcRjty6dV9bQEH8RuBLhpP5LaR8ZxULvsmnI RIvf1gcNvTA4oLgfkVDVTL9u5NpMr73JWn9R1SVbfZ1+WjhQb8KlK7eI45F4fBWlJ0wG ETtuhOFpi6QSlR0zXZqHb4iTk1yP0SBJ8EtA1KeDqj3PRmpj2o0JYPWB2HaWLFzAm5PF +Uvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=KcF1tbRsK5UlMg3Gn7/70TaKP4kU0jRAzZ0Hkoxj1NQ=; b=xWoiR9rNi7i7qhM1y8YFUmcKsgvT3HeD9LeavastaAouNP6b1u+4axVj1GYjNNrkwF Gn57Z7glDBiu9C3qJDS5uvTCSvDwl0OYyLFOSpAQ6zM5Q59u6TPVIlKp1RZpafTQ9pGk xx1CATQ/Q8IvZrjLqWmMeyT7olb44HQdZ+5B/p5yAZuKT37Aef4i3YdJ194mLfZyLRO2 6bPsLhNfr8CGNXihw5KJ6omrgRlAD14SLxnIorvzsXLAwBRzHpSjL6Eo1TmI72XuvLxd UJEzlJipUGCnZ4kC6KNlf6NGUJXey4+esBUDN68PtMBksqcmGa+N4FE28m6zGrS4LtKw Ui/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BZOfzdFZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si3120942pgf.141.2017.11.07.23.58.46; Tue, 07 Nov 2017 23:58:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BZOfzdFZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751325AbdKHH44 (ORCPT + 89 others); Wed, 8 Nov 2017 02:56:56 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:46061 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751188AbdKHH4x (ORCPT ); Wed, 8 Nov 2017 02:56:53 -0500 Received: by mail-pl0-f68.google.com with SMTP id 30so793965pla.2 for ; Tue, 07 Nov 2017 23:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KcF1tbRsK5UlMg3Gn7/70TaKP4kU0jRAzZ0Hkoxj1NQ=; b=BZOfzdFZeG0N42Ipe+k32fg+yUVAr8ijmSva4T4amekPXpuw/b7PRJxrA4ZlGCf93L TTfTlsSkCC1aCiI4sftlrPUYkP4/fmXNMiE0lt8QExtDCZwsh2ZB2XwWX2L7Onit6zBC HCXregXX4rtZ9Q2Yi7+r3S2sCaiTWz4R0IDVoZpIpVTToOzeZJn38ATTAySmDmp3sv/d SOKDioq7ippeLdQSIV3wVD5Q2QYTaOCdc4R1f62GN6ODcpbhivIeA5/MdoqldL3IupQ6 V08ZMxiaZSLXo/36gGhrUQ5aTF/dzOvTfCEo6ZPQCD2b/xq/hRy3PNzbZuUP00pCdpRT 56qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KcF1tbRsK5UlMg3Gn7/70TaKP4kU0jRAzZ0Hkoxj1NQ=; b=dG2F8Uq4HMPOonuCXcl2P7j9kDKsMfkJ464nOD0vtsD1JSh4GK+Ts9oLiAxI/6WYLe Hu0IJYiD3kYheR4230JriI/XIX/uRmpFdHyAinP0MOfPgCWXCQI6yMvRd0x/AXzXTdNZ +5f7jb9qzJgAm4+Jbs6v2csU5gpU3t0skaW+Apjkt487bi55tRhsTJiyvYoDJHtMWixA 8Pl1L8sI+AKDza+oEB+sRjmjfQqTBaL730pQ1QBWLpji+UwB7/hLBoFluRv6ErMauG1o hN1z/hipJQ2+Z9jawJ3r5o1DgvJ4eSzEXn55fE4bfqZdC5QkwNq7Lwip5/WVl+iSSAN8 44Ow== X-Gm-Message-State: AJaThX6UxmXh2RuRTG/k8InwjrX1BpyK8Ulmz4Ppx5Hd7uezfbv5RB8+ LhcmnM9HXakDYoIl0V675yye77K3MhI= X-Received: by 10.159.206.137 with SMTP id bg9mr1412169plb.95.1510127812637; Tue, 07 Nov 2017 23:56:52 -0800 (PST) Received: from localhost (c-67-169-55-77.hsd1.ca.comcast.net. [67.169.55.77]) by smtp.gmail.com with ESMTPSA id t18sm6678012pfi.98.2017.11.07.23.56.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 23:56:52 -0800 (PST) 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 Subject: [PATCH v3 5/5] perf/script: add support for skid ip Date: Tue, 7 Nov 2017 23:56:37 -0800 Message-Id: <1510127797-22483-6-git-send-email-eranian@google.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510127797-22483-1-git-send-email-eranian@google.com> References: <1510127797-22483-1-git-send-email-eranian@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ...... The field is not enabled by default. Signed-off-by: Stephane Eranian --- tools/perf/Documentation/perf-script.txt | 2 +- tools/perf/builtin-script.c | 10 ++++++++-- tools/perf/util/session.c | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index 2811fcf684cb..96871bd3a576 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -117,7 +117,7 @@ OPTIONS Comma separated list of fields to print. Options are: comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff, srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn, - brstackoff, callindent, insn, insnlen, synth, phys_addr. + brstackoff, callindent, insn, insnlen, synth, phys_addr, skid_ip. Field list can be prepended with the type, trace, sw or hw, to indicate to which event type the field list applies. e.g., -F sw:comm,tid,time,ip,sym and -F trace:time,cpu,trace diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 68f36dc0344f..f00fc8c50f68 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -90,6 +90,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 { @@ -124,6 +125,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 { @@ -1563,7 +1565,11 @@ static void process_event(struct perf_script *script, if (PRINT_FIELD(PHYS_ADDR)) fprintf(fp, "%16" PRIx64, sample->phys_addr); - fprintf(fp, "\n"); + + if (PRINT_FIELD(SKID_IP)) + printf(" %"PRIx64" ", sample->skid_ip); + + printf("\n"); } static struct scripting_ops *scripting_ops; @@ -2915,7 +2921,7 @@ int cmd_script(int argc, const char **argv) "Valid types: hw,sw,trace,raw,synth. " "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags," - "bpf-output,callindent,insn,insnlen,brstackinsn,synth,phys_addr", + "bpf-output,callindent,insn,insnlen,brstackinsn,synth,phys_addr,skid_ip", parse_output_fields), OPT_BOOLEAN('a', "all-cpus", &system_wide, "system-wide collection from all CPUs"), diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 223165055d41..ee8fb635f694 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1133,7 +1133,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 From 1585546551465104691@xxx Fri Dec 01 02:23:43 +0000 2017 X-GM-THRID: 1585394859367476601 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread