Skip to content

Commit e2b2cd5

Browse files
olsajirianakryiko
authored andcommitted
bpf: Add missed value to kprobe_multi link info
Add missed value to kprobe_multi link info to hold the stats of missed kprobe_multi probe. The missed counter gets incremented when fprobe fails the recursion check or there's no rethook available for return probe. In either case the attached bpf program is not executed. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Tested-by: Song Liu <song@kernel.org> Reviewed-by: Song Liu <song@kernel.org> Acked-by: Hou Tao <houtao1@huawei.com> Link: https://lore.kernel.org/bpf/20230920213145.1941596-3-jolsa@kernel.org
1 parent f915fcb commit e2b2cd5

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

include/uapi/linux/bpf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6532,6 +6532,7 @@ struct bpf_link_info {
65326532
__aligned_u64 addrs;
65336533
__u32 count; /* in/out: kprobe_multi function count */
65346534
__u32 flags;
6535+
__u64 missed;
65356536
} kprobe_multi;
65366537
struct {
65376538
__u32 type; /* enum bpf_perf_event_type */

kernel/trace/bpf_trace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,6 +2614,7 @@ static int bpf_kprobe_multi_link_fill_link_info(const struct bpf_link *link,
26142614
kmulti_link = container_of(link, struct bpf_kprobe_multi_link, link);
26152615
info->kprobe_multi.count = kmulti_link->cnt;
26162616
info->kprobe_multi.flags = kmulti_link->flags;
2617+
info->kprobe_multi.missed = kmulti_link->fp.nmissed;
26172618

26182619
if (!uaddrs)
26192620
return 0;

tools/include/uapi/linux/bpf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6532,6 +6532,7 @@ struct bpf_link_info {
65326532
__aligned_u64 addrs;
65336533
__u32 count; /* in/out: kprobe_multi function count */
65346534
__u32 flags;
6535+
__u64 missed;
65356536
} kprobe_multi;
65366537
struct {
65376538
__u32 type; /* enum bpf_perf_event_type */

0 commit comments

Comments
 (0)