All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chen Pei" <cp0613@linux.alibaba.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/2] perf tsc: Replace the compile-time TSC support check with a weak hook
Date: Mon, 28 Sep 2026 09:55:27 +0000	[thread overview]
Message-ID: <20260928095528.605811F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260928094739.2605-3-cp0613@linux.alibaba.com>

> 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 it can drift apart from the set of architectures that
> really provide a counter: util/tsc.c already ships a weak rdtsc() which
> an architecture overrides with a strong definition when it has one.
> 
> 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().  Support is then
> declared next to the counter it describes, and a caller can tell a stub
> apart from a real counter without keeping its own copy of the macro
> list.  This follows the pattern of the other optional per-architecture
> hooks in util/ such as get_cpuid_str().
> 
> x86 and arm64 keep the same behaviour, and riscv starts running the
> subtest because it gained rdtsc() in the previous patch.
> 
> Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260928094739.2605-1-cp0613@linux.alibaba.com?part=2


  reply	other threads:[~2026-09-28  9:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  9:47 [PATCH 0/2] perf riscv: Implement rdtsc() Chen Pei
2026-09-28  9:47 ` Chen Pei
2026-09-28  9:47 ` [PATCH 1/2] " Chen Pei
2026-09-28  9:47   ` Chen Pei
2026-09-28  9:54   ` sashiko-bot
2026-09-28 13:42   ` Anup Patel
2026-09-28 13:42     ` Anup Patel
2026-09-28  9:47 ` [PATCH 2/2] perf tsc: Replace the compile-time TSC support check with a weak hook Chen Pei
2026-09-28  9:47   ` Chen Pei
2026-09-28  9:55   ` sashiko-bot [this message]
2026-09-28 13:42   ` Anup Patel
2026-09-28 13:42     ` Anup Patel
2026-09-28 16:34   ` Leo Yan
2026-09-28 16:34     ` Leo Yan
2026-09-29  3:40     ` Chen Pei
2026-09-29  3:40       ` Chen Pei
2026-09-29  8:28   ` David Laight
2026-09-29  8:28     ` David Laight
2026-09-29  9:08     ` Chen Pei
2026-09-29  9:08       ` Chen Pei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260928095528.605811F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cp0613@linux.alibaba.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.