Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

generate byte code for use with BPFd on arm64 #54

Open
maindoor opened this issue Jun 22, 2019 · 3 comments
Open

generate byte code for use with BPFd on arm64 #54

maindoor opened this issue Jun 22, 2019 · 3 comments

Comments

@maindoor
Copy link

Hi,
How do I generate BPF byte code for feeding into bpfd on the target.
compiler/kernel/bcc is on host, no direct communication between host
and target (due to security concern).
lwn.net article uses 'cat my_bpf_prog.base64 | bpfd'
So can someone help in clarifying how to generate BPF byte code in base64 format
for feeding to bpfd using bcc for a simple program like https://github.com/iovisor/bcc/blob/master/examples/hello_world.py ?

@joelagnel
Copy link
Owner

Hi! BPFd is deprecated because of limitations, see this thread here:
iovisor/bcc#2298
Please check the deprecation warning and what is replacing bpfd here:
https://github.com/joelagnel/bpfd/blob/master/README.md

I am sorry but this BPFd repository is here only for historical reasons. I will see if I can find a better way to mark it as deprecated. Future development of BPFd is left to the community, since I am not using this technique for my projects any longer.
Also: Me and folks at Facebook are working to make bpftrace run natively on Android. The community is moving towards bpftrace instead of BCC/BPFd and this what we are focusing on. Hope this helps.

@maindoor
Copy link
Author

Hi Joel,
Thank you for your reply.

  • Your link says that BPFd works for arm64, and my requirement is simple, so this works.
  • BPFtrace, does not allow the level of control that bpfd/bcc gives, also requires llvm backend,
    space not a choice for my embedded system.
  • adeb requires 2GB of free space, my entire embedded system contains only 512Mb, so adeb
    is not the right for me.

Do you have any suggestion how I can work remotely with bcc on an embedded device ?

Maybe in the future I can move to more recent tools for now I have to somehow work with bpfd.
My requirement is simple I just want to call dump_stack() at arbitrary locations within the kernel to understand different data paths a packet takes. Maybe with some arguments like length of the packet
or protocol. For this bpfd works great. Small in size, python works well. I'm almost there, just need one final step to take the bytecode from my dev machine to the target and I'm home free. Any help here is appreciated.

Thanks.

@joelagnel
Copy link
Owner

joelagnel commented Jun 23, 2019 via email

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

No branches or pull requests

2 participants