examples: disksnoop checks if blk_start_request exists before attaching kprobe
@@ -43,6 +43,7 @@ void trace_completion(struct pt_regs *ctx, struct request *req) {
}
""")
+if BPF.get_kprobe_functions(b'blk_start_request'):
b.attach_kprobe(event="blk_start_request", fn_name="trace_start")
b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_start")
b.attach_kprobe(event="blk_account_io_completion", fn_name="trace_completion")
