public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <namhyung.kim@lge.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
	eranian@google.com, paulus@samba.org, hpa@zytor.com,
	mingo@kernel.org, a.p.zijlstra@chello.nl, namhyung.kim@lge.com,
	namhyung@kernel.org, jolsa@redhat.com, dsahern@gmail.com,
	tglx@linutronix.de
Subject: [tip:perf/core] perf sort: Align cpu column to right
Date: Fri, 25 Jan 2013 03:41:11 -0800	[thread overview]
Message-ID: <tip-dccf180542c4e27621ea526769014dc97b9e5676@git.kernel.org> (raw)
In-Reply-To: <1356599507-14226-5-git-send-email-namhyung@kernel.org>

Commit-ID:  dccf180542c4e27621ea526769014dc97b9e5676
Gitweb:     http://git.kernel.org/tip/dccf180542c4e27621ea526769014dc97b9e5676
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Thu, 27 Dec 2012 18:11:41 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 24 Jan 2013 16:40:22 -0300

perf sort: Align cpu column to right

Since cpu number is a natural number, it'd be more appropriate
aligning it to right.

Before:

  # Overhead  CPU      Command:  Pid          Shared Object
  # ........  ...  .................  .....................
  #
       8.91%  8    gnome-shell: 1497  perf-1497.map
       8.90%  7    gnome-shell: 1497  perf-1497.map
       8.86%  9    gnome-shell: 1497  perf-1497.map
       8.83%  6    gnome-shell: 1497  perf-1497.map
       8.81%  10   gnome-shell: 1497  perf-1497.map
       7.44%  5    gnome-shell: 1497  perf-1497.map
       6.20%  3    gnome-shell: 1497  perf-1497.map
       5.10%  0    gnome-shell: 1497  perf-1497.map

After:

  # Overhead  CPU      Command:  Pid          Shared Object
  # ........  ...  .................  .....................
  #
       8.91%    8  gnome-shell: 1497  perf-1497.map
       8.90%    7  gnome-shell: 1497  perf-1497.map
       8.86%    9  gnome-shell: 1497  perf-1497.map
       8.83%    6  gnome-shell: 1497  perf-1497.map
       8.81%   10  gnome-shell: 1497  perf-1497.map
       7.44%    5  gnome-shell: 1497  perf-1497.map
       6.20%    3  gnome-shell: 1497  perf-1497.map
       5.10%    0  gnome-shell: 1497  perf-1497.map

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1356599507-14226-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 8b6d70b..a36051b 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -331,7 +331,7 @@ sort__cpu_cmp(struct hist_entry *left, struct hist_entry *right)
 static int hist_entry__cpu_snprintf(struct hist_entry *self, char *bf,
 				       size_t size, unsigned int width)
 {
-	return repsep_snprintf(bf, size, "%-*d", width, self->cpu);
+	return repsep_snprintf(bf, size, "%*d", width, self->cpu);
 }
 
 struct sort_entry sort_cpu = {

  reply	other threads:[~2013-01-25 11:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27  9:11 [PATCHSET 00/10] perf tools: Cleanups and bug fixes on sort keys Namhyung Kim
2012-12-27  9:11 ` [PATCH 01/10] perf sort: Move misplaced sort entry functions Namhyung Kim
2013-01-25 11:37   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-27  9:11 ` [PATCH 02/10] perf sort: Get rid of unnecessary __maybe_unused Namhyung Kim
2013-01-25 11:38   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-27  9:11 ` [PATCH 03/10] perf sort: Fix --sort pid output Namhyung Kim
2013-01-25 11:40   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-27  9:11 ` [PATCH 04/10] perf sort: Align cpu column to right Namhyung Kim
2013-01-25 11:41   ` tip-bot for Namhyung Kim [this message]
2012-12-27  9:11 ` [PATCH 05/10] perf sort: Calculate parent column width too Namhyung Kim
2013-01-25 11:42   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-27  9:11 ` [PATCH 06/10] perf sort: Drop ip_[lr] arguments from _sort__sym_cmp() Namhyung Kim
2013-01-11  5:16   ` Arnaldo Carvalho de Melo
2012-12-27  9:11 ` [PATCH 07/10] perf sort: Check return value of strdup() Namhyung Kim
2013-01-11  5:17   ` Arnaldo Carvalho de Melo
2013-01-13  8:43     ` Namhyung Kim
2013-01-16 18:38       ` Arnaldo Carvalho de Melo
2012-12-27  9:11 ` [PATCH 08/10] perf sort: Clean up sort__first_dimension setting Namhyung Kim
2013-01-25 11:43   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-27  9:11 ` [PATCH 09/10] perf sort: Separate out branch stack specific sort keys Namhyung Kim
2013-01-25 11:44   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-27  9:11 ` [PATCH 10/10] perf report: Update documentation for " Namhyung Kim
2013-01-25 11:45   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-12-28 11:21 ` [PATCHSET 00/10] perf tools: Cleanups and bug fixes on " 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-dccf180542c4e27621ea526769014dc97b9e5676@git.kernel.org \
    --to=namhyung.kim@lge.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.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@kernel.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox