From patchwork Wed Sep 25 14:13:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13812041 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 9215ACF9C6F for ; Wed, 25 Sep 2024 14:23:25 +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=iFcmRiD7epzn183lvuc3ln6nfs W+1/3GpOl/aSByQGLueL708jnmbCwcmBHBslewhU9AR4dpByI+qrR/HSBhKJQoBlCv7mJ5PjLWPBB dT348AlL4RIeVgX9QhxKf2E/BYUpylmVzqNEVs/KmrgavB1eOFIrHQ8IsJegjX+/qk1KSsZ0bOpni kFHZfVPp4D1uenvsE3AHpiFdaMLGwjOQuIsrbTxEZIg2Fy/V23TNmone4v0w/4pu9EzBIx8rFMPl+ yvRx0gfs7GnVuDZbM6QQ95DAM4OMzqqgjA8hVGP5lGbFNMZJvVVeGbpQBG4aeX8Ooxvnij4rClNqV JHVtw/3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stSvC-00000005bfp-2NTN; Wed, 25 Sep 2024 14:23:14 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stSoQ-00000005Zlt-0EN2 for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2024 14:16:15 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-53655b9bbcdso8230326e87.2 for ; Wed, 25 Sep 2024 07:16:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727273772; x=1727878572; 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=Hj5OMla0k7JRyrWH2Ir14HamEzHzQEPjz0fZlUEpRttO37wbkM4gAYg3bQfvhs+l+r yGrB+Di1TC4Kd5HX6ae07JZ0I2T7SoT9D7cNxtBeMsVf0LdIHMNqVwL7srQcNxnmdRXn ELmIDELKaleThgZ6lAuLAft+z07NhR8prpP+Zd0/MwMApDh94EoLH9U2UoSOTCk/pT6m jFilmzD56kN9Nqpkdw9ztodVrK23Z36dZZy4v6Rb/AAuInxRvvG2earKiqrz/SqLj1AG sDecj4M3HBNdmsRz/pVMxnL/jbINWhnidOlcM4r5N420C/ukEP3q6u4ncRBCnbXf8orG J6ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727273772; x=1727878572; 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=DZIU9rtw7D0zbT2eAN5HhpfwiCSL3FE2Zxe1yFjnTKC5VyQheaqUz0fw73c0y2J0Hh /zhojzFetkDruKknGkdpV2IgnpOUONVpLzFDCuhKmNwpx2RHubx3kd1mcgvcWyxPwZqe zZXnn2JB/0gEVy2JWxbkYvi2Qv9SuBHQNmOOZKchpevt7MTyiYueH9JdVu7DIIpZN1Yo JrCXxXR4W7tnnn7gcZYk4OXNm+kETSZcd3T5IWDbfeP75+tRikD98dmOxzEJrL3Ajt2H I/5R9Q1oBM7ZVeV1+9gmMCCT+CxQWSWRfqqWc4GCYnTE+DW6XEgwtaMwU9E1yc/fwyzH cd+Q== X-Forwarded-Encrypted: i=1; AJvYcCUkwHiTWIoMpgwrRZ0Qxsf6g58LzG+IPQ3HU6UCXen2NhJVWUnrCe0piOZ48tLkL6EY81NEvYrWJVwNGpUXy/0A@lists.infradead.org X-Gm-Message-State: AOJu0YyC/8UOZts0lKNxiYqIpGuqpwllTZrMaM5xN8ZK5zQw4+NhW7xr kCAHJvMoGPOUyn53veX1uOEoq5nHdLkK7svKvfi8qqhaeg8x6jgpeycyhg5grkQ= X-Google-Smtp-Source: AGHT+IH/AokU8nE5Yj8ombOw44PhKPwV1SxEafUhKBgeHTn5hoNRs+iZV0lhr7F3HawGiH9D28Flpw== X-Received: by 2002:a05:6512:1395:b0:52e:9b15:1c60 with SMTP id 2adb3069b0e04-5387755cacdmr2000950e87.48.1727273771713; Wed, 25 Sep 2024 07:16:11 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c5cf4968f4sm1888005a12.27.2024.09.25.07.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 07:16:11 -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 , Athira Rajeev , Dominique Martinet , Yang Jihong , Colin Ian King , Howard Chu , Ze Gao , Yunseong Kim , Yanteng Si , Sun Haiyong , Jing Zhang , Yicong Yang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 6/7] perf test: Make stat test work on DT devices Date: Wed, 25 Sep 2024 15:13:44 +0100 Message-Id: <20240925141357.1033087-7-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240925141357.1033087-1-james.clark@linaro.org> References: <20240925141357.1033087-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-20240925_071614_127109_2D3975AA X-CRM114-Status: GOOD ( 14.17 ) 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