Re: [PATCH v5 00/11] alpha/perf: add ProfileMe sampling
From: Matt Turner
Date: Wed Nov 04 2026 - 14:44:25 EST
On Wed, Nov 4, 2026 at 4:02 AM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> One detail on the wrap check: alpha_perf_event_update() also advances
> prev_count on an ordinary read. Should we cover the case where a read
> has already accounted for a real wrap before its PMI is delivered?
Yes, v6 handles it. When alpha_perf_event_update() sees a negative
delta it adds the period and sets a flag in hwc->flags. If the flag is
set when the interrupt arrives, the handler adds nothing but still
takes the sample and rearms. Writing the counter clears the flag.
> On prefetches, the EV67 HRM, section 2.6 (p. 2-23), says loads to
> R31/F31 may generate exceptions that PALcode must dismiss. So seeing
> no Linux fault wouldn't by itself tell us the access hit in the DTB.
Right. I didn't go by faults. ProfileMe's I_STAT has the trap type, and
on the EV7 a load into $31 that misses the DTB shows the DTB miss trap,
same as a normal load. So the prefetch samples are split into misses
and hits the same way, and reported as PERF_MEM_OP_PFETCH.
> I also checked the saved ES40 recordings: 344 of 266425 samples had
> both PM_KILLED_BM and TRP set, and 53 of those also had MIS set.
> That confirms the Python decoder needs the killed check on EV67 too.
Thanks, good to have that on EV67 as well. Tools v4 ignores TRP and MIS
for killed instructions in both the script and the C decoder.
v6 adds the wrap check as a new patch 5, which shifts the ProfileMe
patch and everything after it up by one, and most of those changed.
There's also a new last patch from Ian's follow-up that lets ProfileMe
events take exclude_user and exclude_kernel, so perf record works
without root at perf_event_paranoid 2. I'd appreciate another run on
the ES40 when you have time.