1funcinterval(8) System Manager's Manual funcinterval(8)
2
3
4
6 funcinterval - Time interval between the same function, tracepoint as a
7 histogram.
8
10 funcinterval [-h] [-p PID] [-i INTERVAL] [-d DURATION] [-T] [-u] [-m]
11 [-v] pattern
12
14 This tool times interval between the same function as a histogram.
15
16 eBPF/bcc is very suitable for platform performance tuning. By funcla‐
17 tency, we can profile specific functions to know how latency this func‐
18 tion costs. However, sometimes performance drop is not about the
19 latency of function but the interval between function calls. funcin‐
20 terval is born for this purpose.
21
22 This tool uses in-kernel eBPF maps for storing timestamps and the his‐
23 togram, for efficiency.
24
25 WARNING: This uses dynamic tracing of (what can be many) functions, an
26 activity that has had issues on some kernel versions (risk of panics or
27 freezes). Test, and know what you are doing, before use.
28
29 Since this uses BPF, only the root user can use this tool.
30
32 CONFIG_BPF and bcc.
33
35 pattern Function name. -h Print usage message.
36
37 -p PID Trace this process ID only.
38
39 -i INTERVAL
40 Print output every interval seconds.
41
42 -d DURATION
43 Total duration of trace, in seconds.
44
45 -T Include timestamps on output.
46
47 -u Output histogram in microseconds.
48
49 -m Output histogram in milliseconds.
50
51 -v Print the BPF program (for debugging purposes).
52
54 Time the interval of do_sys_open() kernel function as a histogram:
55 # funcinterval do_sys_open
56
57 Time the interval of xhci_ring_ep_doorbell(), in microseconds:
58 # funcinterval -u xhci_ring_ep_doorbell
59
60 Time the interval of do_nanosleep(), in milliseconds
61 # funcinterval -m do_nanosleep
62
63 Output every 5 seconds, with timestamps:
64 # funcinterval -mTi 5 vfs_read
65
66 Time process 181 only:
67 # funcinterval -p 181 vfs_read
68
69 Time the interval of mm_vmscan_direct_reclaim_begin tracepoint:
70 # funcinterval t:vmscan:mm_vmscan_direct_reclaim_begin
71
73 necs Nanosecond range
74
75 usecs Microsecond range
76
77 msecs Millisecond range
78
79 count How many calls fell into this range
80
81 distribution
82 An ASCII bar chart to visualize the distribution (count column)
83
85 This traces kernel functions and maintains in-kernel timestamps and a
86 histogram, which are asynchronously copied to user-space. While this
87 method is very efficient, the rate of kernel functions can also be very
88 high (>1M/sec), at which point the overhead is expected to be measur‐
89 able. Measure in a test environment and understand overheads before
90 use. You can also use funccount to measure the rate of kernel functions
91 over a short duration, to set some expectations before use.
92
94 This is from bcc.
95
96 https://github.com/iovisor/bcc
97
98 Also look in the bcc distribution for a companion _examples.txt file
99 containing example usage, output, and commentary for this tool.
100
102 Linux
103
105 Unstable - in development.
106
108 Edward Wu
109
111 funclatency(8) funccount(8)
112
113
114
115USER COMMANDS 2020-05-27 funcinterval(8)