Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2675362ybb; Sun, 5 Apr 2020 13:37:59 -0700 (PDT) X-Google-Smtp-Source: APiQypJ9xMFOdZhOO8bSUijOrN+xee7HZH1DAJqrlSt+4WgIVFp7pG31nuoTxis+z91R9F/xiZ8X X-Received: by 2002:a9d:6ad2:: with SMTP id m18mr15775320otq.28.1586119079383; Sun, 05 Apr 2020 13:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586119079; cv=none; d=google.com; s=arc-20160816; b=VIt1m8QseWwXlh9psG8wA3KDl+6juGVTjvcO84ItcUEb0KoSpsBsZ2LE4jpkUflC5/ ywbtX95X2rzFNfUZ2YBYOEvkIfyaIL/OXp4FTxSqpt94ERAfo0+d/T78gjrwbPizVEL+ YDNsRGjxr6w1Dbehg1haRs8egjiJE4crGvPooLYOqZO1ZtgMH+5uMBP7O/pAo8h86VQ1 TpC5Lry1/JK3d7q5JR3AXlPcifT8oJ4t45Zi9exJcn5CzloSlixeuALjDHwF7wMzALzu DijixMo3HAu0TV72hE7dtfLPZ1Eq2qvSulZrtmR1rr+jWEiPbzaJhwAOAlRin74b/5p/ 8iiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=C+O7GyWDWBgWKIpNRm/jVhJ4+JJGizJNj6KKOmjnASI=; b=stxcLvyvJsoGZBm0WsULivrkOc2M74jixHB9m/XqGKMWNkqbjL4KBOiYP20NRE3zPe fGcWWXNv7rOPRgXEpO3cWW0rj24bdzZHAUjmPu1JHZVN3+WLjQG/G5f8Kk/nop6chK6d w0aCEAtTd+pfsFSKjUAZMhzmDrfLC+EtdcjLzXt/aalp8VU2mnF3fahdfR4j03ZKu/W3 WjATWpZOdCGMu6/x9yjXhhiFJIOJN8o23L1hGS+J+cIKkMMedOQVUaojXQbJdxFO++KL mfH3C8acxCReIYhJ39kNLuN9iM/hsqCgz7q1K16aHsZkl5jVZwzIPnEufpbUhKPGhjSC BsFw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l143si5771341oih.269.2020.04.05.13.37.13; Sun, 05 Apr 2020 13:37:59 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728048AbgDEUPQ (ORCPT + 99 others); Sun, 5 Apr 2020 16:15:16 -0400 Received: from mga01.intel.com ([192.55.52.88]:62225 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727612AbgDEUPQ (ORCPT ); Sun, 5 Apr 2020 16:15:16 -0400 IronPort-SDR: voZa227GW8y0gMGFNU4NNg/vT2LZMNhZquSQS+MVuSqsJAO3sqwOG5Wf2Na7JlzPaJKSfeu0TX vvGGnIY0AhdA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2020 13:15:14 -0700 IronPort-SDR: 9ZpTMo41sj7frxYVp7HlfTKruhr3L84Z3z9XY43x8pwKPSUF4SOYA4gwdbxzXf1gR53mPfQOq4 nUAbQ231/MbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,348,1580803200"; d="scan'208";a="329688515" Received: from ahunter-desktop.fi.intel.com ([10.237.72.87]) by orsmga001.jf.intel.com with ESMTP; 05 Apr 2020 13:15:11 -0700 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Masami Hiramatsu , Steven Rostedt , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, Mark Rutland , Alexander Shishkin , Mathieu Poirier , Leo Yan , Arnaldo Carvalho de Melo , Jiri Olsa , linux-kernel@vger.kernel.org Subject: [PATCH V6 14/15] perf script: Add option --show-text-poke-events Date: Sun, 5 Apr 2020 23:13:26 +0300 Message-Id: <20200405201327.7332-15-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200405201327.7332-1-adrian.hunter@intel.com> References: <20200405201327.7332-1-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Consistent with other new events, add an option to perf script to display text poke events and ksymbol events. Both text poke events and ksymbol events are displayed because some text pokes (e.g. ftrace trampolines) have corresponding ksymbol events. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-script.txt | 4 ++++ tools/perf/builtin-script.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index 99a9853a11ba..8fe507d69f95 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -322,6 +322,10 @@ OPTIONS --show-cgroup-events Display cgroup events i.e. events of type PERF_RECORD_CGROUP. +--show-text-poke-events + Display text poke events i.e. events of type PERF_RECORD_TEXT_POKE and + PERF_RECORD_KSYMBOL. + --demangle:: Demangle symbol names to human readable form. It's enabled by default, disable with --no-demangle. diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 348fec9743a4..e934bf46269d 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1695,6 +1695,7 @@ struct perf_script { bool show_round_events; bool show_bpf_events; bool show_cgroup_events; + bool show_text_poke_events; bool allocated; bool per_event_dump; struct evswitch evswitch; @@ -2319,6 +2320,18 @@ process_bpf_events(struct perf_tool *tool __maybe_unused, sample->tid); } +static int process_text_poke_events(struct perf_tool *tool, + union perf_event *event, + struct perf_sample *sample, + struct machine *machine) +{ + if (perf_event__process_text_poke(tool, event, sample, machine) < 0) + return -1; + + return print_event(tool, event, sample, machine, sample->pid, + sample->tid); +} + static void sig_handler(int sig __maybe_unused) { session_done = 1; @@ -2427,6 +2440,10 @@ static int __cmd_script(struct perf_script *script) script->tool.ksymbol = process_bpf_events; script->tool.bpf = process_bpf_events; } + if (script->show_text_poke_events) { + script->tool.ksymbol = process_bpf_events; + script->tool.text_poke = process_text_poke_events; + } if (perf_script__setup_per_event_dump(script)) { pr_err("Couldn't create the per event dump files\n"); @@ -3452,6 +3469,8 @@ int cmd_script(int argc, const char **argv) "Show round events (if recorded)"), OPT_BOOLEAN('\0', "show-bpf-events", &script.show_bpf_events, "Show bpf related events (if recorded)"), + OPT_BOOLEAN('\0', "show-text-poke-events", &script.show_text_poke_events, + "Show text poke related events (if recorded)"), OPT_BOOLEAN('\0', "per-event-dump", &script.per_event_dump, "Dump trace output to files named by the monitored events"), OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"), -- 2.17.1