path: root/tools/perf/arch/powerpc/util/sym-handling.c
diff options
authorNaveen N. Rao <>2015-04-28 17:35:39 +0530
committerArnaldo Carvalho de Melo <>2015-05-04 12:43:46 -0300
commitd5c2e2c17ae1d630ddbceb53a264f24cc99703a4 (patch)
tree140641716e514c3f40e1002f26146cfacf91f5c0 /tools/perf/arch/powerpc/util/sym-handling.c
parentc50fc0a43e33a6c3257c5cbb954cd747d7b9a680 (diff)
perf probe ppc64le: Prefer symbol table lookup over DWARF
Use symbol table lookups by default if DWARF is not necessary, since powerpc ABIv2 encodes local entry points in the symbol table and the function entry address in DWARF may not be appropriate for kprobes, as described here: "The DWARF address ranges deliberately include the *whole* function, both global and local entry points." ... "If you want to set probes on a local entry point, you should look up the symbol in the main symbol table (not DWARF), and check the st_other bits; they will indicate whether the function has a local entry point, and what its offset from the global entry point is. Note that GDB does the same when setting a breakpoint on a function entry." Signed-off-by: Naveen N. Rao <> Reviewed-by: Srikar Dronamraju <> Cc: Ananth N Mavinakayanahalli <> Cc: Masami Hiramatsu <> Cc: Michael Ellerman <> Cc: Sukadev Bhattiprolu <> Cc: Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/arch/powerpc/util/sym-handling.c')
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c
index 012a0f8098de..a1700609e145 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -9,6 +9,7 @@
#include "debug.h"
#include "symbol.h"
#include "map.h"
+#include "probe-event.h"
bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
@@ -57,3 +58,10 @@ int arch__compare_symbol_names(const char *namea, const char *nameb)
return strcmp(namea, nameb);
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+bool arch__prefers_symtab(void)
+ return true;