Skip to content

Commit

Permalink
biolatency.py: use blk_account_io_done instead of blk_account_io_comp…
Browse files Browse the repository at this point in the history
…letion (iovisor#2109)

The biolatency tool attaches kprobe at blk_account_io_completion() function
to check when a request is finished. But sometimes request can be finished
partially and blk_account_io_completion() is called again.
The blk_account_io_done() is called when a request is finally
finished and biolatency tool should attach blk_account_io_done(), not
blk_account_io_completion().

Signed-off-by: Gioh Kim <[email protected]>
  • Loading branch information
gurugio authored and yonghong-song committed Jan 4, 2019
1 parent 777e802 commit c5a448a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/biolatency.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}
// output
int trace_req_completion(struct pt_regs *ctx, struct request *req)
int trace_req_done(struct pt_regs *ctx, struct request *req)
{
u64 *tsp, delta;
Expand Down Expand Up @@ -119,8 +119,8 @@
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")
b.attach_kprobe(event="blk_account_io_done",
fn_name="trace_req_done")

print("Tracing block device I/O... Hit Ctrl-C to end.")

Expand Down

0 comments on commit c5a448a

Please sign in to comment.