aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-01-22 17:37:02 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-01-22 20:41:57 -0500
commit9486aa38771661e96fbb51c549b9901b5df609d8 (patch)
tree72cecbff0cb5124c960feeec3a6ac1fff75c649a /tools/perf/util/symbol.c
parent57b84e53171ce672683faf1cab2e660965a6bdaf (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/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e32478effed8..7821d0e6866f 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -11,6 +11,7 @@
11#include <sys/param.h> 11#include <sys/param.h>
12#include <fcntl.h> 12#include <fcntl.h>
13#include <unistd.h> 13#include <unistd.h>
14#include <inttypes.h>
14#include "build-id.h" 15#include "build-id.h"
15#include "debug.h" 16#include "debug.h"
16#include "symbol.h" 17#include "symbol.h"
@@ -153,7 +154,7 @@ static struct symbol *symbol__new(u64 start, u64 len, u8 binding,
153 self->binding = binding; 154 self->binding = binding;
154 self->namelen = namelen - 1; 155 self->namelen = namelen - 1;
155 156
156 pr_debug4("%s: %s %#Lx-%#Lx\n", __func__, name, start, self->end); 157 pr_debug4("%s: %s %#" PRIx64 "-%#" PRIx64 "\n", __func__, name, start, self->end);
157 158
158 memcpy(self->name, name, namelen); 159 memcpy(self->name, name, namelen);
159 160
@@ -167,7 +168,7 @@ void symbol__delete(struct symbol *self)
167 168
168static size_t symbol__fprintf(struct symbol *self, FILE *fp) 169static size_t symbol__fprintf(struct symbol *self, FILE *fp)
169{ 170{
170 return fprintf(fp, " %llx-%llx %c %s\n", 171 return fprintf(fp, " %" PRIx64 "-%" PRIx64 " %c %s\n",
171 self->start, self->end, 172 self->start, self->end,
172 self->binding == STB_GLOBAL ? 'g' : 173 self->binding == STB_GLOBAL ? 'g' :
173 self->binding == STB_LOCAL ? 'l' : 'w', 174 self->binding == STB_LOCAL ? 'l' : 'w',
@@ -1215,8 +1216,8 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
1215 } 1216 }
1216 1217
1217 if (curr_dso->adjust_symbols) { 1218 if (curr_dso->adjust_symbols) {
1218 pr_debug4("%s: adjusting symbol: st_value: %#Lx " 1219 pr_debug4("%s: adjusting symbol: st_value: %#" PRIx64 " "
1219 "sh_addr: %#Lx sh_offset: %#Lx\n", __func__, 1220 "sh_addr: %#" PRIx64 " sh_offset: %#" PRIx64 "\n", __func__,
1220 (u64)sym.st_value, (u64)shdr.sh_addr, 1221 (u64)sym.st_value, (u64)shdr.sh_addr,
1221 (u64)shdr.sh_offset); 1222 (u64)shdr.sh_offset);
1222 sym.st_value -= shdr.sh_addr - shdr.sh_offset; 1223 sym.st_value -= shdr.sh_addr - shdr.sh_offset;