diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-01-14 20:45:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-01-16 04:58:48 -0500 |
commit | 59ee68ecd1561a233fb6ad351980bea8402533e7 (patch) | |
tree | 9b095330dfbf754cce495c8bc8ce187d1340d8b6 /tools | |
parent | 18c3daa4961b9fa1f2db0711d93c0acf0c39fd12 (diff) |
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: Arnaldo 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: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/event.c | 26 | ||||
-rw-r--r-- | tools/perf/util/thread.h | 5 |
2 files changed, 22 insertions, 9 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 1abaefc126a8..5a6e827a09eb 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -422,11 +422,10 @@ int event__process_task(event_t *self, struct perf_session *session) | |||
422 | return 0; | 422 | return 0; |
423 | } | 423 | } |
424 | 424 | ||
425 | void thread__find_addr_location(struct thread *self, | 425 | void thread__find_addr_map(struct thread *self, |
426 | struct perf_session *session, u8 cpumode, | 426 | struct perf_session *session, u8 cpumode, |
427 | enum map_type type, u64 addr, | 427 | enum map_type type, u64 addr, |
428 | struct addr_location *al, | 428 | struct addr_location *al) |
429 | symbol_filter_t filter) | ||
430 | { | 429 | { |
431 | struct map_groups *mg = &self->mg; | 430 | struct map_groups *mg = &self->mg; |
432 | 431 | ||
@@ -441,7 +440,6 @@ void thread__find_addr_location(struct thread *self, | |||
441 | else { | 440 | else { |
442 | al->level = 'H'; | 441 | al->level = 'H'; |
443 | al->map = NULL; | 442 | al->map = NULL; |
444 | al->sym = NULL; | ||
445 | return; | 443 | return; |
446 | } | 444 | } |
447 | try_again: | 445 | try_again: |
@@ -460,11 +458,21 @@ try_again: | |||
460 | mg = &session->kmaps; | 458 | mg = &session->kmaps; |
461 | goto try_again; | 459 | goto try_again; |
462 | } | 460 | } |
463 | al->sym = NULL; | 461 | } else |
464 | } else { | ||
465 | al->addr = al->map->map_ip(al->map, al->addr); | 462 | al->addr = al->map->map_ip(al->map, al->addr); |
463 | } | ||
464 | |||
465 | void thread__find_addr_location(struct thread *self, | ||
466 | struct perf_session *session, u8 cpumode, | ||
467 | enum map_type type, u64 addr, | ||
468 | struct addr_location *al, | ||
469 | symbol_filter_t filter) | ||
470 | { | ||
471 | thread__find_addr_map(self, session, cpumode, type, addr, al); | ||
472 | if (al->map != NULL) | ||
466 | al->sym = map__find_symbol(al->map, session, al->addr, filter); | 473 | al->sym = map__find_symbol(al->map, session, al->addr, filter); |
467 | } | 474 | else |
475 | al->sym = NULL; | ||
468 | } | 476 | } |
469 | 477 | ||
470 | static void dso__calc_col_width(struct dso *self) | 478 | static void dso__calc_col_width(struct dso *self) |
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index c06c13535a70..e35653c1817c 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -48,6 +48,11 @@ static inline struct map *thread__find_map(struct thread *self, | |||
48 | return self ? map_groups__find(&self->mg, type, addr) : NULL; | 48 | return self ? map_groups__find(&self->mg, type, addr) : NULL; |
49 | } | 49 | } |
50 | 50 | ||
51 | void thread__find_addr_map(struct thread *self, | ||
52 | struct perf_session *session, u8 cpumode, | ||
53 | enum map_type type, u64 addr, | ||
54 | struct addr_location *al); | ||
55 | |||
51 | void thread__find_addr_location(struct thread *self, | 56 | void thread__find_addr_location(struct thread *self, |
52 | struct perf_session *session, u8 cpumode, | 57 | struct perf_session *session, u8 cpumode, |
53 | enum map_type type, u64 addr, | 58 | enum map_type type, u64 addr, |