Done
Details
Details
Assignee
Utsav Goel
Utsav GoelReporter
Przemyslaw Wirkus
Przemyslaw WirkusComponents
Sprint
Add sprint
Fix versions
Priority
Checklist
Checklist
Sentry
Sentry
Created May 6, 2025 at 1:02 PM
Updated May 9, 2025 at 2:10 PM
Resolved May 9, 2025 at 2:10 PM
We have some magic numbers used in implementation of SPE filter
event_filter
. See below:windowsperf (master)$ git grep 0x8AA wperf-driver/spe.cpp: _WriteStatusReg(PMSEVFR_EL1, context->event_filter & 0x8AA); wperf-driver/spe.cpp: if (context->event_filter & 0x8AA) wperf-test/wperf-test-parsers.cpp: test(L"2218", 0x8AA); wperf-test/wperf-test-parsers.cpp: test(L"0x8AA", 0x8AA); wperf-test/wperf-test-parsers.cpp: test(L"0x00000000000008AA", 0x8AA); wperf/SPE.md:- `event_filter=<n>` - collect only events that match all of the the specified filters. This value is written to `PMSEVFR`. Only bits 1, 3, 5, 7, and 11 (mask 0x8AA) may be used. wperf/spe_device.h: {L"event_filter", {0, 0x8AA}},
I think when I search for binary counterpart of
0x8AA
I can find:$ python >>> bin(0x8aa) '0b100010101010'
$ git grep 0b100010101010 wperf/parsers.cpp:476: constexpr uint16_t VALID_BITS = 0b100010101010;
Definition of done
Simple refactoring to remove magic number
0x8AA
and its binary counterpart from the core.Please drag these values under one consistent const / macro etc.
One source of this const should propagate in the code and unit test of wperf as well.