Skip to content

Commit

Permalink
perf symbols: Support multiple symtabs in struct thread
Browse files Browse the repository at this point in the history
Making the routines that were so far specific to the kernel maps
useful for all threads.

This is done by making the kernel maps be contained in a kernel
"thread".

This gets the kernel specific routines closer to the userspace
counterparts, which will help in reducing the boilerplate for
resolving a symbol, as will be demonstrated in the next patches.

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: <1259346563-12568-9-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 27, 2009
1 parent 23ea4a3 commit 95011c6
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 133 deletions.
2 changes: 1 addition & 1 deletion tools/perf/builtin-annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
map ? map->dso->long_name : "<not found>");
} else if (event->header.misc & PERF_RECORD_MISC_USER) {
level = '.';
map = thread__find_map(thread, ip);
map = thread__find_map(thread, MAP__FUNCTION, ip);
if (map != NULL) {
ip = map->map_ip(map, ip);
sym = map__find_symbol(map, ip, symbol_filter);
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ resolve_symbol(struct thread *thread, struct map **mapp, u64 *ipp)
if (!thread)
return NULL;

map = thread__find_map(thread, ip);
map = thread__find_map(thread, MAP__FUNCTION, ip);
if (map != NULL) {
/*
* We have to do this here as we may have a dso
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ static void event__process_sample(const event_t *self, int counter)
if (thread == NULL)
return;

map = thread__find_map(thread, ip);
map = thread__find_map(thread, MAP__FUNCTION, ip);
if (map != NULL) {
ip = map->map_ip(map, ip);
sym = map__find_symbol(map, ip, symbol_filter);
Expand Down
Loading

0 comments on commit 95011c6

Please sign in to comment.