summaryrefslogtreecommitdiff
path: root/tools/perf/perf-completion.sh
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-09-05 11:15:52 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-09-11 10:26:35 -0300
commit10864594d8dedc63183f164c9cb139a521c7c64d (patch)
treee74c61b54e1d3da275525e6f9c119c118f6032e8 /tools/perf/perf-completion.sh
parenta84fbf205609313594b86065c67e823f09ebe29b (diff)
perf shell completion: Restrict completion of events to events
'perf list' will list libpfm4 events and metrics which aren't valid options to the '-e' option. Restrict the events gathered so that invalid ones aren't shown. Before: $ perf stat -e <tab><tab> Display all 633 possibilities? (y or n) After: $ perf stat -e <tab><tab> Display all 375 possibilities? (y or n) Committer testing: # grep -m1 'model name' /proc/cpuinfo model name : AMD Ryzen 9 5950X 16-Core Processor # Before: # . tools/perf/perf-completion.sh # perf stat -e Display all 2672 possibilities? (y or n) After: # . tools/perf/perf-completion.sh # perf stat -e Display all 2648 possibilities? (y or n) Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20230905181554.3202873-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/perf-completion.sh')
-rw-r--r--tools/perf/perf-completion.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh
index 978249d7868c..40cfc30ad7ad 100644
--- a/tools/perf/perf-completion.sh
+++ b/tools/perf/perf-completion.sh
@@ -164,7 +164,7 @@ __perf_main ()
$prev_skip_opts == @(record|stat|top) ]]; then
local cur1=${COMP_WORDS[COMP_CWORD]}
- local raw_evts=$($cmd list --raw-dump)
+ local raw_evts=$($cmd list --raw-dump hw sw cache tracepoint pmu sdt)
local arr s tmp result cpu_evts
# aarch64 doesn't have /sys/bus/event_source/devices/cpu/events