From ebc4a770ef1657c93fadf48d40294d3cb7e1cb29 Mon Sep 17 00:00:00 2001 From: xietangxin Date: Thu, 27 Apr 2023 16:59:17 +0800 Subject: [PATCH] adapt block_rq_issue tracepoint args in kernel-5.10 --- src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h b/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h index 2109c87..f24078d 100644 --- a/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h +++ b/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h @@ -315,7 +315,11 @@ static __always_inline struct io_latency_s* get_io_latency(struct io_trace_s* io KRAWTRACE(block_rq_issue, bpf_raw_tracepoint_args) { struct io_trace_s *io_trace = NULL; +#if (CURRENT_KERNEL_VERSION >= KERNEL_VERSION(5, 10, 0)) + struct request* req = (struct request *)ctx->args[0]; +#else struct request* req = (struct request *)ctx->args[1]; +#endif io_trace = get_io_trace(req); if (io_trace == NULL) { -- 2.33.0