On 8/9/23 1:34 AM, Jiri Olsa wrote:
Adding support to specify cookies array for uprobe_multi link. The cookies array share indexes and length with other uprobe_multi arrays (offsets/ref_ctr_offsets). The cookies[i] value defines cookie for i-the uprobe and will be returned by bpf_get_attach_cookie helper when called from ebpf program hooked to that specific uprobe. Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Acked-by: Yafang Shao <laoar.shao@xxxxxxxxx> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Ack with a minor nit below. Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>
--- include/uapi/linux/bpf.h | 1 + kernel/bpf/syscall.c | 2 +- kernel/trace/bpf_trace.c | 45 +++++++++++++++++++++++++++++++--- tools/include/uapi/linux/bpf.h | 1 + 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index e48780951fc7..d7f4f50b1e58 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -1639,6 +1639,7 @@ union bpf_attr { __aligned_u64 path; __aligned_u64 offsets; __aligned_u64 ref_ctr_offsets; + __aligned_u64 cookies; __u32 cnt; __u32 flags; } uprobe_multi;
The 'cookies' field is inserted into the middle of 'uprobe_multi' struct. Not sure whether this may cause bug bisecting issue or not.