path: root/kernel/trace
diff options
authorThiago Jung Bauermann <>2016-04-25 18:56:14 -0300
committerMichael Ellerman <>2016-04-27 09:47:29 +1000
commit7132e2d669bd42c3783327f301aaac5f4463299b (patch)
tree01c7d9a61ec5eaa53e677d42572f90c1bbcd30ac /kernel/trace
parent8fe088850f13eabf8197df5b0bf38668fa6c1294 (diff)
ftrace: Match dot symbols when searching functions on ppc64
In the ppc64 big endian ABI, function symbols point to function descriptors. The symbols which point to the function entry points have a dot in front of the function name. Consequently, when the ftrace filter mechanism searches for the symbol corresponding to an entry point address, it gets the dot symbol. As a result, ftrace filter users have to be aware of this ABI detail on ppc64 and prepend a dot to the function name when setting the filter. The perf probe command insulates the user from this by ignoring the dot in front of the symbol name when matching function names to symbols, but the sysfs interface does not. This patch makes the ftrace filter mechanism do the same when searching symbols. Fixes the following failure in ftracetest's .../ line 9: echo: write error: Invalid argument That failure is on this line of echo _do_fork > set_ftrace_filter This is because there's no _do_fork entry in the functions list: # cat available_filter_functions | grep _do_fork ._do_fork This change introduces no regressions on the perf and ftracetest testsuite results. Cc: Steven Rostedt <> Cc: Ingo Molnar <> Cc: Michael Ellerman <> Cc: Signed-off-by: Thiago Jung Bauermann <> Acked-by: Steven Rostedt <> Signed-off-by: Michael Ellerman <>
Diffstat (limited to 'kernel/trace')
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7e8d792da963..a6c8252d7776 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3456,11 +3456,23 @@ struct ftrace_glob {
int type;
+ * If symbols in an architecture don't correspond exactly to the user-visible
+ * name of what they represent, it is possible to define this function to
+ * perform the necessary adjustments.
+char * __weak arch_ftrace_match_adjust(char *str, const char *search)
+ return str;
static int ftrace_match(char *str, struct ftrace_glob *g)
int matched = 0;
int slen;
+ str = arch_ftrace_match_adjust(str, g->search);
switch (g->type) {
if (strcmp(str, g->search) == 0)