group.c 554 B

12345678910111213141516171819202122232425262728
  1. #include <stdio.h>
  2. #include "api/fs/fs.h"
  3. #include "util/group.h"
  4. /*
  5. * Check whether we can use a group for top down.
  6. * Without a group may get bad results due to multiplexing.
  7. */
  8. bool arch_topdown_check_group(bool *warn)
  9. {
  10. int n;
  11. if (sysctl__read_int("kernel/nmi_watchdog", &n) < 0)
  12. return false;
  13. if (n > 0) {
  14. *warn = true;
  15. return false;
  16. }
  17. return true;
  18. }
  19. void arch_topdown_group_warn(void)
  20. {
  21. fprintf(stderr,
  22. "nmi_watchdog enabled with topdown. May give wrong results.\n"
  23. "Disable with echo 0 > /proc/sys/kernel/nmi_watchdog\n");
  24. }