Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp176259lqp; Fri, 12 Apr 2024 14:14:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhLhu0pTOkewyD4OSft4KJy2du0CHfpdHfMlcbR9DzEr7Jmv5JBk0lKRtX7MUvRomi32Tatg1XwW6qC1Ut8Q30aMF19rtfSgWAZx+1Wg== X-Google-Smtp-Source: AGHT+IHyqXxslVqD7D9IWAxA0J8lUSSorrDc7GKlVSCeR6I/TopFNysPjZdo2HhkpwFZrZaAc2cY X-Received: by 2002:a05:6a20:3209:b0:1a7:1e1c:3031 with SMTP id hl9-20020a056a20320900b001a71e1c3031mr4099848pzc.36.1712956441639; Fri, 12 Apr 2024 14:14:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712956441; cv=pass; d=google.com; s=arc-20160816; b=XIs/QZv7exucw7mBSXGr9K6zLKjDcEAYNcJ6kgSvycBUcF2/GTOwKjE2C0tA93UYpZ GHPi2ZGJa1nQZqDWbXvBmkDzQBDyxCQyQ9RU6DR+H186xFl9HIJNLCRmRTZlbx3uclC9 1jjmltAAolbgls8SEPzlDz0TORC57njvskOEWMQpVqVC+3UkQI14LOJ69uC4H4GgguNA OPUsov2xqdSW7sge7fPbAM+wqnLUnaupylJ/jD3/fNcyt3I+rJnvuyS8r78TdSq+Pzvx nVDg4iZt0eYt/dY+o191ikWPW8lUSc5SY744RjfZVMtWcWAEhNGyhkeZHjxCuKJ+RN4v fkpg== 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=ydQBxm1aE2OoJA/htyaDZ9acpDxMIdoN4si0WAOtVYo=; fh=2mx6v3byCNS4RNMabLmfY6Bz0Xn6VvJsmk1bF8Vd49Q=; b=jTbAunb+66sX8TvMrtooXOgSEJHyQ50CaVWwAqJ3uhy/KAWMfDfDhZpyQmn8HCcii+ nkwO2GSPvSJKtrPmwOL9jBqMlcScFtbybcaU0Ud1sEKiFFeK5wodLC7mWJCUkWV7u142 0UMBZwv++rhs4eUo0ZdItGzFgGwhuwOuZGQjR01cXTykcaq+qTj72zBA4qI1GEQKy95n QeYJMoMyfq73YE3EFbGr4RG+XuMhPGGyVINbSdjEtaoVziybbPTXyI4zLhp2kmV1sR86 XvaKJzvJcE4l5V1DMXicgIxCstRLZNlT8x23JtRjuKNbfMqiD3CJs/ETiAsyOGInf8mM HXwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S9JR3dqg; 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-143365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t5-20020a63dd05000000b005e2b17cd8a0si3857527pgg.270.2024.04.12.14.14.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 14:14:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S9JR3dqg; 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-143365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143365-linux.lists.archive=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 72AE6B253F5 for ; Fri, 12 Apr 2024 21:10:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91D2215381B; Fri, 12 Apr 2024 21:08:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="S9JR3dqg" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 1B965152E0F; Fri, 12 Apr 2024 21:08:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712956099; cv=none; b=CR7Ap3jCtrlDq6TvsUdvvEJ+HTcDCCGGPyPnvMS0XRgcB30G211X74CJKhHSMrW4VsYzs+fchHKo/o41ij2DmOO4gD7eN3BFfIQXaUjUfbdKQ15ccYBUbn/FB/vGbAtvGtlzl4BshG0ncFTuXdXPNL1CCH4/auX4u0qmuVygTRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712956099; c=relaxed/simple; bh=SLRT/YXI45DriY5Ez7bnNSFDk+ZX/MfZJIlKThgJlpo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=STs532n8rtLNapoRpwnbAWvSvEVBlj8ksMbFlR2qdlO6yUbqLECBI4f/PeYbon0x0gYlQhsi00PQq6vjgaVd6JupSaDVoewlhVU/iW+kWlhwajxaUGmTBHsdsQHECBxyNAdIBmPAr7N+6u+TNfi5FQPRRJT+Cuq15+vIe37xzjw= 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=S9JR3dqg; arc=none smtp.client-ip=198.175.65.13 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=1712956098; x=1744492098; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SLRT/YXI45DriY5Ez7bnNSFDk+ZX/MfZJIlKThgJlpo=; b=S9JR3dqgFcs1uLSZHjEky6YDOKt5GjzkFyghurYh9ees58qjKM4zo2kO cfcHvB+4NIXLwboXP1n36YE0qCshFtaI4Z431rW6g6hMAXmEUnttq6sDt yDDzdCNz9j4FTCJ2akk9Sev46k8hVD9qxrDXjgViy96Alj6U6dAsMouci /SskbRmmxdhyvTbofya6Zv64QusWGcOJVxiMxettAdzqeyQ9DAqKpsAcE guR66npLcz/YIkxz8r9od7NkEsy21hwbetzNm8tzw3cgXHK5Tr7J6gQhP iAFVP/P2laY4FNa9doWjnunAGqvjmmuMOGbA//paaHDrCMPIaXSgpAHVS g==; X-CSE-ConnectionGUID: j83IAigkQAyJXzlZfgLi7Q== X-CSE-MsgGUID: WP9QZJH3T7uZ8A5pBmfOiQ== X-IronPort-AV: E=McAfee;i="6600,9927,11042"; a="19575488" X-IronPort-AV: E=Sophos;i="6.07,197,1708416000"; d="scan'208";a="19575488" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 14:08:11 -0700 X-CSE-ConnectionGUID: sqyXSFLWTg+rLmERYp2xNg== X-CSE-MsgGUID: F1OduXFwQFO6CrRLWdmANw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,197,1708416000"; d="scan'208";a="21772114" Received: from b49691a74b80.jf.intel.com ([10.165.54.183]) by orviesa006.jf.intel.com with ESMTP; 12 Apr 2024 14:08:11 -0700 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 Subject: [RFC PATCH v5 12/16] perf stat: Handle NMI in hardware-grouping Date: Fri, 12 Apr 2024 14:07:52 -0700 Message-ID: <20240412210756.309828-13-weilin.wang@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240412210756.309828-1-weilin.wang@intel.com> References: <20240412210756.309828-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 Content-Transfer-Encoding: 8bit From: Weilin Wang Add an easy nmi watchdog support in grouping. When nmi watchdog is enabled, we reduce the total num of events could be assigned to one group by 1. A more efficient solution will be added in later. Reviewed-by: Ian Rogers Signed-off-by: Weilin Wang --- tools/perf/util/metricgroup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 9548654c9f6d..31036035484c 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -1993,6 +1993,10 @@ static int insert_new_group(struct list_head *head, size_t counters_num_fixed) { INIT_LIST_HEAD(&new_group->event_head); + if (sysctl__nmi_watchdog_enabled()) { + pr_debug("NMI watchdog is enabled. Reduce num of counters by 1\n"); + counters_num_gp -= 1; + } fill_counter_bitmap(new_group->gp_counters, 0, counters_num_gp); fill_counter_bitmap(new_group->fixed_counters, 0, counters_num_fixed); list_add_tail(&new_group->nd, head); -- 2.42.0