hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/powerpc/include/asm/ftrace.h
....@@ -8,6 +8,8 @@
88 #define MCOUNT_ADDR ((unsigned long)(_mcount))
99 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
1010
11
+#define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
12
+
1113 #ifdef __ASSEMBLY__
1214
1315 /* Based off of objdump optput from glibc */
....@@ -94,7 +96,7 @@
9496 #endif /* PPC64_ELF_ABI_v1 */
9597 #endif /* CONFIG_FTRACE_SYSCALLS */
9698
97
-#ifdef CONFIG_PPC64
99
+#if defined(CONFIG_PPC64) && defined(CONFIG_FUNCTION_TRACER)
98100 #include <asm/paca.h>
99101
100102 static inline void this_cpu_disable_ftrace(void)
....@@ -106,9 +108,25 @@
106108 {
107109 get_paca()->ftrace_enabled = 1;
108110 }
111
+
112
+/* Disable ftrace on this CPU if possible (may not be implemented) */
113
+static inline void this_cpu_set_ftrace_enabled(u8 ftrace_enabled)
114
+{
115
+ get_paca()->ftrace_enabled = ftrace_enabled;
116
+}
117
+
118
+static inline u8 this_cpu_get_ftrace_enabled(void)
119
+{
120
+ return get_paca()->ftrace_enabled;
121
+}
122
+
123
+void ftrace_free_init_tramp(void);
109124 #else /* CONFIG_PPC64 */
110125 static inline void this_cpu_disable_ftrace(void) { }
111126 static inline void this_cpu_enable_ftrace(void) { }
127
+static inline void this_cpu_set_ftrace_enabled(u8 ftrace_enabled) { }
128
+static inline u8 this_cpu_get_ftrace_enabled(void) { return 1; }
129
+static inline void ftrace_free_init_tramp(void) { }
112130 #endif /* CONFIG_PPC64 */
113131 #endif /* !__ASSEMBLY__ */
114132