accomodate mq block device I/O
diff --git a/examples/bitehist.c b/examples/bitehist.c
index 685d825..0894b32 100644
--- a/examples/bitehist.c
+++ b/examples/bitehist.c
@@ -38,7 +38,7 @@
return log2(v) + 1;
}
-int kprobe__blk_start_request(struct pt_regs *ctx, struct request *req)
+int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req)
{
int index = log2l(req->__data_len / 1024);
u64 *leaf = dist.lookup(&index);
diff --git a/examples/disksnoop.c b/examples/disksnoop.c
index c4a25aa..8c29549 100644
--- a/examples/disksnoop.c
+++ b/examples/disksnoop.c
@@ -15,14 +15,14 @@
BPF_HASH(start, struct request *);
-void kprobe__blk_start_request(struct pt_regs *ctx, struct request *req) {
+void trace_start(struct pt_regs *ctx, struct request *req) {
// stash start timestamp by request ptr
u64 ts = bpf_ktime_get_ns();
start.update(&req, &ts);
}
-void kprobe__blk_update_request(struct pt_regs *ctx, struct request *req) {
+void trace_completion(struct pt_regs *ctx, struct request *req) {
u64 *tsp, delta;
tsp = start.lookup(&req);
diff --git a/examples/disksnoop.py b/examples/disksnoop.py
index 352a170..206b618 100755
--- a/examples/disksnoop.py
+++ b/examples/disksnoop.py
@@ -17,6 +17,9 @@
# load BPF program
b = BPF(src_file="disksnoop.c")
+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")
# header
print("%-18s %-2s %-7s %8s" % ("TIME(s)", "T", "BYTES", "LAT(ms)"))