Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158272
b: refs/heads/master
c: 6e08643
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Aug 18, 2009
1 parent da7a602 commit 6d5fb1d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4273b005875c34beda4a11c9d4a9132d80378036
refs/heads/master: 6e086437f35ad9fda448711732c4ce0f82aad569
25 changes: 22 additions & 3 deletions trunk/tools/perf/util/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string.h>
#include "thread.h"
#include "util.h"
#include "debug.h"

static struct thread *thread__new(pid_t pid)
{
Expand Down Expand Up @@ -85,9 +86,27 @@ void thread__insert_map(struct thread *self, struct map *map)

list_for_each_entry_safe(pos, tmp, &self->maps, node) {
if (map__overlap(pos, map)) {
list_del_init(&pos->node);
/* XXX leaks dsos */
free(pos);
if (verbose >= 2) {
printf("overlapping maps:\n");
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);
}
}
}

Expand Down

0 comments on commit 6d5fb1d

Please sign in to comment.