Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1315592rdg; Fri, 13 Oct 2023 18:54:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG984T92WMjqHdxXGd8DNGHjXLG4/5V0wNogvGIyd0huDpKpkqLC81bKiKpy+pgWc8LqER/ X-Received: by 2002:a9d:6a50:0:b0:6c4:f91d:2d9c with SMTP id h16-20020a9d6a50000000b006c4f91d2d9cmr30651600otn.23.1697248476804; Fri, 13 Oct 2023 18:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697248476; cv=none; d=google.com; s=arc-20160816; b=wluJ1pi2mDef64CFrltmzzdYQurQKDM5WpS1s1ly/Zol5Pxo/F6P9R57esqS+ZRk3D Cp8Gr3KhGmzhSlo86FIRYcce5Zeq7YWjLKvgNb2E/1bRf/b5Jx82TFeA/yIwdfATDFVc qJB7JbM9H7vshocF1AZf4Oif/CmZMglIOvpUEughhsv5juT2e7CS9/XCgPEit230TYeJ eyGsVhMYGotMTzG3gdbbL6X7LvqsOt/QZJ0JbG2Y7g3nGK6BguIFvJcBckqvKIU2rK48 tXx9nUiR8vfdit/N2aLsFUI+GOK1LIek7D5DM7mdiTZcvgYku59Zu1HQ/nhHutT0F3Co AjZg== 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=YTFs5lPVaUBQncWCtqm7tArxykFjQ8mqeyP2IZYyKic=; fh=fjecWn2tsXHKF5pPtw+gI2dQE/iSXdFsWSc8KUP/zmc=; b=AvjRHTlecG4HG90V6lL5A8LxuvmQ55Uf8/PHR8jdjCknybFl32u4Lbf+KRpTYxxBf+ 7LQOr+zVV6lmyTl7PsDo5dyM9s3p8cxNut3kNYxQYSPVB94bcKA31ENZ9irvOVNDSaM+ LThuEhsofr9iF5QSD6tBDGplq9p/BiembrZXNN4SzuSfPakTCQpgLSFgbPAlqJYeAjHi 2Shvo4mtGZ/6Roa32UDK2pcaOmNTJxTCEfCWcW6EVH6x4XlGBGsF8cKr6Ev5U9DhRRRf BmGvMQz1IznnYACyZp62/xHoVvF9X0As9oyM8YMADMuWjvTKxf+Ezy4ZP0pWg1gYmO5D ZnGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cBYbzdab; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k63-20020a638442000000b005ab92870413si2670130pgd.498.2023.10.13.18.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 18:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cBYbzdab; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id C85AB82EA166; Fri, 13 Oct 2023 18:54:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233022AbjJNByT (ORCPT + 99 others); Fri, 13 Oct 2023 21:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbjJNBxo (ORCPT ); Fri, 13 Oct 2023 21:53:44 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 674D6D9; Fri, 13 Oct 2023 18:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697248397; x=1728784397; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0uLpjWx1obqDK1PkrFKF6z86fEJ2mxGKnUvYp67G2KQ=; b=cBYbzdabwgUGZeCCbX8As0Js7tT08Rvk5qfDFvKN386QFBwgY1CGkXos S1Su2q1QO9OdpgN7zZcQNU7HqBRhlIY88cO01Zr9ZIQfsYD7QZxe37lhn B+hvS0L9+XdchAhtccq6AMBpGkTZA0UEJr8lbX3l5AmYlzwnHctrkziWO P1e5+fjyB+UyYG6timbLyqL3DOdnfYC64tH2l3aLKKuhz+3AarwJ87yVS PXOyTKwOoxztNiws262SqrdsB1Hw7uMzofQ6XVH6gnOgHADBL1jzbJgdO A1m9CW3rypjtgV+WKUUXgOAMm53IySmL8KbYe36gqKmKahCUfijIOMfnt A==; X-IronPort-AV: E=McAfee;i="6600,9927,10862"; a="389154771" X-IronPort-AV: E=Sophos;i="6.03,223,1694761200"; d="scan'208";a="389154771" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 18:52:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10862"; a="731565699" X-IronPort-AV: E=Sophos;i="6.03,223,1694761200"; d="scan'208";a="731565699" Received: from b49691a75598.jf.intel.com ([10.54.34.22]) by orsmga006.jf.intel.com with ESMTP; 13 Oct 2023 18:52:20 -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 , Yang Jihong Subject: [RFC PATCH v2 14/17] perf stat: Handle NMI in hardware-grouping Date: Fri, 13 Oct 2023 18:51:59 -0700 Message-Id: <20231014015202.1175377-15-weilin.wang@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231014015202.1175377-1-weilin.wang@intel.com> References: <20231014015202.1175377-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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 18:54:33 -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 100c9d948..7da91cbd3 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