diff options
Diffstat (limited to 'arch/powerpc/include/asm/ftrace.h')
-rw-r--r-- | arch/powerpc/include/asm/ftrace.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h index fc3a2203c566..3dfb80b86561 100644 --- a/arch/powerpc/include/asm/ftrace.h +++ b/arch/powerpc/include/asm/ftrace.h | |||
@@ -65,19 +65,34 @@ struct dyn_arch_ftrace { | |||
65 | #endif /* CONFIG_FUNCTION_TRACER */ | 65 | #endif /* CONFIG_FUNCTION_TRACER */ |
66 | 66 | ||
67 | #ifndef __ASSEMBLY__ | 67 | #ifndef __ASSEMBLY__ |
68 | #if defined(CONFIG_FTRACE_SYSCALLS) && defined(PPC64_ELF_ABI_v1) | 68 | #ifdef CONFIG_FTRACE_SYSCALLS |
69 | /* | ||
70 | * Some syscall entry functions on powerpc start with "ppc_" (fork and clone, | ||
71 | * for instance) or ppc32_/ppc64_. We should also match the sys_ variant with | ||
72 | * those. | ||
73 | */ | ||
69 | #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME | 74 | #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME |
75 | #ifdef PPC64_ELF_ABI_v1 | ||
70 | static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) | 76 | static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) |
71 | { | 77 | { |
72 | /* | 78 | /* We need to skip past the initial dot, and the __se_sys alias */ |
73 | * Compare the symbol name with the system call name. Skip the .sys or .SyS | 79 | return !strcmp(sym + 1, name) || |
74 | * prefix from the symbol name and the sys prefix from the system call name and | 80 | (!strncmp(sym, ".__se_sys", 9) && !strcmp(sym + 6, name)) || |
75 | * just match the rest. This is only needed on ppc64 since symbol names on | 81 | (!strncmp(sym, ".ppc_", 5) && !strcmp(sym + 5, name + 4)) || |
76 | * 32bit do not start with a period so the generic function will work. | 82 | (!strncmp(sym, ".ppc32_", 7) && !strcmp(sym + 7, name + 4)) || |
77 | */ | 83 | (!strncmp(sym, ".ppc64_", 7) && !strcmp(sym + 7, name + 4)); |
78 | return !strcmp(sym + 4, name + 3); | ||
79 | } | 84 | } |
80 | #endif /* CONFIG_FTRACE_SYSCALLS && PPC64_ELF_ABI_v1 */ | 85 | #else |
86 | static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) | ||
87 | { | ||
88 | return !strcmp(sym, name) || | ||
89 | (!strncmp(sym, "__se_sys", 8) && !strcmp(sym + 5, name)) || | ||
90 | (!strncmp(sym, "ppc_", 4) && !strcmp(sym + 4, name + 4)) || | ||
91 | (!strncmp(sym, "ppc32_", 6) && !strcmp(sym + 6, name + 4)) || | ||
92 | (!strncmp(sym, "ppc64_", 6) && !strcmp(sym + 6, name + 4)); | ||
93 | } | ||
94 | #endif /* PPC64_ELF_ABI_v1 */ | ||
95 | #endif /* CONFIG_FTRACE_SYSCALLS */ | ||
81 | 96 | ||
82 | #ifdef CONFIG_PPC64 | 97 | #ifdef CONFIG_PPC64 |
83 | #include <asm/paca.h> | 98 | #include <asm/paca.h> |