From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751062AbdBKR7P (ORCPT ); Sat, 11 Feb 2017 12:59:15 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33554 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbdBKR7O (ORCPT ); Sat, 11 Feb 2017 12:59:14 -0500 Date: Sat, 11 Feb 2017 18:59:10 +0100 From: Ingo Molnar To: Borislav Petkov Cc: Robert Richter , Arnaldo Carvalho de Melo , Peter Zijlstra , Vince Weaver , lkml Subject: Re: [RFC PATCH] perf/stat: Add --disable-hwdt Message-ID: <20170211175910.GA31544@gmail.com> References: <20170206122231.GA9404@gmail.com> <20170206124116.7jmrmufthqtnd3dc@pd.tnic> <20170206124447.GA12772@gmail.com> <20170206124937.zlowglr5gpq35piy@pd.tnic> <20170206131832.GG4906@rric.localdomain> <20170206132349.bl6qbpjflez3lpkp@pd.tnic> <20170207072512.GB18584@gmail.com> <20170207105412.yrvnd3ks42jjtrtg@pd.tnic> <20170207150610.k7aptdiqtpxqd6dp@pd.tnic> <20170211170330.nm2ew4nxwa2mn3fo@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170211170330.nm2ew4nxwa2mn3fo@pd.tnic> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Borislav Petkov wrote: > Ok, > > turns out perf-list(1) already talks about it in the "EVENT GROUPS" > section. How about this then: > > --- > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > index a02f2e965628..2d18283574db 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -146,6 +146,7 @@ static aggr_get_id_t aggr_get_id; > static bool append_file; > static const char *output_name; > static int output_fd; > +static int print_free_counters_hint; > > struct perf_stat { > bool record; > @@ -1109,6 +1110,9 @@ static void printout(int id, int nr, struct perf_evsel *counter, double uval, > counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, > csv_sep); > > + if (counter->supported) > + print_free_counters_hint = 1; > + > fprintf(stat_config.output, "%-*s%s", > csv_output ? 0 : unit_width, > counter->unit, csv_sep); > @@ -1476,7 +1480,13 @@ static void print_footer(void) > print_noise_pct(stddev_stats(&walltime_nsecs_stats), > avg_stats(&walltime_nsecs_stats)); > } > + > fprintf(output, "\n\n"); > + > + if (print_free_counters_hint) > + fprintf(output, > +"Some events couldn't be scheduled. Consider freeing some counters by disabling the NMI watchdog temporarily, \n" > +"for example. See perf-list(1) manpage.\n"); So I checked the perf-list manpage and it didn't tell me much about how to disable the NMI watchdog. How about a more proactive hint, something like: To disable the NMI watchdog permanently, do: sudo echo kernel.nmi_watchdog=0 >> /etc/sysctl.conf sudo sysctl -p ? (untested!) Thanks, Ingo