eunomia-bpf / bpftime

Userspace eBPF runtime for fast Uprobe & Syscall hook & Extensions
https://eunomia.dev/bpftime/
MIT License
744 stars 73 forks source link

vm/runtime: implement userspace -> kernel tailcall #131

Closed Officeyutong closed 8 months ago

Officeyutong commented 8 months ago

Implement userspace to kernel tailcall.

Userspace ebpf programs might utilize bpf_tail_call helper and BPF_MAP_TYPE_PROG_ARRAY. fds in BPF_MAP_TYPE_PROG_ARRAY should be kernel prog fds.

kernel programs to call could be arbitary types that bpf_prog_test_run supports (see https://docs.kernel.org/bpf/bpf_prog_run.html#id1 for full list). In our unit tests, we use BPF_PROG_TYPE_RAW_TRACEPOINT.

Context passed through bpf_tail_call should either be a null pointer (where bpftime will provide 64-byte context to the kernel program), or an at-least 64 byte buffer.

yunwei37 commented 8 months ago

Would be better if you can have a README.md for the tail call example.

Officeyutong commented 8 months ago

Would be better if you can have a README.md for the tail call example.

I'll add it later