[PATCH 3/5] perf/arm-cmn: Refactor event filter data
Robin Murphy
robin.murphy at arm.com
Mon Jul 6 03:28:13 PDT 2026
On 2026-07-05 4:44 pm, Leo Yan wrote:
> On Tue, Jun 30, 2026 at 04:19:18PM +0100, Robin Murphy wrote:
>
> [...]
>
>> +struct arm_cmn_filter_attr {
>> + enum cmn_filter_select sel;
>> + u8 val;
>> +};
>
>> -#define _CMN_EVENT_ATTR(_model, _name, _type, _eventid, _filter, _fsel)\
>> +#define _CMN_EVENT_ATTR(_model, _name, _type, _eventid, _filter, ...) \
>> (&((struct arm_cmn_event_attr[]) {{ \
>> .attr = __ATTR(_name, 0444, arm_cmn_event_show, NULL), \
>> .model = _model, \
>> .type = _type, \
>> .eventid = _eventid, \
>> - .filter = _filter, \
>> - .fsel = _fsel, \
>> + .filter = {{_filter}}, \
>
> This patch might break as the "val" field is never initialized. Should
> it use two parameters "_fa, _fb" instead?
Ah, you're right - this evolved through several different designs, and
this line is still from when "_filter..." was the whole varargs, but
then I brought forward more of the changes from patch #5 to try to
minimise intra-series churn, and I guess the fact that it didn't
completely fail to compile (as I was accustomed to by that point...)
meant I missed this subtlety.
> #define _CMN_EVENT_ATTR(_model, _name, _type, _eventid, _fa, _fb, ...) \
> (&((struct arm_cmn_event_attr[]) {{ \
> ... \
> .filter = {{_fa, _fb}}, \
>
> Although the issue is fixed by a later patch, I think it is good to
> correct this patch for bisection.
Agreed, I'll fix that for a v2.
Thanks,
Robin.
More information about the linux-arm-kernel
mailing list