bcc-docker icon indicating copy to clipboard operation
bcc-docker copied to clipboard

Tcp tools in bcc-tools not working

Open shubhtrivedi opened this issue 5 years ago • 2 comments

Hi Everyone,

I am running bcc-tools using:

sudo -i podman run -it --rm --privileged -v /lib/modules:/lib/modules:ro -v /usr/src:/usr/src:ro -v /etc/localtime:/etc/localtime:ro --workdir /usr/share/bcc/tools zlim/bcc

Tools like execsnoop, bashreadLine are running while tools like tcplife or tcptracer are throwing error which I have given below.

`root@3af572433c30:/usr/share/bcc/tools# ./tcptracer In file included from /virtual/main.c:5: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/net/sock.h:51: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/netdevice.h:46: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/net/netprio_cgroup.h:17: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/cgroup.h:28: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/cgroup-defs.h:22: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf-cgroup.h:7: /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:474:39: error: use of undeclared identifier 'BPF_F_RDONLY_PROG' u32 access_flags = map->map_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG); ^ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:474:59: error: use of undeclared identifier 'BPF_F_WRONLY_PROG' u32 access_flags = map->map_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG); ^ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:479:21: error: use of undeclared identifier 'BPF_F_RDONLY_PROG' if (access_flags & BPF_F_RDONLY_PROG) ^ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:481:26: error: use of undeclared identifier 'BPF_F_WRONLY_PROG' else if (access_flags & BPF_F_WRONLY_PROG) ^ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:489:26: error: use of undeclared identifier 'BPF_F_RDONLY_PROG' return (access_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG)) != ^ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:489:46: error: use of undeclared identifier 'BPF_F_WRONLY_PROG' return (access_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG)) != ^ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:490:10: error: use of undeclared identifier 'BPF_F_RDONLY_PROG' (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG); ^ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/bpf.h:490:30: error: use of undeclared identifier 'BPF_F_WRONLY_PROG' (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG); ^ In file included from /virtual/main.c:5: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/net/sock.h:51: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/netdevice.h:50: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/uapi/linux/neighbour.h:6: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/netlink.h:9: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/net/scm.h:13: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/sched/signal.h:6: /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/signal.h:87:11: warning: array index 3 is past the end of the array (which contains 1 element) [-Warray-bounds] return (set->sig[3] | set->sig[2] | ^ ~ /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ In file included from /virtual/main.c:5: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/net/sock.h:51: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/netdevice.h:50: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/uapi/linux/neighbour.h:6: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/netlink.h:9: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/net/scm.h:13: In file included from /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/sched/signal.h:6: /lib/modules/4.18.0-193.13.2.el8_2.x86_64/build/include/linux/signal.h:87:25: warning: array index 2 is past the end of the array (which contains 1 element) [-Warray-bounds] return (set->sig[3] | set->sig[2] | . . . . . . . .

Traceback (most recent call last): File "./tcptracer", line 590, in b = BPF(text=bpf_text) File "/usr/lib/python2.7/dist-packages/bcc/init.py", line 325, in init raise Exception("Failed to compile BPF text") Exception: Failed to compile BPF text ` I need help as to enable running tools like tcptop, tcplife,tcptracer etc.

Thank you

shubhtrivedi avatar Nov 04 '20 07:11 shubhtrivedi

I got the same problem, and I don't know how to solve it. Have you figer it out?

StevenDanxD avatar May 04 '22 10:05 StevenDanxD

I got the same problem, and I don't know how to solve it. Have you figer it out?

StevenDanxD avatar May 04 '22 10:05 StevenDanxD