Hi Jiri, [FYI, it's a private test report for your RFC patch.] [auto build test ERROR on bpf-next/master] url: https://github.com/0day-ci/linux/commits/Jiri-Olsa/bpf-Speed-up-trampoline-attach/20201022-162338 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master config: x86_64-randconfig-a001-20201022 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ee6abef5323d59b983129bf3514ef6775d1d6cd5) 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 # install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # https://github.com/0day-ci/linux/commit/df2d07719c4fd2fa52f40906d5d156e0ffe072f0 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Jiri-Olsa/bpf-Speed-up-trampoline-attach/20201022-162338 git checkout df2d07719c4fd2fa52f40906d5d156e0ffe072f0 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): kernel/bpf/syscall.c:2508:28: error: too many arguments to function call, expected 2, have 3 tr_link->trampoline, NULL)); ^~~~ include/linux/stddef.h:8:14: note: expanded from macro 'NULL' #define NULL ((void *)0) ^~~~~~~~~~~ include/asm-generic/bug.h:102:25: note: expanded from macro 'WARN_ON_ONCE' int __ret_warn_on = !!(condition); \ ^~~~~~~~~ include/linux/bpf.h:712:19: note: 'bpf_trampoline_unlink_prog' declared here static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog, ^ kernel/bpf/syscall.c:2919:10: error: implicit declaration of function 'bpf_trampoline_batch_alloc' [-Werror,-Wimplicit-function-declaration] batch = bpf_trampoline_batch_alloc(count); ^ kernel/bpf/syscall.c:2919:10: note: did you mean 'bpf_trampoline_batch'? kernel/bpf/syscall.c:2885:12: note: 'bpf_trampoline_batch' declared here static int bpf_trampoline_batch(const union bpf_attr *attr, int cmd) ^ kernel/bpf/syscall.c:2919:8: warning: incompatible integer to pointer conversion assigning to 'struct bpf_trampoline_batch *' from 'int' [-Wint-conversion] batch = bpf_trampoline_batch_alloc(count); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/bpf/syscall.c:2960:64: error: too many arguments to function call, expected 2, have 3 bpf_trampoline_unlink_prog(link->prog, tr_link->trampoline, batch); ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~ include/linux/bpf.h:712:19: note: 'bpf_trampoline_unlink_prog' declared here 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' [-Werror,-Wimplicit-function-declaration] ret = register_ftrace_direct_ips(batch->ips, batch->addrs, batch->idx); ^ kernel/bpf/syscall.c:2966:9: note: did you mean 'register_ftrace_direct'? include/linux/ftrace.h:300:19: note: 'register_ftrace_direct' declared here static inline int register_ftrace_direct(unsigned long ip, unsigned long addr) ^ >> kernel/bpf/syscall.c:2968:9: error: implicit declaration of function 'unregister_ftrace_direct_ips' [-Werror,-Wimplicit-function-declaration] ret = unregister_ftrace_direct_ips(batch->ips, batch->addrs, batch->idx); ^ kernel/bpf/syscall.c:2968:9: note: did you mean 'register_ftrace_direct_ips'? kernel/bpf/syscall.c:2966:9: note: 'register_ftrace_direct_ips' declared here ret = register_ftrace_direct_ips(batch->ips, batch->addrs, batch->idx); ^ kernel/bpf/syscall.c:2975:2: error: implicit declaration of function 'bpf_trampoline_batch_free' [-Werror,-Wimplicit-function-declaration] bpf_trampoline_batch_free(batch); ^ 1 warning and 6 errors generated. vim +/unregister_ftrace_direct_ips +2968 kernel/bpf/syscall.c 2884 2885 static int bpf_trampoline_batch(const union bpf_attr *attr, int cmd) 2886 { 2887 void __user *uout = u64_to_user_ptr(attr->trampoline_batch.out); 2888 void __user *uin = u64_to_user_ptr(attr->trampoline_batch.in); 2889 struct bpf_trampoline_batch *batch = NULL; 2890 struct bpf_prog *prog; 2891 int count, ret, i, fd; 2892 u32 *in, *out; 2893 2894 if (CHECK_ATTR(BPF_RAW_TRACEPOINT_OPEN_BATCH)) 2895 return -EINVAL; 2896 2897 if (!uin || !uout) 2898 return -EINVAL; 2899 2900 count = attr->trampoline_batch.count; 2901 2902 in = kcalloc(count, sizeof(u32), GFP_KERNEL); 2903 out = kcalloc(count, sizeof(u32), GFP_KERNEL); 2904 if (!in || !out) { 2905 kfree(in); 2906 kfree(out); 2907 return -ENOMEM; 2908 } 2909 2910 ret = copy_from_user(in, uin, count * sizeof(u32)); 2911 if (ret) 2912 goto out_clean; 2913 2914 /* test read out array */ 2915 ret = copy_to_user(uout, out, count * sizeof(u32)); 2916 if (ret) 2917 goto out_clean; 2918 2919 batch = bpf_trampoline_batch_alloc(count); 2920 if (!batch) 2921 goto out_clean; 2922 2923 for (i = 0; i < count; i++) { 2924 if (cmd == BPF_TRAMPOLINE_BATCH_ATTACH) { 2925 prog = bpf_prog_get(in[i]); 2926 if (IS_ERR(prog)) { 2927 ret = PTR_ERR(prog); 2928 goto out_clean; 2929 } 2930 2931 ret = -EINVAL; 2932 if (prog->type != BPF_PROG_TYPE_TRACING) 2933 goto out_clean; 2934 if (prog->type == BPF_PROG_TYPE_TRACING && 2935 prog->expected_attach_type == BPF_TRACE_RAW_TP) 2936 goto out_clean; 2937 2938 fd = bpf_tracing_prog_attach(prog, 0, 0, batch); 2939 if (fd < 0) 2940 goto out_clean; 2941 2942 out[i] = fd; 2943 } else { 2944 struct bpf_tracing_link *tr_link; 2945 struct bpf_link *link; 2946 2947 link = bpf_link_get_from_fd(in[i]); 2948 if (IS_ERR(link)) { 2949 ret = PTR_ERR(link); 2950 goto out_clean; 2951 } 2952 2953 if (link->type != BPF_LINK_TYPE_TRACING) { 2954 ret = -EINVAL; 2955 bpf_link_put(link); 2956 goto out_clean; 2957 } 2958 2959 tr_link = container_of(link, struct bpf_tracing_link, link); 2960 bpf_trampoline_unlink_prog(link->prog, tr_link->trampoline, batch); 2961 bpf_link_put(link); 2962 } 2963 } 2964 2965 if (cmd == BPF_TRAMPOLINE_BATCH_ATTACH) 2966 ret = register_ftrace_direct_ips(batch->ips, batch->addrs, batch->idx); 2967 else > 2968 ret = unregister_ftrace_direct_ips(batch->ips, batch->addrs, batch->idx); 2969 2970 if (!ret) 2971 WARN_ON_ONCE(copy_to_user(uout, out, count * sizeof(u32))); 2972 2973 out_clean: 2974 /* XXX cleanup partialy attached array */ 2975 bpf_trampoline_batch_free(batch); 2976 kfree(in); 2977 kfree(out); 2978 return ret; 2979 } 2980 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org