linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for David Ahern <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
	eranian@google.com, hpa@zytor.com, mingo@kernel.org,
	a.p.zijlstra@chello.nl, namhyung.kim@lge.com, jolsa@redhat.com,
	fweisbec@gmail.com, dsahern@gmail.com, tglx@linutronix.de
Subject: [tip:perf/core] perf stat: Add units to nanosec-based counters
Date: Mon, 14 Oct 2013 22:30:17 -0700	[thread overview]
Message-ID: <tip-4bbe5a61f29b13437a6a16467328d3bae8fce9e7@git.kernel.org> (raw)
In-Reply-To: <1380400080-9211-4-git-send-email-dsahern@gmail.com>

Commit-ID:  4bbe5a61f29b13437a6a16467328d3bae8fce9e7
Gitweb:     http://git.kernel.org/tip/4bbe5a61f29b13437a6a16467328d3bae8fce9e7
Author:     David Ahern <dsahern@gmail.com>
AuthorDate: Sat, 28 Sep 2013 14:28:00 -0600
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 11 Oct 2013 12:17:46 -0300

perf stat: Add units to nanosec-based counters

Ingo pointed out that the task-clock counter should have the units
explicitly stated since it is not a counter.

Before:

perf stat -a -- sleep 1

 Performance counter stats for 'sleep 1':

      16186.874834 task-clock          #   16.154 CPUs utilized
...

After:

perf stat -a -- sleep 1

 Performance counter stats for 'system wide':

      16146.402138 task-clock (msec)   #   16.125 CPUs utilized
...

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1380400080-9211-4-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 2178e66..1a9c95d 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -706,10 +706,13 @@ static void nsec_printout(int cpu, int nr, struct perf_evsel *evsel, double avg)
 {
 	double msecs = avg / 1e6;
 	const char *fmt = csv_output ? "%.6f%s%s" : "%18.6f%s%-25s";
+	char name[25];
 
 	aggr_printout(evsel, cpu, nr);
 
-	fprintf(output, fmt, msecs, csv_sep, perf_evsel__name(evsel));
+	scnprintf(name, sizeof(name), "%s%s",
+		  perf_evsel__name(evsel), csv_output ? "" : " (msec)");
+	fprintf(output, fmt, msecs, csv_sep, name);
 
 	if (evsel->cgrp)
 		fprintf(output, "%s%s", csv_sep, evsel->cgrp->name);

  reply	other threads:[~2013-10-15  5:30 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 ` [PATCH 1/3] perf stat: Fix misleading message when specifying cpu list or system wide David Ahern
2013-10-15  5:29   ` [tip:perf/core] " 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-bot for David Ahern [this message]
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=tip-4bbe5a61f29b13437a6a16467328d3bae8fce9e7@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=tglx@linutronix.de \
    /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).