Commit 493902fc authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

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: default avatarIan Rogers <irogers@google.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Tested-by: default avatarArnaldo 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 10864594
......@@ -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|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment