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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DE3DC433FE for ; Tue, 21 Dec 2021 14:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238499AbhLUOcJ (ORCPT ); Tue, 21 Dec 2021 09:32:09 -0500 Received: from foss.arm.com ([217.140.110.172]:54272 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234548AbhLUOcI (ORCPT ); Tue, 21 Dec 2021 09:32:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F4FE6D; Tue, 21 Dec 2021 06:32:08 -0800 (PST) Received: from [10.57.37.41] (unknown [10.57.37.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7F36F3F774; Tue, 21 Dec 2021 06:32:05 -0800 (PST) Message-ID: Date: Tue, 21 Dec 2021 14:31:54 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [RFC PATCH 1/1] perf arm64: Implement --topdown with metrics Content-Language: en-US To: John Garry , "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , "acme@kernel.org" , Andi Kleen Cc: Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "linux-arm-kernel@lists.infradead.org" References: <4c375d34-bf20-496d-22fc-aed8597126e2@huawei.com> <20211214184240.24215-1-andrew.kilroy@arm.com> <20211214184240.24215-2-andrew.kilroy@arm.com> <48437bee-9c39-38ba-e990-ba9a6a5378b4@huawei.com> From: Andrew Kilroy In-Reply-To: <48437bee-9c39-38ba-e990-ba9a6a5378b4@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/12/2021 10:19, John Garry wrote: > On 14/12/2021 18:42, Andrew Kilroy wrote: >> This patch implements the --topdown option by making use of metrics to >> dictate what counters are obtained in order to show the various topdown >> columns, e.g.  Frontend Bound, Backend Bound, Retiring and Bad >> Speculation. >> >> The MetricGroup name is used to identify which set of metrics are to be >> shown.  For the moment use TopDownL1 and enable for arm64 >> >> Signed-off-by: Andrew Kilroy > > This works in that it gives results, but does not supply the same output > format as for x86 nor has same restrictions in usage (-a commandline > required, for example, below). > > For my x86 broadwell: > > john@localhost:~/linux/tools/perf> sudo ./perf stat --topdown  sleep 1 > top down event configuration requires system-wide mode (-a) > > john@localhost:~/linux/tools/perf> sudo ./perf stat --topdown -a sleep 1 > Performance counter stats for 'system wide': > >                                    retiring      bad speculation > frontend bound        backend bound > S0-D0-C0           2                29.2%                 6.3% > 37.4%                27.1% > S0-D0-C1           2                20.4%                 6.2% > 42.1%                31.3% > >       0.998007338 seconds time elapsed > > john@localhost:~/linux/tools/perf> > Judging by comments in commits 44b1e60ab576c, 55c36a9fc2aaa, whether -a is required or not differs depending on the cpu. As to why, I'm not sure. The requirement was relaxed in 55c36a9fc2aaa, but I guess that doesn't affect the broadwell. The stats are printed per cpu because on your broadwell, the existing code is forcing per-core mode. Hence why -a is required. See builtin-stat.c lines 1885-1890 on commit 8ff4f20f3eb55. My patch wasn't forcing per-core, hence it didn't require -a. Andrew