1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_S390_FTRACE_H
3 #define _ASM_S390_FTRACE_H
5 #define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
6 #define ARCH_SUPPORTS_FTRACE_OPS 1
7 #define MCOUNT_INSN_SIZE 6
11 #ifdef CONFIG_CC_IS_CLANG
12 /* https://bugs.llvm.org/show_bug.cgi?id=41424 */
13 #define ftrace_return_address(n) 0UL
15 #define ftrace_return_address(n) __builtin_return_address(n)
18 void ftrace_caller(void);
20 extern char ftrace_graph_caller_end;
21 extern void *ftrace_func;
23 struct dyn_arch_ftrace { };
26 #define FTRACE_ADDR ((unsigned long)ftrace_caller)
28 #define KPROBE_ON_FTRACE_NOP 0
29 #define KPROBE_ON_FTRACE_CALL 1
34 bool ftrace_need_init_nop(void);
35 #define ftrace_need_init_nop ftrace_need_init_nop
37 int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec);
38 #define ftrace_init_nop ftrace_init_nop
40 static inline unsigned long ftrace_call_adjust(unsigned long addr)
46 * Even though the system call numbers are identical for s390/s390x a
47 * different system call table is used for compat tasks. This may lead
48 * to e.g. incorrect or missing trace event sysfs files.
49 * Therefore simply do not trace compat system calls at all.
50 * See kernel/trace/trace_syscalls.c.
52 #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS
53 static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
55 return is_compat_task();
58 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
59 static inline bool arch_syscall_match_sym_name(const char *sym,
63 * Skip __s390_ and __s390x_ prefix - due to compat wrappers
64 * and aliasing some symbols of 64 bit system call functions
65 * may get the __s390_ prefix instead of the __s390x_ prefix.
67 return !strcmp(sym + 7, name) || !strcmp(sym + 8, name);
70 #endif /* __ASSEMBLY__ */
71 #endif /* _ASM_S390_FTRACE_H */