All of lore.kernel.org
 help / color / mirror / Atom feed
From: kajoljain <kjain@linux.ibm.com>
To: Athira Rajeev <atrajeev@linux.vnet.ibm.com>,
	acme@kernel.org, jolsa@kernel.org
Cc: mpe@ellerman.id.au, linux-perf-users@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, maddy@linux.vnet.ibm.com,
	rnsastry@linux.ibm.com, disgoel@linux.vnet.ibm.com,
	irogers@google.com
Subject: Re: [PATCH V2] tools/perf/tests: Fix session topology test to skip the test in guest environment
Date: Thu, 12 May 2022 16:45:14 +0530	[thread overview]
Message-ID: <ee50c1c1-a15e-76ec-59fe-b722d595bc17@linux.ibm.com> (raw)
In-Reply-To: <20220511114959.84002-1-atrajeev@linux.vnet.ibm.com>



On 5/11/22 17:19, Athira Rajeev wrote:
> 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
> 

Patch looks fine to me.

Reviewed-by: Kajol Jain<kjain@linux.ibm.com>

Thanks,
Kajol Jain

> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> ---
> 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(+)
> 
> diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
> index 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, 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++) {

WARNING: multiple messages have this Message-ID (diff)
From: kajoljain <kjain@linux.ibm.com>
To: Athira Rajeev <atrajeev@linux.vnet.ibm.com>,
	acme@kernel.org, jolsa@kernel.org
Cc: irogers@google.com, maddy@linux.vnet.ibm.com,
	rnsastry@linux.ibm.com, linux-perf-users@vger.kernel.org,
	disgoel@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH V2] tools/perf/tests: Fix session topology test to skip the test in guest environment
Date: Thu, 12 May 2022 16:45:14 +0530	[thread overview]
Message-ID: <ee50c1c1-a15e-76ec-59fe-b722d595bc17@linux.ibm.com> (raw)
In-Reply-To: <20220511114959.84002-1-atrajeev@linux.vnet.ibm.com>



On 5/11/22 17:19, Athira Rajeev wrote:
> 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
> 

Patch looks fine to me.

Reviewed-by: Kajol Jain<kjain@linux.ibm.com>

Thanks,
Kajol Jain

> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> ---
> 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(+)
> 
> diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
> index 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, 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++) {

  reply	other threads:[~2022-05-12 11:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 11:49 [PATCH V2] tools/perf/tests: Fix session topology test to skip the test in guest environment Athira Rajeev
2022-05-11 11:49 ` Athira Rajeev
2022-05-12 11:15 ` kajoljain [this message]
2022-05-12 11:15   ` kajoljain
2022-05-13  6:17 ` Disha Goel
2022-05-13 18:33   ` Ian Rogers
2022-05-13 18:33     ` Ian Rogers
2022-05-21  4:46     ` Athira Rajeev
2022-05-21  4:46       ` Athira Rajeev
2022-05-21 17:52       ` Arnaldo Carvalho de Melo
2022-05-21 17:52         ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee50c1c1-a15e-76ec-59fe-b722d595bc17@linux.ibm.com \
    --to=kjain@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=disgoel@linux.vnet.ibm.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=rnsastry@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.