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 5C705CA0EE5 for ; Fri, 30 Aug 2024 06:33:22 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=K2pfeDLTYM5kFO0fdoRWWbfA0PIjoWcwoeUV1W4y+WU=; b=TG6bM2DP+QzvoQjf+vKh7/696A B+SOT9IITJtNdPNHxqWPStR8ZFuGktPpjh1b0vIIIjiYaNGMS8tWzW99Yi5eFBePJgO/m1bWL+1cA 7rayVl9LaGS2hldIvLquDWri1twA55Bp2n4VywGnOtvURdOv2AFaDbVRiuUr1YGyIyYETQeGe6ySN wYwDo74wjzcQqnD9/ENn/rKeLz47Xo6RQsEUZwNt3mNf6Etzxmea0Oo/xTPkKuc2j6PxgEtSWwSIW lukKbNwUXPYgsk7x1TJmgzedzJ3Rtbv8v4cUHnD0d4EC59Q9Uc7gKlt5WqeOnZrzU7Lk+kqOAfRfX VQMyb0Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjvC4-00000004xzm-2ixS; Fri, 30 Aug 2024 06:33:12 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjvBD-00000004xrs-1F75 for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 06:32:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 5C184A43569; Fri, 30 Aug 2024 06:32:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13394C4CEC4; Fri, 30 Aug 2024 06:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724999538; bh=UoC7Tqt2sZoHI4+CzQrsZWia+6J+z2QR8hiT2dGYBog=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f1RmxXhmsX7dEydMo2oMZ0r8rPBpus9eB6kPwhlQxtyOxAuWbZ6KGoMEJE3dCRkrK kkp+Z6zwnUbf6fBV9lV7YbyTaUdvvFHLThJltopij3KtMrp41GuNoRvXU/8IJlKlMB D7ZsF+D2mrCxFVn6IJk2nqeYXGQnVmEdrFkvWlJ76NTLnNyFx7tbQNBgO1gTbXz++y i7j8ukuaBiMOHhy/FNDGa48b7K6AgA1b1OflIfE2AkUnU0GPCPY6TOmFb0INg9mueh 3xJGd7UkvuPK+BmKAsWRgtL8Fvh45DDKHAEiY6YjXfH2eUXZLIXEvtvof759Wkffip auVcH29/F4nlA== Date: Thu, 29 Aug 2024 23:32:14 -0700 From: Namhyung Kim To: James Clark Cc: irogers@google.com, linux-perf-users@vger.kernel.org, kan.liang@linux.intel.com, ak@linux.intel.com, 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 , Athira Rajeev , Colin Ian King , Yang Jihong , Ze Gao , Sun Haiyong , Jing Zhang , Yicong Yang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 7/7] perf test: Add a test for default perf stat command Message-ID: References: <20240828140736.156703-1-james.clark@linaro.org> <20240828140736.156703-8-james.clark@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240828140736.156703-8-james.clark@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_233219_494513_2A6AC28B X-CRM114-Status: GOOD ( 21.99 ) 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 Hello, On Wed, Aug 28, 2024 at 03:07:21PM +0100, James Clark wrote: > 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. > > Signed-off-by: James Clark > --- > tools/perf/tests/shell/stat.sh | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh > index 525d0c44fdc6..24ace1de71cc 100755 > --- a/tools/perf/tests/shell/stat.sh > +++ b/tools/perf/tests/shell/stat.sh > @@ -148,6 +148,26 @@ 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 > + pmus=$(ls /sys/bus/event_source/devices/*/cpus 2>/dev/null | wc -l) Is it working on non-hybrid systems? I don't think they have cpus file in the core PMU. Thanks, Namhyung > + > + # 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 > @@ -155,4 +175,5 @@ test_stat_repeat_weak_groups > test_topdown_groups > test_topdown_weak_groups > test_cputype > +test_hybrid > exit $err > -- > 2.34.1 >