aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/bpf/bpftool/skeleton/pid_iter.h
diff options
context:
space:
mode:
authorDmitrii Dolgov <9erthalion6@gmail.com>2022-03-09 17:31:12 +0100
committerAndrii Nakryiko <andrii@kernel.org>2022-03-15 15:07:27 -0700
commitcbdaf71f7e65a45d6e96378ee7bfe3da39c30908 (patch)
tree8a74ca4a585b1b5d6b8a3b47e2d26bafa097f0d1 /tools/bpf/bpftool/skeleton/pid_iter.h
parentselftests/bpf: Clean up array_size.cocci warnings (diff)
downloadwireguard-linux-cbdaf71f7e65a45d6e96378ee7bfe3da39c30908.tar.xz
wireguard-linux-cbdaf71f7e65a45d6e96378ee7bfe3da39c30908.zip
bpftool: Add bpf_cookie to link output
Commit 82e6b1eee6a8 ("bpf: Allow to specify user-provided bpf_cookie for BPF perf links") introduced the concept of user specified bpf_cookie, which could be accessed by BPF programs using bpf_get_attach_cookie(). For troubleshooting purposes it is convenient to expose bpf_cookie via bpftool as well, so there is no need to meddle with the target BPF program itself. Implemented using the pid iterator BPF program to actually fetch bpf_cookies, which allows constraining code changes only to bpftool. $ bpftool link 1: type 7 prog 5 bpf_cookie 123 pids bootstrap(81) Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Acked-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20220309163112.24141-1-9erthalion6@gmail.com
Diffstat (limited to 'tools/bpf/bpftool/skeleton/pid_iter.h')
-rw-r--r--tools/bpf/bpftool/skeleton/pid_iter.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/skeleton/pid_iter.h b/tools/bpf/bpftool/skeleton/pid_iter.h
index 5692cf257adb..bbb570d4cca6 100644
--- a/tools/bpf/bpftool/skeleton/pid_iter.h
+++ b/tools/bpf/bpftool/skeleton/pid_iter.h
@@ -6,6 +6,8 @@
struct pid_iter_entry {
__u32 id;
int pid;
+ __u64 bpf_cookie;
+ bool has_bpf_cookie;
char comm[16];
};