Re: [PATCH] perf arm-spe: Honor --time ranges when synthesizing samples
From: Jan Bernloehr
Date: Sun Nov 29 2026 - 04:31:48 EST
On 27/11/2026 13:07, James Clark wrote:
> Do you care that timestamps don't always increase? Seems like it would
> be acceptable to stop after the first timestamp that you see outside of
> the range, even if there are some edge cases where there may be an
> earlier one later.
>
> Also can you elaborate why they don't always increase? I would have
> thought that they would always generally increase in SPE data, if not
> for some allowance for instruction re-ordering or something like that.
> But that would be tiny and not really relevant for this feature.
Hi James,
Thanks for the review. You're right, real timestamps do increase, and
the commit message is wrong there.
What I actually hit: on some CPUs the first SPE record in the trace
carries a stale timestamp from before the session started (0, or days
old). tsc_to_perf_time() wraps it, so the sample lands about 2^61 ns
in the future. With the early stop, that one record ended the CPU's
whole queue, which cut a fifth of the in-range samples on one trace.
For v2 I'd bring the early stop back, skip records timestamped before
time_cycles, and fix the commit message. Does that sound OK?
Thanks,
Jan