All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Andi Kleen <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, hpa@zytor.com, tglx@linutronix.de,
	mingo@kernel.org, linux-kernel@vger.kernel.org,
	ak@linux.intel.com
Subject: [tip:perf/core] perf stat: Always correctly indent ratio column
Date: Sat, 14 Mar 2015 00:06:15 -0700	[thread overview]
Message-ID: <tip-7910352852f377f6d12286f922299d7ad1cfb2e3@git.kernel.org> (raw)
In-Reply-To: <1426087682-22765-3-git-send-email-andi@firstfloor.org>

Commit-ID:  7910352852f377f6d12286f922299d7ad1cfb2e3
Gitweb:     http://git.kernel.org/tip/7910352852f377f6d12286f922299d7ad1cfb2e3
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Wed, 11 Mar 2015 08:28:02 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 13 Mar 2015 07:47:44 -0300

perf stat: Always correctly indent ratio column

When cycles or instructions do not print anything, as in being,
--per-socket or --per-core modi, the ratio column was not correctly
indented for them. This lead to some ratios not lining up with the
others. Always indent correctly when nothing is printed.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1426087682-22765-3-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index c95dbda..d4d1b77 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1094,6 +1094,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
 		if (total) {
 			ratio = avg / total;
 			fprintf(output, " #   %5.2f  insns per cycle        ", ratio);
+		} else {
+			fprintf(output, "                                   ");
 		}
 		total = avg_stats(&runtime_stalled_cycles_front_stats[cpu]);
 		total = max(total, avg_stats(&runtime_stalled_cycles_back_stats[cpu]));
@@ -1163,6 +1165,8 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
 		if (total) {
 			ratio = avg / total;
 			fprintf(output, " # %8.3f GHz                    ", ratio);
+		} else {
+			fprintf(output, "                                   ");
 		}
 	} else if (transaction_run &&
 		   perf_evsel__cmp(evsel, nth_evsel(T_CYCLES_IN_TX))) {

  reply	other threads:[~2015-03-14  7:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 15:28 [PATCH 1/3] perf, tools: Output running time and run/enabled ratio in CSV mode Andi Kleen
2015-03-11 15:28 ` [PATCH 2/3] perf, tools, stat: Fix IPC and other formulas with -A Andi Kleen
2015-03-14  7:05   ` [tip:perf/core] perf " tip-bot for Andi Kleen
2015-03-11 15:28 ` [PATCH 3/3] perf, tools, stat: Always correctly indent ratio column Andi Kleen
2015-03-14  7:06   ` tip-bot for Andi Kleen [this message]
2015-03-11 19:53 ` [PATCH 1/3] perf, tools: Output running time and run/enabled ratio in CSV mode Arnaldo Carvalho de Melo
2015-03-11 20:42   ` Jiri Olsa

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-7910352852f377f6d12286f922299d7ad1cfb2e3@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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 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.