mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ruidong Tian <tianruidong@linux.alibaba.com>
To: linux-kernel@vger.kernel.org
Cc: coresight@lists.linaro.org, suzuki.poulose@arm.com,
	mike.leach@linaro.org, alexander.shishkin@linux.intel.com,
	linux-arm-kernel@lists.infradead.org,
	Ruidong Tian <tianruidong@linux.alibaba.com>
Subject: [PATCH] perf test: Update cs_etm testcase for Arm ETE
Date: Mon, 11 Sep 2023 14:55:41 +0800	[thread overview]
Message-ID: <20230911065541.91293-1-tianruidong@linux.alibaba.com> (raw)

Add ETE as one of the supported device types in perf cs_etm testcase.

Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
---
 tools/perf/tests/shell/test_arm_coresight.sh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh
index f1bf5621160f..fe78c4626e45 100755
--- a/tools/perf/tests/shell/test_arm_coresight.sh
+++ b/tools/perf/tests/shell/test_arm_coresight.sh
@@ -11,6 +11,19 @@
 
 glb_err=0
 
+cs_etm_dev_name() {
+	cs_etm_path=$(find  /sys/bus/event_source/devices/cs_etm/ -name cpu* -print -quit)
+	trcdevarch=$(cat ${cs_etm_path}/mgmt/trcdevarch)
+	archhver=$((($trcdevarch >> 12) & 0xf))
+	archpart=$(($trcdevarch & 0xfff))
+
+	if [ $archhver -eq 5 -a "$(printf "0x%X\n" $archpart)" = "0xA13" ] ; then
+		echo "ete"
+	else
+		echo "etm"
+	fi
+}
+
 skip_if_no_cs_etm_event() {
 	perf list | grep -q 'cs_etm//' && return 0
 
@@ -136,7 +149,7 @@ arm_cs_iterate_devices() {
 
 arm_cs_etm_traverse_path_test() {
 	# Iterate for every ETM device
-	for dev in /sys/bus/coresight/devices/etm*; do
+	for dev in /sys/bus/coresight/devices/$(cs_etm_dev_name)*; do
 
 		# Find the ETM device belonging to which CPU
 		cpu=`cat $dev/cpu`
-- 
2.33.1


             reply	other threads:[~2023-09-11  6:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11  6:55 Ruidong Tian [this message]
2023-09-11  8:51 ` James Clark
2023-09-12 19:37   ` 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=20230911065541.91293-1-tianruidong@linux.alibaba.com \
    --to=tianruidong@linux.alibaba.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=suzuki.poulose@arm.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 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®