Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1151110rdb; Wed, 6 Dec 2023 09:54:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLl5EJeQDCajw4M/GiVGKW4vQHF+AAQ1lSj4juODTkYfLYA3XekIUi/YybUhKMYzf9L6Rx X-Received: by 2002:a05:6a00:98e:b0:6cd:faa6:fc4b with SMTP id u14-20020a056a00098e00b006cdfaa6fc4bmr1653621pfg.33.1701885283528; Wed, 06 Dec 2023 09:54:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701885283; cv=none; d=google.com; s=arc-20160816; b=zKscnc3ogwRhiNMp6JHwZiJ9nXWzaw4qLnyyQvYrduqyDuI7EQR40q52o4jgpys0iI 3TyzlglecIybbgSVIKUegodorE41udK0ey7I7xMtLLA8gsDPzsjuKiFTPYxAQegGv3DP aGz7AZpfag/MgODXk5Ta22s+VO0O7thmyooy2MfHlIs9a5SjcQ0Y1ulExL5KqAqxy32F t722rrwgDumItCRKhHzss+nJpK0VZVZvyF8dJkB3FVwUhZSScZJAFi1Vbu5fYCDE1XPu wlN83qUDtlftstSo0ukh+1B8MwyrCqiaht/M4LifM31UfAWdiuGePAp0Mxe5m2fcrGJL 5n4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=M8zRXpWCx7N2cmDoQaeE4jZfw7vURa6Kz+7e5qmhcUw=; fh=R3RIq9sG6/3T3+uzyUPTWibA8a6V+FRZVPfX9pSbydY=; b=O6TiMEpFpnvZYCB1DClDOvfl/AAHIClwz2YLC1COZxjBsjNfXEPFc7AuWh6WnLph4R MA8BxT/lOP15AtEsk1sYkRaKrubdDM5goBNYX8FvlNkvkFsW3i4wYsttY/ULZy4N01pY 6j7f7I8rwzuVfJ0E2Q8UNjeXpnuOzxvtnMAa4NyrRjR0N3qAXjJ0NNQE1nS+8sLEI0mQ Z+N+aFmP1/jlA3uYp/1fnBReSyDuu0PNKhr0ARLfe7FvQHOutrd1M2CGU+tVnokX/cFU 4QdYT3GvpLz79Ztvv90EMRC1diX+j3Qh6RnrtGmofnCeZM9MHkfarRz5bGC0G5nh5khR 4Jfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Y/BIu5Ah"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q17-20020a056a00151100b006ce03f8d014si266802pfu.391.2023.12.06.09.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:54:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Y/BIu5Ah"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9232C802922E; Wed, 6 Dec 2023 09:54:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442742AbjLFRyZ (ORCPT + 99 others); Wed, 6 Dec 2023 12:54:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442726AbjLFRyY (ORCPT ); Wed, 6 Dec 2023 12:54:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AC3618D for ; Wed, 6 Dec 2023 09:54:31 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CD1DC433C7; Wed, 6 Dec 2023 17:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701885270; bh=2tDbHUTnzhDqadtqq25zkKFvVdsHBy1BabMsSbHH1NM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y/BIu5AhIWQu8lordRw4GUGC6QE/Qmhc85FS1bDfJXIZzFp3Ael8yQcVmw6B7nruV 7XgMQnmAiQdcNGHUldQ+Ao9W5GIgS956FnPuvgbFfc3BvxQxTFqYqmiKZAXl/8JyQJ y2mz3ncsM0x/c42uxQXZ+p9chQEacmRpt3EEq3aN5b1i8vpsbZklVB9ZPd8x8tvulK qXa3L0CymewN1R4Zv71fKHhSYT3Ar8f5P93mCaPwFP3CF9kfWpfZESWIUqXVnzwEum FN6ViiLpeDgURjoEdfYZZBU01GuPnIOZA7oo626plAnjCvnoodMupBbK9ORoVRRRbc b34ZbL86mkZ6A== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id A81E8403EF; Wed, 6 Dec 2023 14:54:27 -0300 (-03) Date: Wed, 6 Dec 2023 14:54:27 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Ayush Jain , Sandipan Das , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, peterz@infradead.org, Ingo Molnar , mark.rutland@arm.com, alexander.shishkin@linux.intel.com, Jiri Olsa , Namhyung Kim , Adrian Hunter , kjain@linux.ibm.com, atrajeev@linux.vnet.ibm.com, barnali@linux.ibm.com, ananth.narayan@amd.com, ravi.bangoria@amd.com, santosh.shukla@amd.com Subject: Re: [PATCH] perf test: Retry without grouping for all metrics test Message-ID: References: <20230614090710.680330-1-sandipan.das@amd.com> <1320e6e3-c029-2a8c-e8b7-2cfbb781518a@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 06 Dec 2023 09:54:40 -0800 (PST) Em Wed, Dec 06, 2023 at 08:35:23AM -0800, Ian Rogers escreveu: > On Wed, Dec 6, 2023 at 5:08 AM Arnaldo Carvalho de Melo wrote: > > Humm, I'm not being able to reproduce here the problem, before applying > > this patch: > Please don't apply the patch. The patch masks a bug in metrics/PMUs I didn't > and the proper fix was: > 8d40f74ebf21 perf vendor events amd: Fix large metrics > https://lore.kernel.org/r/20230706063440.54189-1-sandipan.das@amd.com that is upstream: ⬢[acme@toolbox perf-tools-next]$ git log tools/perf/pmu-events/arch/x86/amdzen1/recommended.json commit 8d40f74ebf217d3b9e9b7481721e6236b857cc55 Author: Sandipan Das Date: Thu Jul 6 12:04:40 2023 +0530 perf vendor events amd: Fix large metrics There are cases where a metric requires more events than the number of available counters. E.g. AMD Zen, Zen 2 and Zen 3 processors have four data fabric counters but the "nps1_die_to_dram" metric has eight events. By default, the constituent events are placed in a group and since the events cannot be scheduled at the same time, the metric is not computed. The "all metrics" test also fails because of this. Use the NO_GROUP_EVENTS constraint for such metrics which anyway expect the user to run perf with "--metric-no-group". E.g. $ sudo perf test -v 101 Before: 101: perf all metrics test : --- start --- test child forked, pid 37131 Testing branch_misprediction_ratio Testing all_remote_links_outbound Testing nps1_die_to_dram Metric 'nps1_die_to_dram' not printed in: Error: Invalid event (dram_channel_data_controller_4) in per-thread mode, enable system wide with '-a'. Testing macro_ops_dispatched Testing all_l2_cache_accesses Testing all_l2_cache_hits Testing all_l2_cache_misses Testing ic_fetch_miss_ratio Testing l2_cache_accesses_from_l2_hwpf Testing l2_cache_misses_from_l2_hwpf Testing op_cache_fetch_miss_ratio Testing l3_read_miss_latency Testing l1_itlb_misses test child finished with -1 ---- end ---- perf all metrics test: FAILED! After: 101: perf all metrics test : --- start --- test child forked, pid 43766 Testing branch_misprediction_ratio Testing all_remote_links_outbound Testing nps1_die_to_dram Testing macro_ops_dispatched Testing all_l2_cache_accesses Testing all_l2_cache_hits Testing all_l2_cache_misses Testing ic_fetch_miss_ratio Testing l2_cache_accesses_from_l2_hwpf Testing l2_cache_misses_from_l2_hwpf Testing op_cache_fetch_miss_ratio Testing l3_read_miss_latency Testing l1_itlb_misses test child finished with 0 ---- end ---- perf all metrics test: Ok Reported-by: Ayush Jain Suggested-by: Ian Rogers Signed-off-by: Sandipan Das Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Santosh Shukla Link: https://lore.kernel.org/r/20230706063440.54189-1-sandipan.das@amd.com Signed-off-by: Arnaldo Carvalho de Melo > Ian, I also stumbled on this: > > [root@five ~]# perf stat -M dram_channel_data_controller_4 > > Cannot find metric or group `dram_channel_data_controller_4' > > ^C > > Performance counter stats for 'system wide': > > 284,908.91 msec cpu-clock # 32.002 CPUs utilized > > 6,485,456 context-switches # 22.763 K/sec > > 719 cpu-migrations # 2.524 /sec > > 32,800 page-faults # 115.125 /sec > > I.e. -M should bail out at that point (Cannot find metric or group `dram_channel_data_controller_4'), no? > We could. I suspect the code has always just not bailed out. I'll put > together a patch adding the bail out. Great, thanks, - Arnaldo