Commit 2fe1c593 authored by Tao Chen's avatar Tao Chen Committed by Andrii Nakryiko
Browse files

bpf: Add cookie to raw_tp bpf_link_info



After commit 68ca5d4e ("bpf: support BPF cookie in raw tracepoint
(raw_tp, tp_btf) programs"), we can show the cookie in bpf_link_info
like kprobe etc.

Signed-off-by: default avatarTao Chen <chen.dylane@linux.dev>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20250603154309.3063644-1-chen.dylane@linux.dev
parent 7fdaba91
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6651,6 +6651,8 @@ struct bpf_link_info {
		struct {
			__aligned_u64 tp_name; /* in/out: tp_name buffer ptr */
			__u32 tp_name_len;     /* in/out: tp_name buffer len */
			__u32 :32;
			__u64 cookie;
		} raw_tracepoint;
		struct {
			__u32 attach_type;
+1 −0
Original line number Diff line number Diff line
@@ -3688,6 +3688,7 @@ static int bpf_raw_tp_link_fill_link_info(const struct bpf_link *link,
		return -EINVAL;

	info->raw_tracepoint.tp_name_len = tp_len + 1;
	info->raw_tracepoint.cookie = raw_tp_link->cookie;

	if (!ubuf)
		return 0;
+2 −0
Original line number Diff line number Diff line
@@ -6651,6 +6651,8 @@ struct bpf_link_info {
		struct {
			__aligned_u64 tp_name; /* in/out: tp_name buffer ptr */
			__u32 tp_name_len;     /* in/out: tp_name buffer len */
			__u32 :32;
			__u64 cookie;
		} raw_tracepoint;
		struct {
			__u32 attach_type;