Subject: Re: [PATCH V2 2/2] tools/perf/tests: Fix session topology test to skip the test in guest environment

From: Michael Ellerman <[email-masked]>
Date: Fri, 06 May 2022 12:40:38 +1000

Athira Rajeev <[email-masked]> writes:
> The session topology test fails in powerpc pSeries platform.
> Test logs:
> <<>>
> Session topology : FAILED!
> <<>>
>
> This testcases tests cpu topology by checking the core_id and
> socket_id stored in perf_env from perf session. The data from
> perf session is compared with the cpu topology information
> from "/sys/devices/system/cpu/cpuX/topology" like core_id,
> physical_package_id. In case of virtual environment, detail
> like physical_package_id is restricted to be exposed. Hence
> physical_package_id is set to -1. The testcase fails on such
> platforms since socket_id can't be fetched from topology info.
>
> Skip the testcase in powerpc for pSeries. Use the utility
> function "cpuinfo_field" to check platform from /proc/cpuinfo.

I don't think that's the right way to fix it.

If we ever had a "pseries" machine that did expose physical_package_id
then this test would continue to skip, even when it could succeed.

So if physical_package_id being -1 is the problem then you should skip
the test based on that.

cheers