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 include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/bpf.h+1−0
@@ -1487,6 +1487,7 @@ union bpf_attr { · 1486 unmodified lines
14871487 __u32 cnt;
14881488 __aligned_u64 syms;
14891489 __aligned_u64 addrs;
1490+ __aligned_u64 cookies;
14901491 } kprobe_multi;
14911492 };
14921493 } link_create;