Skip to content

Commit 1375884

Browse files
olsajiriqmonnet
authored andcommitted
bpftool: Display ref_ctr_offset for uprobe link info
Adding support to display ref_ctr_offset in link output, like: # bpftool link ... 42: perf_event prog 174 uprobe /proc/self/exe+0x102f13 cookie 3735928559 ref_ctr_offset 0x303a3fa bpf_cookie 3735928559 pids test_progs(1820) # bpftool link -j | jq [ ... { "id": 42, ... "ref_ctr_offset": 50500538, } ] Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 4b96469 commit 1375884

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/link.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ show_perf_event_uprobe_json(struct bpf_link_info *info, json_writer_t *wtr)
380380
u64_to_ptr(info->perf_event.uprobe.file_name));
381381
jsonw_uint_field(wtr, "offset", info->perf_event.uprobe.offset);
382382
jsonw_uint_field(wtr, "cookie", info->perf_event.uprobe.cookie);
383+
jsonw_uint_field(wtr, "ref_ctr_offset", info->perf_event.uprobe.ref_ctr_offset);
383384
}
384385

385386
static void
@@ -823,6 +824,8 @@ static void show_perf_event_uprobe_plain(struct bpf_link_info *info)
823824
printf("%s+%#x ", buf, info->perf_event.uprobe.offset);
824825
if (info->perf_event.uprobe.cookie)
825826
printf("cookie %llu ", info->perf_event.uprobe.cookie);
827+
if (info->perf_event.uprobe.ref_ctr_offset)
828+
printf("ref_ctr_offset 0x%llx ", info->perf_event.uprobe.ref_ctr_offset);
826829
}
827830

828831
static void show_perf_event_tracepoint_plain(struct bpf_link_info *info)

0 commit comments

Comments
 (0)