diff options
author | Ian Rogers <[email protected]> | 2023-09-05 11:15:53 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2023-09-11 10:26:35 -0300 |
commit | 493902fcbdd608a6ece49c1670ffc76fed1e617f (patch) | |
tree | 7105611ec43eacd8614db49b16bde0b6555a50cb | |
parent | 10864594d8dedc63183f164c9cb139a521c7c64d (diff) |
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 <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-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| |