Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755054AbbB0PFW (ORCPT ); Fri, 27 Feb 2015 10:05:22 -0500 Received: from mail9.hitachi.co.jp ([133.145.228.44]:43029 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753340AbbB0PFT (ORCPT ); Fri, 27 Feb 2015 10:05:19 -0500 X-AuditID: 85900ec0-a0ec5b90000043ee-f9-54f08773c7b2 Subject: [PATCH perf/core ] [BUGFIX] perf-probe: Remove bias offset to find probe point by address From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , namhyung@kernel.org, Ingo Molnar , Linux Kernel Mailing List Date: Sat, 28 Feb 2015 00:04:13 +0900 Message-ID: <20150227150413.13393.39907.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1859 Lines: 47 Remove bias offset to find probe point by address. Without this patch, probe points on kernel and executables are shown correctly, but not work with libraries. ----- # ./perf probe -l probe:do_fork (on do_fork@kernel/fork.c) probe_libc:malloc (on malloc in /usr/lib64/libc-2.17.so) probe_perf:strlist__new (on strlist__new@util/strlist.c in /home/mhiramat/ksrc/linux-3/tools/perf/perf) ----- Removing bias allows to show it as real place. ----- # ./perf probe -l probe:do_fork (on do_fork@kernel/fork.c) probe_libc:malloc (on __libc_malloc@malloc/malloc.c in /usr/lib64/libc-2.17.so) probe_perf:strlist__new (on strlist__new@util/strlist.c in /home/mhiramat/ksrc/linux-3/tools/perf/perf) ----- Signed-off-by: Masami Hiramatsu --- tools/perf/util/probe-finder.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index d141935..46f009a 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -1345,11 +1345,8 @@ int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr, const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp; int baseline = 0, lineno = 0, ret = 0; - /* Adjust address with bias */ - addr += dbg->bias; - /* Find cu die */ - if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr - dbg->bias, &cudie)) { + if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) { pr_warning("Failed to find debug information for address %lx\n", addr); ret = -EINVAL; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/