perf map_groups: Pass the object to map_groups__find_ams()

We were just passing a map to look for and reuse its map->groups member,
but the idea is that this is going away, as a map can be in multiple
rb_trees when being reused via a map_node, so do as all the other
map_groups methods and pass as its first arg the object being operated
on.

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-nmi2pbggqloogwl6vxrvex5a@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f2baa060
...@@ -38,7 +38,7 @@ static int s390_call__parse(struct arch *arch, struct ins_operands *ops, ...@@ -38,7 +38,7 @@ static int s390_call__parse(struct arch *arch, struct ins_operands *ops,
return -1; return -1;
target.addr = map__objdump_2mem(map, ops->target.addr); target.addr = map__objdump_2mem(map, ops->target.addr);
if (map_groups__find_ams(&target) == 0 && if (map_groups__find_ams(map->groups, &target) == 0 &&
map__rip_2objdump(target.map, map->map_ip(target.map, target.addr)) == ops->target.addr) map__rip_2objdump(target.map, map->map_ip(target.map, target.addr)) == ops->target.addr)
ops->target.sym = target.sym; ops->target.sym = target.sym;
......
...@@ -271,7 +271,7 @@ static int call__parse(struct arch *arch, struct ins_operands *ops, struct map_s ...@@ -271,7 +271,7 @@ static int call__parse(struct arch *arch, struct ins_operands *ops, struct map_s
find_target: find_target:
target.addr = map__objdump_2mem(map, ops->target.addr); target.addr = map__objdump_2mem(map, ops->target.addr);
if (map_groups__find_ams(&target) == 0 && if (map_groups__find_ams(map->groups, &target) == 0 &&
map__rip_2objdump(target.map, map->map_ip(target.map, target.addr)) == ops->target.addr) map__rip_2objdump(target.map, map->map_ip(target.map, target.addr)) == ops->target.addr)
ops->target.sym = target.sym; ops->target.sym = target.sym;
...@@ -391,7 +391,7 @@ static int jump__parse(struct arch *arch, struct ins_operands *ops, struct map_s ...@@ -391,7 +391,7 @@ static int jump__parse(struct arch *arch, struct ins_operands *ops, struct map_s
* Actual navigation will come next, with further understanding of how * Actual navigation will come next, with further understanding of how
* the symbol searching and disassembly should be done. * the symbol searching and disassembly should be done.
*/ */
if (map_groups__find_ams(&target) == 0 && if (map_groups__find_ams(map->groups, &target) == 0 &&
map__rip_2objdump(target.map, map->map_ip(target.map, target.addr)) == ops->target.addr) map__rip_2objdump(target.map, map->map_ip(target.map, target.addr)) == ops->target.addr)
ops->target.sym = target.sym; ops->target.sym = target.sym;
...@@ -1544,7 +1544,7 @@ static int symbol__parse_objdump_line(struct symbol *sym, ...@@ -1544,7 +1544,7 @@ static int symbol__parse_objdump_line(struct symbol *sym,
.addr = dl->ops.target.addr, .addr = dl->ops.target.addr,
}; };
if (!map_groups__find_ams(&target) && if (!map_groups__find_ams(map->groups, &target) &&
target.sym->start == target.al_addr) target.sym->start == target.al_addr)
dl->ops.target.sym = target.sym; dl->ops.target.sym = target.sym;
} }
......
...@@ -703,12 +703,12 @@ struct symbol *map_groups__find_symbol_by_name(struct map_groups *mg, ...@@ -703,12 +703,12 @@ struct symbol *map_groups__find_symbol_by_name(struct map_groups *mg,
return maps__find_symbol_by_name(&mg->maps, name, mapp); return maps__find_symbol_by_name(&mg->maps, name, mapp);
} }
int map_groups__find_ams(struct addr_map_symbol *ams) int map_groups__find_ams(struct map_groups *mg, struct addr_map_symbol *ams)
{ {
if (ams->addr < ams->map->start || ams->addr >= ams->map->end) { if (ams->addr < ams->map->start || ams->addr >= ams->map->end) {
if (ams->map->groups == NULL) if (mg == NULL)
return -1; return -1;
ams->map = map_groups__find(ams->map->groups, ams->addr); ams->map = map_groups__find(mg, ams->addr);
if (ams->map == NULL) if (ams->map == NULL)
return -1; return -1;
} }
......
...@@ -100,7 +100,7 @@ struct symbol *map_groups__find_symbol_by_name(struct map_groups *mg, const char ...@@ -100,7 +100,7 @@ struct symbol *map_groups__find_symbol_by_name(struct map_groups *mg, const char
struct addr_map_symbol; struct addr_map_symbol;
int map_groups__find_ams(struct addr_map_symbol *ams); int map_groups__find_ams(struct map_groups *mg, struct addr_map_symbol *ams);
int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, FILE *fp); int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, FILE *fp);
......
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