Re: [PATCH 2/2] perf tsc: Replace the compile-time TSC support check with a weak hook
From: Leo Yan
Date: Mon Sep 28 2026 - 12:34:59 EST
On Mon, Sep 28, 2026 at 05:47:39PM +0800, Chen Pei wrote:
[...]
> Add a weak arch__rdtsc_supported() next to the weak rdtsc(), let the
> test query it instead of the macros, and have x86, arm64 and riscv
> override it in the file where they implement rdtsc().
The patch itself is fine for me.
Just a bit on refactoring. You could refer to the implementation of
PERF_HAVE_JITDUMP in arch Makefile and "CFLAGS += -DHAVE_JITDUMP" and
do similiar thing for rdtsc.
Seems to me, we can just use build system for configurations.
Thanks,
Leo