Adding support to specify pid for uprobe_multi link and the uprobes are created only for task with given pid value. Using the consumer.filter filter callback for that, so the task gets filtered during the uprobe installation. We still need to check the task during runtime in the uprobe handler, because the handler could get executed if there's another system wide consumer on the same uprobe (thanks Oleg for the insight).
Showing the changes to tools/include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -1642,6 +1642,7 @@ union bpf_attr { · 1641 unmodified lines | |||
| 1642 | __aligned_u64 cookies; | 1642 | __aligned_u64 cookies; |
| 1643 | __u32 cnt; | 1643 | __u32 cnt; |
| 1644 | __u32 flags; | 1644 | __u32 flags; |
| 1645 | __u32 pid; | ||
| 1645 | } uprobe_multi; | 1646 | } uprobe_multi; |
| 1646 | }; | 1647 | }; |
| 1647 | } link_create; | 1648 | } link_create; |