memset(&al, 0, sizeof(al));
- if (!thread__find_map(thread, cpumode, addr, &al))
- __thread__find_map(thread, cpumode, MAP__VARIABLE, addr, &al);
+ thread__find_map(thread, cpumode, addr, &al);
+
if ((*lastsym) && al.addr >= (*lastsym)->start && al.addr < (*lastsym)->end)
return 0;
return machine__process_event(machine, event, sample);
}
-struct map *__thread__find_map(struct thread *thread, u8 cpumode, enum map_type type,
- u64 addr, struct addr_location *al)
+static struct map *__thread__find_map(struct thread *thread, u8 cpumode, enum map_type type,
+ u64 addr, struct addr_location *al)
{
struct map_groups *mg = thread->mg;
struct machine *machine = mg->machine;
return al->map;
}
+struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,
+ struct addr_location *al)
+{
+ struct map *map = __thread__find_map(thread, cpumode, MAP__FUNCTION, addr, al);
+ return map ?: __thread__find_map(thread, cpumode, MAP__VARIABLE, addr, al);
+}
+
struct symbol *thread__find_symbol(struct thread *thread, u8 cpumode,
u64 addr, struct addr_location *al)
{
al->sym = NULL;
- if (__thread__find_map(thread, cpumode, MAP__FUNCTION, addr, al) ||
- __thread__find_map(thread, cpumode, MAP__VARIABLE, addr, al))
+ if (thread__find_map(thread, cpumode, addr, al))
al->sym = map__find_symbol(al->map, al->addr);
return al->sym;
}
void thread__resolve(struct thread *thread, struct addr_location *al,
struct perf_sample *sample)
{
- if (!thread__find_map(thread, sample->cpumode, sample->addr, al)) {
- __thread__find_map(thread, sample->cpumode, MAP__VARIABLE,
- sample->addr, al);
- }
+ thread__find_map(thread, sample->cpumode, sample->addr, al);
al->cpu = sample->cpu;
al->sym = NULL;
struct thread *thread__main_thread(struct machine *machine, struct thread *thread);
-struct map *__thread__find_map(struct thread *thread, u8 cpumode, enum map_type type,
- u64 addr, struct addr_location *al);
-
-static inline struct map *thread__find_map(struct thread *thread, u8 cpumode,
- u64 addr, struct addr_location *al)
-{
- return __thread__find_map(thread, cpumode, MAP__FUNCTION, addr, al);
-}
+struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,
+ struct addr_location *al);
struct symbol *thread__find_symbol(struct thread *thread, u8 cpumode,
u64 addr, struct addr_location *al);
ssize_t size;
if (!thread__find_map(ui->thread, PERF_RECORD_MISC_USER, addr, &al)) {
- /*
- * We've seen cases (softice) where DWARF unwinder went
- * through non executable mmaps, which we need to lookup
- * in MAP__VARIABLE tree.
- */
- __thread__find_map(ui->thread, PERF_RECORD_MISC_USER,
- MAP__VARIABLE, addr, &al);
- }
-
- if (!al.map) {
pr_debug("unwind: no map for %lx\n", (unsigned long)addr);
return -1;
}
static struct map *find_map(unw_word_t ip, struct unwind_info *ui)
{
struct addr_location al;
-
- if (!thread__find_map(ui->thread, PERF_RECORD_MISC_USER, ip, &al)) {
- /*
- * We've seen cases (softice) where DWARF unwinder went
- * through non executable mmaps, which we need to lookup
- * in MAP__VARIABLE tree.
- */
- __thread__find_map(ui->thread, PERF_RECORD_MISC_USER,
- MAP__VARIABLE, ip, &al);
- }
- return al.map;
+ return thread__find_map(ui->thread, PERF_RECORD_MISC_USER, ip, &al);
}
static int