Commit 59ee68ec authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar

perf symbols: Create thread__find_addr_map from thread__find_addr_location

Because some tools will only want to know with maps had hits,
not needing the full symbol resolution done by
thread__find_addr_location.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1263519930-22803-3-git-send-email-acme@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 18c3daa4
...@@ -422,11 +422,10 @@ int event__process_task(event_t *self, struct perf_session *session) ...@@ -422,11 +422,10 @@ int event__process_task(event_t *self, struct perf_session *session)
return 0; return 0;
} }
void thread__find_addr_location(struct thread *self, void thread__find_addr_map(struct thread *self,
struct perf_session *session, u8 cpumode, struct perf_session *session, u8 cpumode,
enum map_type type, u64 addr, enum map_type type, u64 addr,
struct addr_location *al, struct addr_location *al)
symbol_filter_t filter)
{ {
struct map_groups *mg = &self->mg; struct map_groups *mg = &self->mg;
...@@ -441,7 +440,6 @@ void thread__find_addr_location(struct thread *self, ...@@ -441,7 +440,6 @@ void thread__find_addr_location(struct thread *self,
else { else {
al->level = 'H'; al->level = 'H';
al->map = NULL; al->map = NULL;
al->sym = NULL;
return; return;
} }
try_again: try_again:
...@@ -460,11 +458,21 @@ void thread__find_addr_location(struct thread *self, ...@@ -460,11 +458,21 @@ void thread__find_addr_location(struct thread *self,
mg = &session->kmaps; mg = &session->kmaps;
goto try_again; goto try_again;
} }
al->sym = NULL; } else
} else {
al->addr = al->map->map_ip(al->map, al->addr); al->addr = al->map->map_ip(al->map, al->addr);
}
void thread__find_addr_location(struct thread *self,
struct perf_session *session, u8 cpumode,
enum map_type type, u64 addr,
struct addr_location *al,
symbol_filter_t filter)
{
thread__find_addr_map(self, session, cpumode, type, addr, al);
if (al->map != NULL)
al->sym = map__find_symbol(al->map, session, al->addr, filter); al->sym = map__find_symbol(al->map, session, al->addr, filter);
} else
al->sym = NULL;
} }
static void dso__calc_col_width(struct dso *self) static void dso__calc_col_width(struct dso *self)
......
...@@ -48,6 +48,11 @@ static inline struct map *thread__find_map(struct thread *self, ...@@ -48,6 +48,11 @@ static inline struct map *thread__find_map(struct thread *self,
return self ? map_groups__find(&self->mg, type, addr) : NULL; return self ? map_groups__find(&self->mg, type, addr) : NULL;
} }
void thread__find_addr_map(struct thread *self,
struct perf_session *session, u8 cpumode,
enum map_type type, u64 addr,
struct addr_location *al);
void thread__find_addr_location(struct thread *self, void thread__find_addr_location(struct thread *self,
struct perf_session *session, u8 cpumode, struct perf_session *session, u8 cpumode,
enum map_type type, u64 addr, enum map_type type, u64 addr,
......
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