From patchwork Fri Feb 9 03:14:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Weilin" X-Patchwork-Id: 198738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp608494dyd; Thu, 8 Feb 2024 19:36:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGP3pR6H9Glh0KD+CGf/LoIw2C/p+FTvT0iuX6oZC9RjsKdPt16RMM+7RBM/Gq3F8sMf6ty X-Received: by 2002:a17:902:d4c8:b0:1d9:ad4e:5600 with SMTP id o8-20020a170902d4c800b001d9ad4e5600mr378857plg.29.1707449777292; Thu, 08 Feb 2024 19:36:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707449777; cv=pass; d=google.com; s=arc-20160816; b=yhMJSSBdP6uElPxOvG3W361uHtL/Gn+/EPpAOBDv781eeJbnXSoQGIHgp9xUweX7Ap EIdfuVd1w8nMjIX2GN6OEoTx9/YREMGUuBAdqKwCanXdGLeL0riE8X9iGu2bp2MKhDmq WNCNeCHzZHPnfvd21STpkOx33LhES7sdx4ulJgzEqD5qN0KqFcKxn0cIb1/uf+3GbxnD t0kAVt+rGDjiaJgLWIF5/RY9XtJdrgtwFSej+z7fmLnM8KMQ/fIPre6ygRtTFrjdaXYx /gsEaV06qARbhFh9xrWhmSpu2oDutggFsstqyPpVRWrwKn0VpFdclEKOUvzgofiLayc8 wkyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=O8vfh9AdzWzoQSOI9FHtdsUgg5XT6y5eCsn97EyqRNI=; fh=GEthRwBjKniwGr/6goTyeBiERObPSA4+w9Zki/+yqZI=; b=OiaW4BlSsab3gmZfy5WrqlwVsn6f2E46cwP4hLfE1WpleqY9LPD2vr3X4xDvMAnp6C s6RbqNDClk+U1KPtdsNFfCYBm7LnaaGh7uOUg+A0tfuHduXbALc/cwL/fZEBEEBjIFIb Gaon9G5j/qPIG+GFwpKp0Uw1Nq3WBYatmQQcZ2vnD3sEBL3sHYpzL9I9n0rp4SWb2HKY s3KpMjG/+K05eM3yN0crkMnkk+epO7n8trJ0Y0Sn+xQKABvfnCUCzbVlyuar4MFYQHnF oOLwgSfXrey/W5d2TTbkZ0wKNhLGgVCvY2BOqMEvCT1crqtWnka7ZECQ6BJeCAJkCorA /emA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MvnuPpkT; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58980-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58980-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCV10A3hObNpeF0lLYTifhggJycZBlvFQUm4w/6MjWneImlLgxlLbctVufrUIUv7cLAaoqW36Iv9+loIkTlNax+qlqiSTQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ja15-20020a170902efcf00b001d95a6b0b54si843376plb.252.2024.02.08.19.36.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 19:36:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58980-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MvnuPpkT; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-58980-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58980-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3A661B24DA6 for ; Fri, 9 Feb 2024 03:19:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACFFD39AC2; Fri, 9 Feb 2024 03:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MvnuPpkT" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C53D25610; Fri, 9 Feb 2024 03:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707448501; cv=none; b=nQkAPqIHakcMJTnv2TOIk0oHQ5VQ2G96HowL3fIfgm6yfZiQ1EzWeWXf3TRrNoBe3PB0a17Y21LeSDCm2J2YxqApBBl68WU9AI0d2RUAIKjHCsUBv+RHlv5mNSnvXLNEsYQN6ZwU32Yp3/XR6c5oK+wb92x/eeFylf76O+CEkdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707448501; c=relaxed/simple; bh=UHYv/wd8Tx2Q5u/rY/pti40zJf3hKXnFNuJLdQgtOuo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eG03dlf1P2vqToihW3g+2L0micwUf83CTGGbb6cDXVo8trX8+xa83Ub26FjFw5bjf5Zki6p9QP2iLXOUVYVMD4opfLTIzR5DqkAGcPu/BEux6KlBQjwSMEKVUg9pUdInnBfrBHeF4dxhwhXXVjEuHTU0zye0Myai/LvELv9kZqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MvnuPpkT; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707448499; x=1738984499; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UHYv/wd8Tx2Q5u/rY/pti40zJf3hKXnFNuJLdQgtOuo=; b=MvnuPpkT2/KZ6zS4y8pvDvbb3cDm/0MOALVBKWSpREpLkoKfwRKwsRZV p6GXRuv6sFMhPfGdxQzDaR1xcR+yc9Jlf9F4slSBDmbe9GYbw0SpM5kAS RTilMKcykHgID+m2T2lpLs8dMWj7qyjgnoN6TWCpsVHwGrBcYt1/7Fd1W ga/L1VQH5H2rMsiBaGnzBko2+QzJtNtrVsVP4UyvaVkrRGHSblnSeXZe1 wOvbcWu68Iu1oubh9YMxzlKJr3Cur+u678p3NeGbvWv3fZeEXSzhIlyGp F4++1DbtKg6GSdAldW3yUdqNpRnaVsf5xWezLvO/MF/v1U3X/66iTVEAd Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1257954" X-IronPort-AV: E=Sophos;i="6.05,255,1701158400"; d="scan'208";a="1257954" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 19:14:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,255,1701158400"; d="scan'208";a="32631469" Received: from b49691a74b80.jf.intel.com ([10.165.54.183]) by orviesa002.jf.intel.com with ESMTP; 08 Feb 2024 19:14:48 -0800 From: weilin.wang@intel.com To: weilin.wang@intel.com, Ian Rogers , Kan Liang , Namhyung Kim , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers , Mark Rutland Subject: [RFC PATCH v4 15/15] perf stat: Add hardware-grouping cmd option to perf stat Date: Thu, 8 Feb 2024 19:14:41 -0800 Message-ID: <20240209031441.943012-16-weilin.wang@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240209031441.943012-1-weilin.wang@intel.com> References: <20240209031441.943012-1-weilin.wang@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790390857996973366 X-GMAIL-MSGID: 1790390857996973366 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index d08a40c4bae1..e30f7a856122 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1257,6 +1257,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, "disable adding events for the metric threshold calculation"), + 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,