From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757343AbbCNHGb (ORCPT ); Sat, 14 Mar 2015 03:06:31 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40316 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbbCNHG1 (ORCPT ); Sat, 14 Mar 2015 03:06:27 -0400 Date: Sat, 14 Mar 2015 00:06:15 -0700 From: tip-bot for Andi Kleen Message-ID: Cc: acme@redhat.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, ak@linux.intel.com Reply-To: acme@redhat.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, ak@linux.intel.com In-Reply-To: <1426087682-22765-3-git-send-email-andi@firstfloor.org> References: <1426087682-22765-3-git-send-email-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf stat: Always correctly indent ratio column Git-Commit-ID: 7910352852f377f6d12286f922299d7ad1cfb2e3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7910352852f377f6d12286f922299d7ad1cfb2e3 Gitweb: http://git.kernel.org/tip/7910352852f377f6d12286f922299d7ad1cfb2e3 Author: Andi Kleen AuthorDate: Wed, 11 Mar 2015 08:28:02 -0700 Committer: Arnaldo Carvalho de Melo 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 Link: http://lkml.kernel.org/r/1426087682-22765-3-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- 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))) {