iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.58k stars 3.88k forks source link

bcc-0.27.0 - Failed to attach BPF program kprobe__sys_clone to kprobe sys_clone #4604

Open computrust opened 1 year ago

computrust commented 1 year ago

Not able to compile on this system, so stuck with packages.

cannot attach kprobe, probe entry may not exist Traceback (most recent call last): File "./examples/hello_world.py", line 12, in BPF(text='int kprobesys_clone(void *ctx) { bpf_trace_printk("Hello, World!\n"); return 0; }').trace_print() File "/usr/lib/python3.7/site-packages/bcc/init.py", line 372, in init self._trace_autoload() File "/usr/lib/python3.7/site-packages/bcc/init__.py", line 1232, in _trace_autoload fn_name=fn.name) File "/usr/lib/python3.7/site-packages/bcc/init.py", line 684, in attach_kprobe (fn_name, event)) Exception: Failed to attach BPF program kprobe__sys_clone to kprobe sys_clone

grep sys_clone /proc/kallsyms 0000000000000000 T x64_sys_clone 0000000000000000 T ia32_sys_clone 0000000000000000 t _eil_addr_ia32_sys_clone 0000000000000000 t _eiladdrx64_sys_clone

xt_bpf 16384 0 act_bpf 16384 0 cls_bpf 20480 0 bpfilter 16384 0

4.19.198-rt85-13.ph3-rt #1-photon SMP PREEMPT RT Wed Jul 6 21:04:15 UTC 2022 x86_64 GNU/Linux

CONFIG_KPROBES=y CONFIG_KPROBES_ON_FTRACE=y CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KPROBES_ON_FTRACE=y CONFIG_KPROBE_EVENTS=y

CONFIG_CGROUP_BPF is not set

CONFIG_BPF=y CONFIG_BPF_SYSCALL=y

CONFIG_BPF_JIT_ALWAYS_ON is not set

CONFIG_NETFILTER_XT_MATCH_BPF=m CONFIG_BPFILTER=y CONFIG_BPFILTER_UMH=m CONFIG_NET_CLS_BPF=m CONFIG_NET_ACT_BPF=m CONFIG_BPF_JIT=y

CONFIG_BPF_STREAM_PARSER is not set

CONFIG_HAVE_EBPF_JIT=y CONFIG_BPF_EVENTS=y

CONFIG_BPF_KPROBE_OVERRIDE is not set

CONFIG_TEST_BPF is not set

total 1476 drwxr-xr-x 4 root root 4096 May 3 17:38 . drwxr-xr-x 4 root root 4096 May 3 17:38 .. lrwxrwxrwx 1 root root 49 Jul 6 2022 build -> /usr/src/linux-rt-headers-4.19.198-rt85-13.ph3-rt drwxr-xr-x 2 root root 4096 May 3 17:38 extra drwxr-xr-x 11 root root 4096 May 3 17:38 kernel -rw-r--r-- 1 root root 420840 May 3 17:38 modules.alias -rw-r--r-- 1 root root 401313 May 3 17:38 modules.alias.bin -rw-r--r-- 1 root root 7374 Jul 6 2022 modules.builtin -rw-r--r-- 1 root root 10034 May 3 17:38 modules.builtin.bin -rw-r--r-- 1 root root 77719 May 3 17:38 modules.dep -rw-r--r-- 1 root root 112081 May 3 17:38 modules.dep.bin -rw-r--r-- 1 root root 222 May 3 17:38 modules.devname -rw-r--r-- 1 root root 30873 Jul 6 2022 modules.order -rw-r--r-- 1 root root 541 May 3 17:38 modules.softdep -rw-r--r-- 1 root root 186158 May 3 17:38 modules.symbols -rw-r--r-- 1 root root 229086 May 3 17:38 modules.symbols.bin

pgowda-cve commented 1 year ago

Hi,

I am facing similar issue for ARM64 target when running tests:-


/usr/lib/bcc/ptest/tests/cc/test_libbcc_no_libbpf "test hash of maps" cannot attach kprobe, probe entry may not exist

/usr/src/debug/bcc/0.28.0+gitAUTOINC+8422cd449a-r0/tests/cc/test_map_in_map.cc:101: FAILED: REQUIRE( res.ok() ) with expansion: false


Linux qemuarm64 6.1.38-yocto-standard #1 SMP PREEMPT Thu Jul 6 18:52:54 UTC 2023 aarch64 GNU/Linux Can you please let me know if you have any updates or solution to the issue?

Thanks