[jolsa-perf:bpf/fprobe_link_5 4/10] kernel/trace/bpf_trace.c:1043:22: error: 'struct pt_regs' has no member named 'ip'; did you mean 'sp'?

From: kernel test robot
Date: Sun Feb 13 2022 - 17:33:17 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/fprobe_link_5
head: 9149abfa25286fdf715525babec5150939c9ac96
commit: 6944d13cf0af8628c0b80eb90359d90cbba0d69c [4/10] bpf: Add bpf_get_func_ip kprobe helper for fprobe link
config: riscv-randconfig-m031-20220213 (https://download.01.org/0day-ci/archive/20220214/202202140631.G10tOwU5-lkp@xxxxxxxxx/config)
compiler: riscv32-linux-gcc (GCC) 11.2.0
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=6944d13cf0af8628c0b80eb90359d90cbba0d69c
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf bpf/fprobe_link_5
git checkout 6944d13cf0af8628c0b80eb90359d90cbba0d69c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash kernel/bpf/ kernel/trace/

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

All errors (new ones prefixed by >>):

kernel/trace/bpf_trace.c: In function '____bpf_get_func_ip_fprobe':
>> kernel/trace/bpf_trace.c:1043:22: error: 'struct pt_regs' has no member named 'ip'; did you mean 'sp'?
1043 | return regs->ip;
| ^~
| sp
kernel/trace/bpf_trace.c:1044:1: error: control reaches end of non-void function [-Werror=return-type]
1044 | }
| ^
cc1: some warnings being treated as errors


vim +1043 kernel/trace/bpf_trace.c

1039
1040 BPF_CALL_1(bpf_get_func_ip_fprobe, struct pt_regs *, regs)
1041 {
1042 /* This helper call is inlined by verifier. */
> 1043 return regs->ip;
1044 }
1045

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