perf map: Combine maps__fixup_overlappings with its only use
In the process we can kill some of the struct map->groups usage, trying to get rid of this per-full struct map fields getting in the way of sharing a map across father/parent processes. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-e50eqtqw3za24vmbjnqmmcs6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
94e44b9ca5
commit
3f662fc08d
@ -752,8 +752,9 @@ static void __map_groups__insert(struct map_groups *mg, struct map *map)
|
|||||||
map->groups = mg;
|
map->groups = mg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp)
|
int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, FILE *fp)
|
||||||
{
|
{
|
||||||
|
struct maps *maps = &mg->maps;
|
||||||
struct rb_root *root;
|
struct rb_root *root;
|
||||||
struct rb_node *next, *first;
|
struct rb_node *next, *first;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
@ -818,7 +819,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp
|
|||||||
}
|
}
|
||||||
|
|
||||||
before->end = map->start;
|
before->end = map->start;
|
||||||
__map_groups__insert(pos->groups, before);
|
__map_groups__insert(mg, before);
|
||||||
if (verbose >= 2 && !use_browser)
|
if (verbose >= 2 && !use_browser)
|
||||||
map__fprintf(before, fp);
|
map__fprintf(before, fp);
|
||||||
map__put(before);
|
map__put(before);
|
||||||
@ -835,7 +836,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp
|
|||||||
after->start = map->end;
|
after->start = map->end;
|
||||||
after->pgoff += map->end - pos->start;
|
after->pgoff += map->end - pos->start;
|
||||||
assert(pos->map_ip(pos, map->end) == after->map_ip(after, map->end));
|
assert(pos->map_ip(pos, map->end) == after->map_ip(after, map->end));
|
||||||
__map_groups__insert(pos->groups, after);
|
__map_groups__insert(mg, after);
|
||||||
if (verbose >= 2 && !use_browser)
|
if (verbose >= 2 && !use_browser)
|
||||||
map__fprintf(after, fp);
|
map__fprintf(after, fp);
|
||||||
map__put(after);
|
map__put(after);
|
||||||
@ -853,12 +854,6 @@ out:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map,
|
|
||||||
FILE *fp)
|
|
||||||
{
|
|
||||||
return maps__fixup_overlappings(&mg->maps, map, fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX This should not really _copy_ te maps, but refcount them.
|
* XXX This should not really _copy_ te maps, but refcount them.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user