Skip to content

Commit

Permalink
tools: prepare block tools for the removing of legacy I/O path (iovis…
Browse files Browse the repository at this point in the history
…or#2070)

Recent -next kernels don't have blk_start_request() function
anymore. It has been removed in a recent cleanup. bio* tools should be
able to handle the lack of this probe.
  • Loading branch information
jeromemarchand authored and yonghong-song committed Dec 10, 2018
1 parent 218f748 commit 74e25ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tools/biolatency.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
if args.queued:
b.attach_kprobe(event="blk_account_io_start", fn_name="trace_req_start")
else:
b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start")
if BPF.get_kprobe_functions(b'blk_start_request'):
b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start")
b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start")
b.attach_kprobe(event="blk_account_io_completion",
fn_name="trace_req_completion")
Expand Down
3 changes: 2 additions & 1 deletion tools/biosnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
}
""", debug=0)
b.attach_kprobe(event="blk_account_io_start", fn_name="trace_pid_start")
b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start")
if BPF.get_kprobe_functions(b'blk_start_request'):
b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start")
b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start")
b.attach_kprobe(event="blk_account_io_completion",
fn_name="trace_req_completion")
Expand Down
3 changes: 2 additions & 1 deletion tools/biotop.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ def signal_ignore(signal, frame):

b = BPF(text=bpf_text)
b.attach_kprobe(event="blk_account_io_start", fn_name="trace_pid_start")
b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start")
if BPF.get_kprobe_functions(b'blk_start_request'):
b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start")
b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start")
b.attach_kprobe(event="blk_account_io_completion",
fn_name="trace_req_completion")
Expand Down

0 comments on commit 74e25ed

Please sign in to comment.