mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: German Gomez <german.gomez@arm.com>
To: Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ian Rogers <irogers@google.com>,
	linux-perf-users@vger.kernel.org,
	John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>,
	James Clark <james.clark@arm.com>,
	Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>
Subject: Re: [PATCH] perf test: Add ARM SPE system wide test
Date: Thu, 16 Jun 2022 11:12:25 +0100	[thread overview]
Message-ID: <9242ecfa-36ab-c425-999c-fad44056223b@arm.com> (raw)
In-Reply-To: <20220615190735.1298213-1-namhyung@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

Thanks for the patch, Namhyung

On 15/06/2022 20:07, Namhyung Kim wrote:
> In the past it had a problem not setting the pid/tid on the sample
> correctly when system-wide mode is used.  Although it's fixed now it'd
> be nice if we have a test case for it.
>
> Cc: German Gomez <german.gomez@arm.com>
> Cc: Leo Yan <leo.yan@linaro.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/tests/shell/test_arm_spe.sh | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/tools/perf/tests/shell/test_arm_spe.sh b/tools/perf/tests/shell/test_arm_spe.sh
> index e59044edc406..b9c588ae393b 100755
> --- a/tools/perf/tests/shell/test_arm_spe.sh
> +++ b/tools/perf/tests/shell/test_arm_spe.sh
> @@ -23,6 +23,7 @@ glb_err=0
>  cleanup_files()
>  {
>  	rm -f ${perfdata}
> +	rm -f ${perfdata}.old
>  	exit $glb_err
>  }
>  
> @@ -85,5 +86,19 @@ arm_spe_snapshot_test() {
>  	arm_spe_report "SPE snapshot testing" $err
>  }
>  
> +arm_spe_system_wide_test() {
> +	echo "Recording trace with system-wide mode $perfdata"
> +	perf record -o ${perfdata} -e arm_spe// -a \
> +		-- dd if=/dev/zero of=/dev/null count=100000 > /dev/null 2>&1
> +

Should we skip if we don't have privileges for CPU tracing? (attached diff)

German

> +	perf_script_samples dd &&
> +	perf_report_samples dd
> +
> +	err=$?
> +	arm_spe_report "SPE system-wide testing" $err
> +}
> +
>  arm_spe_snapshot_test
> +arm_spe_system_wide_test
> +
>  exit $glb_err

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 798 bytes --]

diff --git a/tools/perf/tests/shell/test_arm_spe.sh b/tools/perf/tests/shell/test_arm_spe.sh
index b9c588ae3..962841a51 100755
--- a/tools/perf/tests/shell/test_arm_spe.sh
+++ b/tools/perf/tests/shell/test_arm_spe.sh
@@ -30,11 +30,13 @@ cleanup_files()
 trap cleanup_files exit term int
 
 arm_spe_report() {
-	if [ $2 != 0 ]; then
+	if [ $2 = 0 ]; then
+		echo "$1: PASS"
+	elif [ $2 = 2 ]; then
+		echo "$1: SKIPPED"
+	else
 		echo "$1: FAIL"
 		glb_err=$2
-	else
-		echo "$1: PASS"
 	fi
 }
 
@@ -91,6 +93,11 @@ arm_spe_system_wide_test() {
 	perf record -o ${perfdata} -e arm_spe// -a \
 		-- dd if=/dev/zero of=/dev/null count=100000 > /dev/null 2>&1
 
+	if [ $? != 0 ]; then
+		arm_spe_report "SPE system-wide testing" 2
+		return
+	fi
+
 	perf_script_samples dd &&
 	perf_report_samples dd
 

  reply	other threads:[~2022-06-16 10:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 19:07 Namhyung Kim
2022-06-16 10:12 ` German Gomez [this message]
2022-06-16 16:43   ` Namhyung Kim

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=9242ecfa-36ab-c425-999c-fad44056223b@arm.com \
    --to=german.gomez@arm.com \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®