Skip to content

perf: Add --pmu-filter option for filtering PMUs

Qinxin Xia linux-perf-users lkml 2 versions – Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 6 repliesApplied
  2. v11 patch 2 repliesSuperseded

Changes in v2 from the cover letter

- Address the comments from Namhyung, the description of the event filter in commit info is omitted, and wildcard matching is supported for pmu-filter.
- Link: https://lore.kernel.org/all/[email protected]/

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/1perf: Add --pmu-filter option for filtering PMUstools/perf/Documentation/perf-stat.txt tools/perf/builtin-stat.c tools/perf/util/metricgroup.c +1 more+37 -65 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchIan Rogers
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/1] perf: Add --pmu-filter option for filtering PMUs

This patch adds a new --pmu-filter option to perf-stat command to allow filtering events on specific PMUs. This is useful when there are multiple PMUs with same type (e.g. hisi_sicl2_cpa0 and hisi_sicl0_cpa0).

[root@localhost tmp]# perf stat -M cpa_p0_avg_bw
Performance counter stats for 'system wide':

    19,417,779,115      hisi_sicl0_cpa0/cpa_cycles/      #     0.00 cpa_p0_avg_bw
                 0      hisi_sicl0_cpa0/cpa_p0_wr_dat/
                 0      hisi_sicl0_cpa0/cpa_p0_rd_dat_64b/
                 0      hisi_sicl0_cpa0/cpa_p0_rd_dat_32b/
    19,417,751,103      hisi_sicl10_cpa0/cpa_cycles/     #     0.00 cpa_p0_avg_bw
                 0      hisi_sicl10_cpa0/cpa_p0_wr_dat/
                 0      hisi_sicl10_cpa0/cpa_p0_rd_dat_64b/
                 0      hisi_sicl10_cpa0/cpa_p0_rd_dat_32b/
    19,417,730,679      hisi_sicl2_cpa0/cpa_cycles/      #     0.31 cpa_p0_avg_bw
        75,635,749      hisi_sicl2_cpa0/cpa_p0_wr_dat/
        18,520,640      hisi_sicl2_cpa0/cpa_p0_rd_dat_64b/
                 0      hisi_sicl2_cpa0/cpa_p0_rd_dat_32b/
    19,417,674,227      hisi_sicl8_cpa0/cpa_cycles/      #     0.00 cpa_p0_avg_bw
                 0      hisi_sicl8_cpa0/cpa_p0_wr_dat/
                 0      hisi_sicl8_cpa0/cpa_p0_rd_dat_64b/
                 0      hisi_sicl8_cpa0/cpa_p0_rd_dat_32b/
      19.417734480 seconds time elapsed

[root@localhost tmp]# perf stat --pmu-filter hisi_sicl2_cpa0 -M cpa_p0_avg_bw
Performance counter stats for 'system wide':

     6,234,093,559      cpa_cycles                       #     0.60 cpa_p0_avg_bw
        50,548,465      cpa_p0_wr_dat
         7,552,182      cpa_p0_rd_dat_64b
                 0      cpa_p0_rd_dat_32b
       6.234139320 seconds time elapsed

wildcard match:
[root@localhost ~]# ./perf stat --pmu-filter hisi_sicl[2,8]_cpa0 -M cpa_p0_avg_bw
Performance counter stats for 'system wide':

    18,505,025,031      hisi_sicl2_cpa0/cpa_cycles/      #     0.42 cpa_p0_avg_bw
        80,007,944      hisi_sicl2_cpa0/cpa_p0_wr_dat/
        42,014,906      hisi_sicl2_cpa0/cpa_p0_rd_dat_64b/
                 0      hisi_sicl2_cpa0/cpa_p0_rd_dat_32b/
    18,504,957,351      hisi_sicl8_cpa0/cpa_cycles/      #     0.00 cpa_p0_avg_bw
                 0      hisi_sicl8_cpa0/cpa_p0_wr_dat/
                 0      hisi_sicl8_cpa0/cpa_p0_rd_dat_64b/
                 0      hisi_sicl8_cpa0/cpa_p0_rd_dat_32b/
      18.504994880 seconds time elapsed

Changes since V1:
- Address the comments from Namhyung, the description of the event filter in commit info is omitted, and wildcard matching is supported for pmu-filter.
- Link: https://lore.kernel.org/all/[email protected]/

Changes since RFC:
- Address the comments from Ian, replace '--uncorepmu' with '--pmu-filter'.
- Link: https://lore.kernel.org/linux-perf-users/[email protected]/

Qinxin Xia (1):
perf: Add --pmu-filter option for filtering PMUs

 tools/perf/Documentation/perf-stat.txt |  4 ++++
 tools/perf/builtin-stat.c              | 19 +++++++++++++++++++
 tools/perf/util/metricgroup.c          | 18 +++++++++++++-----
 tools/perf/util/parse-events.c         |  2 +-
 4 files changed, 37 insertions(+), 6 deletions(-)
Signature · 1 line
2.33.0