[PATCH v4 10/19] perf auxtrace: Turn Intel BTS snapshot search into a generic one

Adrian Hunter adrian.hunter at intel.com
Tue Nov 24 12:35:00 PST 2026


On 05/11/2026 13:44, James Clark wrote:
> Currently each auxtrace user has to implement both the snapshot search
> and the logic to fixup the 'head' and 'old' values after finding a wrap.
> IntelPT and BTS have the same fixup logic but different wrap searches.
> BTS and Arm SPE have the same search but SPE modifies head differently
> (although it probably shouldn’t), and Arm Coresight doesn't have a
> search at all, but later it will want the same search and fixup logic.
> 
> Add auxtrace_record__default_find_snapshot() as a generic
> find_snapshot() implementation that tracers can use without
> reimplementing it. It's based on intel_bts_find_snapshot() and the
> search includes the caching from it. Split the pointer fixup into
> auxtrace_record__snapshot_fixup() so that tracers with their own search,
> like Intel PT, can still share it.
> 
> No functional changes intended apart from changing the pr_debug3()s
> to print hex to match __auxtrace_mmap__read() and no longer leaking
> snapshot_refs when expanding the array length.
> 
> Reviewed-by: Leo Yan <leo.yan at arm.com>
> Tested-by: Leo Yan <leo.yan at arm.com>
> Signed-off-by: James Clark <james.clark at linaro.org>

Reviewed-by: Adrian Hunter <adrian.hunter at intel.com>




More information about the linux-arm-kernel mailing list