tree:
https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/batch
head: c01d0e8916f27a4ef956b683f46eff53b2e17707
commit: 177c965997379f586e507b97f54088f42866dded [10/16] bpf: Add
BPF_TRAMPOLINE_BATCH_DETACH support
config: x86_64-randconfig-s022-20201021 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id...
git remote add jolsa-perf
https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
git fetch --no-tags jolsa-perf bpf/batch
git checkout 177c965997379f586e507b97f54088f42866dded
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/bug.h:93,
from include/linux/bug.h:5,
from include/linux/cpumask.h:14,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/processor.h:22,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:73,
from include/linux/ktime.h:24,
from include/linux/timer.h:6,
from include/linux/workqueue.h:9,
from include/linux/bpf.h:9,
from kernel/bpf/syscall.c:4:
kernel/bpf/syscall.c: In function 'bpf_tracing_link_release':
> kernel/bpf/syscall.c:2507:15: error: too many arguments to
function 'bpf_trampoline_unlink_prog'
2507 |
WARN_ON_ONCE(bpf_trampoline_unlink_prog(link->prog,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/bug.h:102:25: note: in definition of macro 'WARN_ON_ONCE'
102 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
In file included from kernel/bpf/syscall.c:4:
include/linux/bpf.h:712:19: note: declared here
712 | static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c: In function 'bpf_trampoline_batch':
kernel/bpf/syscall.c:2919:10: error: implicit declaration of function
'bpf_trampoline_batch_alloc'; did you mean 'bpf_trampoline_batch'?
[-Werror=implicit-function-declaration]
2919 | batch = bpf_trampoline_batch_alloc(count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| bpf_trampoline_batch
kernel/bpf/syscall.c:2919:8: warning: assignment to 'struct bpf_trampoline_batch
*' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2919 | batch = bpf_trampoline_batch_alloc(count);
| ^
kernel/bpf/syscall.c:2960:4: error: too many arguments to function
'bpf_trampoline_unlink_prog'
2960 | bpf_trampoline_unlink_prog(link->prog, tr_link->trampoline, batch);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from kernel/bpf/syscall.c:4:
include/linux/bpf.h:712:19: note: declared here
712 | static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/bpf/syscall.c:2966:9: error: implicit declaration of function
'register_ftrace_direct_ips'; did you mean 'register_ftrace_direct'?
[-Werror=implicit-function-declaration]
2966 | ret = register_ftrace_direct_ips(batch->ips, batch->addrs,
batch->idx);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| register_ftrace_direct
> kernel/bpf/syscall.c:2968:9: error: implicit declaration of
function 'unregister_ftrace_direct_ips'; did you mean
'unregister_ftrace_direct'? [-Werror=implicit-function-declaration]
2968
| ret = unregister_ftrace_direct_ips(batch->ips, batch->addrs, batch->idx);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| unregister_ftrace_direct
kernel/bpf/syscall.c:2975:2: error: implicit declaration of function
'bpf_trampoline_batch_free'; did you mean 'bpf_trampoline_batch'?
[-Werror=implicit-function-declaration]
2975 | bpf_trampoline_batch_free(batch);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| bpf_trampoline_batch
cc1: some warnings being treated as errors
vim +/bpf_trampoline_unlink_prog +2507 kernel/bpf/syscall.c
70ed506c3bbcfa8 Andrii Nakryiko 2020-03-02 2501
70ed506c3bbcfa8 Andrii Nakryiko 2020-03-02 2502 static void
bpf_tracing_link_release(struct bpf_link *link)
babf3164095b067 Andrii Nakryiko 2020-03-09 2503 {
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2504 struct bpf_tracing_link *tr_link
=
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2505 container_of(link, struct
bpf_tracing_link, link);
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2506
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 @2507
WARN_ON_ONCE(bpf_trampoline_unlink_prog(link->prog,
177c965997379f5 Jiri Olsa 2020-10-16 2508 tr_link->trampoline,
NULL));
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2509
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2510
bpf_trampoline_put(tr_link->trampoline);
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2511
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2512 /* tgt_prog is NULL if target is
a kernel function */
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2513 if (tr_link->tgt_prog)
3aac1ead5eb6b76 Toke Høiland-Jørgensen 2020-09-29 2514
bpf_prog_put(tr_link->tgt_prog);
babf3164095b067 Andrii Nakryiko 2020-03-09 2515 }
babf3164095b067 Andrii Nakryiko 2020-03-09 2516
:::::: The code at line 2507 was first introduced by commit
:::::: 3aac1ead5eb6b76f3d2b8d111e6de1c2de23fb34 bpf: Move prog->aux->linked_prog and
trampoline into bpf_link on attach
:::::: TO: Toke Høiland-Jørgensen <toke(a)redhat.com>
:::::: CC: Alexei Starovoitov <ast(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org