[PATCH v9 1/5] perf: Add perf_event_attr::config4

James Clark posted 5 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v9 1/5] perf: Add perf_event_attr::config4
Posted by James Clark 3 months, 1 week ago
Arm FEAT_SPE_FDS adds the ability to filter on the data source of a
packet using another 64-bits of event filtering control. As the existing
perf_event_attr::configN fields are all used up for SPE PMU, an
additional field is needed. Add a new 'config4' field.

Reviewed-by: Leo Yan <leo.yan@arm.com>
Tested-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: James Clark <james.clark@linaro.org>
---
 include/uapi/linux/perf_event.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 78a362b80027..0d0ed85ad8cb 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -382,6 +382,7 @@ enum perf_event_read_format {
 #define PERF_ATTR_SIZE_VER6			120	/* Add: aux_sample_size */
 #define PERF_ATTR_SIZE_VER7			128	/* Add: sig_data */
 #define PERF_ATTR_SIZE_VER8			136	/* Add: config3 */
+#define PERF_ATTR_SIZE_VER9			144	/* add: config4 */
 
 /*
  * 'struct perf_event_attr' contains various attributes that define
@@ -543,6 +544,7 @@ struct perf_event_attr {
 	__u64	sig_data;
 
 	__u64	config3; /* extension of config2 */
+	__u64	config4; /* extension of config3 */
 };
 
 /*

-- 
2.34.1
Re: [PATCH v9 1/5] perf: Add perf_event_attr::config4
Posted by Will Deacon 3 months, 1 week ago
On Wed, Oct 29, 2025 at 03:46:01PM +0000, James Clark wrote:
> Arm FEAT_SPE_FDS adds the ability to filter on the data source of a
> packet using another 64-bits of event filtering control. As the existing
> perf_event_attr::configN fields are all used up for SPE PMU, an
> additional field is needed. Add a new 'config4' field.
> 
> Reviewed-by: Leo Yan <leo.yan@arm.com>
> Tested-by: Leo Yan <leo.yan@arm.com>
> Reviewed-by: Ian Rogers <irogers@google.com>
> Signed-off-by: James Clark <james.clark@linaro.org>
> ---
>  include/uapi/linux/perf_event.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> index 78a362b80027..0d0ed85ad8cb 100644
> --- a/include/uapi/linux/perf_event.h
> +++ b/include/uapi/linux/perf_event.h
> @@ -382,6 +382,7 @@ enum perf_event_read_format {
>  #define PERF_ATTR_SIZE_VER6			120	/* Add: aux_sample_size */
>  #define PERF_ATTR_SIZE_VER7			128	/* Add: sig_data */
>  #define PERF_ATTR_SIZE_VER8			136	/* Add: config3 */
> +#define PERF_ATTR_SIZE_VER9			144	/* add: config4 */
>  
>  /*
>   * 'struct perf_event_attr' contains various attributes that define
> @@ -543,6 +544,7 @@ struct perf_event_attr {
>  	__u64	sig_data;
>  
>  	__u64	config3; /* extension of config2 */
> +	__u64	config4; /* extension of config3 */

Please can one of the core perf maintainers ack/nak this extension?

Cheers,

Will
Re: [PATCH v9 1/5] perf: Add perf_event_attr::config4
Posted by Peter Zijlstra 3 months ago
On Mon, Nov 03, 2025 at 02:33:22PM +0000, Will Deacon wrote:
> On Wed, Oct 29, 2025 at 03:46:01PM +0000, James Clark wrote:
> > Arm FEAT_SPE_FDS adds the ability to filter on the data source of a
> > packet using another 64-bits of event filtering control. As the existing
> > perf_event_attr::configN fields are all used up for SPE PMU, an
> > additional field is needed. Add a new 'config4' field.
> > 
> > Reviewed-by: Leo Yan <leo.yan@arm.com>
> > Tested-by: Leo Yan <leo.yan@arm.com>
> > Reviewed-by: Ian Rogers <irogers@google.com>
> > Signed-off-by: James Clark <james.clark@linaro.org>
> > ---
> >  include/uapi/linux/perf_event.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> > index 78a362b80027..0d0ed85ad8cb 100644
> > --- a/include/uapi/linux/perf_event.h
> > +++ b/include/uapi/linux/perf_event.h
> > @@ -382,6 +382,7 @@ enum perf_event_read_format {
> >  #define PERF_ATTR_SIZE_VER6			120	/* Add: aux_sample_size */
> >  #define PERF_ATTR_SIZE_VER7			128	/* Add: sig_data */
> >  #define PERF_ATTR_SIZE_VER8			136	/* Add: config3 */
> > +#define PERF_ATTR_SIZE_VER9			144	/* add: config4 */
> >  
> >  /*
> >   * 'struct perf_event_attr' contains various attributes that define
> > @@ -543,6 +544,7 @@ struct perf_event_attr {
> >  	__u64	sig_data;
> >  
> >  	__u64	config3; /* extension of config2 */
> > +	__u64	config4; /* extension of config3 */
> 
> Please can one of the core perf maintainers ack/nak this extension?

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>