summaryrefslogtreecommitdiff
path: root/tools/include/uapi
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2022-03-16 15:24:12 +0300
committerAlexei Starovoitov <ast@kernel.org>2022-03-18 06:17:19 +0300
commitca74823c6e16dd42b7cf60d9fdde80e2a81a67bb (patch)
treef0c233f5e8a14a92d9b19f348a7fc83c98817b61 /tools/include/uapi
parent97ee4d20ee67eb462581a7af01442de6586e390b (diff)
downloadlinux-ca74823c6e16dd42b7cf60d9fdde80e2a81a67bb.tar.xz
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. Suggested-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20220316122419.933957-7-jolsa@kernel.org
Diffstat (limited to 'tools/include/uapi')
-rw-r--r--tools/include/uapi/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index d77f47af7752..7604e7d5438f 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -1487,6 +1487,7 @@ union bpf_attr {
__u32 cnt;
__aligned_u64 syms;
__aligned_u64 addrs;
+ __aligned_u64 cookies;
} kprobe_multi;
};
} link_create;