perf hists: Fixup addr snprintf width on 32 bit arches
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 5 Aug 2010 22:17:22 +0000 (19:17 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 5 Aug 2010 22:38:01 +0000 (19:38 -0300)
By using BITS_PER_LONG/4 as the width specifier.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/sort.c

index 1c61a4f4aa8affbf01df5992a50a149893257b68..b62a553cc67d969c104638b9bf33922f351f06bb 100644 (file)
@@ -196,7 +196,8 @@ static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
 
        if (verbose) {
                char o = self->ms.map ? dso__symtab_origin(self->ms.map->dso) : '!';
-               ret += repsep_snprintf(bf, size, "%#018llx %c ", self->ip, o);
+               ret += repsep_snprintf(bf, size, "%*Lx %c ",
+                                      BITS_PER_LONG / 4, self->ip, o);
        }
 
        ret += repsep_snprintf(bf + ret, size - ret, "[%c] ", self->level);
@@ -204,7 +205,8 @@ static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
                ret += repsep_snprintf(bf + ret, size - ret, "%s",
                                       self->ms.sym->name);
        else
-               ret += repsep_snprintf(bf + ret, size - ret, "%#016llx", self->ip);
+               ret += repsep_snprintf(bf + ret, size - ret, "%*Lx",
+                                      BITS_PER_LONG / 4, self->ip);
 
        return ret;
 }