OSDN Git Service

perf machine: Don't search for active kernel start in __machine__create_kernel_maps
authorJiri Olsa <jolsa@kernel.org>
Thu, 15 Feb 2018 12:26:32 +0000 (13:26 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Feb 2018 17:25:57 +0000 (14:25 -0300)
commit1fb87b8e9599932e1d8b11c3a1b03b4414aaf7ba
tree8e9139b562c59df2079caf2795f9e6979684a5f7
parent05db6ff73d805ecc70947c9eee2ed9948d0be52b
perf machine: Don't search for active kernel start in __machine__create_kernel_maps

We should not search for the kernel start address in
__machine__create_kernel_maps(), because it's being used in the 'report'
code path, where we are interested in kernel MMAP data address (the one
recorded via 'perf record', possibly on another machine, or an older or
newer kernel on the same machine where analysis is being performed)
instead of in current kernel address.

The __machine__create_kernel_maps() function serves purely for creating
the machines kernel maps and setting up the kmap group. The report code
path then sets the address based on the data from kernel MMAP event in
the machine__set_kernel_mmap() function.

The kallsyms search address logic is used for test code, that calls
machine__create_kernel_maps() to get current maps and calls
machine__get_running_kernel_start() to get kernel starting address.

Use machine__set_kernel_mmap() to set the kernel maps start address and
moving map_groups__fixup_end to be call when all maps are in place.

Also make __machine__create_kernel_maps static, because there's no
external user.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180215122635.24029-7-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/machine.c
tools/perf/util/machine.h