mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip:perf/urgent] perf stat: Only print NMI watchdog hint when enabled
@ 2017-06-07 15:57 tip-bot for Andi Kleen
  0 siblings, 0 replies; only message in thread
From: tip-bot for Andi Kleen @ 2017-06-07 15:57 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: tglx, linux-kernel, acme, jolsa, mingo, ak, hpa

Commit-ID:  918c7b062a0f9198d9503cfece0210c1743c0f88
Gitweb:     http://git.kernel.org/tip/918c7b062a0f9198d9503cfece0210c1743c0f88
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Mon, 22 May 2017 18:00:16 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 2 Jun 2017 11:15:34 -0300

perf stat: Only print NMI watchdog hint when enabled

Only print the NMI watchdog hint when that watchdog it actually enabled.

This avoids printing these unnecessarily.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/n/tip-lnw7edxnqsphkmeew857wz1i@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index a935b50..ad9324d1 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1578,6 +1578,7 @@ static void print_header(int argc, const char **argv)
 static void print_footer(void)
 {
 	FILE *output = stat_config.output;
+	int n;
 
 	if (!null_run)
 		fprintf(output, "\n");
@@ -1590,7 +1591,9 @@ static void print_footer(void)
 	}
 	fprintf(output, "\n\n");
 
-	if (print_free_counters_hint)
+	if (print_free_counters_hint &&
+	    sysctl__read_int("kernel/nmi_watchdog", &n) >= 0 &&
+	    n > 0)
 		fprintf(output,
 "Some events weren't counted. Try disabling the NMI watchdog:\n"
 "	echo 0 > /proc/sys/kernel/nmi_watchdog\n"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-07 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07 15:57 [tip:perf/urgent] perf stat: Only print NMI watchdog hint when enabled tip-bot for Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®