[jolsa-perf:bpf/kprobe_multi_4 6/11] kernel/trace/bpf_trace.c:1058:64: error: 'struct pt_regs' has no member named 'ip'; did you mean 'sp'?

From: kernel test robot
Date: Wed Mar 09 2022 - 17:18:41 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/kprobe_multi_4
head: 02731d567ee31d7c7f012e9c5930f114ed1e2478
commit: 651116687aeb66c22fec5e59d02674e66c0f2587 [6/11] bpf: Add cookie support to programs attached with kprobe multi link
config: riscv-randconfig-s032-20220309 (https://download.01.org/0day-ci/archive/20220310/202203100634.hZ3lL2Gt-lkp@xxxxxxxxx/config)
compiler: riscv32-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=651116687aeb66c22fec5e59d02674e66c0f2587
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf bpf/kprobe_multi_4
git checkout 651116687aeb66c22fec5e59d02674e66c0f2587
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash 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_attach_cookie_kprobe_multi':
>> kernel/trace/bpf_trace.c:1058:64: error: 'struct pt_regs' has no member named 'ip'; did you mean 'sp'?
1058 | return bpf_kprobe_multi_cookie(current->bpf_ctx, regs->ip);
| ^~
| sp
kernel/trace/bpf_trace.c:1059:1: error: control reaches end of non-void function [-Werror=return-type]
1059 | }
| ^
cc1: some warnings being treated as errors


vim +1058 kernel/trace/bpf_trace.c

1055
1056 BPF_CALL_1(bpf_get_attach_cookie_kprobe_multi, struct pt_regs *, regs)
1057 {
> 1058 return bpf_kprobe_multi_cookie(current->bpf_ctx, regs->ip);
1059 }
1060

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