Skip to content

Commit

Permalink
ftrace/samples: Add missing prototype for my_direct_func
Browse files Browse the repository at this point in the history
There's compilation fail reported kernel test robot for W=1 build:

  >> samples/ftrace/ftrace-direct-multi.c:8:6: warning: no previous
  prototype for function 'my_direct_func' [-Wmissing-prototypes]
     void my_direct_func(unsigned long ip)

The inlined assembly is used outside function, so we can't make
my_direct_func static and pass it as asm input argument.

However my_tramp is already extern so I think there's no problem
keeping my_direct_func extern as well and just add its prototype.

Link: https://lkml.kernel.org/r/[email protected]

Reported-by: kernel test robot <[email protected]>
Fixes: 5fae941 ("ftrace/samples: Add multi direct interface test module")
Signed-off-by: Jiri Olsa <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
Jiri Olsa authored and rostedt committed Nov 2, 2021
1 parent 4e9f63c commit 67d4f6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samples/ftrace/ftrace-direct-multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <linux/ftrace.h>
#include <linux/sched/stat.h>

extern void my_direct_func(unsigned long ip);

void my_direct_func(unsigned long ip)
{
trace_printk("ip %lx\n", ip);
Expand Down

0 comments on commit 67d4f6e

Please sign in to comment.