diff options
| author | Todd E Brandt <todd.e.brandt@linux.intel.com> | 2018-01-30 03:17:20 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-02-21 17:56:22 -0500 |
| commit | 700abc90f07b7f60e512c5d5b7cb33bdc207e47c (patch) | |
| tree | 45c14bb495ff2b4775c75b7dfb8495cc9aa080d4 | |
| parent | d83a76a8ec34b3c52e9aadafadb370ebd82cf79a (diff) | |
pm-graph: AnalyzeSuspend v5.0
- add -cgskip option to reduce callgraph output size
- add -cgfilter option to focus on a list of devices
- add -result option for exporting batch test results
- removed all phoronix hooks, use -result to enable batch testing
- change -usbtopo to -devinfo, now prints all devices
- add -gzip option to read/write logs in gz format
- add -bufsize option to manually control ftrace buffer size
- add -sync option to run filesystem sync prior to test
- add -display option to enable/disable the display prior to test
- add -rs option to enable/disable runtime suspend on all devices for test
- add installed config files to search path
- add kernel error/warning links into the timeline
- fix callgraph trace to better handle interrupts
- include command string and kernel params in timeline output header
Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | tools/power/pm-graph/sleepgraph.8 | 47 | ||||
| -rwxr-xr-x | tools/power/pm-graph/sleepgraph.py | 1625 |
2 files changed, 1053 insertions, 619 deletions
diff --git a/tools/power/pm-graph/sleepgraph.8 b/tools/power/pm-graph/sleepgraph.8 index fbe7bd3eae8e..18baaf6300c9 100644 --- a/tools/power/pm-graph/sleepgraph.8 +++ b/tools/power/pm-graph/sleepgraph.8 | |||
| @@ -52,9 +52,32 @@ disable rtcwake and require a user keypress to resume. | |||
| 52 | \fB-addlogs\fR | 52 | \fB-addlogs\fR |
| 53 | Add the dmesg and ftrace logs to the html output. They will be viewable by | 53 | Add the dmesg and ftrace logs to the html output. They will be viewable by |
| 54 | clicking buttons in the timeline. | 54 | clicking buttons in the timeline. |
| 55 | .TP | ||
| 56 | \fB-result \fIfile\fR | ||
| 57 | Export a results table to a text file for parsing. | ||
| 58 | .TP | ||
| 59 | \fB-sync\fR | ||
| 60 | Sync the filesystems before starting the test. This reduces the size of | ||
| 61 | the sys_sync call which happens in the suspend_prepare phase. | ||
| 62 | .TP | ||
| 63 | \fB-rs \fIenable/disable\fR | ||
| 64 | During test, enable/disable runtime suspend for all devices. The test is delayed | ||
| 65 | by 5 seconds to allow runtime suspend changes to occur. The settings are restored | ||
| 66 | after the test is complete. | ||
| 67 | .TP | ||
| 68 | \fB-display \fIon/off\fR | ||
| 69 | Turn the display on or off for the test using the xset command. This helps | ||
| 70 | maintain the consistecy of test data for better comparison. | ||
| 71 | .TP | ||
| 72 | \fB-skiphtml\fR | ||
| 73 | Run the test and capture the trace logs, but skip the timeline generation. | ||
| 55 | 74 | ||
| 56 | .SS "advanced" | 75 | .SS "advanced" |
| 57 | .TP | 76 | .TP |
| 77 | \fB-gzip\fR | ||
| 78 | Gzip the trace and dmesg logs to save space. The tool can also read in gzipped | ||
| 79 | logs for processing. | ||
| 80 | .TP | ||
| 58 | \fB-cmd \fIstr\fR | 81 | \fB-cmd \fIstr\fR |
| 59 | Run the timeline over a custom suspend command, e.g. pm-suspend. By default | 82 | Run the timeline over a custom suspend command, e.g. pm-suspend. By default |
| 60 | the tool forces suspend via /sys/power/state so this allows testing over | 83 | the tool forces suspend via /sys/power/state so this allows testing over |
| @@ -114,6 +137,18 @@ This reduces the html file size as there can be many tiny callgraphs | |||
| 114 | which are barely visible in the timeline. | 137 | which are barely visible in the timeline. |
| 115 | The value is a float: e.g. 0.001 represents 1 us. | 138 | The value is a float: e.g. 0.001 represents 1 us. |
| 116 | .TP | 139 | .TP |
| 140 | \fB-cgfilter \fI"func1,func2,..."\fR | ||
| 141 | Reduce callgraph output in the timeline by limiting it to a list of calls. The | ||
| 142 | argument can be a single function name or a comma delimited list. | ||
| 143 | (default: none) | ||
| 144 | .TP | ||
| 145 | \fB-cgskip \fIfile\fR | ||
| 146 | Reduce callgraph timeline size by skipping over uninteresting functions | ||
| 147 | in the trace, e.g. printk or console_unlock. The functions listed | ||
| 148 | in this file will show up as empty leaves in the callgraph with only the start/end | ||
| 149 | times displayed. cgskip.txt is used automatically if found in the path, so | ||
| 150 | use "off" to disable completely (default: cgskip.txt) | ||
| 151 | .TP | ||
| 117 | \fB-cgphase \fIp\fR | 152 | \fB-cgphase \fIp\fR |
| 118 | Only show callgraph data for phase \fIp\fR (e.g. suspend_late). | 153 | Only show callgraph data for phase \fIp\fR (e.g. suspend_late). |
| 119 | .TP | 154 | .TP |
| @@ -122,6 +157,9 @@ In an x2 run, only show callgraph data for test \fIn\fR (e.g. 0 or 1). | |||
| 122 | .TP | 157 | .TP |
| 123 | \fB-timeprec \fIn\fR | 158 | \fB-timeprec \fIn\fR |
| 124 | Number of significant digits in timestamps (0:S, [3:ms], 6:us). | 159 | Number of significant digits in timestamps (0:S, [3:ms], 6:us). |
| 160 | .TP | ||
| 161 | \fB-bufsize \fIN\fR | ||
| 162 | Set trace buffer size to N kilo-bytes (default: all of free memory up to 3GB) | ||
| 125 | 163 | ||
| 126 | .SH COMMANDS | 164 | .SH COMMANDS |
| 127 | .TP | 165 | .TP |
| @@ -144,11 +182,8 @@ Print out the contents of the ACPI Firmware Performance Data Table. | |||
| 144 | \fB-sysinfo\fR | 182 | \fB-sysinfo\fR |
| 145 | Print out system info extracted from BIOS. Reads /dev/mem directly instead of going through dmidecode. | 183 | Print out system info extracted from BIOS. Reads /dev/mem directly instead of going through dmidecode. |
| 146 | .TP | 184 | .TP |
| 147 | \fB-usbtopo\fR | 185 | \fB-devinfo\fR |
| 148 | Print out the current USB topology with power info. | 186 | Print out the pm settings of all devices which support runtime suspend. |
| 149 | .TP | ||
| 150 | \fB-usbauto\fR | ||
| 151 | Enable autosuspend for all connected USB devices. | ||
| 152 | .TP | 187 | .TP |
| 153 | \fB-flist\fR | 188 | \fB-flist\fR |
| 154 | Print the list of ftrace functions currently being captured. Functions | 189 | Print the list of ftrace functions currently being captured. Functions |
| @@ -198,7 +233,7 @@ Execute a mem suspend with a 15 second wakeup. Include the logs in the html. | |||
| 198 | .PP | 233 | .PP |
| 199 | Execute a standby with a 15 second wakeup. Change the output folder name. | 234 | Execute a standby with a 15 second wakeup. Change the output folder name. |
| 200 | .IP | 235 | .IP |
| 201 | \f(CW$ sudo sleepgraph -m standby -rtcwake 15 -o "standby-{hostname}-{date}-{time}"\fR | 236 | \f(CW$ sudo sleepgraph -m standby -rtcwake 15 -o "standby-{host}-{date}-{time}"\fR |
| 202 | .PP | 237 | .PP |
| 203 | Execute a freeze with no wakeup (require keypress). Change output folder name. | 238 | Execute a freeze with no wakeup (require keypress). Change output folder name. |
| 204 | .IP | 239 | .IP |
diff --git a/tools/power/pm-graph/sleepgraph.py b/tools/power/pm-graph/sleepgraph.py index 1b60fe203741..266409fb27ae 100755 --- a/tools/power/pm-graph/sleepgraph.py +++ b/tools/power/pm-graph/sleepgraph.py | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | # Home Page | 19 | # Home Page |
| 20 | # https://01.org/suspendresume | 20 | # https://01.org/suspendresume |
| 21 | # Source repo | 21 | # Source repo |
| 22 | # https://github.com/01org/pm-graph | 22 | # git@github.com:01org/pm-graph |
| 23 | # | 23 | # |
| 24 | # Description: | 24 | # Description: |
| 25 | # This tool is designed to assist kernel and OS developers in optimizing | 25 | # This tool is designed to assist kernel and OS developers in optimizing |
| @@ -57,6 +57,7 @@ import platform | |||
| 57 | from datetime import datetime | 57 | from datetime import datetime |
| 58 | import struct | 58 | import struct |
| 59 | import ConfigParser | 59 | import ConfigParser |
| 60 | import gzip | ||
| 60 | from threading import Thread | 61 | from threading import Thread |
| 61 | from subprocess import call, Popen, PIPE | 62 | from subprocess import call, Popen, PIPE |
| 62 | 63 | ||
| @@ -68,8 +69,12 @@ from subprocess import call, Popen, PIPE | |||
| 68 | # store system values and test parameters | 69 | # store system values and test parameters |
| 69 | class SystemValues: | 70 | class SystemValues: |
| 70 | title = 'SleepGraph' | 71 | title = 'SleepGraph' |
| 71 | version = '4.7' | 72 | version = '5.0' |
| 72 | ansi = False | 73 | ansi = False |
| 74 | rs = 0 | ||
| 75 | display = 0 | ||
| 76 | gzip = False | ||
| 77 | sync = False | ||
| 73 | verbose = False | 78 | verbose = False |
| 74 | testlog = True | 79 | testlog = True |
| 75 | dmesglog = False | 80 | dmesglog = False |
| @@ -78,14 +83,19 @@ class SystemValues: | |||
| 78 | mincglen = 0.0 | 83 | mincglen = 0.0 |
| 79 | cgphase = '' | 84 | cgphase = '' |
| 80 | cgtest = -1 | 85 | cgtest = -1 |
| 86 | cgskip = '' | ||
| 87 | multitest = {'run': False, 'count': 0, 'delay': 0} | ||
| 81 | max_graph_depth = 0 | 88 | max_graph_depth = 0 |
| 82 | callloopmaxgap = 0.0001 | 89 | callloopmaxgap = 0.0001 |
| 83 | callloopmaxlen = 0.005 | 90 | callloopmaxlen = 0.005 |
| 91 | bufsize = 0 | ||
| 84 | cpucount = 0 | 92 | cpucount = 0 |
| 85 | memtotal = 204800 | 93 | memtotal = 204800 |
| 94 | memfree = 204800 | ||
| 86 | srgap = 0 | 95 | srgap = 0 |
| 87 | cgexp = False | 96 | cgexp = False |
| 88 | testdir = '' | 97 | testdir = '' |
| 98 | outdir = '' | ||
| 89 | tpath = '/sys/kernel/debug/tracing/' | 99 | tpath = '/sys/kernel/debug/tracing/' |
| 90 | fpdtpath = '/sys/firmware/acpi/tables/FPDT' | 100 | fpdtpath = '/sys/firmware/acpi/tables/FPDT' |
| 91 | epath = '/sys/kernel/debug/tracing/events/power/' | 101 | epath = '/sys/kernel/debug/tracing/events/power/' |
| @@ -109,22 +119,24 @@ class SystemValues: | |||
| 109 | dmesgfile = '' | 119 | dmesgfile = '' |
| 110 | ftracefile = '' | 120 | ftracefile = '' |
| 111 | htmlfile = 'output.html' | 121 | htmlfile = 'output.html' |
| 112 | embedded = False | 122 | result = '' |
| 113 | rtcwake = True | 123 | rtcwake = True |
| 114 | rtcwaketime = 15 | 124 | rtcwaketime = 15 |
| 115 | rtcpath = '' | 125 | rtcpath = '' |
| 116 | devicefilter = [] | 126 | devicefilter = [] |
| 127 | cgfilter = [] | ||
| 117 | stamp = 0 | 128 | stamp = 0 |
| 118 | execcount = 1 | 129 | execcount = 1 |
| 119 | x2delay = 0 | 130 | x2delay = 0 |
| 131 | skiphtml = False | ||
| 120 | usecallgraph = False | 132 | usecallgraph = False |
| 121 | usetraceevents = False | 133 | usetraceevents = False |
| 122 | usetraceeventsonly = False | ||
| 123 | usetracemarkers = True | 134 | usetracemarkers = True |
| 124 | usekprobes = True | 135 | usekprobes = True |
| 125 | usedevsrc = False | 136 | usedevsrc = False |
| 126 | useprocmon = False | 137 | useprocmon = False |
| 127 | notestrun = False | 138 | notestrun = False |
| 139 | c | ||
