From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243AbbJBUkc (ORCPT ); Fri, 2 Oct 2015 16:40:32 -0400 Received: from mail.kernel.org ([198.145.29.136]:50180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbbJBUkb (ORCPT ); Fri, 2 Oct 2015 16:40:31 -0400 Date: Fri, 2 Oct 2015 17:40:26 -0300 From: Arnaldo Carvalho de Melo To: "Liang, Kan" Cc: Jiri Olsa , "jolsa@kernel.org" , "namhyung@kernel.org" , "ak@linux.intel.com" , "linux-kernel@vger.kernel.org" , Stephane Eranian Subject: Re: [PATCH 1/1] perf,stat: reduce interval-print to 10ms Message-ID: <20151002204026.GC20515@kernel.org> References: <1443776674-42511-1-git-send-email-kan.liang@intel.com> <20151002165624.GC1673@krava.brq.redhat.com> <20151002200843.GB20515@kernel.org> <37D7C6CF3E00A74B8858931C1DB2F07701953D23@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07701953D23@SHSMSX103.ccr.corp.intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Oct 02, 2015 at 08:22:06PM +0000, Liang, Kan escreveu: > > > > + if (interval < 10) { > > > > + pr_err("print interval must be >= 10ms\n"); > > > > + parse_options_usage(stat_usage, options, "I", 1); > > > > + goto out; > > > > + } else > > > > + pr_warning("print interval < 100ms. " > > > > + "The overhead percentage could be high > > in some cases. " > > > > + "Please proceed with caution.\n"); > > > > > > with '-I' 10 this warning flies away quite fast ;-) > > > > > > I guess it's better than nothing, and I'm not sure about putting some > > > sleep after that warning.. > > > > > > Acked-by: Jiri Olsa > > > > Right, this should appear in the man page as well, I added the patch below, > > we could also print that warning when the workload ends. > OK. We can print the warning message again at the end as the patch below. > > +++ b/tools/perf/builtin-stat.c > @@ -1377,6 +1377,11 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused) > if (!forever && status != -1 && !interval) > print_counters(NULL, argc, argv); > > + if (interval && interval < 100) > + pr_warning("print interval < 100ms. " > + "The overhead percentage could be high in some cases. " > + "Please proceed with caution.\n"); Yeah, something like that, but the warning then becomes strange, "proceed"? I guess that something like: pr_warning("print interval < 100ms. " "The overhead percentage could have been high. " "Take that into account when interpreting the these numbers.\n"); Right? - Arnaldo > + > perf_evlist__free_stats(evsel_list); > out: > perf_evlist__delete(evsel_list);