Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp386612rdb; Tue, 16 Jan 2024 03:36:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+OhSyIms1IngXmxfy7si7bsU/Zwlc+r718soLl4MMQD2X26TzF82L1df+haBqMl2m/hK/ X-Received: by 2002:a05:6358:3e8e:b0:174:d588:2de2 with SMTP id d14-20020a0563583e8e00b00174d5882de2mr10978647rwm.33.1705404975179; Tue, 16 Jan 2024 03:36:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705404975; cv=none; d=google.com; s=arc-20160816; b=FHMcKVkoSwyvjtKJhjwMn/emALl3e7EjJH/z4RMKmPOP7UU/g0ivxal/KEJUrZ81c+ 7tg4rjYNZv9ZoAugUYzZ3952lK1l7BWwz/9hXGKSWssi+p8RJm8R2+iV9rz31T/h1sbG 29Wx0Dn73I+mlQbjO0EMEXFqWV+So7dp7A1N3T2B2HKpOH3fahxI14O9gYGxaznxmsaq K+64pUEdpZxBh7pkg/tfd1ngJZiKlkEADJ7yf1miPh+sKJ9TyJpxku35xPltZH7LRUQx THS0QqUnDaVgUT47fa6X9y7wsQ9NUG2rQhz9T9lIddfMXRkWdIxDyo/efYc/Tz9G8lb2 nnqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=WcgONErF8YVcxgTw+3/TGKL1G+qX2UdEGQRDi429Djw=; fh=wjLkt+hbOkIreNMlyAPJ/U4E0ReWqRTqN/ROQ2ik91w=; b=JEPdL55SGeLgJPWTV0aTcOivteXrN9i4iLsxL3h4xMQbLh+m8LEaeu7CncKtHU9VlS GXzpg0lAFZseBayR2WZVN2I2WVtv5kiWtO3cRXyd1zx1/kFR1JLEwmSiwNwaFOx7VFn8 LcNgh8EIzet2Kg2exVeoPx7AJ690teeTdhA804tRGEZPijpFwJbT2/B/pMOa9bvVJmLV 4d+DG+0uyJbJscoTs8OHoCuPJgalMm861Mg2aNnbK1dcZL6QQnqbL8ReZxsqCK9OqnAz XZ4qf21QTHiQECljcaa0BOmuqKQcqYdvTLunCHU80k0pBICKfZ4DQDNzGthbz7xBDEB5 cvzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27325-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p21-20020a056a000b5500b006d9e84133b7si11203582pfo.217.2024.01.16.03.36.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 03:36:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27325-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27325-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CFB28283DF3 for ; Tue, 16 Jan 2024 11:36:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9FFA1BDC9; Tue, 16 Jan 2024 11:35:14 +0000 (UTC) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C64CC1BC3E; Tue, 16 Jan 2024 11:35:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4TDn3m4dBZz1wn3N; Tue, 16 Jan 2024 19:34:44 +0800 (CST) Received: from kwepemd100002.china.huawei.com (unknown [7.221.188.184]) by mail.maildlp.com (Postfix) with ESMTPS id 4810F1A016B; Tue, 16 Jan 2024 19:35:03 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemd100002.china.huawei.com (7.221.188.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Tue, 16 Jan 2024 19:35:02 +0800 From: Changbin Du To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , , , Changbin Du Subject: [PATCH 3/3] perf: script: deprecate the '--xed' option Date: Tue, 16 Jan 2024 19:34:37 +0800 Message-ID: <20240116113437.1507537-4-changbin.du@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240116113437.1507537-1-changbin.du@huawei.com> References: <20240116113437.1507537-1-changbin.du@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd100002.china.huawei.com (7.221.188.184) Now perf can show assembly instructions with libcapstone for both x86 and Arm. So the old '--xed' option should not be used. Signed-off-by: Changbin Du --- tools/perf/Documentation/build-xed.txt | 19 ------------------- tools/perf/Documentation/perf-intel-pt.txt | 17 +++++------------ tools/perf/Documentation/perf-script.txt | 5 ++--- tools/perf/Documentation/tips.txt | 2 +- tools/perf/builtin-script.c | 7 ++----- tools/perf/ui/browsers/res_sample.c | 2 +- tools/perf/ui/browsers/scripts.c | 4 ++-- 7 files changed, 13 insertions(+), 43 deletions(-) delete mode 100644 tools/perf/Documentation/build-xed.txt diff --git a/tools/perf/Documentation/build-xed.txt b/tools/perf/Documentation/build-xed.txt deleted file mode 100644 index 6222c1e7231f..000000000000 --- a/tools/perf/Documentation/build-xed.txt +++ /dev/null @@ -1,19 +0,0 @@ - -For --xed the xed tool is needed. Here is how to install it: - - $ git clone https://github.com/intelxed/mbuild.git mbuild - $ git clone https://github.com/intelxed/xed - $ cd xed - $ ./mfile.py --share - $ ./mfile.py examples - $ sudo ./mfile.py --prefix=/usr/local install - $ sudo ldconfig - $ sudo cp obj/examples/xed /usr/local/bin - -Basic xed testing: - - $ xed | head -3 - ERROR: required argument(s) were missing - Copyright (C) 2017, Intel Corporation. All rights reserved. - XED version: [v10.0-328-g7d62c8c49b7b] - $ diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt index 2109690b0d5f..15ae7be599e4 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -115,9 +115,8 @@ toggle respectively. perf script also supports higher level ways to dump instruction traces: - perf script --insn-trace --xed + perf script --insn-trace -Dump all instructions. This requires installing the xed tool (see XED below) Dumping all instructions in a long trace can be fairly slow. It is usually better to start with higher level decoding, like @@ -130,12 +129,12 @@ or and then select a time range of interest. The time range can then be examined in detail with - perf script --time starttime,stoptime --insn-trace --xed + perf script --time starttime,stoptime --insn-trace While examining the trace it's also useful to filter on specific CPUs using the -C option - perf script --time starttime,stoptime --insn-trace --xed -C 1 + perf script --time starttime,stoptime --insn-trace -C 1 Dump all instructions in time range on CPU 1. @@ -1243,12 +1242,6 @@ To display PEBS events from the Intel PT trace, use the itrace 'o' option e.g. perf script --itrace=oe -XED ---- - -include::build-xed.txt[] - - Tracing Virtual Machines (kernel only) -------------------------------------- @@ -1306,7 +1299,7 @@ Without timestamps, --per-thread must be specified to distinguish threads. perf script can be used to provide an instruction trace - $ perf script --guestkallsyms $KALLSYMS --insn-trace --xed -F+ipc | grep -C10 vmresume | head -21 + $ perf script --guestkallsyms $KALLSYMS --insn-trace -F+ipc | grep -C10 vmresume | head -21 CPU 0/KVM 1440 ffffffff82133cdd __vmx_vcpu_run+0x3d ([kernel.kallsyms]) movq 0x48(%rax), %r9 CPU 0/KVM 1440 ffffffff82133ce1 __vmx_vcpu_run+0x41 ([kernel.kallsyms]) movq 0x50(%rax), %r10 CPU 0/KVM 1440 ffffffff82133ce5 __vmx_vcpu_run+0x45 ([kernel.kallsyms]) movq 0x58(%rax), %r11 @@ -1407,7 +1400,7 @@ There were none. 'perf script' can be used to provide an instruction trace showing timestamps - $ perf script -i perf.data.kvm --guestkallsyms $KALLSYMS --insn-trace --xed -F+ipc | grep -C10 vmresume | head -21 + $ perf script -i perf.data.kvm --guestkallsyms $KALLSYMS --insn-trace -F+ipc | grep -C10 vmresume | head -21 CPU 1/KVM 17006 [001] 11500.262865593: ffffffff82133cdd __vmx_vcpu_run+0x3d ([kernel.kallsyms]) movq 0x48(%rax), %r9 CPU 1/KVM 17006 [001] 11500.262865593: ffffffff82133ce1 __vmx_vcpu_run+0x41 ([kernel.kallsyms]) movq 0x50(%rax), %r10 CPU 1/KVM 17006 [001] 11500.262865593: ffffffff82133ce5 __vmx_vcpu_run+0x45 ([kernel.kallsyms]) movq 0x58(%rax), %r11 diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index ff9a52e44688..74a0bc2e117f 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt @@ -442,11 +442,10 @@ include::itrace.txt[] default, disable with --no-inline. --insn-trace:: - Show instruction stream for intel_pt traces. Combine with --xed to - show disassembly. + Show instruction stream for intel_pt traces. --xed:: - Run xed disassembler on output. Requires installing the xed disassembler. + Run xed disassembler on output. (deprecated) -S:: --symbols=symbol[,symbol...]:: diff --git a/tools/perf/Documentation/tips.txt b/tools/perf/Documentation/tips.txt index 825745a645c1..5e1182514730 100644 --- a/tools/perf/Documentation/tips.txt +++ b/tools/perf/Documentation/tips.txt @@ -15,7 +15,7 @@ To see callchains in a more compact form: perf report -g folded Show individual samples with: perf script Limit to show entries above 5% only: perf report --percent-limit 5 Profiling branch (mis)predictions with: perf record -b / perf report -To show assembler sample contexts use perf record -b / perf script -F +brstackinsn --xed +To show assembler sample contexts use perf record -b / perf script -F +brstackinsn Treat branches as callchains: perf report --branch-history To count events in every 1000 msec: perf stat -I 1000 Print event counts in CSV format with: perf stat -x, diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index c32a326e660f..9768d00323e6 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -3776,10 +3776,7 @@ static int parse_xed(const struct option *opt __maybe_unused, const char *str __maybe_unused, int unset __maybe_unused) { - if (isatty(1)) - force_pager("xed -F insn: -A -64 | less"); - else - force_pager("xed -F insn: -A -64"); + pr_warning("xed option is deprecated\n"); return 0; } @@ -3915,7 +3912,7 @@ int cmd_script(int argc, const char **argv) OPT_CALLBACK_OPTARG(0, "insn-trace", &itrace_synth_opts, NULL, NULL, "Decode instructions from itrace", parse_insn_trace), OPT_CALLBACK_OPTARG(0, "xed", NULL, NULL, NULL, - "Run xed disassembler on output", parse_xed), + "Run xed disassembler on output (deprecated)", parse_xed), OPT_CALLBACK_OPTARG(0, "call-trace", &itrace_synth_opts, NULL, NULL, "Decode calls from itrace", parse_call_trace), OPT_CALLBACK_OPTARG(0, "call-ret-trace", &itrace_synth_opts, NULL, NULL, diff --git a/tools/perf/ui/browsers/res_sample.c b/tools/perf/ui/browsers/res_sample.c index 7cb2d6678039..382f1fb07a73 100644 --- a/tools/perf/ui/browsers/res_sample.c +++ b/tools/perf/ui/browsers/res_sample.c @@ -83,7 +83,7 @@ int res_sample_browse(struct res_sample *res_samples, int num_res, r->tid ? "--tid " : "", r->tid ? (sprintf(tidbuf, "%d", r->tid), tidbuf) : "", extra_format, - rstype == A_ASM ? "-F +insn --xed" : + rstype == A_ASM ? "-F +insn" : rstype == A_SOURCE ? "-F +srcline,+srccode" : "", symbol_conf.inline_name ? "--inline" : "", "--show-lost-events ", diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c index 47d2c7a8cbe1..056c51a95712 100644 --- a/tools/perf/ui/browsers/scripts.c +++ b/tools/perf/ui/browsers/scripts.c @@ -37,7 +37,7 @@ void attr_to_script(char *extra_format, struct perf_event_attr *attr) if (attr->read_format & PERF_FORMAT_GROUP) strcat(extra_format, " -F +metric"); if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) - strcat(extra_format, " -F +brstackinsn --xed"); + strcat(extra_format, " -F +brstackinsn"); if (attr->sample_type & PERF_SAMPLE_REGS_INTR) strcat(extra_format, " -F +iregs"); if (attr->sample_type & PERF_SAMPLE_REGS_USER) @@ -107,7 +107,7 @@ static int list_scripts(char *script_name, bool *custom, if (evsel) attr_to_script(scriptc.extra_format, &evsel->core.attr); add_script_option("Show individual samples", "", &scriptc); - add_script_option("Show individual samples with assembler", "-F +insn --xed", + add_script_option("Show individual samples with assembler", "-F +insn", &scriptc); add_script_option("Show individual samples with source", "-F +srcline,+srccode", &scriptc); -- 2.25.1