diff options
author | Ravi Bangoria <ravi.bangoria@amd.com> | 2025-01-15 05:44:31 +0000 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2025-02-03 11:46:04 +0100 |
commit | 88c7bcad71c83f52f24108dedcecae0d18dbc627 (patch) | |
tree | 2769d92b2aeea119d88b879690cca5c88a2fda15 /scripts/lib/kdoc/kdoc_parser.py | |
parent | 003c0414318a1829a1a5b195ad81e8a7960c3f5d (diff) |
perf/amd/ibs: Remove pointless sample period check
Valid perf event sample period value for IBS PMUs (Fetch and Op both)
is limited to multiple of 0x10. perf_ibs_init() has this check:
if (!event->attr.sample_freq && hwc->sample_period & 0x0f)
return -EINVAL;
But it's broken since hwc->sample_period will always be 0 when
event->attr.sample_freq is 0 (irrespective of event->attr.freq value.)
One option to fix this is to change the condition:
- if (!event->attr.sample_freq && hwc->sample_period & 0x0f)
+ if (!event->attr.freq && hwc->sample_period & 0x0f)
However, that will break all userspace tools which have been using IBS
event with sample_period not multiple of 0x10.
Another option is to remove the condition altogether and mask lower
nibble _silently_, same as what current code is inadvertently doing.
I'm preferring this approach as it keeps the existing behavior.
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/r/20250115054438.1021-3-ravi.bangoria@amd.com
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions