Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp681107rdb; Thu, 8 Feb 2024 19:18:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFqEAUUtsMAScpFugxr5ka9cEI2Al6MV+18+WLFyKlziTsPUHGtN9CEonNfTMQz8ZB8ziq X-Received: by 2002:a05:6402:1f0b:b0:55f:4d6a:c0ee with SMTP id b11-20020a0564021f0b00b0055f4d6ac0eemr561107edb.7.1707448687650; Thu, 08 Feb 2024 19:18:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707448687; cv=pass; d=google.com; s=arc-20160816; b=RswbmCW7ZxA0etT3pUmjwG7f+/cK7J3zm6BW9L08yY3JVCGtnwFsdxeaTKtubuoxey TCgmYbIR8a47Ag1qWA+uqkxIC89K13hAT8WXiyWoCDXeqn7tE/bpHnWo1pn3uo3niqhk Ry8oPORRNRJAqRgtu6VA2vAWgWQZD/OoeMHU+c7hUTvYEWgLpZZprWyZlYCI0LdyXtXL LfhjxKQAjFyyh/aySDLnpLy3tXuEKa+xnNEGmTOUAD2HGvBJCod7XKcSfpE3jtpxeX3x wKJnoWGePGIAoVAJrVhP6qh8hovLDJpxcnCdcLQ7T6ydqsvftLz5erDd5pz/6A45QL1U lHfg== 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=mi63vZEkJ5kUxFm5vA9axWCX1wp1Mv8XcLqHUvuA4aY=; b=KYMp5Ms+Xd4UXX93QdO4gwyMUiWziT8eKMTJHq4FvG3QaLPhJOzhRSAo3wZGu/W/SO 69+x/VEc28+zMf+jY5qUXsN7Lzll5XO4rWhG+tpFao9m88YohDERdlFPRXtXMN/oMrGn LDBOvoGRQkAnaUT2DIi24ew9j7Vlb0LX8RMhhjhuU3X2sI5sqyygvudj0tTZMqDABwgz Dmascm5BTBxaxqQWkL3gQO01IQ+ASSMwJZJEHxfZnk2ty3H1QGXyk1hCSEdDq8G+TAoe BZqNJUc+N+4WDZaH9MZTfX1B+HBY5UUW2K52BD12+aANYZew02JW49ERAlyyVf+TzWpy Emqw==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58977-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUXg8LYUqymM3SDomEuyqcszT1gMum1f3WZNuZzVAEUYyro1lk32CGnpY9qRI+x+5A/DSFB2wHE0Ut9T9Uj4GPo9FNPegQkoskLM7ejCQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u23-20020aa7d997000000b005600b00a5f9si378736eds.524.2024.02.08.19.18.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 19:18:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58977-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58977-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3A2B01F21814 for ; Fri, 9 Feb 2024 03:18:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B61634C9A; Fri, 9 Feb 2024 03:14:59 +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 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. 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; -- 2.42.0