^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .TH SLEEPGRAPH 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .SH NAME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) sleepgraph \- Suspend/Resume timing analysis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .SH SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) .ft B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) .B sleepgraph
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) .RB [ OPTIONS ]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) .RB [ COMMAND ]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) .SH DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) \fBsleepgraph \fP is designed to assist kernel and OS developers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) in optimizing their linux stack's suspend/resume time. Using a kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) image built with a few extra options enabled, the tool will execute a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) suspend and capture dmesg and ftrace data until resume is complete.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) This data is transformed into a device timeline and an optional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) callgraph to give a detailed view of which devices/subsystems are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) taking the most time in suspend/resume.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) If no specific command is given, the default behavior is to initiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) a suspend/resume.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) Generates output files in subdirectory: suspend-yymmdd-HHMMSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) html timeline : <hostname>_<mode>.html
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) raw dmesg file : <hostname>_<mode>_dmesg.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) raw ftrace file : <hostname>_<mode>_ftrace.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) .SH OPTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) \fB-h\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Print the help text.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) \fB-v\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Print the current tool version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) \fB-verbose\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) Print extra information during execution and analysis.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) \fB-config \fIfile\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) Pull arguments and config options from a file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) \fB-m \fImode\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) Mode to initiate for suspend e.g. standby, freeze, mem (default: mem).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) \fB-o \fIname\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Overrides the output subdirectory name when running a new test.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Use {date}, {time}, {hostname} for current values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) .sp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) e.g. suspend-{hostname}-{date}-{time}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) \fB-rtcwake \fIt\fR | off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Use rtcwake to autoresume after \fIt\fR seconds (default: 15). Set t to "off" to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) disable rtcwake and require a user keypress to resume.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) \fB-addlogs\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) Add the dmesg and ftrace logs to the html output. They will be viewable by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) clicking buttons in the timeline.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) \fB-noturbostat\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) By default, if turbostat is found and the requested mode is freeze, sleepgraph
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) will execute the suspend via turbostat and collect data in the timeline log.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) This option disables the use of turbostat.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) \fB-result \fIfile\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) Export a results table to a text file for parsing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) \fB-sync\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) Sync the filesystems before starting the test. This reduces the size of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) the sys_sync call which happens in the suspend_prepare phase.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) \fB-rs \fIenable/disable\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) During test, enable/disable runtime suspend for all devices. The test is delayed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) by 5 seconds to allow runtime suspend changes to occur. The settings are restored
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) after the test is complete.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) \fB-display \fIon/off/standby/suspend\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) Switch the display to the requested mode for the test using the xset command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) This helps maintain the consistency of test data for better comparison.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) \fB-wifi\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) If a wifi connection is available, check that it reconnects after resume. Include
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) the reconnect time in the total resume time calculation and treat wifi timeouts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) as resume failures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) .SS "advanced"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) \fB-gzip\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) Gzip the trace and dmesg logs to save space. The tool can also read in gzipped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) logs for processing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) \fB-cmd \fIstr\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) Run the timeline over a custom suspend command, e.g. pm-suspend. By default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) the tool forces suspend via /sys/power/state so this allows testing over
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) an OS's official suspend method. The output file will change to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) hostname_command.html and will autodetect which suspend mode was triggered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) \fB-filter \fI"d1,d2,..."\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) Filter out all but these device callbacks. These strings can be device names
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) or module names. e.g. 0000:00:02.0, ata5, i915, usb, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) \fB-mindev \fIt\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) Discard all device callbacks shorter than \fIt\fR milliseconds (default: 0.0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) This reduces the html file size as there can be many tiny callbacks which are barely
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) visible. The value is a float: e.g. 0.001 represents 1 us.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) \fB-proc\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) Add usermode process info into the timeline (default: disabled).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) \fB-dev\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) Add kernel source calls and threads to the timeline (default: disabled).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) \fB-x2\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) Run two suspend/resumes back to back (default: disabled).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) \fB-x2delay \fIt\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) Include \fIt\fR ms delay between multiple test runs (default: 0 ms).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) \fB-predelay \fIt\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) Include \fIt\fR ms delay before 1st suspend (default: 0 ms).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) \fB-postdelay \fIt\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) Include \fIt\fR ms delay after last resume (default: 0 ms).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) \fB-multi \fIn d\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) Used for endurance testing. If \fIn\fR is entirely numeric, it's treated as a count:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) Execute \fIn\fR consecutive tests at \fId\fR second intervals.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) If \fIn\fR is an integer followed by a "d", "h", or "m", it's treated as a duration:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) Execute tests continuously over \fIn\fR days, hours, or minutes at \fId\fR second intervals.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) The outputs will be created in a new subdirectory, for count: suspend-{date}-{time}-xN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) for duration: suspend-{date}-{time}-Nm. When the multitest run is done, the \fI-summary\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) command is called automatically to create summary html files for all the data (unless you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) use \fI-skiphtml\fR). \fI-skiphtml\fR will speed up the testing by not creating timelines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) or summary html files. You can then run the tool again at a later time with \fI-summary\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) and \fI-genhtml\fR to create the timelines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) \fB-maxfail \fIn\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) Abort a -multi run after \fIn\fR consecutive fails. 0 means never abort (default = 0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) \fB-skiphtml\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) Run the test and capture the trace logs, but skip the timeline generation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) You can generate the html timelines later with \fI-dmesg\fR & \fI-ftrace\fR, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) by running \fI-summary\fR and \fI-genhtml\fR.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) .SS "ftrace debug"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) \fB-f\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) Use ftrace to create device callgraphs (default: disabled). This can produce
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) very large outputs, i.e. 10MB - 100MB.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) \fB-ftop\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) Use ftrace on the top level call: "suspend_devices_and_enter" only (default: disabled).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) This option implies -f and creates a single callgraph covering all of suspend/resume.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) \fB-maxdepth \fIlevel\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) limit the callgraph trace depth to \fIlevel\fR (default: 0=all). This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) the best way to limit the output size when using callgraphs via -f.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) \fB-expandcg\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) pre-expand the callgraph data in the html output (default: disabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) \fB-fadd \fIfile\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) Add functions to be graphed in the timeline from a list in a text file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) \fB-mincg \fIt\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) Discard all callgraphs shorter than \fIt\fR milliseconds (default: 0.0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) This reduces the html file size as there can be many tiny callgraphs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) which are barely visible in the timeline.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) The value is a float: e.g. 0.001 represents 1 us.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) \fB-cgfilter \fI"func1,func2,..."\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) Reduce callgraph output in the timeline by limiting it certain devices. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) argument can be a single device name or a comma delimited list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) (default: none)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) \fB-cgskip \fIfile\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) Reduce callgraph timeline size by skipping over uninteresting functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) in the trace, e.g. printk or console_unlock. The functions listed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) in this file will show up as empty leaves in the callgraph with only the start/end
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) times displayed. cgskip.txt is used automatically if found in the path, so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) use "off" to disable completely (default: cgskip.txt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) \fB-cgphase \fIp\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) Only show callgraph data for phase \fIp\fR (e.g. suspend_late).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) \fB-cgtest \fIn\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) In an x2 run, only show callgraph data for test \fIn\fR (e.g. 0 or 1).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) \fB-timeprec \fIn\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) Number of significant digits in timestamps (0:S, [3:ms], 6:us).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) \fB-bufsize \fIN\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) Set trace buffer size to N kilo-bytes (default: all of free memory up to 3GB)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) .SH COMMANDS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) \fB-summary \fIindir\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) Create a set of summary pages for all tests in \fIindir\fR recursively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) Creates summary.html, summary-issues.html, and summary-devices.html in the current folder.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) summary.html is a table of tests with relevant info sorted by kernel/host/mode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) and links to the test html files. It identifies the minimum, maximum, and median
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) suspend and resume times for you with highlights and links in the header.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) summary-issues.html is a list of kernel issues found in dmesg from all the tests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) summary-devices.html is a list of devices and times from all the tests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) Use \fI-genhtml\fR to regenerate any tests with missing html.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) \fB-genhtml\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) Used with \fI-summary\fR to regenerate any missing html timelines from their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) dmesg and ftrace logs. This will require a significant amount of time if there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) are thousands of tests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) \fB-modes\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) List available suspend modes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) \fB-status\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) Test to see if the system is able to run this tool. Use this along
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) with any options you intend to use to see if they will work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) \fB-fpdt\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) Print out the contents of the ACPI Firmware Performance Data Table.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) \fB-wificheck\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) Print out wifi status and connection details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) \fB-xon/-xoff/-xstandby/-xsuspend\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) Test xset by attempting to switch the display to the given mode. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) is the same command which will be issued by \fB-display \fImode\fR.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) \fB-xstat\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) Get the current DPMS display mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) \fB-sysinfo\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) Print out system info extracted from BIOS. Reads /dev/mem directly instead of going through dmidecode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) \fB-devinfo\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) Print out the pm settings of all devices which support runtime suspend.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) \fB-cmdinfo\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) Print out all the platform data collected from the system that makes it into the logs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) \fB-flist\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) Print the list of ftrace functions currently being captured. Functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) that are not available as symbols in the current kernel are shown in red.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) By default, the tool traces a list of important suspend/resume functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) in order to better fill out the timeline. If the user has added their own
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) with -fadd they will also be checked.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) \fB-flistall\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) Print all ftrace functions capable of being captured. These are all the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) possible values you can add to trace via the -fadd argument.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) .SS "rebuild"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) \fB-ftrace \fIfile\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) Create HTML output from an existing ftrace file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) .TP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) \fB-dmesg \fIfile\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) Create HTML output from an existing dmesg file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) .SH EXAMPLES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) .SS "simple commands"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) Check which suspend modes are currently supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) \f(CW$ sleepgraph -modes\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) Read the Firmware Performance Data Table (FPDT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) \f(CW$ sudo sleepgraph -fpdt\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) Print out the current USB power topology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) \f(CW$ sleepgraph -usbtopo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) Verify that you can run a command with a set of arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) \f(CW$ sudo sleepgraph -f -rtcwake 30 -status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) Generate a summary of all timelines in a particular folder.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) \f(CW$ sleepgraph -summary ~/workspace/myresults/\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) .SS "capturing basic timelines"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) Execute a mem suspend with a 15 second wakeup. Include the logs in the html.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) \f(CW$ sudo sleepgraph -rtcwake 15 -addlogs\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) Execute a standby with a 15 second wakeup. Change the output folder name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) \f(CW$ sudo sleepgraph -m standby -rtcwake 15 -o "standby-{host}-{date}-{time}"\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) Execute a freeze with no wakeup (require keypress). Change output folder name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) \f(CW$ sudo sleepgraph -m freeze -rtcwake off -o "freeze-{hostname}-{date}-{time}"\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) .SS "capturing advanced timelines"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) Execute a suspend & include dev mode source calls, limit callbacks to 5ms or larger.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) \f(CW$ sudo sleepgraph -m mem -rtcwake 15 -dev -mindev 5\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) Run two suspends back to back, include a 500ms delay before, after, and in between runs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) \f(CW$ sudo sleepgraph -m mem -rtcwake 15 -x2 -predelay 500 -x2delay 500 -postdelay 500\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) Execute a suspend using a custom command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) \f(CW$ sudo sleepgraph -cmd "echo mem > /sys/power/state" -rtcwake 15\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) .SS "endurance testing using -multi"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) Do a batch run of 10 freezes with 30 seconds delay between runs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) \f(CW$ sudo sleepgraph -m freeze -rtcwake 15 -multi 10 30\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) Do a batch run of freezes for 24 hours.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) \f(CW$ sudo sleepgraph -m freeze -rtcwake 15 -multi 24h 0\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) .SS "adding callgraph data"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) Add device callgraphs. Limit the trace depth and only show callgraphs 10ms or larger.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) \f(CW$ sudo sleepgraph -m mem -rtcwake 15 -f -maxdepth 5 -mincg 10\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) Capture a full callgraph across all suspend, then filter the html by a single phase.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) \f(CW$ sudo sleepgraph -m mem -rtcwake 15 -f\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) \f(CW$ sleepgraph -dmesg host_mem_dmesg.txt -ftrace host_mem_ftrace.txt -f -cgphase resume
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) .SS "rebuild timeline from logs"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) Rebuild the html from a previous run's logs, using the same options.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) \f(CW$ sleepgraph -dmesg dmesg.txt -ftrace ftrace.txt -callgraph\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) Rebuild the html with different options.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) .IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) \f(CW$ sleepgraph -dmesg dmesg.txt -ftrace ftrace.txt -addlogs -srgap\fR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) .SH "SEE ALSO"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) dmesg(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) .PP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) .SH AUTHOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) .nf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) Written by Todd Brandt <todd.e.brandt@linux.intel.com>