Re: [PATCH v2 2/2] perf tsc: Declare TSC support from the build system

From: Paul Walmsley

Date: Wed Oct 07 2026 - 11:34:58 EST


On Tue, 6 Oct 2026, Adrian Hunter wrote:

> On 29/09/2026 06:41, Chen Pei wrote:
> > The "TSC support" subtest of the "Convert perf time to TSC" test decides
> > whether the architecture is covered by matching compiler macros for
> > x86_64, i386 and arm64. That list has to be edited for every new
> > architecture and can drift apart from the set of architectures that really
> > provide a counter.
> >
> > Declare the capability where the implementation is, following the
> > PERF_HAVE_JITDUMP pattern: an architecture with a usable counter sets
> > PERF_HAVE_RDTSC in its arch Makefile, Makefile.config turns it into
> > -DHAVE_RDTSC, and the test keys off that.
> >
> > x86 and arm64 keep the same behaviour, riscv starts running the subtest
> > where the previous patch defines rdtsc().
> >
> > Signed-off-by: Chen Pei <cp0613@xxxxxxxxxxxxxxxxx>
>
> One minor style comment below. In any case:
>
> Reviewed-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>

Reviewed-by: Paul Walmsley <pjw@xxxxxxxxxx>


- Paul