linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] perf stat: enable 1ms interval for printing event counters values
@ 2018-04-03 18:18 Alexey Budankov
  2018-04-04  7:05 ` Jiri Olsa
  2018-04-16  6:40 ` [tip:perf/urgent] perf stat: Enable " tip-bot for Alexey Budankov
  0 siblings, 2 replies; 4+ messages in thread
From: Alexey Budankov @ 2018-04-03 18:18 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: Alexander Shishkin, Jiri Olsa, Namhyung Kim, Andi Kleen, linux-kernel


Currently print count interval for performance counters values is 
limited by 10ms so reading the values at frequencies higher than 100Hz 
is restricted by the tool.

This change makes perf stat -I possible on frequencies up to 1KHz and, 
to some extent, makes perf stat -I to be on-par with perf record 
sampling profiling.

When running perf stat -I for monitoring e.g. PCIe uncore counters and 
at the same time profiling some I/O workload by perf record e.g. for 
cpu-cycles and context switches, it is then possible to observe 
consolidated CPU/OS/IO(Uncore) performance picture for that workload.

Tool overhead warning printed when specifying -v option can be missed 
due to screen scrolling in case you have output to the console 
so message is moved into help available by running perf stat -h.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
---

Changes in v2:
 - updated minimum value to 1ms at perf-stat.txt manual

 tools/perf/Documentation/perf-stat.txt |  2 +-
 tools/perf/builtin-stat.c              | 14 ++------------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index f15b306be183..e6c3b4e555c2 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -153,7 +153,7 @@ perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- m
 
 -I msecs::
 --interval-print msecs::
-Print count deltas every N milliseconds (minimum: 10ms)
+Print count deltas every N milliseconds (minimum: 1ms)
 The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals.  Use with caution.
 	example: 'perf stat -I 1000 -e cycles -a sleep 5'
 
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index f5c454855908..147a27e8c937 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1943,7 +1943,8 @@ static const struct option stat_options[] = {
 	OPT_STRING(0, "post", &post_cmd, "command",
 			"command to run after to the measured command"),
 	OPT_UINTEGER('I', "interval-print", &stat_config.interval,
-		    "print counts at regular interval in ms (>= 10)"),
+		    "print counts at regular interval in ms "
+		    "(overhead is possible for values <= 100ms)"),
 	OPT_INTEGER(0, "interval-count", &stat_config.times,
 		    "print counts for fixed number of times"),
 	OPT_UINTEGER(0, "timeout", &stat_config.timeout,
@@ -2923,17 +2924,6 @@ int cmd_stat(int argc, const char **argv)
 		}
 	}
 
-	if (interval && interval < 100) {
-		if (interval < 10) {
-			pr_err("print interval must be >= 10ms\n");
-			parse_options_usage(stat_usage, stat_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");
-	}
-
 	if (stat_config.times && interval)
 		interval_count = true;
 	else if (stat_config.times && !interval) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf stat: enable 1ms interval for printing event counters values
  2018-04-03 18:18 [PATCH v2] perf stat: enable 1ms interval for printing event counters values Alexey Budankov
@ 2018-04-04  7:05 ` Jiri Olsa
  2018-04-04 13:39   ` Arnaldo Carvalho de Melo
  2018-04-16  6:40 ` [tip:perf/urgent] perf stat: Enable " tip-bot for Alexey Budankov
  1 sibling, 1 reply; 4+ messages in thread
From: Jiri Olsa @ 2018-04-04  7:05 UTC (permalink / raw)
  To: Alexey Budankov
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Namhyung Kim, Andi Kleen, linux-kernel

On Tue, Apr 03, 2018 at 09:18:33PM +0300, Alexey Budankov wrote:
> 
> Currently print count interval for performance counters values is 
> limited by 10ms so reading the values at frequencies higher than 100Hz 
> is restricted by the tool.
> 
> This change makes perf stat -I possible on frequencies up to 1KHz and, 
> to some extent, makes perf stat -I to be on-par with perf record 
> sampling profiling.
> 
> When running perf stat -I for monitoring e.g. PCIe uncore counters and 
> at the same time profiling some I/O workload by perf record e.g. for 
> cpu-cycles and context switches, it is then possible to observe 
> consolidated CPU/OS/IO(Uncore) performance picture for that workload.
> 
> Tool overhead warning printed when specifying -v option can be missed 
> due to screen scrolling in case you have output to the console 
> so message is moved into help available by running perf stat -h.
> 
> Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
> ---
> 
> Changes in v2:
>  - updated minimum value to 1ms at perf-stat.txt manual

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf stat: enable 1ms interval for printing event counters values
  2018-04-04  7:05 ` Jiri Olsa
@ 2018-04-04 13:39   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2018-04-04 13:39 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Alexey Budankov, Peter Zijlstra, Ingo Molnar, Alexander Shishkin,
	Namhyung Kim, Andi Kleen, linux-kernel

Em Wed, Apr 04, 2018 at 09:05:16AM +0200, Jiri Olsa escreveu:
> On Tue, Apr 03, 2018 at 09:18:33PM +0300, Alexey Budankov wrote:
> > 
> > Currently print count interval for performance counters values is 
> > limited by 10ms so reading the values at frequencies higher than 100Hz 
> > is restricted by the tool.
> > 
> > This change makes perf stat -I possible on frequencies up to 1KHz and, 
> > to some extent, makes perf stat -I to be on-par with perf record 
> > sampling profiling.
> > 
> > When running perf stat -I for monitoring e.g. PCIe uncore counters and 
> > at the same time profiling some I/O workload by perf record e.g. for 
> > cpu-cycles and context switches, it is then possible to observe 
> > consolidated CPU/OS/IO(Uncore) performance picture for that workload.
> > 
> > Tool overhead warning printed when specifying -v option can be missed 
> > due to screen scrolling in case you have output to the console 
> > so message is moved into help available by running perf stat -h.
> > 
> > Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
> > ---
> > 
> > Changes in v2:
> >  - updated minimum value to 1ms at perf-stat.txt manual
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>

Thanks, applied to perf/core.

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/urgent] perf stat: Enable 1ms interval for printing event counters values
  2018-04-03 18:18 [PATCH v2] perf stat: enable 1ms interval for printing event counters values Alexey Budankov
  2018-04-04  7:05 ` Jiri Olsa
@ 2018-04-16  6:40 ` tip-bot for Alexey Budankov
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Alexey Budankov @ 2018-04-16  6:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, jolsa, mingo, alexey.budankov, alexander.shishkin, acme,
	peterz, ak, tglx, linux-kernel, namhyung

Commit-ID:  9dc9a95f03a69ab926d9ff1986ab2087f34a5dce
Gitweb:     https://git.kernel.org/tip/9dc9a95f03a69ab926d9ff1986ab2087f34a5dce
Author:     Alexey Budankov <alexey.budankov@linux.intel.com>
AuthorDate: Tue, 3 Apr 2018 21:18:33 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 12 Apr 2018 09:29:31 -0300

perf stat: Enable 1ms interval for printing event counters values

Currently print count interval for performance counters values is
limited by 10ms so reading the values at frequencies higher than 100Hz
is restricted by the tool.

This change makes perf stat -I possible on frequencies up to 1KHz and,
to some extent, makes perf stat -I to be on-par with perf record
sampling profiling.

When running perf stat -I for monitoring e.g. PCIe uncore counters and
at the same time profiling some I/O workload by perf record e.g. for
cpu-cycles and context switches, it is then possible to observe
consolidated CPU/OS/IO(Uncore) performance picture for that workload.

Tool overhead warning printed when specifying -v option can be missed
due to screen scrolling in case you have output to the console
so message is moved into help available by running perf stat -h.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/b842ad6a-d606-32e4-afe5-974071b5198e@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-stat.txt |  2 +-
 tools/perf/builtin-stat.c              | 14 ++------------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index f15b306be183..e6c3b4e555c2 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -153,7 +153,7 @@ perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- m
 
 -I msecs::
 --interval-print msecs::
-Print count deltas every N milliseconds (minimum: 10ms)
+Print count deltas every N milliseconds (minimum: 1ms)
 The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals.  Use with caution.
 	example: 'perf stat -I 1000 -e cycles -a sleep 5'
 
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index f5c454855908..147a27e8c937 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1943,7 +1943,8 @@ static const struct option stat_options[] = {
 	OPT_STRING(0, "post", &post_cmd, "command",
 			"command to run after to the measured command"),
 	OPT_UINTEGER('I', "interval-print", &stat_config.interval,
-		    "print counts at regular interval in ms (>= 10)"),
+		    "print counts at regular interval in ms "
+		    "(overhead is possible for values <= 100ms)"),
 	OPT_INTEGER(0, "interval-count", &stat_config.times,
 		    "print counts for fixed number of times"),
 	OPT_UINTEGER(0, "timeout", &stat_config.timeout,
@@ -2923,17 +2924,6 @@ int cmd_stat(int argc, const char **argv)
 		}
 	}
 
-	if (interval && interval < 100) {
-		if (interval < 10) {
-			pr_err("print interval must be >= 10ms\n");
-			parse_options_usage(stat_usage, stat_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");
-	}
-
 	if (stat_config.times && interval)
 		interval_count = true;
 	else if (stat_config.times && !interval) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-16  6:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 18:18 [PATCH v2] perf stat: enable 1ms interval for printing event counters values Alexey Budankov
2018-04-04  7:05 ` Jiri Olsa
2018-04-04 13:39   ` Arnaldo Carvalho de Melo
2018-04-16  6:40 ` [tip:perf/urgent] perf stat: Enable " tip-bot for Alexey Budankov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).