lkml.org 
[lkml]   [2022]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[jolsa-perf:bpf/tramp_22 20/21] kernel/bpf/syscall.c:3306:7: error: call to undeclared function 'bpf_tramp_id_alloc'; ISO C99 and later do not support implicit function declarations
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/tramp_22
head: 1d891c46bb689a24985cea58f4eddb053d6b1331
commit: 70d8bfe245ee929757e1dcdf280f9e27786047a9 [20/21] bpf: Add support for tracing multi link
config: x86_64-randconfig-a012 (https://download.01.org/0day-ci/archive/20220707/202207070530.sgflrE6n-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project f553287b588916de09c66e3e32bf75e5060f967f)
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=70d8bfe245ee929757e1dcdf280f9e27786047a9
git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf bpf/tramp_22
git checkout 70d8bfe245ee929757e1dcdf280f9e27786047a9
# save the config file
mkdir build_dir && cp config build_dir/.config
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 where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

kernel/bpf/syscall.c:3128:26: error: field has incomplete type 'struct bpf_tramp_attach'
struct bpf_tramp_attach attach;
^
kernel/bpf/syscall.c:3128:9: note: forward declaration of 'struct bpf_tramp_attach'
struct bpf_tramp_attach attach;
^
kernel/bpf/syscall.c:3136:15: error: call to undeclared function 'bpf_trampoline_detach'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
WARN_ON_ONCE(bpf_trampoline_detach(&tr_link->attach));
^
kernel/bpf/syscall.c:3136:15: note: did you mean 'bpf_trampoline_get'?
include/linux/bpf.h:993:38: note: 'bpf_trampoline_get' declared here
static inline struct bpf_trampoline *bpf_trampoline_get(u64 key,
^
>> kernel/bpf/syscall.c:3306:7: error: call to undeclared function 'bpf_tramp_id_alloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
id = bpf_tramp_id_alloc(cnt);
^
kernel/bpf/syscall.c:3306:5: warning: incompatible integer to pointer conversion assigning to 'struct bpf_tramp_id *' from 'int' [-Wint-conversion]
id = bpf_tramp_id_alloc(cnt);
^ ~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:3347:8: error: call to undeclared function 'bpf_trampoline_attach'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
err = bpf_trampoline_attach(&link->attach);
^
1 warning and 4 errors generated.


vim +/bpf_tramp_id_alloc +3306 kernel/bpf/syscall.c

3290
3291 static int bpf_tracing_multi_attach(struct bpf_prog *prog,
3292 const union bpf_attr *attr)
3293 {
3294 void __user *uids = u64_to_user_ptr(attr->link_create.tracing_multi.btf_ids);
3295 u32 cnt_size, cnt = attr->link_create.tracing_multi.btf_ids_cnt;
3296 struct bpf_tracing_multi_link *link = NULL;
3297 struct bpf_link_primer link_primer;
3298 struct bpf_tramp_id *id = NULL;
3299 int err = -EINVAL;
3300
3301 if (check_multi_prog_type(prog))
3302 return -EINVAL;
3303 if (!cnt || !uids)
3304 return -EINVAL;
3305
> 3306 id = bpf_tramp_id_alloc(cnt);
3307 if (!id)
3308 return -ENOMEM;
3309
3310 err = -EFAULT;
3311 cnt_size = cnt * sizeof(id->id[0]);
3312 if (copy_from_user(id->id, uids, cnt_size))
3313 goto out_free_id;
3314
3315 id->cnt = cnt;
3316 id->obj_id = btf_obj_id(prog->aux->attach_btf);
3317
3318 /* Sort user provided BTF ids, so we can use memcmp
3319 * and bsearch on top of it later.
3320 */
3321 sort(id->id, cnt, sizeof(u32), btf_ids_cmp, NULL);
3322
3323 err = bpf_tramp_id_resolve(id, prog);
3324 if (err)
3325 goto out_free_id;
3326
3327 link = kzalloc(sizeof(*link), GFP_KERNEL);
3328 if (!link) {
3329 err = -ENOMEM;
3330 goto out_free_id;
3331 }
3332
3333 bpf_link_init(&link->link, BPF_LINK_TYPE_TRACING_MULTI,
3334 &bpf_tracing_multi_link_lops, prog);
3335 link->attach_type = prog->expected_attach_type;
3336
3337 err = bpf_link_prime(&link->link, &link_primer);
3338 if (err) {
3339 kfree(link);
3340 goto out_free_id;
3341 }
3342
3343 link->attach.id = id;
3344 link->attach.tp.cookie = 0;
3345 link->attach.tp.prog = prog;
3346
3347 err = bpf_trampoline_attach(&link->attach);
3348 if (err) {
3349 bpf_link_cleanup(&link_primer);
3350 goto out_free_id;
3351 }
3352 return bpf_link_settle(&link_primer);
3353 out_free_id:
3354 kfree(id);
3355 return err;
3356 }
3357

--
0-DAY CI Kernel Test Service
https://01.org/lkp

\
 
 \ /
  Last update: 2022-07-06 23:37    [W:0.028 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site