kubectl-trace
kubectl-trace copied to clipboard
/bpftrace/include/clang_workarounds.h:14:10: fatal error: 'linux/types.h' file not found
cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core)
Kubernetes version v1.16.15
When I type the following command: kubectl-trace run node/node1 -f tcpconnect.bt (https://github.com/iovisor/bpftrace/blob/master/tools/tcpconnect.bt) trace e7bf7257-8d7f-4003-b035-fb47b553b978 created
kubectl-trace logs e7bf7257-8d7f-4003-b035-fb47b553b978 if your program has maps to print, send a SIGINT using Ctrl-C, if you want to interrupt the execution send SIGINT two times /bpftrace/include/clang_workarounds.h:14:10: fatal error: 'linux/types.h' file not found exit status 1
I met the same thing.
my OS is centos7.9 , I use the docker image of bpftace.
image name " quay.io/iovisor/bpftrace:latest".
run this docker images with command
docker run -ti -v /usr/src:/usr/src:ro \ -v /lib/modules/:/lib/modules:ro \ -v /sys/kernel/debug/:/sys/kernel/debug:rw \ --net=host --pid=host --privileged \ quay.io/iovisor/bpftrace:latest
and insert bpftrace command in docker console
bpftrace -e 'BEGIN {printf("hello world!\n");}'
the console show /bpftrace/include/clang_workarounds.h:14:10; fatal error: 'linux/types.h' file not found
but But the docker image works normally on another centos7.9 machine . It's amazing
I had to do ln -sf /usr-host/include /usr/include
for trace to work for me. I did not use --fetch-headers
CentOS7 try install i686 components of GCC. yum install libgcc.i686 glibc-devel.i686
It works for me.