Created
October 27, 2020 12:24
-
-
Save rsevilla87/4d17b63929bc34979201a7ae0c5391f4 to your computer and use it in GitHub Desktop.
PID fsync histogram
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 | |
{ | |
printf("Tracing fsync and fdatasync syscalls... Hit Ctrl-C to end.\n"); | |
} | |
tracepoint:syscalls:sys_enter_fsync, | |
tracepoint:syscalls:sys_enter_fdatasync /pid==4320/ { | |
@start[tid] = nsecs; | |
} | |
tracepoint:syscalls:sys_exit_fsync, | |
tracepoint:syscalls:sys_exit_fdatasync /@start[tid]/ { | |
$ns=@start[tid]; | |
$ms=((nsecs - $ns) / 1000000); | |
@lat = lhist($ms, 10, 1000, 100) | |
} | |
interval:s:10 { | |
print(@lat); | |
} | |
END | |
{ | |
clear(@lat); | |
clear(@start); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment