aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorKui-Feng Lee <kuifeng@fb.com>2022-05-10 13:59:21 -0700
committerAndrii Nakryiko <andrii@kernel.org>2022-05-10 21:58:31 -0700
commit2fcc82411e74e5e6aba336561cf56fb899bfae4e (patch)
treeb56024a482d12e1bb739e561d7d60acf9e7f731e /tools/include/uapi/linux/bpf.h
parentbpf, x86: Create bpf_tramp_run_ctx on the caller thread's stack (diff)
downloadlinux-dev-2fcc82411e74e5e6aba336561cf56fb899bfae4e.tar.xz
linux-dev-2fcc82411e74e5e6aba336561cf56fb899bfae4e.zip
bpf, x86: Attach a cookie to fentry/fexit/fmod_ret/lsm.
Pass a cookie along with BPF_LINK_CREATE requests. Add a bpf_cookie field to struct bpf_tracing_link to attach a cookie. The cookie of a bpf_tracing_link is available by calling bpf_get_attach_cookie when running the BPF program of the attached link. The value of a cookie will be set at bpf_tramp_run_ctx by the trampoline of the link. Signed-off-by: Kui-Feng Lee <kuifeng@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220510205923.3206889-4-kuifeng@fb.com
Diffstat (limited to '')
-rw-r--r--tools/include/uapi/linux/bpf.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 3d032ea1b6a3..bc7f89948f54 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -1490,6 +1490,15 @@ union bpf_attr {
__aligned_u64 addrs;
__aligned_u64 cookies;
} kprobe_multi;
+ struct {
+ /* this is overlaid with the target_btf_id above. */
+ __u32 target_btf_id;
+ /* black box user-provided value passed through
+ * to BPF program at the execution time and
+ * accessible through bpf_get_attach_cookie() BPF helper
+ */
+ __u64 cookie;
+ } tracing;
};
} link_create;