RE: [PATCH V0 2/3] perf/x86/intel/bm.c: Add Intel Branch Monitoring support

From: Dey, Megha
Date: Fri Nov 10 2017 - 19:44:44 EST




>-----Original Message-----
>From: Jiri Olsa [mailto:jolsa@xxxxxxxxxx]
>Sent: Saturday, November 4, 2017 6:25 AM
>To: Megha Dey <megha.dey@xxxxxxxxxxxxxxx>
>Cc: x86@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-
>doc@xxxxxxxxxxxxxxx; tglx@xxxxxxxxxxxxx; mingo@xxxxxxxxxx;
>hpa@xxxxxxxxx; andriy.shevchenko@xxxxxxxxxxxxxxx;
>kstewart@xxxxxxxxxxxxxxxxxxx; Yu, Yu-cheng <yu-cheng.yu@xxxxxxxxx>;
>Brown, Len <len.brown@xxxxxxxxx>; gregkh@xxxxxxxxxxxxxxxxxxx;
>peterz@xxxxxxxxxxxxx; acme@xxxxxxxxxx;
>alexander.shishkin@xxxxxxxxxxxxxxx; namhyung@xxxxxxxxxx;
>vikas.shivappa@xxxxxxxxxxxxxxx; pombredanne@xxxxxxxx;
>me@xxxxxxxxxxxx; bp@xxxxxxx; Andrejczuk, Grzegorz
><grzegorz.andrejczuk@xxxxxxxxx>; Luck, Tony <tony.luck@xxxxxxxxx>;
>corbet@xxxxxxx; Shankar, Ravi V <ravi.v.shankar@xxxxxxxxx>; Dey, Megha
><megha.dey@xxxxxxxxx>
>Subject: Re: [PATCH V0 2/3] perf/x86/intel/bm.c: Add Intel Branch
>Monitoring support
>
>On Fri, Nov 03, 2017 at 11:00:05AM -0700, Megha Dey wrote:
>
>SNIP
>
>> + event->event_caps |= PERF_EV_CAP_BM;
>> + /*
>> + * cfg contains one of the 6 possible Branch Monitoring events
>> + */
>> + cfg = event->attr.config;
>> + if (cfg < 0 || cfg > (BM_MAX_EVENTS - 1))
>> + return -EINVAL;
>> +
>> + if (event->attr.sample_period) /* no sampling */
>> + return -EINVAL;
>
>you can use the 'is_sampling_event' function

Will make the change.
>
>jirka