Skip to content

Commit 7d8b31b

Browse files
arndbrostedt
authored andcommitted
tracing: arm64: Avoid missing-prototype warnings
These are all tracing W=1 warnings in arm64 allmodconfig about missing prototypes: kernel/trace/trace_kprobe_selftest.c:7:5: error: no previous prototype for 'kprobe_trace_selftest_target' [-Werror=missing-pro totypes] kernel/trace/ftrace.c:329:5: error: no previous prototype for '__register_ftrace_function' [-Werror=missing-prototypes] kernel/trace/ftrace.c:372:5: error: no previous prototype for '__unregister_ftrace_function' [-Werror=missing-prototypes] kernel/trace/ftrace.c:4130:15: error: no previous prototype for 'arch_ftrace_match_adjust' [-Werror=missing-prototypes] kernel/trace/fgraph.c:243:15: error: no previous prototype for 'ftrace_return_to_handler' [-Werror=missing-prototypes] kernel/trace/fgraph.c:358:6: error: no previous prototype for 'ftrace_graph_sleep_time_control' [-Werror=missing-prototypes] arch/arm64/kernel/ftrace.c:460:6: error: no previous prototype for 'prepare_ftrace_return' [-Werror=missing-prototypes] arch/arm64/kernel/ptrace.c:2172:5: error: no previous prototype for 'syscall_trace_enter' [-Werror=missing-prototypes] arch/arm64/kernel/ptrace.c:2195:6: error: no previous prototype for 'syscall_trace_exit' [-Werror=missing-prototypes] Move the declarations to an appropriate header where they can be seen by the caller and callee, and make sure the headers are included where needed. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Will Deacon <[email protected]> Cc: Kees Cook <[email protected]> Cc: Florent Revest <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Catalin Marinas <[email protected]> [ Fixed ftrace_return_to_handler() to handle CONFIG_HAVE_FUNCTION_GRAPH_RETVAL case ] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 769e637 commit 7d8b31b

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

arch/arm64/include/asm/ftrace.h

+4
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ static inline unsigned long fgraph_ret_regs_frame_pointer(struct fgraph_ret_regs
211211
{
212212
return ret_regs->fp;
213213
}
214+
215+
void prepare_ftrace_return(unsigned long self_addr, unsigned long *parent,
216+
unsigned long frame_pointer);
217+
214218
#endif /* ifdef CONFIG_FUNCTION_GRAPH_TRACER */
215219
#endif
216220

arch/arm64/include/asm/syscall.h

+3
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@ static inline int syscall_get_arch(struct task_struct *task)
8585
return AUDIT_ARCH_AARCH64;
8686
}
8787

88+
int syscall_trace_enter(struct pt_regs *regs);
89+
void syscall_trace_exit(struct pt_regs *regs);
90+
8891
#endif /* __ASM_SYSCALL_H */

arch/arm64/kernel/syscall.c

-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ static inline bool has_syscall_work(unsigned long flags)
7575
return unlikely(flags & _TIF_SYSCALL_WORK);
7676
}
7777

78-
int syscall_trace_enter(struct pt_regs *regs);
79-
void syscall_trace_exit(struct pt_regs *regs);
80-
8178
static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
8279
const syscall_fn_t syscall_table[])
8380
{

include/linux/ftrace.h

+9
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ struct ftrace_ops;
4141
struct ftrace_regs;
4242
struct dyn_ftrace;
4343

44+
char *arch_ftrace_match_adjust(char *str, const char *search);
45+
46+
#ifdef CONFIG_HAVE_FUNCTION_GRAPH_RETVAL
47+
struct fgraph_ret_regs;
48+
unsigned long ftrace_return_to_handler(struct fgraph_ret_regs *ret_regs);
49+
#else
50+
unsigned long ftrace_return_to_handler(unsigned long frame_pointer);
51+
#endif
52+
4453
#ifdef CONFIG_FUNCTION_TRACER
4554
/*
4655
* If the arch's mcount caller does not support all of ftrace's

kernel/trace/fgraph.c

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <trace/events/sched.h>
1616

1717
#include "ftrace_internal.h"
18+
#include "trace.h"
1819

1920
#ifdef CONFIG_DYNAMIC_FTRACE
2021
#define ASSIGN_OPS_HASH(opsname, val) \

kernel/trace/ftrace_internal.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#ifndef _LINUX_KERNEL_FTRACE_INTERNAL_H
33
#define _LINUX_KERNEL_FTRACE_INTERNAL_H
44

5+
int __register_ftrace_function(struct ftrace_ops *ops);
6+
int __unregister_ftrace_function(struct ftrace_ops *ops);
7+
58
#ifdef CONFIG_FUNCTION_TRACER
69

710
extern struct mutex ftrace_lock;
@@ -15,8 +18,6 @@ int ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip, void *regs);
1518

1619
#else /* !CONFIG_DYNAMIC_FTRACE */
1720

18-
int __register_ftrace_function(struct ftrace_ops *ops);
19-
int __unregister_ftrace_function(struct ftrace_ops *ops);
2021
/* Keep as macros so we do not need to define the commands */
2122
# define ftrace_startup(ops, command) \
2223
({ \

kernel/trace/trace_kprobe_selftest.c

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include "trace_kprobe_selftest.h"
4+
25
/*
36
* Function used during the kprobe self test. This function is in a separate
47
* compile unit so it can be compile with CC_FLAGS_FTRACE to ensure that it

0 commit comments

Comments
 (0)