[PATCH v2 1/2] perf cs-etm: Fix decoding for sparse CPU maps
Leo Yan
leo.yan at arm.com
Mon Jan 19 05:59:07 PST 2026
On Mon, Jan 19, 2026 at 02:11:43PM +0200, Adrian Hunter wrote:
[...]
> >> 0 0 0x200 [0x90]: PERF_RECORD_ID_INDEX nr: 4
> >> ... id: 771 idx: 0 cpu: 2 tid: -1
> >> ... id: 772 idx: 1 cpu: 3 tid: -1
> >> ... id: 773 idx: 0 cpu: 2 tid: -1
> >> ... id: 774 idx: 1 cpu: 3 tid: -1
> >
> > Seems to me that this patch works around the issue by using the CPU ID
> > instead, but event->auxtrace.idx is broken.
> >
> > Should we store the correct index in event->auxtrace.idx (e.g., in the
> > __perf_event__synthesize_id_index()) ?
>
> The idx value represents a perf events ring buffer. Events on the same
> CPU can share the same ring buffer. But in the case of per-thread
> recording, different threads have different ring buffers and therefore
> different idx values.
>
> So I don't think the idx value is wrong. It is just not the same thing
> as CPU number.
Thanks a lot for the explanation, this makes sense to me.
Leo
More information about the linux-arm-kernel
mailing list