public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] perf: Add --pmu-filter option for filtering PMUs
@ 2026-02-25  3:41 Qinxin Xia
  2026-02-25  3:41 ` [PATCH 1/1] " Qinxin Xia
  0 siblings, 1 reply; 4+ messages in thread
From: Qinxin Xia @ 2026-02-25  3:41 UTC (permalink / raw)
  To: irogers, peterz, mingo, acme, namhyung, wangyushan12, hejunhao3,
	jonathan.cameron, xiaqinxin
  Cc: linux-perf-users, linux-kernel, mark.rutland, alexander.shishkin,
	jolsa, adrian.hunter, "james.clark

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).

perf event:
[root@localhost tmp]# perf stat -e cpa_cycles
 Performance counter stats for 'system wide':

     3,005,509,659      hisi_sicl0_cpa0/cpa_cycles/
     3,005,502,319      hisi_sicl2_cpa0/cpa_cycles/

       3.005460970 seconds time elapsed

[root@localhost tmp]# perf stat --pmu-filter hisi_sicl0_cpa0 -e cpa_cycles
 Performance counter stats for 'system wide':

     3,003,899,571      cpa_cycles

       3.003864470 seconds time elapsed

perf metric:
[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

Changes since RFC:
- Address the comments from Ian, replace '--uncorepmu'  with '--pmu-filter'.
- Link: https://lore.kernel.org/linux-perf-users/20260120095058.2778834-1-xiaqinxin@huawei.com/

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

 tools/perf/Documentation/perf-stat.txt |  4 ++++
 tools/perf/builtin-stat.c              | 26 ++++++++++++++++++++++++++
 tools/perf/util/metricgroup.c          | 18 +++++++++++++-----
 3 files changed, 43 insertions(+), 5 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-05  6:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25  3:41 [PATCH 0/1] perf: Add --pmu-filter option for filtering PMUs Qinxin Xia
2026-02-25  3:41 ` [PATCH 1/1] " Qinxin Xia
2026-03-04  1:19   ` Namhyung Kim
2026-03-05  6:14     ` Qinxin Xia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox