Skip to content

Commit cfd7092

Browse files
athira-rajeevacmel
authored andcommitted
perf test session topology: Fix test to skip the test in guest environment
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 if physical_package_id returns -1. Reviewed-by: Kajol Jain <[email protected]> Signed-off-by: Athira Rajeev <[email protected]>--- Tested-by: Disha Goel <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nageswara R Sastry <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent f8ac1c4 commit cfd7092

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/perf/tests/topology.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
109109
&& strncmp(session->header.env.arch, "aarch64", 7))
110110
return TEST_SKIP;
111111

112+
/*
113+
* In powerpc pSeries platform, not all the topology information
114+
* are exposed via sysfs. Due to restriction, detail like
115+
* physical_package_id will be set to -1. Hence skip this
116+
* test if physical_package_id returns -1 for cpu from perf_cpu_map.
117+
*/
118+
if (strncmp(session->header.env.arch, "powerpc", 7)) {
119+
if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)
120+
return TEST_SKIP;
121+
}
122+
112123
TEST_ASSERT_VAL("Session header CPU map not set", session->header.env.cpu);
113124

114125
for (i = 0; i < session->header.env.nr_cpus_avail; i++) {

0 commit comments

Comments
 (0)