From patchwork Mon Sep 11 06:55:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruidong Tian X-Patchwork-Id: 13378866 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2438EE57DF for ; Mon, 11 Sep 2023 06:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Y9zP9GQHycLDzsNRKq1WOHDRW8XNm6tlOnOjJE6xSk4=; b=gH9m6u/KvkXivE OoPtDQmTLWhMsIMadtHmliyLHfgpqiKgRgiWHH8PswJBue517udXc2NZUHCuPxMBp4PgVMA7zWHW/ ZFlsybQhicwaqFWaHMAjAiMcMmSzWPR12LgpcAEbQKeTdW84xBh9hQLAJEWHAmvKWUgba0wTNx9Na wRKpUIXkyMerf7ANqQrW+RyOj7s7Dw5FH7MdrKn09L4TFZ3SF5GPvnwzDf88WSOXAcKT7ot2hLvQR W0+z3yy7RpDVdnOdbFNGP2mjY/OMAlsYsY6pL3viPP081vDP6awhFleStooCcBK1iEd2EW3HrvzbP gwuhUIxwPd1ZFJGPdAkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qfapy-00HMQp-2c; Mon, 11 Sep 2023 06:55:58 +0000 Received: from out30-118.freemail.mail.aliyun.com ([115.124.30.118]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qfapv-00HMQ3-0T for linux-arm-kernel@lists.infradead.org; Mon, 11 Sep 2023 06:55:57 +0000 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VrmdUvU_1694415344; Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0VrmdUvU_1694415344) by smtp.aliyun-inc.com; Mon, 11 Sep 2023 14:55:46 +0800 From: Ruidong Tian 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 Subject: [PATCH] perf test: Update cs_etm testcase for Arm ETE Date: Mon, 11 Sep 2023 14:55:41 +0800 Message-Id: <20230911065541.91293-1-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230910_235555_376042_40A1652A X-CRM114-Status: UNSURE ( 8.21 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add ETE as one of the supported device types in perf cs_etm testcase. Signed-off-by: Ruidong Tian Reviewed-by: James Clark --- 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`