Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4969719rdb; Tue, 12 Dec 2023 15:05:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXqK8maWfbYCrgpjil4ghDMZ88T+HAtMztPutY/3oUPWsaudwXLB9KsTW0YuvMTqDMFl00 X-Received: by 2002:a17:902:c946:b0:1d3:4860:591b with SMTP id i6-20020a170902c94600b001d34860591bmr516618pla.0.1702422310610; Tue, 12 Dec 2023 15:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702422310; cv=none; d=google.com; s=arc-20160816; b=hz6xOZLfrCtJZhbXGlwuJVQ/f/MByVp/z+RoyRUQHaskaDvFt71yVYoQ6ojWQQQ3+m cVyXnd7+7wPsvglnic60zv3MlHN/lmvGsQgj7dOXst9RfL9x1zVU6cx0JUUWuwx5FSyL QPOTLr95Bd1Gnnr91LZIbvKhCXLHRWrFjZEE/wT2zUIXFmhUQFkBdub4Cc8jm2FSqvpA tNE9c8WrO+klBuYbUZELggZTSULRVmnwFaiUxd4qjZM/2CUD9HYJMpTqXji81cZ8l137 vtFaLokqNkNzp+6ZpYviqvQ3HsssoN2oBuKFONdadroZaC4Opu4r7hzA1SFmhBH61YMJ lFZw== 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=vLbrrDam3Bw4WWJUEOnRnJiH4KHW7gOVqTtUcMPcugU=; fh=fjecWn2tsXHKF5pPtw+gI2dQE/iSXdFsWSc8KUP/zmc=; b=n9b9jlN8GiPr8wqRCfmNUEjEgTr196Te3ZboNH9VaGxeKBxa+LAEiCvd2uNUSZZu0w 6A7ADlTnGTK0YtGbWMtLp6Rigy7Y7k0kcc7XDJ8dM63HCDS/APEMJWgyWS6PXvvdKGaR yHghqJpfDBwTH/5MXq4wXIDMk29kaT3YV3xK2qJuwTnwdda2bqaGLBk51oM6vmpqfLnT tyxfeR0nsjBRwybI6UJkyvnmeTKEm9GMxcc6d+Ct/h9b1LAgw0RgJsAJMF5WCC/fVU3E PyCSLcOfGQPsuId+N6CdXEqyJcq7sE5Wn0suezEBFtmTcNinqFhsp1g1FPE6wd+3wk1X FssQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i4V0nu02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l12-20020a17090270cc00b001d33c368c1asi1415932plt.9.2023.12.12.15.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 15:05:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i4V0nu02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 026A5801B657; Tue, 12 Dec 2023 15:05:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235300AbjLLXEu (ORCPT + 99 others); Tue, 12 Dec 2023 18:04:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378036AbjLLXEN (ORCPT ); Tue, 12 Dec 2023 18:04:13 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF8CBD5B; Tue, 12 Dec 2023 15:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702422238; x=1733958238; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lGmUesm6oK9yWEhQ+Jh1h3QfdLQsmdyaf+eqEcUWR4A=; b=i4V0nu02IkVqZVC2ERskwkDQ8LNOn9vCHykSZHcP9/0N7hmSYuXhsLlj N5AwtymhJSGhCw+IE9sUAer/pcNcAQ66raRYyVlpMJCkfr4xcaE6mV5hk YflPcQgN6f51GuWTBtIxd2PRQ66F1t7Wk/lRD6T/+iuuzwR3oAYHyLxxn idpvzSgDCvEpThLB1W/2Mvc7mIztFjgrSnNtsiQr0NuCTjxGUJKA1GNrQ 1Ul/GiV/pYLEo0insqZcGm0FJQpt5AD34/YSXem8CjXm2dHJbi1jXgDeZ 5iyCgPoF3EwTjzGix/S9J6mlV1PpJRGzyr8zh2JXRBOQWW7De/n7+NxIZ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="392056024" X-IronPort-AV: E=Sophos;i="6.04,271,1695711600"; d="scan'208";a="392056024" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2023 15:02:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="864392031" X-IronPort-AV: E=Sophos;i="6.04,271,1695711600"; d="scan'208";a="864392031" Received: from node-10329.jf.intel.com ([10.54.34.22]) by FMSMGA003.fm.intel.com with ESMTP; 12 Dec 2023 15:02:56 -0800 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 , Yang Jihong Subject: [RFC PATCH v3 14/18] perf stat: Handle NMI in hardware-grouping Date: Tue, 12 Dec 2023 15:02:20 -0800 Message-Id: <20231212230224.1473300-16-weilin.wang@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231212230224.1473300-1-weilin.wang@intel.com> References: <20231212230224.1473300-1-weilin.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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]); Tue, 12 Dec 2023 15:05:05 -0800 (PST) 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 78e607f3ad56..4df04d14d602 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -1852,6 +1852,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