]> git.baikalelectronics.ru Git - kernel.git/commit
perf symbols: Get kernel start address by symbol name
authorSimon Que <sque@chromium.org>
Mon, 16 Jun 2014 18:32:09 +0000 (11:32 -0700)
committerJiri Olsa <jolsa@kernel.org>
Fri, 20 Jun 2014 07:34:22 +0000 (09:34 +0200)
commit7411aaac5aa8071883e0b375eb2685e68cddd217
tree3816f86c02f055fa02437000a2b3fa660a51cf66
parent2a8ff87b931bf1a244833fd61320f6288d5f32cc
perf symbols: Get kernel start address by symbol name

The function machine__get_kernel_start_addr() was taking the first symbol
of kallsyms as the start address. This is incorrect in certain cases
where the first symbol is something at 0, while the actual kernel
functions begin at a later point (e.g. 0x80200000).

This patch fixes machine__get_kernel_start_addr() to search for the
symbol "_text" or "_stext", which marks the beginning of kernel mapping.
This was already being done in machine__create_kernel_maps(). Thus, this
patch is just a refactor, to move that code into
machine__get_kernel_start_addr().

Signed-off-by: Simon Que <sque@chromium.org>
Link: http://lkml.kernel.org/r/1402943529-13244-1-git-send-email-sque@chromium.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
tools/perf/util/machine.c