[PATCH] perf arm-spe: Honor --time ranges when synthesizing samples
James Clark
james.clark at linaro.org
Tue Dec 1 03:56:31 PST 2026
On 29/11/2026 09:29, Jan Bernloehr wrote:
> 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
A zero timestamp could be V2 erratum 2813408, but "days old" would be
something new wouldn't it? It says that timestamps could only be "zero
or off by one tick in some cases".
> 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
I think we should dig into what the root cause is before coming up with
anything. Can you share a perf.data file that has the issue? Maybe one
file with the 0 timestamp and one with the days old timestamp.
0 would be easy to workaround because it can easily ignored or treated
as invalid, but the other issue needs more investigation.
More information about the linux-arm-kernel
mailing list