From patchwork Tue Sep 3 10:19:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13788483 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 52C94CD13CF for ; Tue, 3 Sep 2024 10:27:43 +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=FXow/HXS2t6eZsIhNK0KrvK5I+CXmczupsEF4/wQsaM=; b=oMXYe0oCvRXW96mjJqvKf6+HWv 4jvIG2IE2/LvBs0JayEEt0F0bflxhQSLdHjDztB4GQ0+qMjUcQSLdvRbV9QQ2ElV27UyI8mbdkzGI NlLe9sH0x9kc6BRdmHv4KFzknTG//Upgnnd7RqiJiJcNinl/ww4yzBE07HATIa5RgyQeTUbeg+GW9 80EqPQ/BxELRxURIU627eqWMIi9NoJ/HkwpMuorxP1kcoOuaXAaG3A6E6Bmk6bpJOHvQAZl0pBlyM NFs0uQnA0VbLsx5+YJCOds1WKX9vQHXuF0hfZ9NUeZdkFE3MdKLPsV5maU+uXcZI8mB0IC7QHo7f1 HJb5e/Yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQl2-0000000HL7H-0tFa; Tue, 03 Sep 2024 10:27:32 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQfg-0000000HK5Y-2Wav for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 10:22:01 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42bb72a5e0bso45220355e9.1 for ; Tue, 03 Sep 2024 03:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725358919; x=1725963719; 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=FXow/HXS2t6eZsIhNK0KrvK5I+CXmczupsEF4/wQsaM=; b=mfmD0spUziX5sytp65j9JHr7/dJ4vKpLgBnEi9WX0Oy6k2SRcykPHkLfHWrZ/h+UnL e1plQ4nAuzaoz79eRAKn29+r3cfv9P2R6xBwon6cdYo/47DEm5Pq2pG6MhzbWqE4SDMS YKb7N7sQj8kDUKN4vQNpv6P7Z8BoxxfmCAlEbrU6/1J/mSCv3eTgVtb63cGYm0gq8b8/ P8r7jME6rltBVQyKtrbof3R6fNUcj5DGXo642N/xlVeNOH5Ig3Jum2edia0YB8LeasdU m+hK7z7GpkC4q+eBR2jMz57p1eQ355th+4rJqdMSRYdQUFgvTj4xe6vTdd3HEm6pX3uC tOog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725358919; x=1725963719; 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=FXow/HXS2t6eZsIhNK0KrvK5I+CXmczupsEF4/wQsaM=; b=KYG8pENRxmM+Rb8sdwGjLfOQO//NpTml0qLgdlLTv1HWHpAwoVwKwpZbIipLfVfyB8 xjLEwjjceWDCoPRElapHdJ3UpIIereFiEcP4+4eUwfXrl1gz92KohW9OcT0zueWWon1O Gzpt2Mv7Lg3o6hb3csB8rkhZRBt0mSNJakImM9ZG8Ug/svenDDDG79QEZPb3CcF3PIO8 0Uno1uUF9cvKZJnr3RwcxfrlgBSKTl5TNZNt1flQSbFEctMtfp3C7Rc9bW1Edlxhduhl LhiVuE+mU90VgXfDbbilwo6K8RzGFITtLHHPUgmuA/OrbTP40ClS2FhbhaXMEBdQFP9d 0M9Q== X-Forwarded-Encrypted: i=1; AJvYcCVXei1REICScidwZA15AxT4rW0q9iQfsMHKIQIMoR+JVE9KwQPI+31nP08FK1kQ+3pggwclnVa+ZaqBf3y2HJ/L@lists.infradead.org X-Gm-Message-State: AOJu0Yxfh/tMmVUVwGhXEzZaQH/DTl+Pcn/GW6kva4RNSJ8jWhJ3+Q2z NTYdmM2WVyajf06LMvlO5ZvRcYI+krpDYfazP8tw//4I07LArOz9AUhpzPYlrJU= X-Google-Smtp-Source: AGHT+IHkBX4KzIJzZmErwYTrZ+5GhpDTKAgX+51Byz51rMyHGi/ROqeYUZBfKl487Mq1nQLo3tEQCg== X-Received: by 2002:a05:600c:1c1b:b0:426:6f27:379a with SMTP id 5b1f17b1804b1-42bb01b4c35mr118683625e9.13.1725358918867; Tue, 03 Sep 2024 03:21:58 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e274ccsm168739995e9.37.2024.09.03.03.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 03:21:58 -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 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 v6 6/7] perf test: Make stat test work on DT devices Date: Tue, 3 Sep 2024 11:19:50 +0100 Message-Id: <20240903102005.78049-7-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240903102005.78049-1-james.clark@linaro.org> References: <20240903102005.78049-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-20240903_032200_700800_E2CA139A X-CRM114-Status: GOOD ( 14.40 ) 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. 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