From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Cc: David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung.kim@lge.com>,
Stephane Eranian <eranian@google.com>
Subject: [PATCH 1/3] perf stat: Fix misleading message when specifying cpu list or system wide
Date: Sat, 28 Sep 2013 14:27:58 -0600 [thread overview]
Message-ID: <1380400080-9211-2-git-send-email-dsahern@gmail.com> (raw)
In-Reply-To: <1380400080-9211-1-git-send-email-dsahern@gmail.com>
perf-stat displays the command run in its summary output which is misleading
when using a cpu list or system wide collection.
Before:
perf stat -a -- sleep 1
Performance counter stats for 'sleep 1':
16152.670249 task-clock # 16.132 CPUs utilized
417 context-switches # 0.002 M/sec
7 cpu-migrations # 0.030 K/sec
...
After:
perf stat -a -- sleep 1
Performance counter stats for 'system wide':
16206.931120 task-clock # 16.144 CPUs utilized
395 context-switches # 0.002 M/sec
5 cpu-migrations # 0.030 K/sec
...
or
perf stat -C1 -- sleep 1
Performance counter stats for 'CPU(s) 1':
1001.669257 task-clock # 1.000 CPUs utilized
4,264 context-switches # 0.004 M/sec
3 cpu-migrations # 0.003 K/sec
...
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Stephane Eranian <eranian@google.com>
---
tools/perf/builtin-stat.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index f686d5f..6cc0aa2 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1115,7 +1115,11 @@ static void print_stat(int argc, const char **argv)
if (!csv_output) {
fprintf(output, "\n");
fprintf(output, " Performance counter stats for ");
- if (!perf_target__has_task(&target)) {
+ if (target.system_wide)
+ fprintf(output, "\'system wide");
+ else if (target.cpu_list)
+ fprintf(output, "\'CPU(s) %s", target.cpu_list);
+ else if (!perf_target__has_task(&target)) {
fprintf(output, "\'%s", argv[0]);
for (i = 1; i < argc; i++)
fprintf(output, " %s", argv[i]);
--
1.7.10.1
next prev parent reply other threads:[~2013-09-28 20:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 20:27 [PATCH 0/3] perf stat cleanups David Ahern
2013-09-28 20:27 ` David Ahern [this message]
2013-10-15 5:29 ` [tip:perf/core] perf stat: Fix misleading message when specifying cpu list or system wide tip-bot for David Ahern
2013-09-28 20:27 ` [PATCH 2/3] perf stat: Don't require a workload when using system wide or CPU options David Ahern
2013-09-30 8:47 ` Namhyung Kim
2013-09-30 13:40 ` David Ahern
2013-10-08 12:39 ` Arnaldo Carvalho de Melo
2013-10-08 12:51 ` Ingo Molnar
2013-10-08 13:27 ` Arnaldo Carvalho de Melo
2013-10-08 19:24 ` Ingo Molnar
2013-10-08 13:25 ` David Ahern
2013-10-08 13:33 ` Arnaldo Carvalho de Melo
2013-10-08 13:42 ` David Ahern
2013-10-15 5:30 ` [tip:perf/core] perf stat: Don' t " tip-bot for David Ahern
2013-09-28 20:28 ` [PATCH 3/3] perf stat: Add units to nanosec-based counters David Ahern
2013-10-15 5:30 ` [tip:perf/core] " tip-bot for David Ahern
2013-10-08 1:44 ` [PATCH 0/3] perf stat cleanups David Ahern
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=1380400080-9211-2-git-send-email-dsahern@gmail.com \
--to=dsahern@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.