[PATCH v1 0/3] perf list: Remove duplicate PMUs

From: Ian Rogers
Date: Tue Jul 11 2023 - 01:59:26 EST


When there are multiple PMUs differing by ordered suffixes only
display one. This avoids repeated listing of events, in particular
when there are 10s of uncore PMUs. This also helps speed the all PMU
event tests.

Before:
```
$ perf list
...
uncore_imc_free_running_0/data_read/ [Kernel PMU event]
uncore_imc_free_running_0/data_total/ [Kernel PMU event]
uncore_imc_free_running_0/data_write/ [Kernel PMU event]
uncore_imc_free_running_1/data_read/ [Kernel PMU event]
uncore_imc_free_running_1/data_total/ [Kernel PMU event]
uncore_imc_free_running_1/data_write/ [Kernel PMU event]
```

After:
```
$ perf list
...
uncore_imc_free_running/data_read/ [Kernel PMU event]
uncore_imc_free_running/data_total/ [Kernel PMU event]
uncore_imc_free_running/data_write/ [Kernel PMU event]
```

The PMUs are sorted by name then suffix as a part of this change.

Ian Rogers (3):
perf pmus: Sort pmus by name then suffix
perf pmus: Add scan that ignores duplicates, use for perf list
perf pmus: Don't print PMU suffix in list

tools/perf/util/pmus.c | 107 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 102 insertions(+), 5 deletions(-)

--
2.41.0.390.g38632f3daf-goog