Commit 9527bd32 authored by Committed by Greg Kroah-Hartman
Revert "perf tools: Fix PMU term format max value calculation"
[ Upstream commit 1b9caa10b31dda0866f4028e4bfb923fb6e4072f ] This reverts commit ac0e2cd5. Michael reported an issue with oversized terms values assignment and I noticed there was actually a misunderstanding of the max value check in the past. The above commit's changelog says: If bit 21 is set, there is parsing issues as below. $ perf stat -a -e uncore_qpi_0/event=0x200002,umask=0x8/ event syntax error: '..pi_0/event=0x200002,umask=0x8/' \___ value too big for format, maximum is 511 But there's no issue there, because the event value is distributed along the value defined by the format. Even if the format defines separated bit, the value is treated as a continual number, which should follow the format definition. In above case it's 9-bit value with last bit separated: $ cat uncore_qpi_0/format/event config:0-7,21 Hence the value 0x200002 is correctly reported as format violation, because it exceeds 9 bits. It should have been 0x102 instead, which sets the 9th bit - the bit 21 of the format. $ perf stat -vv -a -e uncore_qpi_0/event=0x102,umask=0x8/ Using CPUID GenuineIntel-6-2D ... ------------------------------------------------------------ perf_event_attr: type 10 size 112 config 0x200802 sample_type IDENTIFIER ... Reported-by: Michael Petlan <firstname.lastname@example.org> Signed-off-by: Jiri Olsa <email@example.com> Cc: Alexander Shishkin <firstname.lastname@example.org> Cc: Andi Kleen <email@example.com> Cc: Kan Liang <firstname.lastname@example.org> Cc: Namhyung Kim <email@example.com> Cc: Peter Zijlstra <firstname.lastname@example.org> Fixes: ac0e2cd5 ("perf tools: Fix PMU term format max value calculation") Link: http://email@example.comSigned-off-by: Arnaldo Carvalho de Melo <firstname.lastname@example.org> Signed-off-by: Sasha Levin <email@example.com> Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>
Showing with 7 additions and 6 deletions