diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-22 17:37:02 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-22 20:41:57 -0500 |
commit | 9486aa38771661e96fbb51c549b9901b5df609d8 (patch) | |
tree | 72cecbff0cb5124c960feeec3a6ac1fff75c649a /tools/perf/builtin-kmem.c | |
parent | 57b84e53171ce672683faf1cab2e660965a6bdaf (diff) |
perf tools: Fix 64 bit integer format strings
Using %L[uxd] has issues in some architectures, like on ppc64. Fix it
by making our 64 bit integers typedefs of stdint.h types and using
PRI[ux]64 like, for instance, git does.
Reported by Denis Kirjanov that provided a patch for one case, I went
and changed all cases.
Reported-by: Denis Kirjanov <dkirjanov@kernel.org>
Tested-by: Denis Kirjanov <dkirjanov@kernel.org>
LKML-Reference: <20110120093246.GA8031@hera.kernel.org>
Cc: Denis Kirjanov <dkirjanov@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Pingtian Han <phan@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-kmem.c')
-rw-r--r-- | tools/perf/builtin-kmem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index def7ddc2fd4f..d97256d65980 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c | |||
@@ -371,10 +371,10 @@ static void __print_result(struct rb_root *root, struct perf_session *session, | |||
371 | addr = data->ptr; | 371 | addr = data->ptr; |
372 | 372 | ||
373 | if (sym != NULL) | 373 | if (sym != NULL) |
374 | snprintf(buf, sizeof(buf), "%s+%Lx", sym->name, | 374 | snprintf(buf, sizeof(buf), "%s+%" PRIx64 "", sym->name, |
375 | addr - map->unmap_ip(map, sym->start)); | 375 | addr - map->unmap_ip(map, sym->start)); |
376 | else | 376 | else |
377 | snprintf(buf, sizeof(buf), "%#Lx", addr); | 377 | snprintf(buf, sizeof(buf), "%#" PRIx64 "", addr); |
378 | printf(" %-34s |", buf); | 378 | printf(" %-34s |", buf); |
379 | 379 | ||
380 | printf(" %9llu/%-5lu | %9llu/%-5lu | %8lu | %8lu | %6.3f%%\n", | 380 | printf(" %9llu/%-5lu | %9llu/%-5lu | %8lu | %8lu | %6.3f%%\n", |