Skip to content

Commit 500e626

Browse files
AndybnACTpalmer-dabbelt
authored andcommitted
kernel: ftrace: export ftrace_sync_ipi
The following ftrace patch for riscv uses a data store to update ftrace function. Therefore, a romote fence is required to order it against function_trace_op updates. The mechanism is similar to the fence between function_trace_op and update_ftrace_func in the generic ftrace, so we leverage the same ftrace_sync_ipi function. [ alex: Fix build warning when !CONFIG_DYNAMIC_FTRACE ] Signed-off-by: Andy Chiu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Ghiti <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent c41bf43 commit 500e626

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/linux/ftrace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ enum {
635635
#define ftrace_get_symaddr(fentry_ip) (0)
636636
#endif
637637

638+
void ftrace_sync_ipi(void *data);
639+
638640
#ifdef CONFIG_DYNAMIC_FTRACE
639641

640642
void ftrace_arch_code_modify_prepare(void);

kernel/trace/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void ftrace_pid_func(unsigned long ip, unsigned long parent_ip,
188188
op->saved_func(ip, parent_ip, op, fregs);
189189
}
190190

191-
static void ftrace_sync_ipi(void *data)
191+
void ftrace_sync_ipi(void *data)
192192
{
193193
/* Probably not needed, but do it anyway */
194194
smp_rmb();

0 commit comments

Comments
 (0)