diff mbox

ftrace: filter: Match dot symbols when searching functions on ppc64.

Message ID 3507082.VaWR3lh7Ni@hactar (mailing list archive)
State Superseded
Headers show

Commit Message

Thiago Jung Bauermann April 1, 2016, 9:28 p.m. UTC
Am Samstag, 02 April 2016, 03:51:21 schrieb kbuild test robot:
> >> arch/powerpc/include/asm/ftrace.h:62:5: error: "CONFIG_PPC64" is not
> >> defined [-Werror=undef]
>     #if CONFIG_PPC64 && (!defined(_CALL_ELF) || _CALL_ELF != 2)
>         ^
>    cc1: all warnings being treated as errors

I forgot to use defined() in the #if expression. Here’s the fixed version.

Comments

Thiago Jung Bauermann April 14, 2016, 12:39 a.m. UTC | #1
Hello,

Am Freitag, 01 April 2016, 18:28:06 schrieb Thiago Jung Bauermann:
> Am Samstag, 02 April 2016, 03:51:21 schrieb kbuild test robot:
> > >> arch/powerpc/include/asm/ftrace.h:62:5: error: "CONFIG_PPC64" is not
> > >> defined [-Werror=undef]
> > >> 
> >     #if CONFIG_PPC64 && (!defined(_CALL_ELF) || _CALL_ELF != 2)
> >     
> >         ^
> >    
> >    cc1: all warnings being treated as errors
> 
> I forgot to use defined() in the #if expression. Here’s the fixed version.

People seem to be considering patches for next, so this looks like a good 
moment to ping about this one.

Ps: patchwork seems to have an issue which causes it to show the message 
body as if it were the commit message, but if you feed my original email 
(the one I’m replying to here) to git am, the commit message will be 
correct.
Steven Rostedt April 14, 2016, 3:51 a.m. UTC | #2
On Wed, 13 Apr 2016 21:39 -0300
Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> wrote:


> People seem to be considering patches for next, so this looks like a good 
> moment to ping about this one.

Your timing is fine with respect to the merge window. I'm currently
traveling, but I'll get to it on Monday. I have it marked as TODO.

> 
> Ps: patchwork seems to have an issue which causes it to show the message 
> body as if it were the commit message, but if you feed my original email 
> (the one I’m replying to here) to git am, the commit message will be 
> correct.
> 

Yeah I noticed that. But I'll be able to handle it.

Thanks,

-- Steve
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
index 50ca7585abe2..f6ed1908f0f7 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -58,6 +58,15 @@  struct dyn_arch_ftrace {
 	struct module *mod;
 };
 #endif /*  CONFIG_DYNAMIC_FTRACE */
+
+#if defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF != 2)
+#define ARCH_HAS_FTRACE_MATCH_ADJUST
+static inline void arch_ftrace_match_adjust(char **str, char *search)
+{
+	if ((*str)[0] == '.' && search[0] != '.')
+		(*str)++;
+}
+#endif /* defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF != 2) */
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b1870fbd2b67..e806c2a3b7a8 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3444,11 +3444,24 @@  struct ftrace_glob {
 	int type;
 };
 
+#ifndef ARCH_HAS_FTRACE_MATCH_ADJUST
+/*
+ * 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.
+*/
+static inline void arch_ftrace_match_adjust(char **str, char *search)
+{
+}
+#endif
+
 static int ftrace_match(char *str, struct ftrace_glob *g)
 {
 	int matched = 0;
 	int slen;
 
+	arch_ftrace_match_adjust(&str, g->search);
+
 	switch (g->type) {
 	case MATCH_FULL:
 		if (strcmp(str, g->search) == 0)