bcc的这个工具 funclatency
主要是为了测量 函数调用的延时的
funclatency(8)
NAME
funclatency - Time functions and print latency as a histogram.
OPTIONS
pattern Function name or search pattern. Supports "*" wildcards. See EXAMPLES. You can also use -r for reg‐
ular expressions. -h Print usage message.
-p PID Trace this process ID only.
-i INTERVAL
Print output every interval seconds.
-d DURATION
Total duration of trace, in seconds.
-T Include timestamps on output.
-u Output histogram in microseconds.
-m Output histogram in milliseconds.
-F Print a separate histogram per function matched.
-r Use regular expressions for the search pattern.
-v Print the BPF program (for debugging purposes).
sudo funclatency-bpfcc c:read
Tracing 1 functions for "c:read"... Hit Ctrl-C to end.
Function = b'__read' [19014]
nsecs : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 0 | |
1024 -> 2047 : 0 | |
2048 -> 4095 : 0 | |
4096 -> 8191 : 0 | |
8192 -> 16383 : 0 | |
16384 -> 32767 : 8 |****************************************|
32768 -> 65535 : 1 |***** |