1wakeuptime(8) System Manager's Manual wakeuptime(8)
2
3
4
6 wakeuptime - Summarize sleep to wakeup time by waker kernel stack. Uses
7 Linux eBPF/bcc.
8
10 wakeuptime [-h] [-u] [-p PID] [-v] [-f] [--stack-storage-size
11 STACK_STORAGE_SIZE] [-m MIN_BLOCK_TIME] [-M MAX_BLOCK_TIME] [duration]
12
14 This program shows the kernel stack traces for threads that woke up
15 other blocked threads, along with the process names of the waker and
16 target, along with a sum of the time that the target was blocked: the
17 "blocked time". It works by tracing when threads block and when they
18 were then woken up, and measuring the time delta. This time measurement
19 will be very similar to off-CPU time, however, off-CPU time may include
20 a little extra time spent waiting on a run queue to be scheduled. The
21 stack traces, process names, and time spent blocked is summarized in
22 the kernel using an eBPF map for efficiency.
23
24 The output summary will help you identify reasons why threads were
25 blocking by showing who woke them up, along with the time they were
26 blocked. This spans all types of blocking activity: disk I/O, network
27 I/O, locks, page faults, involuntary context switches, etc.
28
29 This can be used in conjunction with offcputime, which shows the stack
30 trace of the blocked thread. wakeuptime shows the stack trace of the
31 waker thread.
32
33 See http://www.brendangregg.com/FlameGraphs/offcpuflamegraphs.html
34
35 This tool only works on Linux 4.6+. It uses the new `BPF_STACK_TRACE`
36 table APIs to generate the in-kernel stack traces.
37
39 CONFIG_BPF and bcc.
40
42 -h Print usage message.
43
44 -f Print output in folded stack format.
45
46 -u Only trace user threads (not kernel threads).
47
48 -v Show raw addresses (for non-folded format).
49
50 -p PID Trace this process ID only (filtered in-kernel).
51
52 --stack-storage-size STACK_STORAGE_SIZE
53 Change the number of unique stack traces that can be stored and
54 displayed.
55
56 duration
57 Duration to trace, in seconds.
58
59 -m MIN_BLOCK_TIME
60 The amount of time in microseconds over which we store traces
61 (default 1)
62
63 -M MAX_BLOCK_TIME
64 The amount of time in microseconds under which we store traces
65 (default U64_MAX)
66
68 Trace all thread blocking events, and summarize (in-kernel) by kernel
69 stack trace and total blocked time:
70 # wakeuptime
71
72 Trace user-mode target threads only:
73 # wakeuptime -u
74
75 Trace for 5 seconds only:
76 # wakeuptime 5
77
78 Trace for 5 seconds, and emit output in folded stack format (suitable
79 for flame graphs):
80 # wakeuptime -f 5
81
82 Trace PID 185 only:
83 # wakeuptime -p 185
84
86 This summarizes unique stack traces in-kernel for efficiency, allowing
87 it to trace a higher rate of events than methods that post-process in
88 user space. The stack trace and time data is only copied to user space
89 once, when the output is printed. While these techniques greatly lower
90 overhead, scheduler events are still a high frequency event, as they
91 can exceed 1 million events per second, and so caution should still be
92 used. Test before production use.
93
94 If the overhead is still a problem, take a look at the min block
95 option. If your aim is to chase down longer blocking events, then this
96 could be increased to filter shorter blocking events, further lowering
97 overhead.
98
100 This is from bcc.
101
102 https://github.com/iovisor/bcc
103
104 Also look in the bcc distribution for a companion _examples.txt file
105 containing example usage, output, and commentary for this tool.
106
108 Linux
109
111 Unstable - in development.
112
114 Brendan Gregg
115
117 offcputime(8), stackcount(8)
118
119
120
121USER COMMANDS 2016-01-27 wakeuptime(8)