I found that when using bpf_program__attach_uprobe_opts, it can only set one PID. Unless set to -1, it indicates all processes. Is there a way to set multiple PIDs? Or can it only be achieved through map.
I found that when using bpf_program__attach_uprobe_opts, it can only set one PID. Unless set to -1, it indicates all processes. Is there a way to set multiple PIDs? Or can it only be achieved through map.
Share Improve this question asked Mar 17 at 8:31 SunjalSunjal 175 bronze badges1 Answer
Reset to default 1Indeed you cannot attach to multiple PIDs, you would have to add some logic in your eBPF program and exit early if you detect you are running for a unwanted PID.
It works that way because perf events work that way, see arguments to perf_event_open
.