summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/ftrace.h
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2021-10-12 16:37:59 +0300
committerVasily Gorbik <gor@linux.ibm.com>2021-10-19 16:39:53 +0300
commit2ab3a0a9fad846e751148e9cdeda85a8f7765f31 (patch)
tree3de33a636ee0208fb3eaae71dcf94476c97dd7fc /arch/s390/include/asm/ftrace.h
parentb2f583937aad0e43cdf18186070e5502983f60fd (diff)
downloadlinux-2ab3a0a9fad846e751148e9cdeda85a8f7765f31.tar.xz
s390/ftrace: add HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALL support
This is the s390 variant of commit 562955fe6a55 ("ftrace/x86: Add register_ftrace_direct() for custom trampolines"). Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/20211012133802.2460757-2-hca@linux.ibm.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/ftrace.h')
-rw-r--r--arch/s390/include/asm/ftrace.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
index 4a721b44d4f4..267f70f4393f 100644
--- a/arch/s390/include/asm/ftrace.h
+++ b/arch/s390/include/asm/ftrace.h
@@ -59,6 +59,18 @@ static __always_inline void ftrace_instruction_pointer_set(struct ftrace_regs *f
}
/*
+ * When an ftrace registered caller is tracing a function that is
+ * also set by a register_ftrace_direct() call, it needs to be
+ * differentiated in the ftrace_caller trampoline. To do this,
+ * place the direct caller in the ORIG_GPR2 part of pt_regs. This
+ * tells the ftrace_caller that there's a direct caller.
+ */
+static inline void arch_ftrace_set_direct_caller(struct pt_regs *regs, unsigned long addr)
+{
+ regs->orig_gpr2 = addr;
+}
+
+/*
* Even though the system call numbers are identical for s390/s390x a
* different system call table is used for compat tasks. This may lead
* to e.g. incorrect or missing trace event sysfs files.