Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1026949rdh; Mon, 25 Sep 2023 00:25:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeAHmRDnI+K3wL2b8+XPeOP5mriOVZwu/tdQ0kGofeVSvfvMG62nf7MrGvkWDiH6eYNXlI X-Received: by 2002:a17:90a:2c81:b0:276:df1d:61ba with SMTP id n1-20020a17090a2c8100b00276df1d61bamr5648310pjd.17.1695626753706; Mon, 25 Sep 2023 00:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695626753; cv=none; d=google.com; s=arc-20160816; b=khNQ+46yABN5UPpf4lHqYBBWQT2M1wEm2g65Eab7ghYwF34BKAOfdwUoZyI5HyFmRd /SwnJ8fdpG76s9B2lipAlLyUKayrtmedIqvjiqGZ6tZbWGOdJR3ijwsN4IsEtEwP8mPd 0T1hOxmoambwDXOGKBIQPamj71yJTrBFNdhbd+K7faZCheMuR1PdP+Je+egSI0OxbQjf G7QKo7aj/ulTF4k3mf0TIkX93WJMecc+dp/5MQetVXyh/xht8B44dl/Qix78YQIiEZOY J0O2g7WaY5s9MTtv40cE5kEsTm4ILnxVYRGfNKK267lFWZHSva1fcbb2wXunVOMtk7me e3KA== 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=0BlgpEcuCrASN1wiyoZu4cXpCXOLjYPSpI8x6vSRVOM=; fh=aicQXd2sVDKynU70/92qv+8AnsPgYK5pq7fTzS41MP4=; b=FJRd/4FgMhFUfZUhZQ2suHBLogPYDlOJyECIQLbu+qIGk8RXKnpTKwiuqVrKjlI15I I2SkjBKVzhOkEAWaB0pUEDGKgBk/8FFlcXgSt6peiNFyc/tCsdawzlppqKv1GriI9GHh v18tOxSCWQqgZpxrvlKxsLBQnPsYCAMnb/wjFHzBED91NhpCmGJUHY7/RBrQMk6y0Cb3 Bfp+S7gUbjF+/ZsJlyQPAO9TXX2rhxZ7GV9W5EBMgEd+TYnLRpfx0xkV6zfHxn87Fthk aCwCcUgMkvfiwaRFdg/Pw28ErB0Dv71PtNf7tETPf8662lupJOsplUOtyWbNk71+/0P2 rYiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S0Bt7kgz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id w11-20020a17090aea0b00b002774f38c8f6si2370778pjy.29.2023.09.25.00.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 00:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S0Bt7kgz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 5492A82A41E9; Sun, 24 Sep 2023 23:21:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232289AbjIYGVP (ORCPT + 99 others); Mon, 25 Sep 2023 02:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232180AbjIYGUQ (ORCPT ); Mon, 25 Sep 2023 02:20:16 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13623FC; Sun, 24 Sep 2023 23:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695622805; x=1727158805; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HuA4yAmfyh8wdJhemtg1Bqk3t4Ev3a11ADmaGIxjGhc=; b=S0Bt7kgzxgRjAWukG23T3Gtngw56boP0aeVIBvuofAWIUF0NExdL8j5w eNxXXS1+ktaN5Zs1cz+HIDuk/OftnkWYv8lYyOoy15SIYEuvyUtyl1woN mMUTF1Q1W2QytC6uI9Svdk8ftpeLmbjvm0Rh59Ebbo0YYyALORxoQDb6C StKohGNjWYdfIp6oYoSkMl6i+ijU97vJ9cIdn/mpak+furRY/FvOWqMDw fk2Oiqfd0GyDB7YUk3a2OHVv73zdARVOvoa2lR6cYceh/km0gXdX8Be6j 6kfoUOJVNvQYcny1cMbCoEk0BUGrwtVyqRWXF5wCFKiu2n4KaY9DY6Bhl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="445279522" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="445279522" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 23:19:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="818494407" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="818494407" Received: from b49691a75598.jf.intel.com ([10.54.34.22]) by fmsmga004.fm.intel.com with ESMTP; 24 Sep 2023 23:19:21 -0700 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 Subject: [RFC PATCH 18/25] perf stat: Handle NMI in hardware-grouping Date: Sun, 24 Sep 2023 23:18:17 -0700 Message-Id: <20230925061824.3818631-19-weilin.wang@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230925061824.3818631-1-weilin.wang@intel.com> References: <20230925061824.3818631-1-weilin.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Sun, 24 Sep 2023 23:21:25 -0700 (PDT) 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 020db8e61..1086da84c 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -1850,6 +1850,10 @@ static int insert_new_group(struct list_head *head, size_t fixed_size) { INIT_LIST_HEAD(&new_group->event_head); + if (sysctl__nmi_watchdog_enabled()) { + pr_debug("NMI watchdog is enabled\n"); + size -= 1; + } fill_counter_bitmap(new_group->gp_counters, 0, size); fill_counter_bitmap(new_group->fixed_counters, 0, fixed_size); new_group->taken_alone = false; -- 2.39.3