aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-01-14 09:23:09 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-16 04:58:45 -0500
commit0d755034dbd01e240eadf2d31f4f75d3088ccd21 (patch)
tree922b509d4bf2964ea369c8586f9f2931065e0191 /tools/perf/util
parent66aeb6d5cb701aedd508187e08612bfd1e108e2e (diff)
perf tools: Don't cast RIP to pointers
Since they can come from another architecture with bigger pointers, i.e. processing a 64-bit perf.data on a 32-bit arch. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1263478990-8200-1-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/event.c9
-rw-r--r--tools/perf/util/session.c16
2 files changed, 9 insertions, 16 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 4f3e7ef33b83..24ec5be4a1c0 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -313,12 +313,9 @@ int event__process_mmap(event_t *self, struct perf_session *session)
313 struct thread *thread; 313 struct thread *thread;
314 struct map *map; 314 struct map *map;
315 315
316 dump_printf(" %d/%d: [%p(%p) @ %p]: %s\n", 316 dump_printf(" %d/%d: [%#Lx(%#Lx) @ %#Lx]: %s\n",
317 self->mmap.pid, self->mmap.tid, 317 self->mmap.pid, self->mmap.tid, self->mmap.start,
318 (void *)(long)self->mmap.start, 318 self->mmap.len, self->mmap.pgoff, self->mmap.filename);
319 (void *)(long)self->mmap.len,
320 (void *)(long)self->mmap.pgoff,
321 self->mmap.filename);
322 319
323 if (self->mmap.pid == 0) { 320 if (self->mmap.pid == 0) {
324 static const char kmmap_prefix[] = "[kernel.kallsyms."; 321 static const char kmmap_prefix[] = "[kernel.kallsyms.";
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index fd1c5a39a5bb..e3ccdb46d6c4 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -209,9 +209,8 @@ static int perf_session__process_event(struct perf_session *self,
209 trace_event(event); 209 trace_event(event);
210 210
211 if (event->header.type < PERF_RECORD_MAX) { 211 if (event->header.type < PERF_RECORD_MAX) {
212 dump_printf("%p [%p]: PERF_RECORD_%s", 212 dump_printf("%#lx [%#x]: PERF_RECORD_%s",
213 (void *)(offset + head), 213 offset + head, event->header.size,
214 (void *)(long)(event->header.size),
215 event__name[event->header.type]); 214 event__name[event->header.type]);
216 ++event__total[0]; 215 ++event__total[0];
217 ++event__total[event->header.type]; 216 ++event__total[event->header.type];
@@ -362,16 +361,13 @@ more:
362 361
363 size = event->header.size; 362 size = event->header.size;
364 363
365 dump_printf("\n%p [%p]: event: %d\n", 364 dump_printf("\n%#lx [%#x]: event: %d\n",
366 (void *)(offset + head), 365 offset + head, event->header.size, event->header.type);
367 (void *)(long)event->header.size,
368 event->header.type);
369 366
370 if (size == 0 || 367 if (size == 0 ||
371 perf_session__process_event(self, event, ops, offset, head) < 0) { 368 perf_session__process_event(self, event, ops, offset, head) < 0) {
372 dump_printf("%p [%p]: skipping unknown header type: %d\n", 369 dump_printf("%#lx [%#x]: skipping unknown header type: %d\n",
373 (void *)(offset + head), 370 offset + head, event->header.size,
374 (void *)(long)(event->header.size),
375 event->header.type); 371 event->header.type);
376 /* 372 /*
377 * assume we lost track of the stream, check alignment, and 373 * assume we lost track of the stream, check alignment, and