admin管理员组

文章数量:1391968

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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

Indeed 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.

本文标签: linuxCan only one specific PID be specified for bpfprogramattachuprobeoptsStack Overflow