Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to attach BPF program b'kprobe__sys_clone' to kprobe b'__arm64_sys_clone' #4563

Closed
xucongyong opened this issue Apr 11, 2023 · 5 comments

Comments

@xucongyong
Copy link

xucongyong commented Apr 11, 2023

enviment:
board: rk3588
arm64
redroid:13.0.0:run debian system

debug information:

root@localhost:/tmp/bcc/examples# python3 hello_world.py
create_probe_event: open(/sys/kernel/tracing/kprobe_events): No such file or directory
Traceback (most recent call last):
  File "/tmp/bcc/examples/hello_world.py", line 12, in <module>
    BPF(text='int kprobe__sys_clone(void *ctx) { bpf_trace_printk("Hello, World!\\n"); return 0; }').trace_print()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 483, in __init__
    self._trace_autoload()
  File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 1448, in _trace_autoload
    self.attach_kprobe(
  File "/usr/lib/python3/dist-packages/bcc/__init__.py", line 840, in attach_kprobe
    raise Exception("Failed to attach BPF program %s to kprobe %s" %
Exception: Failed to attach BPF program b'kprobe__sys_clone' to kprobe b'__arm64_sys_clone'
@chenhengqi
Copy link
Collaborator

https://github.com/iovisor/bcc/blob/master/docs/kernel_config.md

Please make sure you have kprobes enabled.

@xucongyong
Copy link
Author

https://github.com/iovisor/bcc/blob/master/docs/kernel_config.md

Please make sure you have kprobes enabled.

大佬 ebpf过andriod检测 咋那么难,可否加你下v哈?

@xucongyong
Copy link
Author

root@localhost:/usr/share/bcc/examples# grep BPF /boot/config-5.10.110-rockchip-rk3588
CONFIG_CGROUP_BPF=y
CONFIG_BPF=y
CONFIG_BPF_SYSCALL=y
CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y

CONFIG_BPF_UNPRIV_DEFAULT_OFF is not set

CONFIG_BPF_PRELOAD 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 is not set

CONFIG_BPF_JIT is not set

CONFIG_BPF_STREAM_PARSER=y
CONFIG_LWTUNNEL_BPF=y
CONFIG_HAVE_EBPF_JIT=y
CONFIG_BPF_EVENTS=y

CONFIG_TEST_BPF is not set


kprobes config not open.

@lxy417
Copy link

lxy417 commented Apr 14, 2023

image
I have a similar problem with you. Have you solved it? I'm not sure if my kernel configuration is correct.

@zydmtaichi
Copy link

The issue is not solved. I encountered the same problem when run the example bitehist.py #5124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants