From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755198AbbCXQcN (ORCPT ); Tue, 24 Mar 2015 12:32:13 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56836 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752767AbbCXQcJ (ORCPT ); Tue, 24 Mar 2015 12:32:09 -0400 Date: Tue, 24 Mar 2015 09:31:14 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: namhyung@kernel.org, acme@redhat.com, hekuang@huawei.com, masami.hiramatsu.pt@hitachi.com, wangnan0@huawei.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org Reply-To: hekuang@huawei.com, acme@redhat.com, masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, peterz@infradead.org, tglx@linutronix.de, wangnan0@huawei.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org In-Reply-To: <20150322114022.32639.19096.stgit@localhost.localdomain> References: <20150322114022.32639.19096.stgit@localhost.localdomain> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe: Fix to get ummapped symbol address on kernel Git-Commit-ID: e6d7c91c8c5ea532584056f3e8bf1643310c8ef7 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: e6d7c91c8c5ea532584056f3e8bf1643310c8ef7 Gitweb: http://git.kernel.org/tip/e6d7c91c8c5ea532584056f3e8bf1643310c8ef7 Author: Masami Hiramatsu AuthorDate: Sun, 22 Mar 2015 20:40:22 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Mar 2015 12:07:04 -0300 perf probe: Fix to get ummapped symbol address on kernel Fix to get correctly unmapped symbol address on kernel. This allows us to probe on syscall symbols which are aliases of SyS_ functions with using debuginfo. Without this fix: ---- # ./perf probe -a sys_write Failed to find debug information for address 3b0100 Probe point 'sys_write' not found. Error: Failed to add events. ---- The address 0x3b0100 is a mapped address, and not usable in debuginfo. With this fix: ---- # ./perf probe -a sys_write Added new event: probe:sys_write (on sys_write) You can now use it in all perf tools, such as: perf record -e probe:sys_write -aR sleep 1 ---- Signed-off-by: Masami Hiramatsu Cc: He Kuang Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/20150322114022.32639.19096.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 6b95985..8feac07 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -310,7 +310,10 @@ static int find_alternative_probe_point(struct debuginfo *dinfo, /* Find the address of given function */ map__for_each_symbol_by_name(map, pp->function, sym) { - address = sym->start; + if (uprobes) + address = sym->start; + else + address = map->unmap_ip(map, sym->start); break; } if (!address) {