Re: [PATCH] perf pmu: Validate raw event with sysfs exported format bits

2021-03-04 Thread Jin, Yao
Hi Andi, On 3/5/2021 9:10 AM, Andi Kleen wrote: Single event: # ./perf stat -e cpu/r031234/ -a -- sleep 1 WARNING: event config '31234' not valid (bits 16 17 not supported by kernel)! Just noticed that again. Can you please print the original event as string in the message? While it's

Re: [PATCH] perf pmu: Validate raw event with sysfs exported format bits

2021-03-04 Thread Jin, Yao
Hi Jiri, On 3/5/2021 4:17 AM, Jiri Olsa wrote: On Wed, Mar 03, 2021 at 01:17:36PM +0800, Jin Yao wrote: SNIP The set bits in 'bits' indicate the invalid bits used in config. Finally use strbuf to report the invalid bits. Some architectures may not export supported bits through sysfs, so if

Re: [PATCH] perf pmu: Validate raw event with sysfs exported format bits

2021-03-04 Thread Andi Kleen
> Single event: > > # ./perf stat -e cpu/r031234/ -a -- sleep 1 > WARNING: event config '31234' not valid (bits 16 17 not supported by > kernel)! Just noticed that again. Can you please print the original event as string in the message? While it's obvious with rXXX which one it is, it may

Re: [PATCH] perf pmu: Validate raw event with sysfs exported format bits

2021-03-04 Thread Jiri Olsa
On Wed, Mar 03, 2021 at 01:17:36PM +0800, Jin Yao wrote: SNIP > The set bits in 'bits' indicate the invalid bits used in config. > Finally use strbuf to report the invalid bits. > > Some architectures may not export supported bits through sysfs, > so if masks is 0, perf_pmu__config_valid just

[PATCH] perf pmu: Validate raw event with sysfs exported format bits

2021-03-03 Thread Jin Yao
A raw PMU event (eventsel+umask) in the form of rNNN is supported by perf but lacks of checking for the validity of raw encoding. For example, bit 16 and bit 17 are not valid on KBL but perf doesn't report warning when encoding with these bits. Before: # ./perf stat -e cpu/r031234/ -a --