lkml.org 
[lkml]   [2013]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:perf/core] perf sort: Align cpu column to right
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 = {

\
 
 \ /
  Last update: 2013-01-25 13:21    [W:0.107 / U:10.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site