[PATCH v2 5/5] perf/arm_cspmu: nvidia: Add pmevfiltr2 support
Besar Wicaksono
bwicaksono at nvidia.com
Fri Sep 26 09:35:25 PDT 2025
> -----Original Message-----
> From: Robin Murphy <robin.murphy at arm.com>
> Sent: Friday, September 26, 2025 5:32 AM
> To: Besar Wicaksono <bwicaksono at nvidia.com>; will at kernel.org;
> ilkka at os.amperecomputing.com
> Cc: linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org; linux-
> tegra at vger.kernel.org; suzuki.poulose at arm.com; mark.rutland at arm.com;
> Thierry Reding <treding at nvidia.com>; Jon Hunter <jonathanh at nvidia.com>;
> Vikram Sethi <vsethi at nvidia.com>; Rich Wiley <rwiley at nvidia.com>; Shanker
> Donthineni <sdonthineni at nvidia.com>
> Subject: Re: [PATCH v2 5/5] perf/arm_cspmu: nvidia: Add pmevfiltr2 support
>
> External email: Use caution opening links or attachments
>
>
> On 2025-09-23 1:18 am, Besar Wicaksono wrote:
> > Support NVIDIA PMU that utilizes the optional event filter2 register.
> >
> > Signed-off-by: Besar Wicaksono <bwicaksono at nvidia.com>
> > ---
> > drivers/perf/arm_cspmu/nvidia_cspmu.c | 176 +++++++++++++++++++---
> ----
> > 1 file changed, 133 insertions(+), 43 deletions(-)
> >
> > diff --git a/drivers/perf/arm_cspmu/nvidia_cspmu.c
> b/drivers/perf/arm_cspmu/nvidia_cspmu.c
> > index ac91dc46501d..e06a06d3407b 100644
> > --- a/drivers/perf/arm_cspmu/nvidia_cspmu.c
> > +++ b/drivers/perf/arm_cspmu/nvidia_cspmu.c
> > @@ -40,10 +40,21 @@
> >
> > struct nv_cspmu_ctx {
> > const char *name;
> > - u32 filter_mask;
> > - u32 filter_default_val;
> > +
> > struct attribute **event_attr;
> > struct attribute **format_attr;
> > +
> > + u32 filter_mask;
> > + u32 filter_default_val;
> > + u32 filter2_mask;
> > + u32 filter2_default_val;
> > +
> > + u32 (*get_filter)(const struct perf_event *event);
> > + u32 (*get_filter2)(const struct perf_event *event);
>
> Callbacks for this seem like complete overkill - you already know
> whether a given implementation cares about each filter via
> .filter{,2}_mask being nonzero, so unless you intend to have wildly
> different event encodings across implementations, a simple conditional
> extension of the existing nv_cspmu_event_filter() logic should be all
> you need.
>
Indeed, this is the reason. All the new PMUs we are planning to support
have unique requirements on the filter configuration.
Regards,
Besar
More information about the linux-arm-kernel
mailing list