From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751242AbdGMJmv (ORCPT ); Thu, 13 Jul 2017 05:42:51 -0400 Received: from terminus.zytor.com ([65.50.211.136]:49231 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751046AbdGMJmu (ORCPT ); Thu, 13 Jul 2017 05:42:50 -0400 Date: Thu, 13 Jul 2017 02:40:28 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: jolsa@kernel.org, zvonko.kosic@de.ibm.com, adrian.hunter@intel.com, brueckner@linux.vnet.ibm.com, dsahern@gmail.com, hpa@zytor.com, wangnan0@huawei.com, namhyung@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, tmricht@linux.vnet.ibm.com, tglx@linutronix.de Reply-To: tglx@linutronix.de, tmricht@linux.vnet.ibm.com, acme@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, dsahern@gmail.com, wangnan0@huawei.com, hpa@zytor.com, namhyung@kernel.org, brueckner@linux.vnet.ibm.com, adrian.hunter@intel.com, jolsa@kernel.org, zvonko.kosic@de.ibm.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf symbols: Accept zero as the kernel base address Git-Commit-ID: 4b1303d0b01440f224cf81493b7e8e43d9b4965e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4b1303d0b01440f224cf81493b7e8e43d9b4965e Gitweb: http://git.kernel.org/tip/4b1303d0b01440f224cf81493b7e8e43d9b4965e Author: Arnaldo Carvalho de Melo AuthorDate: Tue, 11 Jul 2017 16:21:40 -0300 Committer: Arnaldo Carvalho de Melo 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 0x26fa84 and 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.... ---- Reported-and-Tested-by: Thomas-Mich Richter Cc: Adrian Hunter Cc: David Ahern Cc: Hendrik Brueckner Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Cc: Zvonko Kosic Link: http://lkml.kernel.org/n/tip-dk0n1uzmbe0tbthrpfqlx6bz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 5de2b86..2e9eb6a 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -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;