Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757442AbbEFDMO (ORCPT ); Tue, 5 May 2015 23:12:14 -0400 Received: from terminus.zytor.com ([198.137.202.10]:36233 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757406AbbEFDMJ (ORCPT ); Tue, 5 May 2015 23:12:09 -0400 Date: Tue, 5 May 2015 20:11:34 -0700 From: "tip-bot for Naveen N. Rao" Message-ID: Cc: hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, ananth@in.ibm.com, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, srikar@linux.vnet.ibm.com, sukadev@linux.vnet.ibm.com, naveen.n.rao@linux.vnet.ibm.com, acme@redhat.com, masami.hiramatsu.pt@hitachi.com Reply-To: hpa@zytor.com, mingo@kernel.org, ananth@in.ibm.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mpe@ellerman.id.au, srikar@linux.vnet.ibm.com, sukadev@linux.vnet.ibm.com, masami.hiramatsu.pt@hitachi.com, acme@redhat.com, naveen.n.rao@linux.vnet.ibm.com In-Reply-To: <92253021e77a104b23b615c8c23bf9501dfe60bf.1430217967.git.naveen.n.rao@linux.vnet.ibm.com> References: <92253021e77a104b23b615c8c23bf9501dfe60bf.1430217967.git.naveen.n.rao@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe ppc64le: Fixup function entry if using kallsyms lookup Git-Commit-ID: 7b6ff0bdbf4f7f429c2116cca92a6d171217449e 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 Content-Length: 3844 Lines: 94 Commit-ID: 7b6ff0bdbf4f7f429c2116cca92a6d171217449e Gitweb: http://git.kernel.org/tip/7b6ff0bdbf4f7f429c2116cca92a6d171217449e Author: Naveen N. Rao AuthorDate: Tue, 28 Apr 2015 17:35:40 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 4 May 2015 12:43:47 -0300 perf probe ppc64le: Fixup function entry if using kallsyms lookup On powerpc ABIv2, if no debug-info is found and we use kallsyms, we need to fixup the function entry to point to the local entry point. Use offset of 8 since current toolchains always generate 2 instructions (8 bytes). Signed-off-by: Naveen N. Rao Reviewed-by: Srikar Dronamraju Cc: Ananth N Mavinakayanahalli Cc: Masami Hiramatsu Cc: Michael Ellerman Cc: Sukadev Bhattiprolu Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/92253021e77a104b23b615c8c23bf9501dfe60bf.1430217967.git.naveen.n.rao@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/arch/powerpc/util/sym-handling.c | 15 +++++++++++++++ tools/perf/util/probe-event.c | 5 +++++ tools/perf/util/probe-event.h | 2 ++ 3 files changed, 22 insertions(+) diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index a170060..bbc1a50 100644 --- a/tools/perf/arch/powerpc/util/sym-handling.c +++ b/tools/perf/arch/powerpc/util/sym-handling.c @@ -64,4 +64,19 @@ bool arch__prefers_symtab(void) { return true; } + +#define PPC64LE_LEP_OFFSET 8 + +void arch__fix_tev_from_maps(struct perf_probe_event *pev, + struct probe_trace_event *tev, struct map *map) +{ + /* + * ppc64 ABIv2 local entry point is currently always 2 instructions + * (8 bytes) after the global entry point. + */ + if (!pev->uprobes && map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) { + tev->point.address += PPC64LE_LEP_OFFSET; + tev->point.offset += PPC64LE_LEP_OFFSET; + } +} #endif diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 4dfb412..eb75a5e 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -2447,6 +2447,10 @@ static int find_probe_functions(struct map *map, char *name) #define strdup_or_goto(str, label) \ ({ char *__p = strdup(str); if (!__p) goto label; __p; }) +void __weak arch__fix_tev_from_maps(struct perf_probe_event *pev __maybe_unused, + struct probe_trace_event *tev __maybe_unused, + struct map *map __maybe_unused) { } + /* * Find probe function addresses from map. * Return an error or the number of found probe_trace_event @@ -2553,6 +2557,7 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev, strdup_or_goto(pev->args[i].type, nomem_out); } + arch__fix_tev_from_maps(pev, tev, map); } out: diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h index 52bca4b..180f142 100644 --- a/tools/perf/util/probe-event.h +++ b/tools/perf/util/probe-event.h @@ -136,6 +136,8 @@ extern int show_available_vars(struct perf_probe_event *pevs, int npevs, extern int show_available_funcs(const char *module, struct strfilter *filter, bool user); bool arch__prefers_symtab(void); +void arch__fix_tev_from_maps(struct perf_probe_event *pev, + struct probe_trace_event *tev, struct map *map); /* Maximum index number of event-name postfix */ #define MAX_EVENT_INDEX 1024 -- 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/