eunomia-bpf / bpftime

Userspace eBPF runtime for fast Uprobe & Syscall hook & Extensions with LLVM JIT
https://eunomia.dev/bpftime/
MIT License
693 stars 68 forks source link

[BUG] runtime should not depend on attach #230

Closed yunwei37 closed 4 months ago

yunwei37 commented 4 months ago

Describe the bug

The runtime should be able to be built as a standalone library and doesn't rely on attach targets. However, currently runtime still depends on attach targets:

https://github.com/eunomia-bpf/bpftime/blob/0a3ac616f0c02ee23d8f8ecbfb610cdea19268ba/runtime/CMakeLists.txt#L125-L130

Expected behavior

Runtime doesn't need attach targets as dependencies. It should be attach depends on runtime.

Screenshots

c7e22e70d2be6c3060b833e7bf6d321

Officeyutong commented 4 months ago

Refactoring of runtime is not done yet, the bpf attach context needs to be rewritten, which was put off

Officeyutong commented 4 months ago

And in the current design, the base of all attach impl (base_attach_impl) is in the attach folder. Move it to the runtime folder (If we have cleaned up the runtime folder) so that other attach impls may rely on runtime

yunwei37 commented 4 months ago

The base_attach_impl should remain in attach dir. We can make it a header only library.