Linux Perf Users
 help / color / mirror / Atom feed
From: Qi Liu <liuqi@hygon.cn>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"namhyung@kernel.org" <namhyung@kernel.org>,
	"alexander.shishkin@linux.intel.com"
	<alexander.shishkin@linux.intel.com>,
	"jolsa@kernel.org" <jolsa@kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jing Li <lijing@hygon.cn>, Zhenglang Hu <huzhenglang@hygon.cn>
Subject: 答复: [PATCH 1/3] perf/x86/amd/uncore: Add common PMU helper functions
Date: Wed, 1 Jul 2026 07:50:16 +0000	[thread overview]
Message-ID: <dab0dd2b31d14bef9fdc9d0c887dc460@hygon.cn> (raw)
In-Reply-To: <20260701070013.GJ48970@noisy.programming.kicks-ass.net>



-----邮件原件-----
发件人: Peter Zijlstra <peterz@infradead.org> 
发送时间: 2026年7月1日 15:00
收件人: Qi Liu <liuqi@hygon.cn>
抄送: mingo@redhat.com; namhyung@kernel.org; alexander.shishkin@linux.intel.com; jolsa@kernel.org; x86@kernel.org; linux-perf-users@vger.kernel.org; linux-kernel@vger.kernel.org; Jing Li <lijing@hygon.cn>; Zhenglang Hu <huzhenglang@hygon.cn>
主题: Re: [PATCH 1/3] perf/x86/amd/uncore: Add common PMU helper functions

On Wed, Jul 01, 2026 at 03:44:11AM +0000, Qi Liu wrote:
> Add common helper functions for AMD-family uncore PMU handling.
> 
> The helpers cover event initialization, counter allocation, counter 
> read/update, event start/stop and per-CPU context management.  These 
> paths are not tied to a specific uncore unit and can be reused by 
> drivers with a similar uncore PMU programming model.
> 
> Signed-off-by: Qi Liu <liuqi@hygon.cn>
> Tested-by: Zhenglang Hu <huzhenglang@hygon.cn>

> +EXPORT_SYMBOL_GPL(uncore_common_set_update_interval);
> +EXPORT_SYMBOL_GPL(event_to_uncore_common_pmu);
> +EXPORT_SYMBOL_GPL(uncore_common_attr_group);
> +EXPORT_SYMBOL_GPL(uncore_common_start_hrtimer);
> +EXPORT_SYMBOL_GPL(uncore_common_read);
> +EXPORT_SYMBOL_GPL(uncore_common_start);
> +EXPORT_SYMBOL_GPL(uncore_common_stop);
> +EXPORT_SYMBOL_GPL(uncore_common_event_init);
> +EXPORT_SYMBOL_GPL(uncore_common_add);
> +EXPORT_SYMBOL_GPL(uncore_common_del);
> +EXPORT_SYMBOL_GPL(uncore_common_ctx_init);
> +EXPORT_SYMBOL_GPL(uncore_common_ctx_free);
> +EXPORT_SYMBOL_GPL(uncore_common_ctx_move);

I like the idea, but I don't particularly like the namespace.
'uncore_common' is too generic, there are a ton of uncore drivers, even on x86 and these functions are specific to the AMD family. That is, they aren't really common at all.

Hi Peter,

Thanks for your reply!

Yes, that namespace is a fair point ― "common" is too broad. Here are two options:
A) amd_uncore_* ― The prefix describes the programming model origin, not the vendor running it.
B) amd_family_uncore_* ― makes it explicit that this is AMD-family uncore infrastructure.

Do you have a preference?  Or something else entirely?

Thanks,
Qi Liu

  reply	other threads:[~2026-07-01  7:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01  3:44 [PATCH 0/3] perf/x86/amd/uncore: Add common helpers and Hygon support Qi Liu
2026-07-01  3:44 ` [PATCH 1/3] perf/x86/amd/uncore: Add common PMU helper functions Qi Liu
2026-07-01  4:04   ` sashiko-bot
2026-07-01  7:00   ` Peter Zijlstra
2026-07-01  7:50     ` Qi Liu [this message]
2026-07-01  7:51       ` 答复: " Peter Zijlstra
2026-07-01  7:55         ` 答复: " Qi Liu
2026-07-01  3:44 ` [PATCH 2/3] perf/x86/amd/uncore: Convert AMD driver to common PMU helpers Qi Liu
2026-07-01  4:00   ` sashiko-bot
2026-07-01  3:44 ` [PATCH 3/3] perf/x86/amd/uncore: Add Hygon uncore PMU support Qi Liu
2026-07-01  3:56   ` sashiko-bot

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=dab0dd2b31d14bef9fdc9d0c887dc460@hygon.cn \
    --to=liuqi@hygon.cn \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=huzhenglang@hygon.cn \
    --cc=jolsa@kernel.org \
    --cc=lijing@hygon.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox