Skip to content

Commit

Permalink
powerpc64/ftrace: Add helpers to hard disable ftrace
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Naveen N. Rao authored and Michael Ellerman committed May 3, 2018
1 parent c3e59d7 commit acd55b1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions arch/powerpc/include/asm/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit acd55b1

Please sign in to comment.