[RFC PATCH v2 14/17] perf stat: Handle NMI in hardware-grouping
From: weilin . wang
Date: Fri Oct 13 2023 - 21:54:20 EST
From: Weilin Wang <weilin.wang@xxxxxxxxx>
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 <weilin.wang@xxxxxxxxx>
---
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