From patchwork Fri Feb 9 03:14:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Weilin" X-Patchwork-Id: 198729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp603366dyd; Thu, 8 Feb 2024 19:19:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IExZQZfHKQR4gB8f24S3q2DPpv2pGA7O4Ct391u1Df98h32WhpdPvzcrgZQniygPox5JUPM X-Received: by 2002:a05:620a:3dc:b0:785:5efd:fc22 with SMTP id r28-20020a05620a03dc00b007855efdfc22mr472481qkm.11.1707448740686; Thu, 08 Feb 2024 19:19:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707448740; cv=pass; d=google.com; s=arc-20160816; b=yEUckgE2xJAm9QzGThhXoPAjYUmU7EIf6MNFiY3lgdCPxvJRgXaIs5RmcV/M2rfqrG 7uZCZ0pH2lY6OOKV/v5zzUUGmgeGf4tJYeLxGv/8Owuw9D7CRC4vtTQJdQtXLYWiahuQ 7LSTBMdPQX3U4uLlv7eWLwQQZ1/+3Vh24uOuBO0QXW4+Zzk+fbszV0912ikHyt/WsT05 s6xVBn2GoV6vrxdHwd5KjbagSefVFnJOSht48x248b8x0sBDX2i99gGS+Bx/MbXh+rk/ vyph4vAupxbwOXN9UAhekJREJVVVhJsTph3lyjAgW2Cblc9/tp9fJQOw9C+ppuaoanTp ce3w== 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=sprFx4bZ30C0GLwPKmPka9LXaGYqs99o+NarEg714E0=; fh=Cg2Lf4VfOgzNOwgDQRFr8glYFjONudX9KrdqQrp8XDU=; b=e7YlkRofhKQVsHTzvDDIoTdlhSHh004lyA1lmFKPzWASp+alYb1NstEfIV9Evmqo1u P20xdIwMzSDYC2xQUyD7CRHiytItdtHf1LqCLsZGKFmu1XgCktZ1CSjzyyoRyvmb8vO6 FBKN0tX+bTdofkzy71HqC+O6SYVl3fprLzcc4p0Bxs2FzDR9t2QaMPY7JuItx+H+iY/K u5lAxgECMKvZgQYpHmPjzXml+C7X3hswYM2KBCT/hB7qQiBPujOFWA91qyd7kEEdgtda b8svdc7tMr/QK8+Fo9As03DojYCFL8YS0ALQ+ZrL9le7f4xpniYJXs3igEz21mdGlAzJ 28/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YvX5ZOHU; 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-58977-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58977-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCX2z2MrgTjRTcU2NhiXEVzB2MJgWjlrUj7uAMnXI8w/L1eMwUEzAEHlRQLD5cvtTDiCVGM+JXL9W7T8UDcXemeerqByWA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j15-20020a05622a038f00b0042c4c4622fcsi946431qtx.738.2024.02.08.19.19.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 19:19:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58977-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YvX5ZOHU; 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-58977-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58977-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7AB271C20F43 for ; Fri, 9 Feb 2024 03:19:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D915938DE2; Fri, 9 Feb 2024 03:15:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YvX5ZOHU" 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 DAFDF1B942; Fri, 9 Feb 2024 03:14:56 +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=1707448498; cv=none; b=Ho3VBPkylD9d/eFT/hNUK/nIh/OL7wKB8Wk9MEYkHaybgvnlStYQ1uHDQzPMfzsHqz0f+nYB9TdpZKFMs+X4ynWzcrWJtqvk8M2Oc+MHOdgW2ZM/Z5mp2vL9JHpXTztq7kOhc0kYFiUHAtC/95qnCCtmJuOSB3m0e9eZCS6KEeM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707448498; c=relaxed/simple; bh=4TtYi0lpyHo54jJPp5QX24oZBCSlhJrdo5RjQxIdVIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fvkQRl9fC3Xk/1oWK1mNUi7+Pu5uz7WCaOvEL1grMaa31F3aGWUcXsaS6afKBU08Mwc7hPDjdzDrhqoxaCD0xErQYKC9TRK15GIQrgLMg2VzyFJ8x2z/x58ml4+sxLVe0jBfv7vPnq2z3qOC7wJyv9wqz1C+alb1WOlHiXE4e/Y= 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=YvX5ZOHU; 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=1707448497; x=1738984497; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4TtYi0lpyHo54jJPp5QX24oZBCSlhJrdo5RjQxIdVIQ=; b=YvX5ZOHUqwP3G1ate8wcnTfVlfuOyfr7O/qCqXAZ68Ge1r5b3JROXJLf 7cshPAcNRX5PM87/kclURq/Au/1RcycLx/Xvst0gwZMSDFdcYSrEcTiYr SKlNQU2emAolnmSDmFLQrPRiOX7/M8AfTrvDU8gdHsGQJzYZbR78/5Crd 0iMNelEADLrD6vwffGIj4V7t1WQ6dMrAktEic5y981ZJP2uP8IXgAd84X ZO47tYgfliOQ7n202VabwbSTqtzm57wNorgjJVWF3EHuHTNetSDEEIk0q HCnhqibMWTcXVnUOt/RhKid6vaUFMggutMT/nPyXBwVrjBoCpHplRPq0K w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1257945" X-IronPort-AV: E=Sophos;i="6.05,255,1701158400"; d="scan'208";a="1257945" 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="32631450" 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 12/15] perf stat: Handle NMI in hardware-grouping Date: Thu, 8 Feb 2024 19:14:38 -0800 Message-ID: <20240209031441.943012-13-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: 1790389770733860097 X-GMAIL-MSGID: 1790389770733860097 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. 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 95d3868819e3..f1eb73957765 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -1947,6 +1947,10 @@ static int insert_new_group(struct list_head *head, size_t num_fixed_counters) { 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"); + num_counters -= 1; + } fill_counter_bitmap(new_group->gp_counters, 0, num_counters); fill_counter_bitmap(new_group->fixed_counters, 0, num_fixed_counters); new_group->taken_alone = false;