Re: [PATCH v3 3/3] perf test: Add selftest to test IBS invocation via core pmu events

From: Ravi Bangoria
Date: Mon May 01 2023 - 23:09:52 EST


On 30-Apr-23 2:39 AM, Ian Rogers wrote:
> On Tue, Apr 25, 2023 at 7:23 AM Ravi Bangoria <ravi.bangoria@xxxxxxx> wrote:
>>
>> IBS pmu can be invoked via fixed set of core pmu events with 'precise_ip'
>> set to 1. Add a simple event open test for all these events.
>>
>> Without kernel fix:
>> $ sudo ./perf test -vv 76
>> 76: AMD IBS via core pmu :
>> --- start ---
>> test child forked, pid 6553
>> Using CPUID AuthenticAMD-25-1-1
>> type: 0x0, config: 0x0, fd: 3 - Pass
>> type: 0x0, config: 0x1, fd: -1 - Pass
>> type: 0x4, config: 0x76, fd: -1 - Fail
>> type: 0x4, config: 0xc1, fd: -1 - Fail
>> type: 0x4, config: 0x12, fd: -1 - Pass
>> test child finished with -1
>> ---- end ----
>> AMD IBS via core pmu: FAILED!
>>
>> With kernel fix:
>> $ sudo ./perf test -vv 76
>> 76: AMD IBS via core pmu :
>> --- start ---
>> test child forked, pid 7526
>> Using CPUID AuthenticAMD-25-1-1
>> type: 0x0, config: 0x0, fd: 3 - Pass
>> type: 0x0, config: 0x1, fd: -1 - Pass
>> type: 0x4, config: 0x76, fd: 3 - Pass
>> type: 0x4, config: 0xc1, fd: 3 - Pass
>> type: 0x4, config: 0x12, fd: -1 - Pass
>> test child finished with 0
>> ---- end ----
>> AMD IBS via core pmu: Ok
>>
>> Signed-off-by: Ravi Bangoria <ravi.bangoria@xxxxxxx>
>
> Thanks Ravi, as the test is AMD specific I think it makes sense to place it in:
> tools/perf/arch/x86/tests
> and then to update the test list in:
> tools/perf/arch/x86/tests/arch-tests.c

Sure, will respin.

Thanks,
Ravi