linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/perf/tests: Fix session topology test comparison check
@ 2022-06-10 13:59 Athira Rajeev
  2022-06-14 14:38 ` Ian Rogers
  0 siblings, 1 reply; 3+ messages in thread
From: Athira Rajeev @ 2022-06-10 13:59 UTC (permalink / raw)
  To: acme, jolsa, disgoel
  Cc: mpe, linux-perf-users, linuxppc-dev, maddy, rnsastry, kjain,
	tmricht

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")
Reported-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
 tools/perf/tests/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
index d23a9e322ff5..0b4f61b6cc6b 100644
--- a/tools/perf/tests/topology.c
+++ b/tools/perf/tests/topology.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/perf/tests: Fix session topology test comparison check
  2022-06-10 13:59 [PATCH] tools/perf/tests: Fix session topology test comparison check Athira Rajeev
@ 2022-06-14 14:38 ` Ian Rogers
  2022-06-14 19:17   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Rogers @ 2022-06-14 14:38 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: acme, jolsa, disgoel, mpe, linux-perf-users, linuxppc-dev, maddy,
	rnsastry, kjain, tmricht

On Fri, Jun 10, 2022 at 7:00 AM Athira Rajeev
<atrajeev@linux.vnet.ibm.com> wrote:
>
> 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")
> Reported-by: Thomas Richter <tmricht@linux.ibm.com>
> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/tests/topology.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
> index d23a9e322ff5..0b4f61b6cc6b 100644
> --- a/tools/perf/tests/topology.c
> +++ b/tools/perf/tests/topology.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/perf/tests: Fix session topology test comparison check
  2022-06-14 14:38 ` Ian Rogers
@ 2022-06-14 19:17   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-06-14 19:17 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Athira Rajeev, jolsa, disgoel, mpe, linux-perf-users,
	linuxppc-dev, maddy, rnsastry, kjain, tmricht

Em Tue, Jun 14, 2022 at 07:38:55AM -0700, Ian Rogers escreveu:
> On Fri, Jun 10, 2022 at 7:00 AM Athira Rajeev
> <atrajeev@linux.vnet.ibm.com> wrote:
> >
> > 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")
> > Reported-by: Thomas Richter <tmricht@linux.ibm.com>
> > Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, applied.

- Arnaldo

 
> Thanks,
> Ian
> 
> > ---
> >  tools/perf/tests/topology.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
> > index d23a9e322ff5..0b4f61b6cc6b 100644
> > --- a/tools/perf/tests/topology.c
> > +++ b/tools/perf/tests/topology.c
> > @@ -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
> >

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-14 19:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-10 13:59 [PATCH] tools/perf/tests: Fix session topology test comparison check Athira Rajeev
2022-06-14 14:38 ` Ian Rogers
2022-06-14 19:17   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).