Re: [RFC PATCH] perf/stat: Add --disable-hwdt

From: Ingo Molnar
Date: Sat Feb 11 2017 - 15:41:42 EST



* Borislav Petkov <bp@xxxxxxxxx> wrote:

> On Sat, Feb 11, 2017 at 06:59:10PM +0100, Ingo Molnar wrote:
> > So I checked the perf-list manpage and it didn't tell me much about how to disable
> > the NMI watchdog.
>
> Oh, it is buried there:
>
> "
> EVENT GROUPS
> ------------
>
> ...
>
>
> Globally pinned events can limit the number of counters available for
> other groups. On x86 systems, the NMI watchdog pins a counter by default.
> The nmi watchdog can be disabled as root with
>
> echo 0 > /proc/sys/kernel/nmi_watchdog"
>
> > How about a more proactive hint, something like:
> >
> > To disable the NMI watchdog permanently, do:
>
> Why permanently? We want it to run and be disabled around the
> measurement only. Anyway, here's something more to the point:

> + if (print_free_counters_hint)
> + fprintf(output,
> +"Some events weren't counted. Try disabling the NMI watchdog:\n"
> +" echo 0 > /proc/sys/kernel/nmi_watchdog\n"
> +" perf stat ...\n"
> +" echo 1 > /proc/sys/kernel/nmi_watchdog\n");
> }

Ok, looks good to me!

Acked-by: Ingo Molnar <mingo@xxxxxxxxxx>

Thanks,

Ingo