Thread (34 messages) 34 messages, 3 authors, 3d ago

Re: [PATCH v8 20/22] tools/perf: Add RISC-V CounterIDMask event field

From: Ian Rogers <irogers@google.com>
Date: 2026-07-01 17:45:15
Also in: linux-arm-kernel, linux-perf-users, linux-riscv, lkml

On Wed, Jul 1, 2026 at 1:48 AM Atish Patra [off-list ref] wrote:
From: Atish Patra <redacted>

Counter delegation lets supervisor mode choose the hpmcounter for an event,
but the hardware may only allow a given event on a subset of counters. Add
a RISC-V specific "CounterIDMask" json event field, handled like the other
arch-specific entries in event_fields[], that carries the allowed-counter
bitmask through to the driver's existing counterid_mask (config2:0-31)
format.

The value is the bitmask directly so no counter-list to bitmask
conversion is needed, and because the field is RISC-V specific it is a
no-op for every other architecture's events (unlike the shared "Counter"
field).

Signed-off-by: Atish Patra <redacted>
Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian
quoted hunk ↗ jump to hunk
---
 tools/perf/pmu-events/jevents.py | 1 +
 1 file changed, 1 insertion(+)
diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
index 0cf9d26315b3..516fb73886ed 100755
--- a/tools/perf/pmu-events/jevents.py
+++ b/tools/perf/pmu-events/jevents.py
@@ -396,6 +396,7 @@ class JsonEvent:
         ('EnAllSlices', 'enallslices='),
         ('SliceId', 'sliceid='),
         ('ThreadMask', 'threadmask='),
+        ('CounterIDMask', 'counterid_mask='),
     ]
     for key, value in event_fields:
       if key in jd and not is_zero(jd[key]):

--
2.53.0-Meta
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help