最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

linux - Can only one specific PID be specified for bpf_program__attach_uprobe_opts? - Stack Overflow

programmeradmin4浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论