eunomia-bpf / bpftime

Userspace eBPF runtime for Observability, Network & General Extensions Framework
https://eunomia.dev/bpftime/
MIT License
791 stars 74 forks source link

[QUESTION] How to hot patch user space eBPF program? #309

Open D1cestor opened 2 months ago

D1cestor commented 2 months ago

First of all, nice work from you.

Let's say we have a user space eBPF program a.bpf.c running. Is it possible to update it to b.bpf.c without stopping the program a.bpf.c is hooking to?

I have checked tailcall_minimal but I found it confusing because I am not familiar with the eBPF byte code.

Thanks

Officeyutong commented 2 months ago

If you mean to detach a userspace eBPF program, and then attach a new one:

D1cestor commented 2 months ago

Thanks for your reply.

I can detach the attaches but how do I re-attach a new hook?

I tried bpftime attach but it doesn't work.

image

Officeyutong commented 2 months ago

Thanks for your reply.

I can detach the attaches but how do I re-attach a new hook?

I tried bpftime attach but it doesn't work.

image

After a glance at the source of frida-gum:

image

D1cestor commented 2 months ago

The file did exist. Do I need to turn on some settings or grant some permissions?

image