Created
December 4, 2023 11:39
-
-
Save 135e2/5477e907351e299c83da1676ad6b2821 to your computer and use it in GitHub Desktop.
SEU-Mirrors: Testing Scripts
This file contains hidden or 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/env bpftrace | |
| BEGIN | |
| { | |
| printf("Tracing open file latency... Hit Ctrl-C to end.\n"); | |
| } | |
| tracepoint:syscalls:sys_enter_openat | |
| { | |
| if (strncmp(str(args->filename), "/opt/tunasync/serve/archlinux", 29) == 0) { | |
| printf("%s ", str(args->filename)); | |
| @start[tid] = nsecs; | |
| } | |
| } | |
| tracepoint:syscalls:sys_exit_sendfile64 | |
| /@start[tid]/ | |
| { | |
| $delta = (nsecs - @start[tid]) / 1000; | |
| printf("(%d bytes): %d ms\n", args->ret, $delta / 1000); | |
| @usec = hist($delta); | |
| @usec_stats = stats($delta); | |
| delete(@start[tid]); | |
| } | |
| END | |
| { | |
| clear(@start); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment