History

bpf: Add cookie support to programs attached with kprobe multi link

Adding support to call bpf_get_attach_cookie helper from kprobe programs attached with kprobe multi link. The cookie is provided by array of u64 values, where each value is paired with provided function address or symbol with the same array index. When cookie array is provided it's sorted together with addresses (check bpf_kprobe_multi_cookie_swap). This way we can find cookie based on the address in bpf_get_attach_cookie helper.

Jiri Olsa committed 4 years ago

Commit ca748231 parent 97ee4d24 files · +116 −2Browse files

Showing the changes to tools/include/uapi (1 of 4 files). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+1−0
@@ -1487,6 +1487,7 @@ union bpf_attr { · 1486 unmodified lines
1487 __u32 cnt;1487 __u32 cnt;
1488 __aligned_u64 syms;1488 __aligned_u64 syms;
1489 __aligned_u64 addrs;1489 __aligned_u64 addrs;
1490 __aligned_u64 cookies;
1490 } kprobe_multi;1491 } kprobe_multi;
1491 };1492 };
1492 } link_create;1493 } link_create;