Lines Matching defs:map
30 #include "map.h"
80 pr_debug("Failed to init symbol map.\n");
109 static struct ref_reloc_sym *kernel_get_ref_reloc_sym(struct map **pmap)
113 struct map *map = machine__kernel_map(host_machine);
115 if (map__load(map) < 0)
118 kmap = map__kmap(map);
123 *pmap = map;
133 struct map *map;
136 reloc_sym = kernel_get_ref_reloc_sym(&map);
138 *addr = (!map->reloc || reloc) ? reloc_sym->addr :
141 sym = machine__find_kernel_symbol_by_name(host_machine, name, &map);
144 *addr = map->unmap_ip(map, sym->start) -
145 ((reloc) ? 0 : map->reloc) -
146 ((reladdr) ? map->start : 0);
151 static struct map *kernel_get_module_map(const char *module)
154 struct map *pos;
176 struct map *get_target_map(const char *target, struct nsinfo *nsi, bool user)
180 struct map *map;
182 map = dso__new_map(target);
183 if (map && map->dso) {
184 nsinfo__put(map->dso->nsinfo);
185 map->dso->nsinfo = nsinfo__get(nsi);
187 return map;
246 struct map *map;
249 map = kernel_get_module_map(NULL);
250 if (map) {
251 ret = address <= map->start || map->end < address;
254 map__put(map);
328 struct map *map;
336 map = maps__find_by_name(&host_machine->kmaps, module_name);
337 if (map) {
338 dso = map->dso;
345 map = machine__kernel_map(host_machine);
346 dso = map->dso;
353 ret = dso__load_vmlinux(dso, map, vmlinux_name, false);
355 ret = dso__load_vmlinux_path(dso, map);
364 * symbol from map, we can translate the address back to the probe point.
372 struct map *map = NULL;
381 map = get_target_map(target, nsi, uprobes);
382 if (!map)
386 map__for_each_symbol_by_name(map, pp->function, sym) {
394 address = map->unmap_ip(map, sym->start) - map->reloc;
416 map__put(map);
682 struct map *map, unsigned long offs)
687 sym = map__find_symbol(map, addr);
719 struct map *map;
723 /* Prepare a map for offline binary */
724 map = dso__new_map(pathname);
725 if (!map || get_text_start_address(pathname, &stext, NULL) < 0) {
732 map, stext);
736 map__put(map);
777 struct map *map;
782 map = get_target_map(module, NULL, false);
783 if (!map || debuginfo__get_text_offset(dinfo, &text_offs, true) < 0) {
791 map, (unsigned long)text_offs);
803 map__put(map);
813 struct map *map;
822 reloc_sym = kernel_get_ref_reloc_sym(&map);
839 map__objdump_2mem(map, tevs[i].point.address))) {
854 (map->reloc ? reloc_sym->unrelocated_addr :
2190 struct map *map = NULL;
2195 map = dso__new_map(tp->module);
2196 if (!map)
2198 sym = map__find_symbol(map, addr);
2207 sym = machine__find_kernel_symbol(host_machine, addr, &map);
2215 pp->offset = addr - map->unmap_ip(map, sym->start);
2220 if (map && !is_kprobe) {
2221 map__put(map);
2241 pr_debug("Failed to find probe point from both of dwarf and map.\n");
2920 static int find_probe_functions(struct map *map, char *name,
2930 if (map__load(map) < 0)
2937 map__for_each_symbol(map, sym, tmp) {
2967 struct map *map __maybe_unused,
2971 * Find probe function addresses from map.
2977 struct map *map = NULL;
2988 map = get_target_map(pev->target, pev->nsi, pev->uprobes);
2989 if (!map) {
3004 num_matched_functions = find_probe_functions(map, pp->function, syms);
3043 /* There can be duplicated symbols in the map */
3068 tp->address = map->unmap_ip(map, sym->start) + pp->offset;
3119 arch__fix_tev_from_maps(pev, tev, map, sym);
3127 map__put(map);
3612 struct map *map;
3619 /* Get a symbol map */
3620 map = get_target_map(target, nsi, user);
3621 if (!map) {
3622 pr_err("Failed to get a map for %s\n", (target) ? : "kernel");
3626 ret = map__load(map);
3638 if (!dso__sorted_by_name(map->dso))
3639 dso__sort_by_name(map->dso);
3644 for (nd = rb_first_cached(&map->dso->symbol_names); nd;
3652 map__put(map);