How to attach a single bpf_program multiple times?
Hi, everyone!
When the ebpf program is the same, but attach to a different kprobe function, I have to recompile the entire program. If the kprobe function of bpf_program attach can be specified dynamically, then there is no need to modify the original program.
Thanks!
Quoted 7 lines · Shuyi Cheng
Hi, everyone!
When the ebpf program is the same, but attach to a different kprobe function, I have to recompile the entire program. If the kprobe function of
bpf_programattach can be specified dynamically, then there is no need to modify the original program.
With libbpf you can attach the same bpf_program to multiple kprobes. Use bpf_program__attach_kprobe() API multiple times with the same program instance, but different target functions.
Quoted 2 lines
Thanks!