Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4970030rdb; Tue, 12 Dec 2023 15:05:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHU7ezaiDnXq4nGO3Kv+JBS8Ru/QTteTPupjGEhtLxrpjgw+S3eIoRA+M6Ez3HNDYidwfpe X-Received: by 2002:a17:902:a383:b0:1d0:8dc3:9149 with SMTP id x3-20020a170902a38300b001d08dc39149mr5820282pla.72.1702422338867; Tue, 12 Dec 2023 15:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702422338; cv=none; d=google.com; s=arc-20160816; b=zKj208tlSxM1TUl4W1vPB5fFptMvFRI5CDVS8hpfl7L4V1A2agnMsEE7tqF8XCljt5 yRzeidPMYeD5KoBCYvNZKyDfvD4LjcUUTZCS/tIu8JQDAkTqxRf61IwofyFKTPTdMf9k o5iiXvoU6O5JkUo+xhXS+gm/I2zLcoVpGMqHBZr+uFGoyicKXNo1nABzlmPqyxtUrmOg ERrblGZKaHWdeW0s02YS8NfBMTSlk/XvSx9/jSagT2rKhDUHBx+8UQXtFoJNStULevF4 9VDQwuTNvZkn4FlFnM0RdBOfmLlaOjfahA1rYlVVAjzkoQEOoQzCNk0kZ40qshY0XQGT /+NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Yoat6x9dG2b9DIQazE6N+YBRTedooK7oye0E6mSi0+o=; fh=fjecWn2tsXHKF5pPtw+gI2dQE/iSXdFsWSc8KUP/zmc=; b=aqjZJRSh85BpV0Oiy4ny74pKk6pfWIRT7MGVcQJWgBHSa1F1abtxCatGf0hpy8jdkq EVK+iAioouRxnKpntjZ2/YFWF6KAnr3ppNWSkQw+j3wTIKR1qtHqoJjmCecbdGq8Qcnc LjwFLm6KH41BFMe2fkclHAC4ppYrZvT23PN5rOC1atHiRUAq8+Jhh00BYf3t3Ch5gBS/ 3DStoaw7hqDBX1MSfr+98b21MzcY6p7P2FrMmgD8GeK5MiXFiwCST6yaoaCROvZKS2dY JTZ6UKG3wFD4JRn2PS2ZzJAs5SWZq+GyPX8KrwaFjJ70gwS8ZQr5IouJAbkMT3FK02U2 5y1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z1eDBONb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n8-20020a170902e54800b001d0107ee537si8596533plf.428.2023.12.12.15.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 15:05:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z1eDBONb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id AB30180A8D85; Tue, 12 Dec 2023 15:05:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378015AbjLLXFD (ORCPT + 99 others); Tue, 12 Dec 2023 18:05:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378020AbjLLXEb (ORCPT ); Tue, 12 Dec 2023 18:04:31 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA21123; Tue, 12 Dec 2023 15:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702422256; x=1733958256; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aE77fMweebFjQP55AyGmMphhXJmvS2gbmOLgQJ472SQ=; b=Z1eDBONbI+gXuHrsPi1hvr8Lw2xmH6qfO5CQi3UGAnOReeQLezY5wLc7 TJDowqd3T3Oi1nyDELzCRy4VROM/uBmPyQ/PwwrbLQcuk6EJ7aEpSwR6h xzbGmHzllITYcJxeFyGoI0ePtKyaSaogBi7Tk2EvwAKqPeiPOmn50BSbD ivF+TI5Y/jHTKP0xMY1pudtqVwIOm1OGcvRurE2zk+ixD5M4SfIwAVm0U 98Lyjg8flch9Sse/+iuHEM01jM/kLB3R8sT6nXMV2ngPca7F2yqyjBKro wvSFMifyd7xyAivzykcrjaIhOxgXEctHpw1Pjs+VzTMbqXCmoKCUwAZKJ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="392056068" X-IronPort-AV: E=Sophos;i="6.04,271,1695711600"; d="scan'208";a="392056068" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 15:03:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="864392058" X-IronPort-AV: E=Sophos;i="6.04,271,1695711600"; d="scan'208";a="864392058" Received: from node-10329.jf.intel.com ([10.54.34.22]) by FMSMGA003.fm.intel.com with ESMTP; 12 Dec 2023 15:03:01 -0800 From: weilin.wang@intel.com To: weilin.wang@intel.com, Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Kan Liang Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers , Mark Rutland , Yang Jihong Subject: [RFC PATCH v3 18/18] perf stat: Add hardware-grouping cmd option to perf stat Date: Tue, 12 Dec 2023 15:02:24 -0800 Message-Id: <20231212230224.1473300-20-weilin.wang@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231212230224.1473300-1-weilin.wang@intel.com> References: <20231212230224.1473300-1-weilin.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 12 Dec 2023 15:05:36 -0800 (PST) From: Weilin Wang Add a cmd option to allow user to choose this new metric grouping method. $ perf stat -M TopdownL1 -a --hardware-grouping Signed-off-by: Weilin Wang --- tools/perf/builtin-stat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index a7a8018c3511..2f9fe54248a3 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1256,6 +1256,8 @@ static struct option stat_options[] = { "don't try to share events between metrics in a group"), OPT_BOOLEAN(0, "metric-no-threshold", &stat_config.metric_no_threshold, "don't try to share events between metrics in a group "), + OPT_BOOLEAN(0, "hardware-grouping", &stat_config.hardware_aware_grouping, + "Use hardware aware metric grouping method"), OPT_BOOLEAN(0, "topdown", &topdown_run, "measure top-down statistics"), OPT_UINTEGER(0, "td-level", &stat_config.topdown_level, @@ -2506,9 +2508,6 @@ int cmd_stat(int argc, const char **argv) (const char **) stat_usage, PARSE_OPT_STOP_AT_NON_OPTION); - /* Set hardware_aware_grouping to false on default before completely enable it.*/ - stat_config.hardware_aware_grouping = false; - if (stat_config.csv_sep) { stat_config.csv_output = true; if (!strcmp(stat_config.csv_sep, "\\t")) -- 2.39.3