[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202140713.Pklmh3QR-lkp@intel.com>
Date: Mon, 14 Feb 2022 07:44:36 +0800
From: kernel test robot <lkp@...el.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Masami Hiramatsu <mhiramat@...nel.org>
Subject: [jolsa-perf:bpf/fprobe_link_5 3/10] kernel/bpf/syscall.c:4337:
undefined reference to `bpf_fprobe_link_attach'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/fprobe_link_5
head: 9149abfa25286fdf715525babec5150939c9ac96
commit: 32adbf1760d4cccb9702863371d50b625ae7ee1d [3/10] bpf: Add support to attach kprobe program with fprobe
config: i386-randconfig-c021 (https://download.01.org/0day-ci/archive/20220214/202202140713.Pklmh3QR-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=32adbf1760d4cccb9702863371d50b625ae7ee1d
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 32adbf1760d4cccb9702863371d50b625ae7ee1d
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
ld: kernel/bpf/syscall.o: in function `link_create':
>> kernel/bpf/syscall.c:4337: undefined reference to `bpf_fprobe_link_attach'
vim +4337 kernel/bpf/syscall.c
4258
4259 #define BPF_LINK_CREATE_LAST_FIELD link_create.fprobe.flags
4260 static int link_create(union bpf_attr *attr, bpfptr_t uattr)
4261 {
4262 enum bpf_prog_type ptype;
4263 struct bpf_prog *prog;
4264 int ret;
4265
4266 if (CHECK_ATTR(BPF_LINK_CREATE))
4267 return -EINVAL;
4268
4269 prog = bpf_prog_get(attr->link_create.prog_fd);
4270 if (IS_ERR(prog))
4271 return PTR_ERR(prog);
4272
4273 ret = bpf_prog_attach_check_attach_type(prog,
4274 attr->link_create.attach_type);
4275 if (ret)
4276 goto out;
4277
4278 switch (prog->type) {
4279 case BPF_PROG_TYPE_EXT:
4280 ret = tracing_bpf_link_attach(attr, uattr, prog);
4281 goto out;
4282 case BPF_PROG_TYPE_PERF_EVENT:
4283 case BPF_PROG_TYPE_TRACEPOINT:
4284 if (attr->link_create.attach_type != BPF_PERF_EVENT) {
4285 ret = -EINVAL;
4286 goto out;
4287 }
4288 ptype = prog->type;
4289 break;
4290 case BPF_PROG_TYPE_KPROBE:
4291 if (attr->link_create.attach_type != BPF_PERF_EVENT &&
4292 attr->link_create.attach_type != BPF_TRACE_FPROBE) {
4293 ret = -EINVAL;
4294 goto out;
4295 }
4296 ptype = prog->type;
4297 break;
4298 default:
4299 ptype = attach_type_to_prog_type(attr->link_create.attach_type);
4300 if (ptype == BPF_PROG_TYPE_UNSPEC || ptype != prog->type) {
4301 ret = -EINVAL;
4302 goto out;
4303 }
4304 break;
4305 }
4306
4307 switch (ptype) {
4308 case BPF_PROG_TYPE_CGROUP_SKB:
4309 case BPF_PROG_TYPE_CGROUP_SOCK:
4310 case BPF_PROG_TYPE_CGROUP_SOCK_ADDR:
4311 case BPF_PROG_TYPE_SOCK_OPS:
4312 case BPF_PROG_TYPE_CGROUP_DEVICE:
4313 case BPF_PROG_TYPE_CGROUP_SYSCTL:
4314 case BPF_PROG_TYPE_CGROUP_SOCKOPT:
4315 ret = cgroup_bpf_link_attach(attr, prog);
4316 break;
4317 case BPF_PROG_TYPE_TRACING:
4318 ret = tracing_bpf_link_attach(attr, uattr, prog);
4319 break;
4320 case BPF_PROG_TYPE_FLOW_DISSECTOR:
4321 case BPF_PROG_TYPE_SK_LOOKUP:
4322 ret = netns_bpf_link_create(attr, prog);
4323 break;
4324 #ifdef CONFIG_NET
4325 case BPF_PROG_TYPE_XDP:
4326 ret = bpf_xdp_link_attach(attr, prog);
4327 break;
4328 #endif
4329 case BPF_PROG_TYPE_PERF_EVENT:
4330 case BPF_PROG_TYPE_TRACEPOINT:
4331 ret = bpf_perf_link_attach(attr, prog);
4332 break;
4333 case BPF_PROG_TYPE_KPROBE:
4334 if (attr->link_create.attach_type == BPF_PERF_EVENT)
4335 ret = bpf_perf_link_attach(attr, prog);
4336 else
> 4337 ret = bpf_fprobe_link_attach(attr, prog);
4338 break;
4339 default:
4340 ret = -EINVAL;
4341 }
4342
4343 out:
4344 if (ret < 0)
4345 bpf_prog_put(prog);
4346 return ret;
4347 }
4348
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists