Open waectr opened 3 years ago
/virtual/main.c:44:9: warning: implicit declaration of function 'bpf_probe_read_kernel' is invalid in C99 [-Wimplicit-function-declaration] bpf_probe_read_kernel(&data.query, sizeof(data.query), tempp->query); ^ 1 warning generated. LLVM ERROR: Program used external function 'bpf_probe_read_kernel' which could not be resolved!
Do you have a reproducible test case for this? if the underlying kernel does not support bpf_probe_read_kernel, bcc rewriter is supposed to have
#define bpf_probe_read_kernel bpf_probe_read
to fall back to old way bpf_probe_read.
ok thanks, this problem solved by your method!
@waectr Sounds good. I think the rewriter should be automatically catch this. But if your kernel is a backported kernel with selected backported bpf features. it may not work. Is your kernel a backported kernel?
I ran into this on RHEL7, which uses extensive backporting.
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
uname -r
3.10.0-1160.76.1.el7.x86_64
The bcc tools package on RHEL8 includes '/usr/share/bcc/tools/tcpstates', and I wanted to run this on RHEL7. The tool already has support for both tracepoint and kprobe, but would not run on RHEL7, due to 'bpf_probe_read_kernel'. I added two lines near the start of the bpf program
#define KBUILD_MODNAME "foo"
#define bpf_probe_read_kernel bpf_probe_read
and the 'tcpstates' tool is now able to run.
C:\Users\26898\Anaconda3\lib\site-packages\numba\decorators.py:146: RuntimeWarning: Caching is not available when the 'parallel' target is in use. Caching is now being disabled to allow execution to continue. warnings.warn(msg, RuntimeWarning) LLVM ERROR: Program used external function '.kernel.2222260625408' which could not be resolved!
How to solve this which has confused me many days?
this is my issue!please help me
/virtual/main.c:44:9: warning: implicit declaration of function 'bpf_probe_read_kernel' is invalid in C99 [-Wimplicit-function-declaration] bpf_probe_read_kernel(&data.query, sizeof(data.query), tempp->query); ^ 1 warning generated. LLVM ERROR: Program used external function 'bpf_probe_read_kernel' which could not be resolved!