diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2018-04-19 09:04:02 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-05-03 14:32:26 +0200 |
commit | acd55b1005768266e899b0da51babcb57e75e846 (patch) | |
tree | d171c355970535a82d7d65187f450076e3df0d4c /arch/powerpc/include/asm/ftrace.h | |
parent | powerpc64/ftrace: Rearrange #ifdef sections in ftrace.h (diff) | |
download | linux-acd55b1005768266e899b0da51babcb57e75e846.tar.xz linux-acd55b1005768266e899b0da51babcb57e75e846.zip |
powerpc64/ftrace: Add helpers to hard disable ftrace
Add some helpers to enable/disable ftrace through paca->ftrace_enabled.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/ftrace.h')
-rw-r--r-- | arch/powerpc/include/asm/ftrace.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h index ebfc0b846bb5..3b5e85a72e10 100644 --- a/arch/powerpc/include/asm/ftrace.h +++ b/arch/powerpc/include/asm/ftrace.h @@ -82,6 +82,23 @@ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name return !strcmp(sym + 4, name + 3); } #endif /* CONFIG_FTRACE_SYSCALLS && PPC64_ELF_ABI_v1 */ + +#ifdef CONFIG_PPC64 +#include <asm/paca.h> + +static inline void this_cpu_disable_ftrace(void) +{ + get_paca()->ftrace_enabled = 0; +} + +static inline void this_cpu_enable_ftrace(void) +{ + get_paca()->ftrace_enabled = 1; +} +#else /* CONFIG_PPC64 */ +static inline void this_cpu_disable_ftrace(void) { } +static inline void this_cpu_enable_ftrace(void) { } +#endif /* CONFIG_PPC64 */ #endif /* !__ASSEMBLY__ */ #endif /* _ASM_POWERPC_FTRACE */ |