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 BCEB0C433F5 for ; Wed, 5 Jan 2022 17:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242094AbiAERAN (ORCPT ); Wed, 5 Jan 2022 12:00:13 -0500 Received: from foss.arm.com ([217.140.110.172]:45960 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242066AbiAERAD (ORCPT ); Wed, 5 Jan 2022 12:00:03 -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 6CB6311D4; Wed, 5 Jan 2022 09:00:03 -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 9FBF33F774; Wed, 5 Jan 2022 09:00:00 -0800 (PST) Message-ID: <6ba550d1-61bc-e229-2a64-331cfa59c388@arm.com> Date: Wed, 5 Jan 2022 16:58:42 +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: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/12/2021 10:19, John Garry wrote: > > And there is no colouring for results which are above/below standard > thresholds (see stat-shadow.c:get_radio_color()). > > My impression is that we're not plugging the results from > metricgroup__parse_groups_to_evlist() into the --topdown print > functionality properly. > The --topdown kernel event colouring is dictated by a large if-else statement in stat-shadow.c:perf_stat__print_shadow_stats. There are branches depending on what is returned by perf_stat_evsel__is() for example } else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_BUBBLES)) { double fe_bound = td_fe_bound(cpu, st, &rsd); if (fe_bound > 0.2) color = PERF_COLOR_RED; print_metric(config, ctxp, color, "%8.1f%%", "frontend bound", fe_bound * 100.); } else if (perf_stat_evsel__is(evsel, TOPDOWN_SLOTS_RETIRED)) { Because the patches are enabling metrics (equivalent of the -M 'somemetricname' option), the perf_stat__print_shadow_stats function always makes calls to generic_metric(), where colours are never picked. Seeing thresholds like: retiring > 0.7 fe_bound > 0.2 be_bound > 0.2 bad_spec > 0.1 I'm not sure about adding the colouring really. Are these thresholds x86 specific? > Thanks, > John Andrew 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 9DD61C433EF for ; Wed, 5 Jan 2022 17:01: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:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ga17BA700VPYB45OQrtrpnrDi6CAdvQ4BuobEougdw8=; b=tt071UKgembHLY Yn1tfM21YFgc7TV/50kSpimYlYERGGuqdtKa3K2Ci9jsWdcPmxcUL/at/7HQAkyP1qGrYlHgPknAm zlYw4Ot5yXkYKqon+3UillGrtWUln0LV5Kqjc77WPiiCQHGI48YT/vpep/oZRERVcpBgenTzPIYQh l+l9s/cfrscFGQ0AN2xORpCRN0SBtiYyYAInzFgQsExkTYH7cHQ/+5mzqx/mcg81+N/zhkg7cI/re wWytgYMbt3gzeEeeM5bkRmsQ/lBOrniiS2xcfz3hQgG5zIdRJy0oaArkYd6o/LukA1w7v7Aelz5MZ 4DTnKzFsId8RhMdYeXBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n59dy-00FOAx-Rb; Wed, 05 Jan 2022 17:00:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n59du-00FO7M-Sg for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 17:00:08 +0000 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 6CB6311D4; Wed, 5 Jan 2022 09:00:03 -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 9FBF33F774; Wed, 5 Jan 2022 09:00:00 -0800 (PST) Message-ID: <6ba550d1-61bc-e229-2a64-331cfa59c388@arm.com> Date: Wed, 5 Jan 2022 16:58:42 +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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220105_090007_019142_B9B5C497 X-CRM114-Status: GOOD ( 11.18 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 17/12/2021 10:19, John Garry wrote: > > And there is no colouring for results which are above/below standard > thresholds (see stat-shadow.c:get_radio_color()). > > My impression is that we're not plugging the results from > metricgroup__parse_groups_to_evlist() into the --topdown print > functionality properly. > The --topdown kernel event colouring is dictated by a large if-else statement in stat-shadow.c:perf_stat__print_shadow_stats. There are branches depending on what is returned by perf_stat_evsel__is() for example } else if (perf_stat_evsel__is(evsel, TOPDOWN_FETCH_BUBBLES)) { double fe_bound = td_fe_bound(cpu, st, &rsd); if (fe_bound > 0.2) color = PERF_COLOR_RED; print_metric(config, ctxp, color, "%8.1f%%", "frontend bound", fe_bound * 100.); } else if (perf_stat_evsel__is(evsel, TOPDOWN_SLOTS_RETIRED)) { Because the patches are enabling metrics (equivalent of the -M 'somemetricname' option), the perf_stat__print_shadow_stats function always makes calls to generic_metric(), where colours are never picked. Seeing thresholds like: retiring > 0.7 fe_bound > 0.2 be_bound > 0.2 bad_spec > 0.1 I'm not sure about adding the colouring really. Are these thresholds x86 specific? > Thanks, > John Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel