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 C48A3CA0ED3 for ; Mon, 2 Sep 2024 17:44:33 +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-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NebsBTEFX5y7ETlS1KtnCJT5mvennzVi83CE5wqQ0Q8=; b=RTiOrCyQK7jSry2mclrO/w0t1o aq8fsz7977u3HYibqf6kvLTbXxVlLR2BmjDhG9iHwzi3hDO88YMSguUTd0S3qi6MPel6jsIEhyMOe iz61VPk2beiY/XfOuiZP9OuIKA3R3SvEfuy12C0BpASe+AerpLQEgLyd7jYRCo6962N0qlEFlLYej 6GzN6hTeFzedx6PMMIBTO0msE0dCUEXaIyrScWYNHEH8/oP4NQTrvzUpE9/V7DmyuDEmOl5zpSVzo FiCegaGjSwQGcmH9wviswQeuDWK1tmZkwItxQYVKNHx5j6Qewz7KWxjacdRzva5Db8YxmSq60yJi8 W8I+TEPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slB68-0000000FBHQ-3HZo; Mon, 02 Sep 2024 17:44:16 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slB5E-0000000FB8K-2Dh7 for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 17:43:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 99A8A5C58C7; Mon, 2 Sep 2024 17:43:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C405DC4CEC2; Mon, 2 Sep 2024 17:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725298998; bh=pQjq5637RhyeLyjUbHTYNQQZXlfmZQqh2HY8sgaNvyU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EGjwJhx1h8jDsC78GRLKmR4Hdh/xNYAf7ROCcShPyQgGLvGt3uXVNqrzdQvKXizOM boxw7X+phdUjTY0jPM7Qs3mKt9tlVFuDubX0eTD7Z3FSSNahemHE+zOmTl1VErIZWh l2IZMSV6UMHOrUGZ5AgrHE0DnqgfOM6CkJXyOmCRLGcSGHPe5wUtrvzfKOkwV5Fmr+ GqlAUW4oBrru/8i+P+/o/0KZNkMr+nZ8SxXAIbflX+bCYhWw73s74lSUVvp3ClxrNZ s6nHGZbiblbNsVsB4RPQ+jFX+5gxZeLqu9KQ9ikc4mxk2qdvPbx/KS7HQT0RoDgb/B FCU9fSxU6y4cQ== Date: Mon, 2 Sep 2024 10:43:15 -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> <52de8df9-4554-4bc0-9735-fdbd197dbb7c@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_104320_691567_4398DE36 X-CRM114-Status: GOOD ( 28.82 ) 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 On Fri, Aug 30, 2024 at 09:45:11AM +0100, James Clark wrote: > > > On 30/08/2024 9:29 am, James Clark wrote: > > > > > > On 30/08/2024 7:32 am, Namhyung Kim wrote: > > > 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 > > > > > > > Good point I only tested on Arm non-hybrid. I can change it to assume 1 > > PMU for no cpus files? > > Or maybe assume 1 if a /sys/bus/event_source/devices/cpu folder exists? Not > sure which is best but either will work. Some arch might not have a cpu PMU, I think we can assume 1 and update only if it finds cpus files. Thanks, Namhyung