diff options
author | Ian Rogers <irogers@google.com> | 2023-09-05 20:15:53 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-09-11 15:26:35 +0200 |
commit | 493902fcbdd608a6ece49c1670ffc76fed1e617f (patch) | |
tree | 7105611ec43eacd8614db49b16bde0b6555a50cb /tools/perf/perf-completion.sh | |
parent | perf shell completion: Restrict completion of events to events (diff) | |
download | linux-493902fcbdd608a6ece49c1670ffc76fed1e617f.tar.xz linux-493902fcbdd608a6ece49c1670ffc76fed1e617f.zip |
perf completion: Support completion of libpfm4 events
Use `perf list --raw-dump pfm` to support completion of libpfm4 events.
Committer testing:
# grep -m1 'model name' /proc/cpuinfo
model name : AMD Ryzen 9 5950X 16-Core Processor
Before:
Files in the current directory are expanded when <tab>
After:
Only the PFM events are:
# . tools/perf/perf-completion.sh
# perf stat --pfm-events <tab>
Becomes:
# perf stat --pfm-events perf_raw::r0000
As apparently there are no other PFM events for this Ryzen 9 5950X
machine.
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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-2-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.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index 40cfc30ad7ad..319ad724b97a 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh @@ -198,6 +198,10 @@ __perf_main () else __perfcomp_colon "$evts" "$cur1" fi + elif [[ $prev == @("--pfm-events") && + $prev_skip_opts == @(record|stat|top) ]]; then + local evts=$($cmd list --raw-dump pfm) + __perfcomp "$evts" "$cur" else # List subcommands for perf commands if [[ $prev_skip_opts == @(kvm|kmem|mem|lock|sched| |