Received: by 10.223.164.202 with SMTP id h10csp608004wrb; Wed, 8 Nov 2017 23:58:47 -0800 (PST) X-Google-Smtp-Source: ABhQp+TGl/KpLhQefan3FSlFVpY40quWT5B1y1MWj/YdazqAmEEMPPp5k/vb4L2pqxVFxzV4DC2g X-Received: by 10.99.120.7 with SMTP id t7mr3003156pgc.360.1510214326897; Wed, 08 Nov 2017 23:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510214326; cv=none; d=google.com; s=arc-20160816; b=sUtj4qAeXZwXNEkZpOP38+JH+Fg55NSlR+xpzz8SLjBtJ+j+J23N3/Bc2xkq81rHEH MRNRemNSUm720zuFBL5XBMW6kRyYrpM2DO6p+gFhXNDIGPvQUaqzmLfF2K0Is0kPUjkB Xak8I3dMLRwTkJEfC93+Kh04xqhOlpPOLAzo0xdTcy8Lm73jceGPPjsBrzbh+kTY6IKF La++7LO+HR6FRHvt/hZcQVGkSojuUij4CL92Zztk+1tfX2ypuv1KxiVOeuVrDX4k0qZo COADe/ZARQZrtz8jWhFBeVjhgqyBxv/rBgkjCiUzL2toE5xvfKKcXQf1VMtcz7+RY/54 4cMg== 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=/TGy7YNV9mbG4bJvXxMYVRE6nN8QRAjgdULLNjYtyI4=; b=GUTLqRYFYkDGo4BD0SvMQsJl9Tf0c+vx/Vpr5iSpC0jkR9tBhJxWYJFfpsutSTzlDd i3c7BGTdoygoHnapD4bE6AOJ+650ArOTUaLoT+cT0CIq65FnQ+ah43LwIzAucTQdWZaY fHuvJaBA14j3Wbi1NW3YKIKfFU+jKK2CX8zJfO4gBiXHHWX0kSkG4LoKBehUnfUsPmwv KrEnhncqrL2qTzz84nHSmpl9dtlgy6sGqxZ4VQL7AlhcGXERFuGsfAA+jyCvEM/MT3V+ 6x0Wm0gZIWLogNNz3ZB+lhfpmRCd8clp0tvAnmQxHfrYhsK5OynP9ch4mzQQHvJFRk2/ KS1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ts7e431s; 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 o1si5190827plk.182.2017.11.08.23.58.35; Wed, 08 Nov 2017 23:58:46 -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=Ts7e431s; 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 S1753230AbdKIH5j (ORCPT + 82 others); Thu, 9 Nov 2017 02:57:39 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:47154 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753168AbdKIH5a (ORCPT ); Thu, 9 Nov 2017 02:57:30 -0500 Received: by mail-pf0-f194.google.com with SMTP id z80so3672571pff.4 for ; Wed, 08 Nov 2017 23:57:30 -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=/TGy7YNV9mbG4bJvXxMYVRE6nN8QRAjgdULLNjYtyI4=; b=Ts7e431sTLP4harvHZxnfJ0kiTQgYVcdyDcs3HjPQ+ljnj38SP4VZfx9NylxGrif2A JQkeM2GhHOi28FSD/LI08g9eERrSeQJMowldAsvc9tFXxGYk+eI8TslfqUunZBjCqM2S AajypgaauoCEAnQh8hHEX371Tv6HhH16BQAis1FRjGP0K7lfVSW+JBr4RobvvneX/Nfu iv37dqX80D3ZtHBKVALCQx98uq4DgLSyau5WFNv0oarnQJgJiFm5PQeumiAgYEj2/y67 TkXFI4cdLGVYFhhZE8XmfpBRmf4GWQui860iL2HnWNHBfS5uLUf8dwQy1WSgHGYhui9J dwSw== 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=/TGy7YNV9mbG4bJvXxMYVRE6nN8QRAjgdULLNjYtyI4=; b=uMRAuWZSV9dhjuP7c+y1Ph1YycTqRon+Kuanpdiv8GHG+TeMukH0Vj8GMWCwonVLrn +2Wp9m8d/AS6Chkf17DPdqfheMbXTDfn6fG9g3BuPI2smt3+XBlJDyzfEKFlFIbl5tG8 xvd4h+HwZlvnPSd9KLJGA6r/O40sWFRZnfJ45zwx9mK6an1qXHQO4QYcJC9b10tm9XOc rtuXrt3nm2/uRFoaaBiTOp9guVkchm4aRa5QS+hkGPttaSoXIkZesKfzo43bwTBb6v+E zEwi7fJhKHFbEYjgPEhrzS9keYFo75MBnSy9Ui957fBUlPz23lsN6+KD/IuU1/XBpFOb AAfA== X-Gm-Message-State: AJaThX6Ky52n33Bin9OeY0w+cV9h5SJbtqgBy8Wr8HY0ORVykqmUlV45 yQnwnnmRNfq3OLJpkAO9/C36okIlBnk= X-Received: by 10.101.81.10 with SMTP id f10mr3085170pgq.148.1510214249317; Wed, 08 Nov 2017 23:57:29 -0800 (PST) Received: from localhost ([172.56.39.30]) by smtp.gmail.com with ESMTPSA id h186sm10920843pfe.66.2017.11.08.23.57.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 23:57:28 -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 v4 5/5] perf/script: add support for PERF_SAMPLE_SKID_IP Date: Wed, 8 Nov 2017 23:57:13 -0800 Message-Id: <1510214233-2074-6-git-send-email-eranian@google.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510214233-2074-1-git-send-email-eranian@google.com> References: <1510214233-2074-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 ++++++++-- 2 files changed, 9 insertions(+), 3 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"), -- 2.7.4 From 1583954844153772893@xxx Mon Nov 13 12:44:13 +0000 2017 X-GM-THRID: 1583456763764804053 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread