Skip to contentSkip to conversation

tools/perf/tests: Fix session topology test comparison check

PATCH Applied Athira Rajeev 3 participants 3 messages Jun 10, 2022 – Jun 14, 2022 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/perf/tests: Fix session topology test comparison check

commit cfd7092c31ae ("perf test session topology: Fix test to skip the test in guest environment") added check to skip the testcase if the socket_id can't be fetched from topology info. But the condition check uses strncmp which should be changed to !strncmp and to correctly match platform. Patch fixes this condition check.

Fixes cfd7092c31ae ("perf test session topology: Fix test to skip the test in guest environment")
---
 tools/perf/tests/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/topology.c +1 -1
index d23a9e322ff5..0b4f61b6cc6b 100644
@@ -115,7 +115,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
 	 * 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 (!strncmp(session->header.env.arch, "ppc64le", 7)) {
 		if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)
 			return TEST_SKIP;
 	}
Signature · 1 line
2.35.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Athira Rajeev

commit cfd7092c31ae ("perf test session topology: Fix test to skip the test in guest environment") added check to skip the testcase if the socket_id can't be fetched from topology info. But the condition check uses strncmp which should be changed to !strncmp and to correctly match platform. Patch fixes this condition check.

Fixes cfd7092c31ae ("perf test session topology: Fix test to skip the test in guest environment")

Thanks,
Ian

Quoted 20 lines
---
 tools/perf/tests/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/topology.c +1 -2
index d23a9e322ff5..0b4f61b6cc6b 100644
@@ -115,7 +115,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
         * 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 (!strncmp(session->header.env.arch, "ppc64le", 7)) {
                if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)
                        return TEST_SKIP;
        }
--

2.35.1

maintainer Applied
#2 lore raw

Em Tue, Jun 14, 2022 at 07:38:55AM -0700, Ian Rogers escreveu:

Quoted 10 lines
Quoted 8 lines · Athira Rajeev

commit cfd7092c31ae ("perf test session topology: Fix test to skip the test in guest environment") added check to skip the testcase if the socket_id can't be fetched from topology info. But the condition check uses strncmp which should be changed to !strncmp and to correctly match platform. Patch fixes this condition check.

Quoted 5 lines
Quoted 3 lines
Fixes cfd7092c31ae ("perf test session topology: Fix test to skip the test in guest environment")

Thanks, applied.

- Arnaldo

Quoted 23 lines

Thanks,
Ian

Quoted 20 lines
---
 tools/perf/tests/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/topology.c +1 -2
index d23a9e322ff5..0b4f61b6cc6b 100644
@@ -115,7 +115,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
         * 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 (!strncmp(session->header.env.arch, "ppc64le", 7)) {
                if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)
                        return TEST_SKIP;
        }
--

2.35.1

Signature · 1 line
- Arnaldo