Created
May 17, 2023 15:16
-
-
Save isilence/bc25109615e9d4e4949aa9d29ebbecb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bpftrace | |
BEGIN { | |
@rw_compl_addr = kaddr("io_req_rw_complete"); | |
@compl_addr = kaddr("io_req_task_complete"); | |
} | |
kprobe:io_req_task_complete { | |
$req = (struct io_kiocb *)arg0; | |
// if ($req->cqe.user_data != 0 || | |
// $req->cqe.res != 0) { | |
// return; | |
// } | |
@tc_stack[kstack] = count(); | |
@tc_opcodes = lhist($req->opcode, 0, 30, 1); | |
} | |
kprobe:__io_req_task_work_add { | |
$req = (struct io_kiocb *)arg0; | |
if ((uint64)$req->io_task_work.func != @compl_addr) { | |
return; | |
} | |
// if ($req->cqe.user_data != 0 || | |
// $req->cqe.res != 0) { | |
// return; | |
// } | |
@tw_add_stack[kstack] = count(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment