Re: [PATCH v1 2/3] perf completion: Support completion of libpfm4 events
From: Namhyung Kim
Date: Tue Sep 05 2023 - 14:25:58 EST
On Tue, Sep 5, 2023 at 11:16 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> Use `perf list --raw-dump pfm` to support completion of libpfm4 events.
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>
Thanks,
Namhyung
> ---
> tools/perf/perf-completion.sh | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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|
> --
> 2.42.0.283.g2d96d420d3-goog
>