From 4c82b9ddf5c2933d642c11e00ee6c058b8373be1 Mon Sep 17 00:00:00 2001 From: wubijie Date: Sun, 25 Jun 2023 14:36:53 +0800 Subject: [PATCH] Adds the ability to track and log block device request queue operations --- observation/src/biolatency/biolatency,bpf.c | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/observation/src/biolatency/biolatency,bpf.c b/observation/src/biolatency/biolatency,bpf.c index 66cfc133..d8f898b2 100644 --- a/observation/src/biolatency/biolatency,bpf.c +++ b/observation/src/biolatency/biolatency,bpf.c @@ -70,3 +70,29 @@ static int __always_inline trace_rq_start(struct request *rq, int issue) return 0; } + +static int handle_block_rq_insert(__u64 *ctx) +{ + /* + * commit a54895fs (v5.11-rc1) changed tracepoint argument list from + * TP_PROTO(struct request_queue *q, struct request *rq) to + * TP_PROTO(struct request *rq) + */ + if (LINUX_KERNEL_VERSION < KERNEL_VERSION(5, 11, 0)) + return trace_rq_start((void *)ctx[1], false); + else + return trace_rq_start((void *)ctx[0], false); +} + +static int handle_block_rq_issue(__u64 *ctx) +{ + /* + * commit a54895fs (v5.11-rc1) changed tracepoint argument list from + * TP_PROTO(struct request_queue *q, struct request *rq) to + * TP_PROTO(struct request *rq) + */ + if (LINUX_KERNEL_VERSION < KERNEL_VERSION(5, 11, 0)) + return trace_rq_start((void *)ctx[1], true); + else + return trace_rq_start((void *)ctx[0], true); +} \ No newline at end of file -- Gitee