Skip to content

Commit

Permalink
perf symbols: Fix up map end too on modular kernels with no modules i…
Browse files Browse the repository at this point in the history
…nstalled

In 2161db9 we stopped failing when not finding modules when
asked too, but then the kernel maps (just one, for vmlinux)
wasn't having its ->end field correctly set up, so symbols were
not being found for the vmlinux map because its range was 0-0.

Reported-by: Ingo Molnar <mingo@elte.hu>
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: <1266702793-29434-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
acmel authored and Ingo Molnar committed Feb 21, 2010
1 parent f7e7ee3 commit 10fe12e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@ int event__process_mmap(event_t *self, struct perf_session *session)

session->vmlinux_maps[MAP__FUNCTION]->start = self->mmap.start;
session->vmlinux_maps[MAP__FUNCTION]->end = self->mmap.start + self->mmap.len;
/*
* Be a bit paranoid here, some perf.data file came with
* a zero sized synthesized MMAP event for the kernel.
*/
if (session->vmlinux_maps[MAP__FUNCTION]->end == 0)
session->vmlinux_maps[MAP__FUNCTION]->end = ~0UL;

perf_session__set_kallsyms_ref_reloc_sym(session, symbol_name,
self->mmap.pgoff);
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,7 @@ int map_groups__create_kernel_maps(struct map_groups *self,
return -1;

if (symbol_conf.use_modules && map_groups__create_modules(self) < 0)
return 0;
pr_debug("Problems creating module maps, continuing anyway...\n");
/*
* Now that we have all the maps created, just set the ->end of them:
*/
Expand Down

0 comments on commit 10fe12e

Please sign in to comment.