mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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: Frederic Weisbecker <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Mike Galbraith <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
4273b00587
commit
6e086437f3
1 changed files with 22 additions and 3 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <string.h>
|
||||
#include "thread.h"
|
||||
#include "util.h"
|
||||
#include "debug.h"
|
||||
|
||||
static struct thread *thread__new(pid_t pid)
|
||||
{
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue