tools/perf/tests: Fix session topology test to skip the test in guest environment
PATCH v2 1/1 tools/perf/tests: Fix session topology 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
---
Changelog:
v1 -> v2:
Addressed review comments from Arnaldo and Michael Ellerman. skip the test in powerpc when physical_package_id is set to -1.
Dropped patch 1 from V1 since current change doesn't use info from /proc/cpuinfo and rather uses physical_package_id value.
tools/perf/tests/topology.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/perf/tests/topology.c +11 -0
@@ -109,6 +109,17 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) && strncmp(session->header.env.arch, "aarch64", 7))return TEST_SKIP ; +/* +* In powerpc pSeries platform, not all the topology information +* are exposed via sysfs. Due to restriction, detail like +* physical_package_id will be set to -1. Hence skip this +* test if physical_package_id returns -1 for cpu from perf_cpu_map. +*/ +if (strncmp (session->header.env.arch,"powerpc" ,7 )) { +if (cpu__get_socket_id (perf_cpu_map__cpu (map,0 )) ==-1 ) +return TEST_SKIP ; + } +TEST_ASSERT_VAL ("Session header CPU map not set" , session->header.env.cpu);for (i =0 ; i < session->header.env.nr_cpus_avail; i++) {
Signature · 1 line
2.31.1
Quoted 15 lines · Athira Rajeev
The session topology test fails in powerpc pSeries platform. Test logs:
<<>>
Session topology : FAILED!
<<>>This testcases tests cpu topology by checking the
core_idandsocket_idstored inperf_envfrom perf session. The data from perf session is compared with the cpu topology information from "/sys/devices/system/cpu/cpuX/topology" likecore_id,physical_package_id. In case of virtual environment, detail likephysical_package_idis restricted to be exposed. Hencephysical_package_idis set to -1. The testcase fails on such platforms sincesocket_idcan't be fetched from topology info.
Quoted 2 lines
Skip the testcase in powerpc if
physical_package_idreturns -1
Patch looks fine to me.
Thanks,
Kajol Jain
Quoted 35 lines
Signed-off-by Athira Rajeev <[email protected]>---
Changelog:
v1 -> v2:
Addressed review comments from Arnaldo and Michael Ellerman. skip the test in powerpc whenphysical_package_idis set to -1.
Dropped patch 1 from V1 since current change doesn't use info from/proc/cpuinfoand rather usesphysical_package_idvalue.tools/perf/tests/topology.c | 11 +++++++++++ 1 file changed, 11 insertions(+)tools/perf/tests/topology.c +11
-0@@ -109,6 +109,17 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) && strncmp(session->header.env.arch, "aarch64", 7))return TEST_SKIP ; +/* +* In powerpc pSeries platform, not all the topology information +* are exposed via sysfs. Due to restriction, detail like +* physical_package_id will be set to -1. Hence skip this +* test if physical_package_id returns -1 for cpu from perf_cpu_map. +*/ +if (strncmp (session->header.env.arch,"powerpc" ,7 )) { +if (cpu__get_socket_id (perf_cpu_map__cpu (map,0 )) ==-1 ) +return TEST_SKIP ; + } +TEST_ASSERT_VAL ("Session header CPU map not set" , session->header.env.cpu);for (i =0 ; i < session->header.env.nr_cpus_avail; i++) {
-----Original Message-----
From: Athira Rajeev <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] , [email protected]
Subject: [PATCH V2] tools/perf/tests: Fix session topology test to skip the test in guest environment
Date: Wed, 11 May 2022 17:19:59 +0530
The session topology test fails in powerpc pSeries platform.Test logs:<<>>Session topology : FAILED!<<>>
This testcases tests cpu topology by checking the core_id andsocket_id stored in perf_env from perf session. The data fromperf session is compared with the cpu topology informationfrom "/sys/devices/system/cpu/cpuX/topology" like core_id,physical_package_id. In case of virtual environment, detaillike physical_package_id is restricted to be exposed. Hencephysical_package_id is set to -1. The testcase fails on suchplatforms since socket_id can't be fetched from topology info. Skip the testcase in powerpc if physical_package_id returns -1
Changelog:v1 -> v2: Addressed review comments from Arnaldo and Michael Ellerman. skip the test in powerpc when physical_package_id is set to -1. Dropped patch 1 from V1 since current change doesn't use info from /proc/cpuinfo and rather uses physical_package_id value.
tools/perf/tests/topology.c | 11 +++++++++++ 1 file changed, 11
insertions(+)
Tested the patch on powerpc and powernv, session topology test works fine with the patch.Tested-by: Disha Goel <[email protected]>
(quoted diff) +0 -0
b/tools/perf/tests/topology.cindex ee1e3dcbc0bd..d23a9e322ff5 100644--- a/tools/perf/tests/topology.c+++ b/tools/perf/tests/topology.c@@ -109,6 +109,17 @@ static int check_cpu_topology(char *path, structperf_cpu_map *map) && strncmp(session-
Quoted 1 line
header.env.arch, "aarch64", 7)) return
TEST_SKIP;
+ /*+ * In powerpc pSeries platform, not all the topology
information+ * are exposed via sysfs. Due to restriction, detail
like+ * physical_package_id will be set to -1. Hence skip this+
* test if physical_package_id returns -1 for cpu from perf_cpu_map.+
*/+ if (strncmp(session->header.env.arch, "powerpc", 7)) {+
if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)+
return TEST_SKIP;+ }+ TEST_ASSERT_VAL("Session header
CPU map not set", session->header.env.cpu);
for (i = 0; i < session->header.env.nr_cpus_avail; i++) {
Quoted 64 lines · Disha Goel
-----Original Message-----
From: Athira Rajeev <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: [PATCH V2]tools/perf/tests: Fix session topology test to skip the test in guest environment
Date: Wed, 11 May 2022 17:19:59 +0530The session topology test fails in powerpc pSeries platform.
Test logs:
<<>>
Session topology : FAILED!
<<>>
This testcases tests cpu topology by checking the
core_idand
socket_idstored inperf_envfrom perf session. The data fromperf session is compared with the cpu topology information
from "
/sys/devices/system/cpu/cpuX/topology" likecore_id,
physical_package_id. In case of virtual environment, detaillike
physical_package_idis restricted to be exposed. Hence
physical_package_idis set to -1. The testcase fails on suchplatforms since
socket_idcan't be fetched from topology info.Skip the testcase in powerpc if
physical_package_idreturns -1Signed-off-by Athira Rajeev <Quoted 1 line
---
Changelog:
v1 -> v2:
Addressed review comments from Arnaldo and Michael Ellerman.
skip the test in powerpc when
physical_package_idis set to-1.
Dropped patch 1 from V1 since current change doesn't use info
from
/proc/cpuinfoand rather usesphysical_package_idvalue.
Quoted 8 lines
tools/perf/tests/topology.c | 11 +++++++++++1 file changed, 11 insertions(+)Tested the patch on powerpc and powernv, session topology test works fine with the patch.
Tested-by Disha Goel <[email protected]>
Thanks,
Ian
Quoted 41 lines
tools/perf/tests/topology.c +0
-0index
ee1e3dcbc0bd..d23a9e322ff5100644---
a/tools/perf/tests/topology.c+++
b/tools/perf/tests/topology.ctools/perf/tests/topology.c +11
-0@@ -109,6 +109,17 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) && strncmp(session->header.env.arch, "aarch64", 7))return TEST_SKIP ; +/* +* In powerpc pSeries platform, not all the topology information +* are exposed via sysfs. Due to restriction, detail like +* physical_package_id will be set to -1. Hence skip this +* test if physical_package_id returns -1 for cpu from perf_cpu_map. +*/ +if (strncmp (session->header.env.arch,"powerpc" ,7 )) { +if (cpu__get_socket_id (perf_cpu_map__cpu (map,0 )) ==-1 ) +return TEST_SKIP ; + } +TEST_ASSERT_VAL ("Session header CPU map not set" , session->header.env.cpu);for (i =0 ; i < session->header.env.nr_cpus_avail; i++) {
Quoted 76 lines · Ian Rogers
Quoted 71 lines · Disha Goel
-----Original Message-----
From: Athira Rajeev <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: [PATCH V2]tools/perf/tests: Fix session topology test to skip the test in guest environment
Date: Wed, 11 May 2022 17:19:59 +0530The session topology test fails in powerpc pSeries platform.
Test logs:
<<>>
Session topology : FAILED!
<<>>
This testcases tests cpu topology by checking the
core_idand
socket_idstored inperf_envfrom perf session. The data fromperf session is compared with the cpu topology information
from "
/sys/devices/system/cpu/cpuX/topology" likecore_id,
physical_package_id. In case of virtual environment, detaillike
physical_package_idis restricted to be exposed. Hence
physical_package_idis set to -1. The testcase fails on suchplatforms since
socket_idcan't be fetched from topology info.Skip the testcase in powerpc if
physical_package_idreturns -1Signed-off-by Athira Rajeev <Quoted 1 line
---
Changelog:
v1 -> v2:
Addressed review comments from Arnaldo and Michael Ellerman.
skip the test in powerpc when
physical_package_idis set to-1.
Dropped patch 1 from V1 since current change doesn't use info
from
/proc/cpuinfoand rather usesphysical_package_idvalue.
tools/perf/tests/topology.c| 11 +++++++++++1 file changed, 11 insertions(+)Tested the patch on powerpc and powernv, session topology test works fine with the patch.
Quoted 7 lines
Quoted 1 line
Tested-by Disha Goel <[email protected]>Acked-by Ian Rogers <[email protected]>Thanks,
Ian
Hi,
Thanks all for the review.
Athira
Quoted 42 lines
Quoted 42 lines
tools/perf/tests/topology.c +0
-0index
ee1e3dcbc0bd..d23a9e322ff5100644---
a/tools/perf/tests/topology.c+++
b/tools/perf/tests/topology.ctools/perf/tests/topology.c +11
-0@@ -109,6 +109,17 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) && strncmp(session->header.env.arch, "aarch64", 7))return TEST_SKIP ; +/* +* In powerpc pSeries platform, not all the topology information +* are exposed via sysfs. Due to restriction, detail like +* physical_package_id will be set to -1. Hence skip this +* test if physical_package_id returns -1 for cpu from perf_cpu_map. +*/ +if (strncmp (session->header.env.arch,"powerpc" ,7 )) { +if (cpu__get_socket_id (perf_cpu_map__cpu (map,0 )) ==-1 ) +return TEST_SKIP ; + } +TEST_ASSERT_VAL ("Session header CPU map not set" , session->header.env.cpu);for (i =0 ; i < session->header.env.nr_cpus_avail; i++) {
Em Sat, May 21, 2022 at 10:16:59AM +0530, Athira Rajeev escreveu:
Quoted 8 lines
Quoted 6 lines · Ian Rogers
Quoted 2 lines · Disha Goel
Tested the patch on powerpc and powernv, session topology test works fine with the patch.
Tested-by Disha Goel <[email protected]>Acked-by Ian Rogers <[email protected]>Thanks all for the review.
Thanks, applied.
- Arnaldo