[PATCH v4 08/10] drivers/perf: hisi: Export associated CPUs of each PMU through sysfs
Will Deacon
will at kernel.org
Mon Dec 9 07:48:30 PST 2024
On Tue, Dec 03, 2024 at 08:50:47PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong at hisilicon.com>
>
> Although the event of the uncore PMU can only be opened on a single
> CPU, some PMU does have the affinity on a range of CPUs. For example
> the L3C PMU is associated to the CPUs sharing the L3T it monitors.
> Users may infer this affinity by the PMU name which may have SCCL ID
> and CCL ID encoded (for L3C etc), but it's not that straightforward.
> So export this information by adding an "associated_cpus" sysfs
> attribute then user can get this directly.
>
> Reviewed-by: Jonathan Cameron <Joanthan.Cameron at huawei.com>
> Signed-off-by: Yicong Yang <yangyicong at hisilicon.com>
> ---
> Documentation/admin-guide/perf/hisi-pmu.rst | 5 ++++-
> drivers/perf/hisilicon/hisi_uncore_pmu.c | 10 ++++++++++
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/admin-guide/perf/hisi-pmu.rst b/Documentation/admin-guide/perf/hisi-pmu.rst
> index 5cc248d18c63..48992a0b8e94 100644
> --- a/Documentation/admin-guide/perf/hisi-pmu.rst
> +++ b/Documentation/admin-guide/perf/hisi-pmu.rst
> @@ -35,7 +35,10 @@ e.g. hisi_sccl1_hha0/rx_operations is RX_OPERATIONS event of HHA index #0 in
> SCCL ID #1.
>
> The driver also provides a "cpumask" sysfs attribute, which shows the CPU core
> -ID used to count the uncore PMU event.
> +ID used to count the uncore PMU event. An "associated_cpus" sysfs attribute is
> +also provided to show the CPUs associated with this PMU. The "cpumask" indicates
> +the CPUs to open the events, usually as a hint for userspaces tools like perf.
> +It only contains one associated CPU from the "associated_cpus".
What is userspace expected to do with this information? Can you point me
to patches that add the corresponding support to the 'perf' tool, please?
Will
More information about the linux-arm-kernel
mailing list