[jolsa-perf:kprobe/multi 6/13] kernel/trace/bpf_trace.c:1032:22: error: implicit declaration of function 'kprobe_ftrace_multi_addr'

From: kernel test robot
Date: Mon Dec 27 2021 - 17:56:59 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git kprobe/multi
head: bc59262730d5cfc95d6cae84f247d2e8690a309b
commit: a1974e6769e507428f52729967e6670a1548c239 [6/13] kprobe: Allow to get traced function address for multi ftrace kprobes
config: x86_64-randconfig-a003-20211227 (https://download.01.org/0day-ci/archive/20211228/202112280625.ZNZllxQ6-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 511726c64d3b6cca66f7c54d457d586aa3129f67)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=a1974e6769e507428f52729967e6670a1548c239
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf kprobe/multi
git checkout a1974e6769e507428f52729967e6670a1548c239
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from kernel/trace/bpf_trace.c:14:
include/linux/kprobes.h:76:21: error: field has incomplete type 'struct ftrace_ops'
struct ftrace_ops ops;
^
include/linux/ftrace.h:332:8: note: forward declaration of 'struct ftrace_ops'
struct ftrace_ops;
^
>> kernel/trace/bpf_trace.c:1032:22: error: implicit declaration of function 'kprobe_ftrace_multi_addr' [-Werror,-Wimplicit-function-declaration]
return (uintptr_t) kprobe_ftrace_multi_addr();
^
kernel/trace/bpf_trace.c:1032:22: note: did you mean 'kprobe_ftrace_multi'?
include/linux/kprobes.h:144:20: note: 'kprobe_ftrace_multi' declared here
static inline bool kprobe_ftrace_multi(struct kprobe *p)
^
2 errors generated.


vim +/kprobe_ftrace_multi_addr +1032 kernel/trace/bpf_trace.c

1024
1025 BPF_CALL_1(bpf_get_func_ip_kprobe, struct pt_regs *, regs)
1026 {
1027 struct kprobe *kp = kprobe_running();
1028
1029 if (!kp)
1030 return 0;
1031 if (kprobe_ftrace_multi(kp))
> 1032 return (uintptr_t) kprobe_ftrace_multi_addr();
1033 else
1034 return (uintptr_t) kp->func_addr;
1035 }
1036

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx