Skip to content

Commit 60601f6

Browse files
authored
libbpf-tools:Fix biosnoop dependency on kernel version (#5244)
tracepoint block_rq_insert and block_rq_issue changed from 5.10.137, not 5.11 Signed-off-by: niuwanli <[email protected]>
1 parent dd14376 commit 60601f6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

libbpf-tools/biosnoop.bpf.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@ int BPF_PROG(block_rq_insert)
126126
return 0;
127127

128128
/**
129-
* commit a54895fa (v5.11-rc1) changed tracepoint argument list
129+
* commit a54895fa (block: remove the request_queue to argument
130+
* request based tracepoints) changed tracepoint argument list
130131
* from TP_PROTO(struct request_queue *q, struct request *rq)
131132
* to TP_PROTO(struct request *rq)
133+
* see:
134+
* https://github.com/torvalds/linux/commit/a54895fa
132135
*/
133-
if (LINUX_KERNEL_VERSION >= KERNEL_VERSION(5, 11, 0))
136+
if (LINUX_KERNEL_VERSION >= KERNEL_VERSION(5, 10, 137))
134137
return trace_rq_start((void *)ctx[0], true);
135138
else
136139
return trace_rq_start((void *)ctx[1], true);
@@ -143,11 +146,14 @@ int BPF_PROG(block_rq_issue)
143146
return 0;
144147

145148
/**
146-
* commit a54895fa (v5.11-rc1) changed tracepoint argument list
149+
* commit a54895fa (block: remove the request_queue to argument
150+
* request based tracepoints) changed tracepoint argument list
147151
* from TP_PROTO(struct request_queue *q, struct request *rq)
148152
* to TP_PROTO(struct request *rq)
153+
* see:
154+
* https://github.com/torvalds/linux/commit/a54895fa
149155
*/
150-
if (LINUX_KERNEL_VERSION >= KERNEL_VERSION(5, 11, 0))
156+
if (LINUX_KERNEL_VERSION >= KERNEL_VERSION(5, 10, 137))
151157
return trace_rq_start((void *)ctx[0], false);
152158
else
153159
return trace_rq_start((void *)ctx[1], false);

0 commit comments

Comments
 (0)