From mboxrd@z Thu Jan 1 00:00:00 1970 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 882DACCD195 for ; Fri, 17 Oct 2025 15:05:08 +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=d0E9bpJ70XcR2K+KIkSDama1wp8RUqqDRr3ESIT0JuM=; b=gdU00QFCcm50WDsrOJ8BaVmGPf xbDCeFN3KqPKOvPAVC9aynRZ38mFaB4vwqq+U9FYK9ytxfNSbc7vPzH6F4oDFDMUQWsnKfrcpCFsS a+Di7Q39UiG+UWkk0o8vy9phM5KETHwMhlFFfFxhzwgegqBCEmbwhD81zxoArW2MfuLX0yk/8x83Q JoU45mHLocbXJd6diByFNuhLi5ztN/d2+hATJPnN/eei16oYLz8MGYUY26kR+UuUy55fdOyc8Ek4k 5B8Z1m04035Cx8/dinZdReKiHm1b8iM5HXzIU14TD5k8PVOqq2X+pXMjqpnRgYTvWoMdDsN2S1gyO 97sYEY2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9m0q-00000008CnS-41Pz; Fri, 17 Oct 2025 15:05:00 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9m0n-00000008Cn4-3xtF for linux-arm-kernel@lists.infradead.org; Fri, 17 Oct 2025 15:04:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 632154054C; Fri, 17 Oct 2025 15:04:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEBA1C4CEE7; Fri, 17 Oct 2025 15:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760713497; bh=a1j31TYJKqx2mT0afuLiEaai3JjlnoEc/sojQHUdEDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnmxM1DLEGPF0fvD+lgPfFOID2P9vxboij8sY7aajB/4W1DJ2C5DmzWYS0WR4Somo oAHsPWrWZh/VDo2wqvcMbTPvcYYTlr+BI67PbhxU0Xg/zb216+Pz1ASsoMvhHjjY6L CrphJ/l5T2cPo2tRJKzMDVQRtklYvp4qRW494bDw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Namhyung Kim , Kan Liang , James Clark , Yang Jihong , Dominique Martinet , Colin Ian King , Howard Chu , Ze Gao , Yicong Yang , Weilin Wang , Will Deacon , Mike Leach , Jing Zhang , Yang Li , Leo Yan , ak@linux.intel.com, Athira Rajeev , linux-arm-kernel@lists.infradead.org, Yanteng Si , Sun Haiyong , John Garry , Sasha Levin Subject: [PATCH 6.6 018/201] perf test: Add a test for default perf stat command Date: Fri, 17 Oct 2025 16:51:19 +0200 Message-ID: <20251017145135.405992496@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017145134.710337454@linuxfoundation.org> References: <20251017145134.710337454@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251017_080458_029367_33594AD0 X-CRM114-Status: GOOD ( 12.24 ) 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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Clark [ Upstream commit 65d11821910bd910a2b4b5b005360d036c76ecef ] Test that one cycles event is opened for each core PMU when "perf stat" is run without arguments. The event line can either be output as "pmu/cycles/" or just "cycles" if there is only one PMU. Include 2 spaces for padding in the one PMU case to avoid matching when the word cycles is included in metric descriptions. Acked-by: Namhyung Kim Acked-by: Kan Liang Signed-off-by: James Clark Cc: Yang Jihong Cc: Dominique Martinet Cc: Colin Ian King Cc: Howard Chu Cc: Ze Gao Cc: Yicong Yang Cc: Weilin Wang Cc: Will Deacon Cc: Mike Leach Cc: Jing Zhang Cc: Yang Li Cc: Leo Yan Cc: ak@linux.intel.com Cc: Athira Rajeev Cc: linux-arm-kernel@lists.infradead.org Cc: Yanteng Si Cc: Sun Haiyong Cc: John Garry Link: https://lore.kernel.org/r/20240926144851.245903-8-james.clark@linaro.org Signed-off-by: Namhyung Kim Stable-dep-of: 24937ee839e4 ("perf evsel: Ensure the fallback message is always written to") Signed-off-by: Sasha Levin --- tools/perf/tests/shell/stat.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh index 3f1e67795490a..c6df7eec96b98 100755 --- a/tools/perf/tests/shell/stat.sh +++ b/tools/perf/tests/shell/stat.sh @@ -146,6 +146,30 @@ test_cputype() { echo "cputype test [Success]" } +test_hybrid() { + # Test the default stat command on hybrid devices opens one cycles event for + # each CPU type. + echo "hybrid test" + + # Count the number of core PMUs, assume minimum of 1 + pmus=$(ls /sys/bus/event_source/devices/*/cpus 2>/dev/null | wc -l) + if [ "$pmus" -lt 1 ] + then + pmus=1 + fi + + # Run default Perf stat + cycles_events=$(perf stat -- true 2>&1 | grep -E "/cycles/| cycles " | wc -l) + + if [ "$pmus" -ne "$cycles_events" ] + then + echo "hybrid test [Found $pmus PMUs but $cycles_events cycles events. Failed]" + err=1 + return + fi + echo "hybrid test [Success]" +} + test_default_stat test_stat_record_report test_stat_record_script @@ -153,4 +177,5 @@ test_stat_repeat_weak_groups test_topdown_groups test_topdown_weak_groups test_cputype +test_hybrid exit $err -- 2.51.0