linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Alexey Budankov <alexey.budankov@linux.intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 01/17] perf stat: Enable 1ms interval for printing event counters values
Date: Fri, 13 Apr 2018 11:00:55 -0300	[thread overview]
Message-ID: <20180413140111.25313-2-acme@kernel.org> (raw)
In-Reply-To: <20180413140111.25313-1-acme@kernel.org>

From: Alexey Budankov <alexey.budankov@linux.intel.com>

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) {
-- 
2.14.3

       reply	other threads:[~2018-04-13 14:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180413140111.25313-1-acme@kernel.org>
2018-04-13 14:00 ` Arnaldo Carvalho de Melo [this message]
2018-04-13 14:00 ` [PATCH 02/17] tools headers: Restore READ_ONCE() C++ compatibility Arnaldo Carvalho de Melo
2018-04-13 14:00 ` [PATCH 03/17] perf tests: Run dwarf unwind test on arm32 Arnaldo Carvalho de Melo
2018-04-13 14:00 ` [PATCH 04/17] perf annotate: Allow showing offsets in more than just jump targets Arnaldo Carvalho de Melo
2018-04-13 14:00 ` [PATCH 05/17] perf annotate browser: " Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 06/17] perf jvmti: Give hints about package names needed to build Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 07/17] perf tests bpf: Remove unused ptrace.h include from LLVM test Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 08/17] Revert "x86/asm: Allow again using asm.h when building for the 'bpf' clang target" Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 10/17] perf tools: Rename HAVE_SYSCALL_TABLE to HAVE_SYSCALL_TABLE_SUPPORT Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 11/17] perf version: Print status for syscall_table Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 12/17] perf sched: Fix documentation for timehist Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 13/17] perf tests: Disable breakpoint accounting test for powerpc Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 14/17] perf record: Change warning for missing sysfs entry to debug Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 15/17] perf report: Fix switching to another perf.data file Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 16/17] perf annotate: Allow setting the offset level in .perfconfig Arnaldo Carvalho de Melo
2018-04-13 14:01 ` [PATCH 17/17] perf annotate: Handle variables in 'sub', 'or' and many other instructions Arnaldo Carvalho de Melo
2018-04-13 16:20   ` Andi Kleen
2018-04-13 17:20     ` Arnaldo Carvalho de Melo
2018-04-13 17:39       ` Andi Kleen
2018-04-17  2:56         ` Namhyung Kim
2018-04-17 12:51           ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180413140111.25313-2-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexey.budankov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).