mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
bpftool: Display cookie for tracing link probe
Display cookie for tracing link probe, in plain mode:
#bpftool link
5: tracing prog 34
prog_type tracing attach_type trace_fentry
target_obj_id 1 target_btf_id 60355
cookie 4503599627370496
pids test_progs(176)
And in json mode:
#bpftool link -j | jq
{
"id": 5,
"type": "tracing",
"prog_id": 34,
"prog_type": "tracing",
"attach_type": "trace_fentry",
"target_obj_id": 1,
"target_btf_id": 60355,
"cookie": 4503599627370496,
"pids": [
{
"pid": 176,
"comm": "test_progs"
}
]
}
Signed-off-by: Tao Chen <chen.dylane@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250606165818.3394397-3-chen.dylane@linux.dev
This commit is contained in:
committed by
Andrii Nakryiko
parent
d77efc0ef5
commit
ad954cbe08
@@ -503,6 +503,7 @@ static int show_link_close_json(int fd, struct bpf_link_info *info)
|
||||
json_wtr);
|
||||
jsonw_uint_field(json_wtr, "target_obj_id", info->tracing.target_obj_id);
|
||||
jsonw_uint_field(json_wtr, "target_btf_id", info->tracing.target_btf_id);
|
||||
jsonw_uint_field(json_wtr, "cookie", info->tracing.cookie);
|
||||
break;
|
||||
case BPF_LINK_TYPE_CGROUP:
|
||||
jsonw_lluint_field(json_wtr, "cgroup_id",
|
||||
@@ -900,6 +901,8 @@ static int show_link_close_plain(int fd, struct bpf_link_info *info)
|
||||
printf("\n\ttarget_obj_id %u target_btf_id %u ",
|
||||
info->tracing.target_obj_id,
|
||||
info->tracing.target_btf_id);
|
||||
if (info->tracing.cookie)
|
||||
printf("\n\tcookie %llu ", info->tracing.cookie);
|
||||
break;
|
||||
case BPF_LINK_TYPE_CGROUP:
|
||||
printf("\n\tcgroup_id %zu ", (size_t)info->cgroup.cgroup_id);
|
||||
|
||||
Reference in New Issue
Block a user