Lines Matching +full:suspend +full:- +full:to +full:- +full:disk

8    pm-graph: suspend/resume/boot timing analysis tools
11 Home Page: https://01.org/pm-graph
13 Report bugs/issues at bugzilla.kernel.org Tools/pm-graph
14 - https://bugzilla.kernel.org/buglist.cgi?component=pm-graph&product=Tools
17 - Getting Started:
18 https://01.org/pm-graph/documentation/getting-started
20 - Config File Format:
21 https://01.org/pm-graph/documentation/3-config-file-format
23 - upstream version in git:
24 https://github.com/intel/pm-graph/
27 - Overview
28 - Setup
29 - Usage
30 - Basic Usage
31 - Dev Mode Usage
32 - Proc Mode Usage
33 - Endurance Testing
34 - Usage Examples
35 - Configuration Files
36 - Usage Examples
37 - Config File Options
38 - Custom Timeline Entries
39 - Adding/Editing Timeline Functions
40 - Adding/Editing Dev Timeline Source Functions
41 - Verifying your Custom Functions
42 - Testing on consumer linux Operating Systems
43 - Android
45 ------------------------------------------------------------------
47 ------------------------------------------------------------------
49 This tool suite is designed to assist kernel and OS developers in optimizing
50 their linux stack's suspend/resume & boot time. Using a kernel image built
51 with a few extra options enabled, the tools will execute a suspend or boot,
53 timelines and a callgraph to give a quick and detailed view of which devices
54 and kernel processes are taking the most time in suspend/resume & boot.
56 ------------------------------------------------------------------
58 ------------------------------------------------------------------
61 - runs with python2 or python3, choice is made by /usr/bin/python link
62 - python
63 - python-configparser (for python2 sleepgraph)
64 - python-requests (for googlesheet.py)
65 - linux-tools-common (for turbostat usage in sleepgraph)
68 sudo apt-get install python python-configparser python-requests linux-tools-common
71 sudo dnf install python python-configparser python-requests linux-tools-common
75 $> git clone http://github.com/intel/pm-graph.git
76 $> cd pm-graph
93 v3.0 behavior. These patches allow the tool to read all the
97 (kernel/pre-3.15/enable_trace_events_suspend_resume.patch)
98 (kernel/pre-3.15/enable_trace_events_device_pm_callback.patch)
105 If you're using a kernel older than 3.11-rc2, the following simple
106 patch must be applied to enable ftrace data:
107 in file: kernel/power/suspend.c
109 remove call to "ftrace_stop();"
110 remove call to "ftrace_start();"
113 (kernel/pre-3.11-rc2/enable_ftrace_in_suspendresume.patch)
117 ------------------------------------------------------------------
119 ------------------------------------------------------------------
128 %> sudo ./sleepgraph.py -modes
129 ['freeze', 'mem', 'disk']
133 %> sudo ./sleepgraph.py -m mem -rtcwake 15
137 %> sudo ./sleepgraph.py -config config/suspend.cfg
141 files in subdirectory: suspend-mmddyy-HHMMSS. The ftrace file can
142 be used to regenerate the html timeline with different options
154 Developer mode adds information on low level source calls to the timeline.
155 The tool sets kprobes on all delay and mutex calls to see which devices
157 subsystem dependent calls to better fill out the timeline.
160 timeline. This is useful in discovering dependent threads to get a better
162 a.k.a. scsi resume error handler, is what each SATA disk device waits for
166 to set the -mindev option to clip out any device blocks that are too small
167 to see easily. The following command will give a nice dev mode run:
169 %> sudo ./sleepgraph.py -m mem -rtcwake 15 -mindev 1 -dev
173 %> sudo ./sleepgraph.py -config config/suspend-dev.cfg
179 Proc mode adds user process info to the timeline. This is done in a manner
180 similar to the bootchart utility, which graphs init processes and their
182 the period before and after suspend/resume.
184 In order to see any process info, there needs to be some delay before or
186 resume_complete. The predelay and postdelay args allow you to do this. It
187 can also be useful to run in x2 mode with an x2 delay, this way you can
189 successive suspend/resumes.
193 %> sudo ./sleepgraph.py -m mem -rtcwake 15 -x2 -x2delay 1000 -predelay 1000 -postdelay 1000 -proc
197 %> sudo ./sleepgraph.py -config config/suspend-proc.cfg
199 ------------------------------------------------------------------
201 ------------------------------------------------------------------
203 The best way to gauge the health of a system is to run a series of
204 suspend/resumes over an extended period and analyze the behavior. This can be
205 accomplished with sleepgraph's -multi argument. You specify two numbers: the
206 number of tests to run OR the duration in days, hours, or minutes, and the
207 delay in seconds between them. For instance, -multi 20 5: execute 20 tests with
208 a 5 second delay between each, or -multi 24h 0: execute tests over a 24 hour
210 to generate the data you want. It's most useful to collect dev mode timelines
216 summary-issue.html and summary-devices.html files include data taken from
219 suspend-xN-{date}-{time}:
221 summary-issues.html
222 summary-devices.html
223 suspend-{date}-{time} (1)
224 suspend-{date}-{time} (2)
227 These are the relevant arguments to use for testing:
229 -m mode
230 Mode to initiate for suspend e.g. mem, freeze, standby (default: mem).
232 -rtcwake t
233 Use rtcwake to autoresume after t seconds (default: 15).
235 -gzip (optional)
236 Gzip the trace and dmesg logs to save space. The tool can also read in
239 -dev (optional)
240 Add kernel source calls and threads to the timeline (default: disabled).
242 -multi n d
244 created in a new subdirectory: suspend-xN-{date}-{time}. When the multitest
245 run is done, the -summary command is called automatically to create summary
246 html files for all the data (unless you use -skiphtml). -skiphtml will
248 can then run the tool again at a later time with -summary and -genhtml to
251 -skiphtml (optional)
254 copy the data to a faster host machine and run -summary -genhtml to
257 These are the relevant commands to use after testing is complete:
259 -summary indir
260 Generate or regenerate the summary for a -multi test run. Creates three
261 files: summary.html, summary-issues.html, and summary-devices.html in the
263 by kernel/host/mode, and links to the test html files. summary-issues.html
265 summary-devices.html is a list of devices and times from all the tests.
267 -genhtml
268 Used with -summary to regenerate any missing html timelines from their
277 %> sudo ./sleepgraph.py -m mem -rtcwake 10 -dev -gzip -multi 2000 0
279 or you can skip timeline generation in order to speed things up
281 %> sudo ./sleepgraph.py -m mem -rtcwake 10 -dev -gzip -multi 2000 0 -skiphtml
285 depending on whether you used the -skiphtml option. The root folder contains
290 %> cd suspend-x2000-{date}-{time}
291 %> sleepgraph.py -summary .
293 or if you need to generate the html timelines you can use -genhtml
295 %> cd suspend-xN-{date}-{time}
296 %> sleepgraph.py -summary . -genhtml
298 ------------------------------------------------------------------
300 ------------------------------------------------------------------
302 Since 4.0 we've moved to using config files in lieu of command line options.
306 Simple suspend/resume with basic timeline (mem/freeze/standby)
307 config/suspend.cfg
311 Dev mode suspend/resume with dev timeline (mem/freeze/standby)
312 config/suspend-dev.cfg
313 config/freeze-dev.cfg
314 config/standby-dev.cfg
316 Simple suspend/resume with timeline and callgraph (mem/freeze/standby)
317 config/suspend-callgraph.cfg
318 config/freeze-callgraph.cfg
319 config/standby-callgraph.cfg
321 Sample proc mode x2 run using mem suspend
322 config/suspend-x2-proc.cfg
325 config/custom-timeline-functions.cfg
328 config/debug-serio-suspend.cfg
334 Run a simple mem suspend:
335 %> sudo ./sleepgraph.py -config config/suspend.cfg
337 Run a mem suspend with callgraph data:
338 %> sudo ./sleepgraph.py -config config/suspend-callgraph.cfg
340 Run a mem suspend with dev mode detail:
341 %> sudo ./sleepgraph.py -config config/suspend-dev.cfg
352 # Suspend Mode: e.g. standby, mem, freeze, disk (def: mem)
356 output-dir: suspend-{hostname}-{date}-{time}
358 # Automatic Wakeup: use rtcwake to wakeup after X seconds (def: infinity)
361 # Add Logs: add the dmesg and ftrace log to the html output (def: false)
367 # Custom Command: Command to execute in lieu of suspend (def: "")
376 # Suspend/Resume x2: run 2 suspend/resumes back to back (def: false)
379 # x2 Suspend Delay: time delay between the two test runs in ms (def: 0 ms)
382 # Pre Suspend Delay: nclude an N ms delay before (1st) suspend (def: 0 ms)
394 # Expand Callgraph: pre-expand the callgraph treeviews in html (def: false)
408 # Set this to true if you intend to only use the ones defined in the config
409 override-timeline-functions: true
413 # Set this to true if you intend to only use the ones defined in the config
414 override-dev-timeline-functions: true
418 callloop-maxgap: 0.0001
422 callloop-maxlen: 0.005
424 ------------------------------------------------------------------
426 ------------------------------------------------------------------
431 The tool uses an array of function names to fill out empty spaces in the
434 in the timeline to show you where the time is going. These calls should fill
437 It is possible to add new function calls to the timeline by adding them to
438 the config. It's also possible to copy the internal timeline functions into
443 Use the override-timeline-functions option if you only want to use your
444 custom calls, or leave it false to append them to the internal ones.
449 can include up to four pieces of info: The function name, a format string,
452 For a full example config, see config/custom-timeline-functions.cfg. It pulls
453 all the internal timeline functions into the config and allows you to edit
470 format: The format to display the data on the timeline in. Use braces to
496 In dev mode, the tool uses an array of function names to monitor source
507 the functions that add a hardcoded time delay to the suspend/resume path.
508 The tool also includes some common functions native to important
511 It is possible to add new function calls to the dev timeline by adding them
512 to the config. It's also possible to copy the internal dev timeline
517 Use the override-dev-timeline-functions option if you only want to use your
518 custom calls, or leave it false to append them to the internal ones.
524 to four pieces of info: The function name, a format string, an argument list,
527 For a full example config, see config/custom-timeline-functions.cfg. It pulls
528 all the internal dev timeline functions into the config and allows you to edit
532 ataN_port_reset in the timeline. This is where most of the SATA disk resume
533 time goes, so it can be helpful to see the low level call.
542 Once you have a set of functions (kprobes) defined, it can be useful to
543 perform a quick check to see if you formatted them correctly and if the system
544 actually supports them. To do this, run the tool with your config file
545 and the -status option. The tool will go through all the kprobes (both
547 to set them in ftrace. It will then print out success or fail for you.
554 sudo ./sleepgraph.py -config config/custom-timeline-functions.cfg -status
586 ------------------------------------------------------------------
588 ------------------------------------------------------------------
593 The easiest way to execute on an android device is to run the android.sh
594 script on the device, then pull the ftrace log back to the host and run
601 host%> wget https://raw.githubusercontent.com/intel/pm-graph/master/tools/android.sh
604 # push the script to a writeable location
613 kernel : 3.14.0-i386-dirty
624 [execute the suspend]
626 # NOTE: The suspend will only work if the screen isn't timed out,
627 # so you have to press some keys first to wake it up b4 suspend)
628 dev%> sh android.sh suspend mem
629 ------------------------------------
630 Suspend/Resume timing test initiated
631 ------------------------------------
633 kernel : 3.14.0-i386-dirty
638 ------------------------------------
641 SUSPEND START @ 21:24:02 (rtcwake in 10 seconds)
646 # I find that you have to actually kill the adb process and
647 # reconnect sometimes in order for the connection to work post-suspend
658 host%> sleepgraph.py -ftrace ftrace.txt