Commit 6e086437 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar

perf tools: Save partial non-overlapping map

The librarization of the thread helpers between annotate and
report lost some perf report specifics.

thread__insert_map() had its most uptodate version in perf
report which cared about partial map overlapping. In case of
overlap between two maps, perf annotate's version removes the
whole old map without considering if it partially or
absolutely overlaps the new map.

We exported the odd version, change it by using the perf
report version.
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1250607843-7395-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 4273b005
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include "thread.h" #include "thread.h"
#include "util.h" #include "util.h"
#include "debug.h"
static struct thread *thread__new(pid_t pid) static struct thread *thread__new(pid_t pid)
{ {
...@@ -85,9 +86,27 @@ void thread__insert_map(struct thread *self, struct map *map) ...@@ -85,9 +86,27 @@ void thread__insert_map(struct thread *self, struct map *map)
list_for_each_entry_safe(pos, tmp, &self->maps, node) { list_for_each_entry_safe(pos, tmp, &self->maps, node) {
if (map__overlap(pos, map)) { if (map__overlap(pos, map)) {
list_del_init(&pos->node); if (verbose >= 2) {
/* XXX leaks dsos */ printf("overlapping maps:\n");
free(pos); map__fprintf(map, stdout);
map__fprintf(pos, stdout);
}
if (map->start <= pos->start && map->end > pos->start)
pos->start = map->end;
if (map->end >= pos->end && map->start < pos->end)
pos->end = map->start;
if (verbose >= 2) {
printf("after collision:\n");
map__fprintf(pos, stdout);
}
if (pos->start >= pos->end) {
list_del_init(&pos->node);
free(pos);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment