aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-06-23 05:23:07 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-23 05:42:44 -0400
commit3d906ef10a539ff336010afab8f6f9c4fe379695 (patch)
tree3c0bbac1c4417d91e3794f4f0bbc8a01c4949821 /tools/perf/builtin-report.c
parentdee412066aeb16c43cf31599948c1a1de385df56 (diff)
perf_counter tools: Handle overlapping MMAP events
Martin Schwidefsky reported "perf report" symbol resolution problems on S390. Since we only report MMAP, not MUNMAP, we have to deal with overlapping maps. We used to simply throw out the old map on the assumption whole maps got unmapped. This obviously doesn't deal with partial unmaps. However it appears some dynamic linkers do fancy partial unmaps (s390), so do something more elaborate and truncate the old maps, only removing them when they've been fully covered. This resolves (part of) the S390 symbol resolution problems. Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Tested-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ec230a0146e9..b4e76f75ba87 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -400,9 +400,27 @@ static void thread__insert_map(struct thread *self, struct map *map)
400 400
401 list_for_each_entry_safe(pos, tmp, &self->maps, node) { 401 list_for_each_entry_safe(pos, tmp, &self->maps, node) {
402 if (map__overlap(pos, map)) { 402 if (map__overlap(pos, map)) {
403 list_del_init(&pos->node); 403 if (verbose >= 2) {
404 /* XXX leaks dsos */ 404 printf("overlapping maps:\n");
405 free(pos); 405 map__fprintf(map, stdout);
406 map__fprintf(pos, stdout);
407 }
408
409 if (map->start <= pos->start && map->end > pos->start)
410 pos->start = map->end;
411
412 if (map->end >= pos->end && map->start < pos->end)
413 pos->end = map->start;
414
415 if (verbose >= 2) {
416 printf("after collision:\n");
417 map__fprintf(pos, stdout);
418 }
419
420 if (pos->start >= pos->end) {
421 list_del_init(&pos->node);
422 free(pos);
423 }
406 } 424 }
407 } 425 }
408 426