hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/arch/s390/include/asm/ftrace.h
....@@ -11,9 +11,16 @@
1111 #define MCOUNT_RETURN_FIXUP 18
1212 #endif
1313
14
+#define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
15
+
1416 #ifndef __ASSEMBLY__
1517
18
+#ifdef CONFIG_CC_IS_CLANG
19
+/* https://bugs.llvm.org/show_bug.cgi?id=41424 */
20
+#define ftrace_return_address(n) 0UL
21
+#else
1622 #define ftrace_return_address(n) __builtin_return_address(n)
23
+#endif
1724
1825 void _mcount(void);
1926 void ftrace_caller(void);
....@@ -82,5 +89,30 @@
8289 #endif
8390 }
8491
92
+/*
93
+ * Even though the system call numbers are identical for s390/s390x a
94
+ * different system call table is used for compat tasks. This may lead
95
+ * to e.g. incorrect or missing trace event sysfs files.
96
+ * Therefore simply do not trace compat system calls at all.
97
+ * See kernel/trace/trace_syscalls.c.
98
+ */
99
+#define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS
100
+static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
101
+{
102
+ return is_compat_task();
103
+}
104
+
105
+#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
106
+static inline bool arch_syscall_match_sym_name(const char *sym,
107
+ const char *name)
108
+{
109
+ /*
110
+ * Skip __s390_ and __s390x_ prefix - due to compat wrappers
111
+ * and aliasing some symbols of 64 bit system call functions
112
+ * may get the __s390_ prefix instead of the __s390x_ prefix.
113
+ */
114
+ return !strcmp(sym + 7, name) || !strcmp(sym + 8, name);
115
+}
116
+
85117 #endif /* __ASSEMBLY__ */
86118 #endif /* _ASM_S390_FTRACE_H */