Linux 4.16-rc1
[cris-mirror.git] / tools / perf / arch / x86 / util / group.c
blobe2f8034b89733200f81e3cc76f9b522b114ef080
1 // SPDX-License-Identifier: GPL-2.0
2 #include <stdio.h>
3 #include "api/fs/fs.h"
4 #include "util/group.h"
6 /*
7 * Check whether we can use a group for top down.
8 * Without a group may get bad results due to multiplexing.
9 */
10 bool arch_topdown_check_group(bool *warn)
12 int n;
14 if (sysctl__read_int("kernel/nmi_watchdog", &n) < 0)
15 return false;
16 if (n > 0) {
17 *warn = true;
18 return false;
20 return true;
23 void arch_topdown_group_warn(void)
25 fprintf(stderr,
26 "nmi_watchdog enabled with topdown. May give wrong results.\n"
27 "Disable with echo 0 > /proc/sys/kernel/nmi_watchdog\n");