perf symbols: Accept zero as the kernel base address
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 4b1303d0b01440f224cf81493b7e8e43d9b4965e Gitweb: http://git.kernel.org/tip/4b1303d0b01440f224cf81493b7e8e43d9b4965e Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Tue, 11 Jul 2017 16:21:40 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Wed, 12 Jul 2017 11:47:05 -0300
perf symbols: Accept zero as the kernel base address
Which is the case in S/390, where symbols were not being resolved because machine__get_kernel_start was only setting machine->kernel_start when the just successfully loaded kernel symtab had its map->start set to !0, when it was left at (1ULL << 63) assuming a partitioning of the address space for user/kernel, which is not the case in S/390 nor in Sparc.
So just check if map__load() was successfull and set machine->kernel_start to zero, fixing kernel symbol resolution on S/390.
Test performed by Thomas:
----
I like this patch. I have done a new build and removed all my debug output to start from scratch. Without your patch I get this:
# Samples: 4 of event 'cpu-clock'
# Event count (approx.): 1000000
#
# Children Self Command Shared Object Symbol
# ........ ........ ....... ................ ........................
75.00% 0.00% true [unknown] [k] 0x00000000004bedda
|
---0x4bedda
|
|--50.00%--0x42693a
| |
| --25.00%--0x2a72e0
| 0x2af0ca
| 0x3d1003fe4c0
|
--25.00%--0x4272bc
0x26fa84and with your patch (I just rebuilt the perf tool, nothing else and used the same perf.data file as input):
# Samples: 4 of event 'cpu-clock'
# Event count (approx.): 1000000
#
# Children Self Command Shared Object Symbol
# ........ ........ ....... .......................... ..................................
75.00% 0.00% true [kernel.vmlinux] [k] pgm_check_handler
|
---pgm_check_handler
do_dat_exception
handle_mm_fault
__handle_mm_fault
filemap_map_pages
|
|--25.00%--rcu_read_lock_held
| rcu_lockdep_current_cpu_online
| 0x3d1003ff4c0
|
--25.00%--lock_release Looks good to me....
----
--- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/machine.c +1 -1
@@ -2209,7 +2209,7 @@ int machine__get_kernel_start(struct machine *machine) machine->kernel_start =1ULL <<63 ;if (map) { err =map__load (map); -if (map->start) +if (!err) machine->kernel_start = map->start; }return err;