From patchwork Thu Sep 26 14:48:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13813440 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 B3A67CDE00D for ; Thu, 26 Sep 2024 14:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5C2IaRNsHC56vkJV7d2z1hySpqTijtSB8YUkIrjThBQ=; b=2eaieWyXKxXpfhX+ffitZTbSyx Ib8rcfQDtVqGPj6EvH4amqcNKYjDZ0s/RdQ56NZBb57WlWx4pNDvTTBQDmfctIjca1I65v7viTzYk C6X9cX1QN0END1qwKxRCwr3ERkH7f3DdkwzG2767TspL9zliYLSUeT2+TZfh9dEIP/e3WfbmFuPQ9 nPEpU6HeXJU7V9nD32ZXE1rssJfzosFPrLe7tLfdSGTf+d8T7pLAZRq1AI8Wc/Uw7KR6Nk4NaWcwo yYSG5G7mqxZa1nPAFOfVB9q0GLpQlnf4DpC6DHeiLkA/qUtXp+knMHMjQtAJedYrndkI1W7ilScoH LyiwSUuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stpwC-00000008ftH-1vSK; Thu, 26 Sep 2024 14:57:48 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stppB-00000008eWt-0p0Q for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 14:50:34 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5365aa568ceso1306129e87.0 for ; Thu, 26 Sep 2024 07:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727362231; x=1727967031; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5C2IaRNsHC56vkJV7d2z1hySpqTijtSB8YUkIrjThBQ=; b=AR2DlTjT9Ej3L4oKSyLs8ial+KTC47NmMkzopeVKARjyhsZ66draE0Rz7RnertmIMJ UkSggHrbSuKb/gs+mx5g7/Csia7MmFIWoeOMIf/4Ba43fKBs+2gc8JpFMz6igSFoEDIq eqi8sLLHNYnLldXvSdmVLhrToWN8bATctHPyZGpl0GwFJqbdtdAes7WzpBHKNCWHajZd PIrtb5feZ1WLH3Dj82GmrogASd/pBXCaOL4OD5OsKKBWA/AWV95QKXRqf3nXPuxMfc6n ShlzNp/Bo/I1I4axlV5mO47A5EwADS6IUpsnWaVcnfwhwrJ1kG5Pk1zSSfwncnrEip1e JA6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727362231; x=1727967031; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5C2IaRNsHC56vkJV7d2z1hySpqTijtSB8YUkIrjThBQ=; b=pZEwAN2Qxi7lmhXCFMO7lSrsA/JXPcmOBIK3dZyg79E1MBw+WiVsp4ENdjo7UJvWxP s/0d7EmeSebfzbcAVYLBOKlh0fCkZDqyHWrzxD0BTA0uHPGasggGN4sFYGwXdqh7onLD 11gZeK3ItjCCBWYbdMYKrdfWwpOCQxPz8zsmLeiNKyQPhYNamcpIZSxhhEUxCN572nmd 9jUE9U9IPrPd15c8tVXmCx72ijHMOmITh4O6JXUqdawl/FguM8sXllgNpKPX/guvHR59 hdc678AeSbxaw3U4i7DtIfGBpoooAaN2naLRaqUd24udC6E17yrv9ZafQTQhlLMZvNNe LfsA== X-Forwarded-Encrypted: i=1; AJvYcCW8jWU2vZFEH9dfkVwz4QfFc0gkQCbqrtJi1Uz9BMSxeSko/MgWCxA2WmMt5Ze5dznX1StDM2gcA2wMBxRCj7zp@lists.infradead.org X-Gm-Message-State: AOJu0YyPc3C34ZOZ5HOOzgZNK2D0Mzc1smRp0lM35mr++WvTc3b1qY+c 2HzYRBtm+50H0NcPgtz/bphULBRWAxsULCFXIw3FEZHJ+zY4aJi/DcY0rViPjYA= X-Google-Smtp-Source: AGHT+IHFBhIAAGgVt9IOOCYfDDIgsohl3GTjfp4I7Y73RftEYhJ7VTnhJZmj1Oc2A4CYQGF88oJngA== X-Received: by 2002:a05:6512:3a90:b0:52e:fa5f:b6a7 with SMTP id 2adb3069b0e04-53870496c1fmr5903737e87.13.1727362231305; Thu, 26 Sep 2024 07:50:31 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c294833asm5589966b.98.2024.09.26.07.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 07:50:30 -0700 (PDT) From: James Clark To: irogers@google.com, linux-perf-users@vger.kernel.org, kan.liang@linux.intel.com, ak@linux.intel.com, namhyung@kernel.org Cc: James Clark , John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Weilin Wang , Dominique Martinet , Yang Li , Yang Jihong , Colin Ian King , Athira Rajeev , Howard Chu , Ze Gao , Yunseong Kim , Sun Haiyong , Jing Zhang , Yicong Yang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 6/7] perf test: Make stat test work on DT devices Date: Thu, 26 Sep 2024 15:48:37 +0100 Message-Id: <20240926144851.245903-7-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240926144851.245903-1-james.clark@linaro.org> References: <20240926144851.245903-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240926_075033_246809_25EE3C26 X-CRM114-Status: GOOD ( 13.78 ) 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 PMUs aren't listed in /sys/devices/ on DT devices, so change the search directory to /sys/bus/event_source/devices which works everywhere. Also add armv8_cortex_* as a known PMU type to search for to make the test run on more devices. Acked-by: Namhyung Kim Acked-by: Kan Liang Signed-off-by: James Clark --- tools/perf/tests/shell/stat.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh index 3f1e67795490..525d0c44fdc6 100755 --- a/tools/perf/tests/shell/stat.sh +++ b/tools/perf/tests/shell/stat.sh @@ -117,16 +117,18 @@ test_cputype() { # Find a known PMU for cputype. pmu="" - for i in cpu cpu_atom armv8_pmuv3_0 + devs="/sys/bus/event_source/devices" + for i in $devs/cpu $devs/cpu_atom $devs/armv8_pmuv3_0 $devs/armv8_cortex_* do - if test -d "/sys/devices/$i" + i_base=$(basename "$i") + if test -d "$i" then - pmu="$i" + pmu="$i_base" break fi - if perf stat -e "$i/instructions/" true > /dev/null 2>&1 + if perf stat -e "$i_base/instructions/" true > /dev/null 2>&1 then - pmu="$i" + pmu="$i_base" break fi done