sleepgraph.py (14e77332e74603efab8347c89d3cda447c3b97c9) | sleepgraph.py (9bfb09774ea40937b6c6d6e07858e0f7ad1991ec) |
---|---|
1#!/usr/bin/env python3 2# SPDX-License-Identifier: GPL-2.0-only 3# 4# Tool for analyzing suspend/resume timing 5# Copyright (c) 2013, Intel Corporation. 6# 7# This program is free software; you can redistribute it and/or modify it 8# under the terms and conditions of the GNU General Public License, --- 72 unchanged lines hidden (view full) --- 81# ----------------- CLASSES -------------------- 82 83# Class: SystemValues 84# Description: 85# A global, single-instance container used to 86# store system values and test parameters 87class SystemValues: 88 title = 'SleepGraph' | 1#!/usr/bin/env python3 2# SPDX-License-Identifier: GPL-2.0-only 3# 4# Tool for analyzing suspend/resume timing 5# Copyright (c) 2013, Intel Corporation. 6# 7# This program is free software; you can redistribute it and/or modify it 8# under the terms and conditions of the GNU General Public License, --- 72 unchanged lines hidden (view full) --- 81# ----------------- CLASSES -------------------- 82 83# Class: SystemValues 84# Description: 85# A global, single-instance container used to 86# store system values and test parameters 87class SystemValues: 88 title = 'SleepGraph' |
89 version = '5.9' | 89 version = '5.10' |
90 ansi = False 91 rs = 0 92 display = '' 93 gzip = False 94 sync = False 95 wifi = False 96 netfix = False 97 verbose = False 98 testlog = True 99 dmesglog = True 100 ftracelog = False 101 acpidebug = True 102 tstat = True | 90 ansi = False 91 rs = 0 92 display = '' 93 gzip = False 94 sync = False 95 wifi = False 96 netfix = False 97 verbose = False 98 testlog = True 99 dmesglog = True 100 ftracelog = False 101 acpidebug = True 102 tstat = True |
103 wifitrace = False |
|
103 mindevlen = 0.0001 104 mincglen = 0.0 105 cgphase = '' 106 cgtest = -1 107 cgskip = '' 108 maxfail = 0 109 multitest = {'run': False, 'count': 1000000, 'delay': 0} 110 max_graph_depth = 0 --- 8 unchanged lines hidden (view full) --- 119 cgexp = False 120 testdir = '' 121 outdir = '' 122 tpath = '/sys/kernel/debug/tracing/' 123 fpdtpath = '/sys/firmware/acpi/tables/FPDT' 124 epath = '/sys/kernel/debug/tracing/events/power/' 125 pmdpath = '/sys/power/pm_debug_messages' 126 s0ixpath = '/sys/module/intel_pmc_core/parameters/warn_on_s0ix_failures' | 104 mindevlen = 0.0001 105 mincglen = 0.0 106 cgphase = '' 107 cgtest = -1 108 cgskip = '' 109 maxfail = 0 110 multitest = {'run': False, 'count': 1000000, 'delay': 0} 111 max_graph_depth = 0 --- 8 unchanged lines hidden (view full) --- 120 cgexp = False 121 testdir = '' 122 outdir = '' 123 tpath = '/sys/kernel/debug/tracing/' 124 fpdtpath = '/sys/firmware/acpi/tables/FPDT' 125 epath = '/sys/kernel/debug/tracing/events/power/' 126 pmdpath = '/sys/power/pm_debug_messages' 127 s0ixpath = '/sys/module/intel_pmc_core/parameters/warn_on_s0ix_failures' |
128 s0ixres = '/sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us' |
|
127 acpipath='/sys/module/acpi/parameters/debug_level' 128 traceevents = [ 129 'suspend_resume', 130 'wakeup_source_activate', 131 'wakeup_source_deactivate', 132 'device_pm_callback_end', 133 'device_pm_callback_start' 134 ] --- 40 unchanged lines hidden (view full) --- 175 devprops = dict() 176 cfgdef = dict() 177 platinfo = [] 178 predelay = 0 179 postdelay = 0 180 tmstart = 'SUSPEND START %Y%m%d-%H:%M:%S.%f' 181 tmend = 'RESUME COMPLETE %Y%m%d-%H:%M:%S.%f' 182 tracefuncs = { | 129 acpipath='/sys/module/acpi/parameters/debug_level' 130 traceevents = [ 131 'suspend_resume', 132 'wakeup_source_activate', 133 'wakeup_source_deactivate', 134 'device_pm_callback_end', 135 'device_pm_callback_start' 136 ] --- 40 unchanged lines hidden (view full) --- 177 devprops = dict() 178 cfgdef = dict() 179 platinfo = [] 180 predelay = 0 181 postdelay = 0 182 tmstart = 'SUSPEND START %Y%m%d-%H:%M:%S.%f' 183 tmend = 'RESUME COMPLETE %Y%m%d-%H:%M:%S.%f' 184 tracefuncs = { |
185 'async_synchronize_full': {}, |
|
183 'sys_sync': {}, 184 'ksys_sync': {}, 185 '__pm_notifier_call_chain': {}, 186 'pm_prepare_console': {}, 187 'pm_notifier_call_chain': {}, 188 'freeze_processes': {}, 189 'freeze_kernel_threads': {}, 190 'pm_restrict_gfp_mask': {}, --- 108 unchanged lines hidden (view full) --- 299 [0, 's0ix_debug', 'cat', '/sys/kernel/debug/pmc_core/slp_s0_debug_status'], 300 [1, 's0ix_residency', 'cat', '/sys/kernel/debug/pmc_core/slp_s0_residency_usec'], 301 [1, 'interrupts', 'cat', '/proc/interrupts'], 302 [1, 'wakeups', 'cat', '/sys/kernel/debug/wakeup_sources'], 303 [2, 'gpecounts', 'sh', '-c', 'grep -v invalid /sys/firmware/acpi/interrupts/*'], 304 [2, 'suspendstats', 'sh', '-c', 'grep -v invalid /sys/power/suspend_stats/*'], 305 [2, 'cpuidle', 'sh', '-c', 'grep -v invalid /sys/devices/system/cpu/cpu*/cpuidle/state*/s2idle/*'], 306 [2, 'battery', 'sh', '-c', 'grep -v invalid /sys/class/power_supply/*/*'], | 186 'sys_sync': {}, 187 'ksys_sync': {}, 188 '__pm_notifier_call_chain': {}, 189 'pm_prepare_console': {}, 190 'pm_notifier_call_chain': {}, 191 'freeze_processes': {}, 192 'freeze_kernel_threads': {}, 193 'pm_restrict_gfp_mask': {}, --- 108 unchanged lines hidden (view full) --- 302 [0, 's0ix_debug', 'cat', '/sys/kernel/debug/pmc_core/slp_s0_debug_status'], 303 [1, 's0ix_residency', 'cat', '/sys/kernel/debug/pmc_core/slp_s0_residency_usec'], 304 [1, 'interrupts', 'cat', '/proc/interrupts'], 305 [1, 'wakeups', 'cat', '/sys/kernel/debug/wakeup_sources'], 306 [2, 'gpecounts', 'sh', '-c', 'grep -v invalid /sys/firmware/acpi/interrupts/*'], 307 [2, 'suspendstats', 'sh', '-c', 'grep -v invalid /sys/power/suspend_stats/*'], 308 [2, 'cpuidle', 'sh', '-c', 'grep -v invalid /sys/devices/system/cpu/cpu*/cpuidle/state*/s2idle/*'], 309 [2, 'battery', 'sh', '-c', 'grep -v invalid /sys/class/power_supply/*/*'], |
310 [2, 'thermal', 'sh', '-c', 'grep . /sys/class/thermal/thermal_zone*/temp'], |
|
307 ] 308 cgblacklist = [] 309 kprobes = dict() 310 timeformat = '%.3f' 311 cmdline = '%s %s' % \ 312 (os.path.basename(sys.argv[0]), ' '.join(sys.argv[1:])) 313 sudouser = '' 314 def __init__(self): --- 457 unchanged lines hidden (view full) --- 772 if name == f: 773 return True 774 return False 775 def initFtrace(self, quiet=False): 776 if not self.useftrace: 777 return 778 if not quiet: 779 sysvals.printSystemInfo(False) | 311 ] 312 cgblacklist = [] 313 kprobes = dict() 314 timeformat = '%.3f' 315 cmdline = '%s %s' % \ 316 (os.path.basename(sys.argv[0]), ' '.join(sys.argv[1:])) 317 sudouser = '' 318 def __init__(self): --- 457 unchanged lines hidden (view full) --- 776 if name == f: 777 return True 778 return False 779 def initFtrace(self, quiet=False): 780 if not self.useftrace: 781 return 782 if not quiet: 783 sysvals.printSystemInfo(False) |
780 pprint('INITIALIZING FTRACE...') | 784 pprint('INITIALIZING FTRACE') |
781 # turn trace off 782 self.fsetVal('0', 'tracing_on') 783 self.cleanupFtrace() 784 # set the trace clock to global 785 self.fsetVal('global', 'trace_clock') 786 self.fsetVal('nop', 'current_tracer') 787 # set trace buffer to an appropriate value 788 cpus = max(1, self.cpucount) --- 47 unchanged lines hidden (view full) --- 836 # initialize the kprobe trace 837 elif self.usekprobes: 838 for name in self.tracefuncs: 839 self.defaultKprobe(name, self.tracefuncs[name]) 840 if self.usedevsrc: 841 for name in self.dev_tracefuncs: 842 self.defaultKprobe(name, self.dev_tracefuncs[name]) 843 if not quiet: | 785 # turn trace off 786 self.fsetVal('0', 'tracing_on') 787 self.cleanupFtrace() 788 # set the trace clock to global 789 self.fsetVal('global', 'trace_clock') 790 self.fsetVal('nop', 'current_tracer') 791 # set trace buffer to an appropriate value 792 cpus = max(1, self.cpucount) --- 47 unchanged lines hidden (view full) --- 840 # initialize the kprobe trace 841 elif self.usekprobes: 842 for name in self.tracefuncs: 843 self.defaultKprobe(name, self.tracefuncs[name]) 844 if self.usedevsrc: 845 for name in self.dev_tracefuncs: 846 self.defaultKprobe(name, self.dev_tracefuncs[name]) 847 if not quiet: |
844 pprint('INITIALIZING KPROBES...') | 848 pprint('INITIALIZING KPROBES') |
845 self.addKprobes(self.verbose) 846 if(self.usetraceevents): 847 # turn trace events on 848 events = iter(self.traceevents) 849 for e in events: 850 self.fsetVal('1', 'events/power/'+e+'/enable') 851 # clear the trace buffer 852 self.fsetVal('', 'trace') --- 275 unchanged lines hidden (view full) --- 1128 line = fp.read().strip().split('\n')[-1] 1129 m = re.match('.* (?P<v>[0-9A-Fx]*) .*', line) 1130 if m: 1131 self.cfgdef[file] = m.group('v') 1132 else: 1133 self.cfgdef[file] = fp.read().strip() 1134 fp.write(value) 1135 fp.close() | 849 self.addKprobes(self.verbose) 850 if(self.usetraceevents): 851 # turn trace events on 852 events = iter(self.traceevents) 853 for e in events: 854 self.fsetVal('1', 'events/power/'+e+'/enable') 855 # clear the trace buffer 856 self.fsetVal('', 'trace') --- 275 unchanged lines hidden (view full) --- 1132 line = fp.read().strip().split('\n')[-1] 1133 m = re.match('.* (?P<v>[0-9A-Fx]*) .*', line) 1134 if m: 1135 self.cfgdef[file] = m.group('v') 1136 else: 1137 self.cfgdef[file] = fp.read().strip() 1138 fp.write(value) 1139 fp.close() |
1140 def s0ixSupport(self): 1141 if not os.path.exists(self.s0ixres) or not os.path.exists(self.mempowerfile): 1142 return False 1143 fp = open(sysvals.mempowerfile, 'r') 1144 data = fp.read().strip() 1145 fp.close() 1146 if '[s2idle]' in data: 1147 return True 1148 return False |
|
1136 def haveTurbostat(self): 1137 if not self.tstat: 1138 return False 1139 cmd = self.getExec('turbostat') 1140 if not cmd: 1141 return False 1142 fp = Popen([cmd, '-v'], stdout=PIPE, stderr=PIPE).stderr 1143 out = ascii(fp.read()).strip() 1144 fp.close() 1145 if re.match('turbostat version .*', out): 1146 self.vprint(out) 1147 return True 1148 return False | 1149 def haveTurbostat(self): 1150 if not self.tstat: 1151 return False 1152 cmd = self.getExec('turbostat') 1153 if not cmd: 1154 return False 1155 fp = Popen([cmd, '-v'], stdout=PIPE, stderr=PIPE).stderr 1156 out = ascii(fp.read()).strip() 1157 fp.close() 1158 if re.match('turbostat version .*', out): 1159 self.vprint(out) 1160 return True 1161 return False |
1149 def turbostat(self): | 1162 def turbostat(self, s0ixready): |
1150 cmd = self.getExec('turbostat') 1151 rawout = keyline = valline = '' 1152 fullcmd = '%s -q -S echo freeze > %s' % (cmd, self.powerfile) 1153 fp = Popen(['sh', '-c', fullcmd], stdout=PIPE, stderr=PIPE).stderr 1154 for line in fp: 1155 line = ascii(line) 1156 rawout += line 1157 if keyline and valline: --- 10 unchanged lines hidden (view full) --- 1168 pprint(errmsg) 1169 return '' 1170 if self.verbose: 1171 pprint(rawout.strip()) 1172 out = [] 1173 for key in keyline: 1174 idx = keyline.index(key) 1175 val = valline[idx] | 1163 cmd = self.getExec('turbostat') 1164 rawout = keyline = valline = '' 1165 fullcmd = '%s -q -S echo freeze > %s' % (cmd, self.powerfile) 1166 fp = Popen(['sh', '-c', fullcmd], stdout=PIPE, stderr=PIPE).stderr 1167 for line in fp: 1168 line = ascii(line) 1169 rawout += line 1170 if keyline and valline: --- 10 unchanged lines hidden (view full) --- 1181 pprint(errmsg) 1182 return '' 1183 if self.verbose: 1184 pprint(rawout.strip()) 1185 out = [] 1186 for key in keyline: 1187 idx = keyline.index(key) 1188 val = valline[idx] |
1189 if key == 'SYS%LPI' and not s0ixready and re.match('^[0\.]*$', val): 1190 continue |
|
1176 out.append('%s=%s' % (key, val)) 1177 return '|'.join(out) 1178 def netfixon(self, net='both'): 1179 cmd = self.getExec('netfix') 1180 if not cmd: 1181 return '' 1182 fp = Popen([cmd, '-s', net, 'on'], stdout=PIPE, stderr=PIPE).stdout 1183 out = ascii(fp.read()).strip() 1184 fp.close() 1185 return out | 1191 out.append('%s=%s' % (key, val)) 1192 return '|'.join(out) 1193 def netfixon(self, net='both'): 1194 cmd = self.getExec('netfix') 1195 if not cmd: 1196 return '' 1197 fp = Popen([cmd, '-s', net, 'on'], stdout=PIPE, stderr=PIPE).stdout 1198 out = ascii(fp.read()).strip() 1199 fp.close() 1200 return out |
1186 def wifiRepair(self): 1187 out = self.netfixon('wifi') 1188 if not out or 'error' in out.lower(): 1189 return '' 1190 m = re.match('WIFI \S* ONLINE (?P<action>\S*)', out) 1191 if not m: 1192 return 'dead' 1193 return m.group('action') | |
1194 def wifiDetails(self, dev): 1195 try: 1196 info = open('/sys/class/net/%s/device/uevent' % dev, 'r').read().strip() 1197 except: 1198 return dev 1199 vals = [dev] 1200 for prop in info.split('\n'): 1201 if prop.startswith('DRIVER=') or prop.startswith('PCI_ID='): --- 13 unchanged lines hidden (view full) --- 1215 def pollWifi(self, dev, timeout=10): 1216 start = time.time() 1217 while (time.time() - start) < timeout: 1218 w = self.checkWifi(dev) 1219 if w: 1220 return '%s reconnected %.2f' % \ 1221 (self.wifiDetails(dev), max(0, time.time() - start)) 1222 time.sleep(0.01) | 1201 def wifiDetails(self, dev): 1202 try: 1203 info = open('/sys/class/net/%s/device/uevent' % dev, 'r').read().strip() 1204 except: 1205 return dev 1206 vals = [dev] 1207 for prop in info.split('\n'): 1208 if prop.startswith('DRIVER=') or prop.startswith('PCI_ID='): --- 13 unchanged lines hidden (view full) --- 1222 def pollWifi(self, dev, timeout=10): 1223 start = time.time() 1224 while (time.time() - start) < timeout: 1225 w = self.checkWifi(dev) 1226 if w: 1227 return '%s reconnected %.2f' % \ 1228 (self.wifiDetails(dev), max(0, time.time() - start)) 1229 time.sleep(0.01) |
1223 if self.netfix: 1224 res = self.wifiRepair() 1225 if res: 1226 timeout = max(0, time.time() - start) 1227 return '%s %s %d' % (self.wifiDetails(dev), res, timeout) | |
1228 return '%s timeout %d' % (self.wifiDetails(dev), timeout) 1229 def errorSummary(self, errinfo, msg): 1230 found = False 1231 for entry in errinfo: 1232 if re.match(entry['match'], msg): 1233 entry['count'] += 1 1234 if self.hostname not in entry['urls']: 1235 entry['urls'][self.hostname] = [self.htmlfile] --- 105 unchanged lines hidden (view full) --- 1341 pprint('runtime suspend %s on all devices (%d changed)' % (self.rsdir, len(self.rslist))) 1342 pprint('waiting 5 seconds...') 1343 time.sleep(5) 1344 else: 1345 # runtime suspend re-enable or re-disable 1346 for i in self.rslist: 1347 self.setVal(self.rstgt, i) 1348 pprint('runtime suspend settings restored on %d devices' % len(self.rslist)) | 1230 return '%s timeout %d' % (self.wifiDetails(dev), timeout) 1231 def errorSummary(self, errinfo, msg): 1232 found = False 1233 for entry in errinfo: 1234 if re.match(entry['match'], msg): 1235 entry['count'] += 1 1236 if self.hostname not in entry['urls']: 1237 entry['urls'][self.hostname] = [self.htmlfile] --- 105 unchanged lines hidden (view full) --- 1343 pprint('runtime suspend %s on all devices (%d changed)' % (self.rsdir, len(self.rslist))) 1344 pprint('waiting 5 seconds...') 1345 time.sleep(5) 1346 else: 1347 # runtime suspend re-enable or re-disable 1348 for i in self.rslist: 1349 self.setVal(self.rstgt, i) 1350 pprint('runtime suspend settings restored on %d devices' % len(self.rslist)) |
1351 def start(self, pm): 1352 if self.useftrace: 1353 self.dlog('start ftrace tracing') 1354 self.fsetVal('1', 'tracing_on') 1355 if self.useprocmon: 1356 self.dlog('start the process monitor') 1357 pm.start() 1358 def stop(self, pm): 1359 if self.useftrace: 1360 if self.useprocmon: 1361 self.dlog('stop the process monitor') 1362 pm.stop() 1363 self.dlog('stop ftrace tracing') 1364 self.fsetVal('0', 'tracing_on') |
|
1349 1350sysvals = SystemValues() 1351switchvalues = ['enable', 'disable', 'on', 'off', 'true', 'false', '1', '0'] 1352switchoff = ['disable', 'off', 'false', '0'] 1353suspendmodename = { 1354 'standby': 'standby (S1)', 1355 'freeze': 'freeze (S2idle)', 1356 'mem': 'suspend (S3)', --- 281 unchanged lines hidden (view full) --- 1638 return False 1639 # place the call data inside the src element of the tgtdev 1640 if('src' not in tgtdev): 1641 tgtdev['src'] = [] 1642 dtf = sysvals.dev_tracefuncs 1643 ubiquitous = False 1644 if kprobename in dtf and 'ub' in dtf[kprobename]: 1645 ubiquitous = True | 1365 1366sysvals = SystemValues() 1367switchvalues = ['enable', 'disable', 'on', 'off', 'true', 'false', '1', '0'] 1368switchoff = ['disable', 'off', 'false', '0'] 1369suspendmodename = { 1370 'standby': 'standby (S1)', 1371 'freeze': 'freeze (S2idle)', 1372 'mem': 'suspend (S3)', --- 281 unchanged lines hidden (view full) --- 1654 return False 1655 # place the call data inside the src element of the tgtdev 1656 if('src' not in tgtdev): 1657 tgtdev['src'] = [] 1658 dtf = sysvals.dev_tracefuncs 1659 ubiquitous = False 1660 if kprobename in dtf and 'ub' in dtf[kprobename]: 1661 ubiquitous = True |
1646 title = cdata+' '+rdata 1647 mstr = '\(.*\) *(?P<args>.*) *\((?P<caller>.*)\+.* arg1=(?P<ret>.*)' 1648 m = re.match(mstr, title) 1649 if m: 1650 c = m.group('caller') 1651 a = m.group('args').strip() 1652 r = m.group('ret') | 1662 mc = re.match('\(.*\) *(?P<args>.*)', cdata) 1663 mr = re.match('\((?P<caller>\S*).* arg1=(?P<ret>.*)', rdata) 1664 if mc and mr: 1665 c = mr.group('caller').split('+')[0] 1666 a = mc.group('args').strip() 1667 r = mr.group('ret') |
1653 if len(r) > 6: 1654 r = '' 1655 else: 1656 r = 'ret=%s ' % r 1657 if ubiquitous and c in dtf and 'ub' in dtf[c]: 1658 return False | 1668 if len(r) > 6: 1669 r = '' 1670 else: 1671 r = 'ret=%s ' % r 1672 if ubiquitous and c in dtf and 'ub' in dtf[c]: 1673 return False |
1674 else: 1675 return False |
|
1659 color = sysvals.kprobeColor(kprobename) 1660 e = DevFunction(displayname, a, c, r, start, end, ubiquitous, proc, pid, color) 1661 tgtdev['src'].append(e) 1662 return True 1663 def overflowDevices(self): 1664 # get a list of devices that extend beyond the end of this test run 1665 devlist = [] 1666 for phase in self.sortedPhases(): --- 100 unchanged lines hidden (view full) --- 1767 cg.end = self.trimTimeVal(cg.end, t0, dT, left) 1768 for line in cg.list: 1769 line.time = self.trimTimeVal(line.time, t0, dT, left) 1770 if('src' in d): 1771 for e in d['src']: 1772 e.time = self.trimTimeVal(e.time, t0, dT, left) 1773 e.end = self.trimTimeVal(e.end, t0, dT, left) 1774 e.length = e.end - e.time | 1676 color = sysvals.kprobeColor(kprobename) 1677 e = DevFunction(displayname, a, c, r, start, end, ubiquitous, proc, pid, color) 1678 tgtdev['src'].append(e) 1679 return True 1680 def overflowDevices(self): 1681 # get a list of devices that extend beyond the end of this test run 1682 devlist = [] 1683 for phase in self.sortedPhases(): --- 100 unchanged lines hidden (view full) --- 1784 cg.end = self.trimTimeVal(cg.end, t0, dT, left) 1785 for line in cg.list: 1786 line.time = self.trimTimeVal(line.time, t0, dT, left) 1787 if('src' in d): 1788 for e in d['src']: 1789 e.time = self.trimTimeVal(e.time, t0, dT, left) 1790 e.end = self.trimTimeVal(e.end, t0, dT, left) 1791 e.length = e.end - e.time |
1792 if('cpuexec' in d): 1793 cpuexec = dict() 1794 for e in d['cpuexec']: 1795 c0, cN = e 1796 c0 = self.trimTimeVal(c0, t0, dT, left) 1797 cN = self.trimTimeVal(cN, t0, dT, left) 1798 cpuexec[(c0, cN)] = d['cpuexec'][e] 1799 d['cpuexec'] = cpuexec |
|
1775 for dir in ['suspend', 'resume']: 1776 list = [] 1777 for e in self.errorinfo[dir]: 1778 type, tm, idx1, idx2 = e 1779 tm = self.trimTimeVal(tm, t0, dT, left) 1780 list.append((type, tm, idx1, idx2)) 1781 self.errorinfo[dir] = list 1782 def trimFreezeTime(self, tZero): --- 298 unchanged lines hidden (view full) --- 2081 self.start, devend, '', ' sec', '') 2082 if phase not in self.tdevlist: 2083 self.tdevlist[phase] = [] 2084 self.tdevlist[phase].append(devname) 2085 d = DevItem(0, phase, self.dmesg[phase]['list'][devname]) 2086 return d 2087 def addProcessUsageEvent(self, name, times): 2088 # get the start and end times for this process | 1800 for dir in ['suspend', 'resume']: 1801 list = [] 1802 for e in self.errorinfo[dir]: 1803 type, tm, idx1, idx2 = e 1804 tm = self.trimTimeVal(tm, t0, dT, left) 1805 list.append((type, tm, idx1, idx2)) 1806 self.errorinfo[dir] = list 1807 def trimFreezeTime(self, tZero): --- 298 unchanged lines hidden (view full) --- 2106 self.start, devend, '', ' sec', '') 2107 if phase not in self.tdevlist: 2108 self.tdevlist[phase] = [] 2109 self.tdevlist[phase].append(devname) 2110 d = DevItem(0, phase, self.dmesg[phase]['list'][devname]) 2111 return d 2112 def addProcessUsageEvent(self, name, times): 2113 # get the start and end times for this process |
2089 maxC = 0 2090 tlast = 0 2091 start = -1 2092 end = -1 | 2114 cpuexec = dict() 2115 tlast = start = end = -1 |
2093 for t in sorted(times): | 2116 for t in sorted(times): |
2094 if tlast == 0: | 2117 if tlast < 0: |
2095 tlast = t 2096 continue | 2118 tlast = t 2119 continue |
2097 if name in self.pstl[t]: 2098 if start == -1 or tlast < start: | 2120 if name in self.pstl[t] and self.pstl[t][name] > 0: 2121 if start < 0: |
2099 start = tlast | 2122 start = tlast |
2100 if end == -1 or t > end: 2101 end = t | 2123 end, key = t, (tlast, t) 2124 maxj = (t - tlast) * 1024.0 2125 cpuexec[key] = min(1.0, float(self.pstl[t][name]) / maxj) |
2102 tlast = t | 2126 tlast = t |
2103 if start == -1 or end == -1: 2104 return 0 | 2127 if start < 0 or end < 0: 2128 return |
2105 # add a new action for this process and get the object 2106 out = self.newActionGlobal(name, start, end, -3) | 2129 # add a new action for this process and get the object 2130 out = self.newActionGlobal(name, start, end, -3) |
2107 if not out: 2108 return 0 2109 phase, devname = out 2110 dev = self.dmesg[phase]['list'][devname] 2111 # get the cpu exec data 2112 tlast = 0 2113 clast = 0 2114 cpuexec = dict() 2115 for t in sorted(times): 2116 if tlast == 0 or t <= start or t > end: 2117 tlast = t 2118 continue 2119 list = self.pstl[t] 2120 c = 0 2121 if name in list: 2122 c = list[name] 2123 if c > maxC: 2124 maxC = c 2125 if c != clast: 2126 key = (tlast, t) 2127 cpuexec[key] = c 2128 tlast = t 2129 clast = c 2130 dev['cpuexec'] = cpuexec 2131 return maxC | 2131 if out: 2132 phase, devname = out 2133 dev = self.dmesg[phase]['list'][devname] 2134 dev['cpuexec'] = cpuexec |
2132 def createProcessUsageEvents(self): | 2135 def createProcessUsageEvents(self): |
2133 # get an array of process names 2134 proclist = [] | 2136 # get an array of process names and times 2137 proclist = {'sus': dict(), 'res': dict()} 2138 tdata = {'sus': [], 'res': []} |
2135 for t in sorted(self.pstl): | 2139 for t in sorted(self.pstl): |
2136 pslist = self.pstl[t] 2137 for ps in sorted(pslist): 2138 if ps not in proclist: 2139 proclist.append(ps) 2140 # get a list of data points for suspend and resume 2141 tsus = [] 2142 tres = [] 2143 for t in sorted(self.pstl): 2144 if t < self.tSuspended: 2145 tsus.append(t) 2146 else: 2147 tres.append(t) | 2140 dir = 'sus' if t < self.tSuspended else 'res' 2141 for ps in sorted(self.pstl[t]): 2142 if ps not in proclist[dir]: 2143 proclist[dir][ps] = 0 2144 tdata[dir].append(t) |
2148 # process the events for suspend and resume | 2145 # process the events for suspend and resume |
2149 if len(proclist) > 0: | 2146 if len(proclist['sus']) > 0 or len(proclist['res']) > 0: |
2150 sysvals.vprint('Process Execution:') | 2147 sysvals.vprint('Process Execution:') |
2151 for ps in proclist: 2152 c = self.addProcessUsageEvent(ps, tsus) 2153 if c > 0: 2154 sysvals.vprint('%25s (sus): %d' % (ps, c)) 2155 c = self.addProcessUsageEvent(ps, tres) 2156 if c > 0: 2157 sysvals.vprint('%25s (res): %d' % (ps, c)) | 2148 for dir in ['sus', 'res']: 2149 for ps in sorted(proclist[dir]): 2150 self.addProcessUsageEvent(ps, tdata[dir]) |
2158 def handleEndMarker(self, time, msg=''): 2159 dm = self.dmesg 2160 self.setEnd(time, msg) 2161 self.initDevicegroups() 2162 # give suspend_prepare an end if needed 2163 if 'suspend_prepare' in dm and dm['suspend_prepare']['end'] < 0: 2164 dm['suspend_prepare']['end'] = time 2165 # assume resume machine ends at next phase start --- 1047 unchanged lines hidden (view full) --- 3213# ----------------- FUNCTIONS -------------------- 3214 3215# Function: doesTraceLogHaveTraceEvents 3216# Description: 3217# Quickly determine if the ftrace log has all of the trace events, 3218# markers, and/or kprobes required for primary parsing. 3219def doesTraceLogHaveTraceEvents(): 3220 kpcheck = ['_cal: (', '_ret: ('] | 2151 def handleEndMarker(self, time, msg=''): 2152 dm = self.dmesg 2153 self.setEnd(time, msg) 2154 self.initDevicegroups() 2155 # give suspend_prepare an end if needed 2156 if 'suspend_prepare' in dm and dm['suspend_prepare']['end'] < 0: 2157 dm['suspend_prepare']['end'] = time 2158 # assume resume machine ends at next phase start --- 1047 unchanged lines hidden (view full) --- 3206# ----------------- FUNCTIONS -------------------- 3207 3208# Function: doesTraceLogHaveTraceEvents 3209# Description: 3210# Quickly determine if the ftrace log has all of the trace events, 3211# markers, and/or kprobes required for primary parsing. 3212def doesTraceLogHaveTraceEvents(): 3213 kpcheck = ['_cal: (', '_ret: ('] |
3221 techeck = ['suspend_resume', 'device_pm_callback'] | 3214 techeck = ['suspend_resume', 'device_pm_callback', 'tracing_mark_write'] |
3222 tmcheck = ['SUSPEND START', 'RESUME COMPLETE'] 3223 sysvals.usekprobes = False 3224 fp = sysvals.openlog(sysvals.ftracefile, 'r') 3225 for line in fp: 3226 # check for kprobes 3227 if not sysvals.usekprobes: 3228 for i in kpcheck: 3229 if i in line: --- 6 unchanged lines hidden (view full) --- 3236 techeck = check 3237 # check for all necessary trace markers 3238 check = tmcheck[:] 3239 for i in tmcheck: 3240 if i in line: 3241 check.remove(i) 3242 tmcheck = check 3243 fp.close() | 3215 tmcheck = ['SUSPEND START', 'RESUME COMPLETE'] 3216 sysvals.usekprobes = False 3217 fp = sysvals.openlog(sysvals.ftracefile, 'r') 3218 for line in fp: 3219 # check for kprobes 3220 if not sysvals.usekprobes: 3221 for i in kpcheck: 3222 if i in line: --- 6 unchanged lines hidden (view full) --- 3229 techeck = check 3230 # check for all necessary trace markers 3231 check = tmcheck[:] 3232 for i in tmcheck: 3233 if i in line: 3234 check.remove(i) 3235 tmcheck = check 3236 fp.close() |
3244 sysvals.usetraceevents = True if len(techeck) < 2 else False | 3237 sysvals.usetraceevents = True if len(techeck) < 3 else False |
3245 sysvals.usetracemarkers = True if len(tmcheck) == 0 else False 3246 3247# Function: appendIncompleteTraceLog 3248# Description: 3249# Adds callgraph data which lacks trace event data. This is only 3250# for timelines generated from 3.15 or older 3251# Arguments: 3252# testruns: the array of Data objects obtained from parseKernelLog --- 198 unchanged lines hidden (view full) --- 3451 data.setStart(t.time, t.name) 3452 data.first_suspend_prepare = True 3453 phase = data.setPhase('suspend_prepare', t.time, True) 3454 continue 3455 if(not data or limbo): 3456 continue 3457 # process cpu exec line 3458 if t.type == 'tracing_mark_write': | 3238 sysvals.usetracemarkers = True if len(tmcheck) == 0 else False 3239 3240# Function: appendIncompleteTraceLog 3241# Description: 3242# Adds callgraph data which lacks trace event data. This is only 3243# for timelines generated from 3.15 or older 3244# Arguments: 3245# testruns: the array of Data objects obtained from parseKernelLog --- 198 unchanged lines hidden (view full) --- 3444 data.setStart(t.time, t.name) 3445 data.first_suspend_prepare = True 3446 phase = data.setPhase('suspend_prepare', t.time, True) 3447 continue 3448 if(not data or limbo): 3449 continue 3450 # process cpu exec line 3451 if t.type == 'tracing_mark_write': |
3452 if t.name == 'CMD COMPLETE' and data.tKernRes == 0: 3453 data.tKernRes = t.time |
|
3459 m = re.match(tp.procexecfmt, t.name) 3460 if(m): 3461 parts, msg = 1, m.group('ps') 3462 m = re.match(tp.procmultifmt, msg) 3463 if(m): 3464 parts, msg = int(m.group('n')), m.group('ps') 3465 if tp.multiproccnt == 0: 3466 tp.multiproctime = t.time --- 202 unchanged lines hidden (view full) --- 3669 and kprobename in ksuscalls): 3670 data.tKernSus = t.time 3671 elif(t.freturn): 3672 if(key not in tp.ktemp) or len(tp.ktemp[key]) < 1: 3673 continue 3674 e = next((x for x in reversed(tp.ktemp[key]) if x['end'] < 0), 0) 3675 if not e: 3676 continue | 3454 m = re.match(tp.procexecfmt, t.name) 3455 if(m): 3456 parts, msg = 1, m.group('ps') 3457 m = re.match(tp.procmultifmt, msg) 3458 if(m): 3459 parts, msg = int(m.group('n')), m.group('ps') 3460 if tp.multiproccnt == 0: 3461 tp.multiproctime = t.time --- 202 unchanged lines hidden (view full) --- 3664 and kprobename in ksuscalls): 3665 data.tKernSus = t.time 3666 elif(t.freturn): 3667 if(key not in tp.ktemp) or len(tp.ktemp[key]) < 1: 3668 continue 3669 e = next((x for x in reversed(tp.ktemp[key]) if x['end'] < 0), 0) 3670 if not e: 3671 continue |
3672 if (t.time - e['begin']) * 1000 < sysvals.mindevlen: 3673 tp.ktemp[key].pop() 3674 continue |
|
3677 e['end'] = t.time 3678 e['rdata'] = kprobedata 3679 # end of kernel resume 3680 if(phase != 'suspend_prepare' and kprobename in krescalls): 3681 if phase in data.dmesg: 3682 data.dmesg[phase]['end'] = t.time 3683 data.tKernRes = t.time 3684 --- 523 unchanged lines hidden (view full) --- 4208 num += 1 4209 for line in cg.list: 4210 if(line.length < 0.000000001): 4211 flen = '' 4212 else: 4213 fmt = '<n>(%.3f ms @ '+sv.timeformat+')</n>' 4214 flen = fmt % (line.length*1000, line.time) 4215 if line.isLeaf(): | 3675 e['end'] = t.time 3676 e['rdata'] = kprobedata 3677 # end of kernel resume 3678 if(phase != 'suspend_prepare' and kprobename in krescalls): 3679 if phase in data.dmesg: 3680 data.dmesg[phase]['end'] = t.time 3681 data.tKernRes = t.time 3682 --- 523 unchanged lines hidden (view full) --- 4206 num += 1 4207 for line in cg.list: 4208 if(line.length < 0.000000001): 4209 flen = '' 4210 else: 4211 fmt = '<n>(%.3f ms @ '+sv.timeformat+')</n>' 4212 flen = fmt % (line.length*1000, line.time) 4213 if line.isLeaf(): |
4214 if line.length * 1000 < sv.mincglen: 4215 continue |
|
4216 hf.write(html_func_leaf.format(line.name, flen)) 4217 elif line.freturn: 4218 hf.write(html_func_end) 4219 else: 4220 hf.write(html_func_start.format(num, line.name, flen)) 4221 num += 1 4222 hf.write(html_func_end) 4223 return num --- 598 unchanged lines hidden (view full) --- 4822 else: 4823 title += b 4824 devtl.html += devtl.html_device.format(dev['id'], \ 4825 title, left, top, '%.3f'%rowheight, width, \ 4826 dname+drv, xtraclass, xtrastyle) 4827 if('cpuexec' in dev): 4828 for t in sorted(dev['cpuexec']): 4829 start, end = t | 4216 hf.write(html_func_leaf.format(line.name, flen)) 4217 elif line.freturn: 4218 hf.write(html_func_end) 4219 else: 4220 hf.write(html_func_start.format(num, line.name, flen)) 4221 num += 1 4222 hf.write(html_func_end) 4223 return num --- 598 unchanged lines hidden (view full) --- 4822 else: 4823 title += b 4824 devtl.html += devtl.html_device.format(dev['id'], \ 4825 title, left, top, '%.3f'%rowheight, width, \ 4826 dname+drv, xtraclass, xtrastyle) 4827 if('cpuexec' in dev): 4828 for t in sorted(dev['cpuexec']): 4829 start, end = t |
4830 j = float(dev['cpuexec'][t]) / 5 4831 if j > 1.0: 4832 j = 1.0 | |
4833 height = '%.3f' % (rowheight/3) 4834 top = '%.3f' % (rowtop + devtl.scaleH + 2*rowheight/3) 4835 left = '%f' % (((start-m0)*100)/mTotal) 4836 width = '%f' % ((end-start)*100/mTotal) | 4830 height = '%.3f' % (rowheight/3) 4831 top = '%.3f' % (rowtop + devtl.scaleH + 2*rowheight/3) 4832 left = '%f' % (((start-m0)*100)/mTotal) 4833 width = '%f' % ((end-start)*100/mTotal) |
4837 color = 'rgba(255, 0, 0, %f)' % j | 4834 color = 'rgba(255, 0, 0, %f)' % dev['cpuexec'][t] |
4838 devtl.html += \ 4839 html_cpuexec.format(left, top, height, width, color) 4840 if('src' not in dev): 4841 continue 4842 # draw any trace events for this device 4843 for e in dev['src']: 4844 if e.length == 0: 4845 continue --- 602 unchanged lines hidden (view full) --- 5448 time.sleep(1) 5449 if sv.sync: 5450 if not quiet: 5451 pprint('SYNCING FILESYSTEMS') 5452 sv.dlog('syncing filesystems') 5453 call('sync', shell=True) 5454 sv.dlog('read dmesg') 5455 sv.initdmesg() | 4835 devtl.html += \ 4836 html_cpuexec.format(left, top, height, width, color) 4837 if('src' not in dev): 4838 continue 4839 # draw any trace events for this device 4840 for e in dev['src']: 4841 if e.length == 0: 4842 continue --- 602 unchanged lines hidden (view full) --- 5445 time.sleep(1) 5446 if sv.sync: 5447 if not quiet: 5448 pprint('SYNCING FILESYSTEMS') 5449 sv.dlog('syncing filesystems') 5450 call('sync', shell=True) 5451 sv.dlog('read dmesg') 5452 sv.initdmesg() |
5456 # start ftrace 5457 if sv.useftrace: 5458 if not quiet: 5459 pprint('START TRACING') 5460 sv.dlog('start ftrace tracing') 5461 sv.fsetVal('1', 'tracing_on') 5462 if sv.useprocmon: 5463 sv.dlog('start the process monitor') 5464 pm.start() 5465 sv.dlog('run the cmdinfo list before') | 5453 sv.dlog('cmdinfo before') |
5466 sv.cmdinfo(True) | 5454 sv.cmdinfo(True) |
5455 sv.start(pm) |
|
5467 # execute however many s/r runs requested 5468 for count in range(1,sv.execcount+1): 5469 # x2delay in between test runs 5470 if(count > 1 and sv.x2delay > 0): 5471 sv.fsetVal('WAIT %d' % sv.x2delay, 'trace_marker') 5472 time.sleep(sv.x2delay/1000.0) 5473 sv.fsetVal('WAIT END', 'trace_marker') 5474 # start message --- 20 unchanged lines hidden (view full) --- 5495 # initiate suspend or command 5496 sv.dlog('system executing a suspend') 5497 tdata = {'error': ''} 5498 if sv.testcommand != '': 5499 res = call(sv.testcommand+' 2>&1', shell=True); 5500 if res != 0: 5501 tdata['error'] = 'cmd returned %d' % res 5502 else: | 5456 # execute however many s/r runs requested 5457 for count in range(1,sv.execcount+1): 5458 # x2delay in between test runs 5459 if(count > 1 and sv.x2delay > 0): 5460 sv.fsetVal('WAIT %d' % sv.x2delay, 'trace_marker') 5461 time.sleep(sv.x2delay/1000.0) 5462 sv.fsetVal('WAIT END', 'trace_marker') 5463 # start message --- 20 unchanged lines hidden (view full) --- 5484 # initiate suspend or command 5485 sv.dlog('system executing a suspend') 5486 tdata = {'error': ''} 5487 if sv.testcommand != '': 5488 res = call(sv.testcommand+' 2>&1', shell=True); 5489 if res != 0: 5490 tdata['error'] = 'cmd returned %d' % res 5491 else: |
5492 s0ixready = sv.s0ixSupport() |
|
5503 mode = sv.suspendmode 5504 if sv.memmode and os.path.exists(sv.mempowerfile): 5505 mode = 'mem' 5506 sv.testVal(sv.mempowerfile, 'radio', sv.memmode) 5507 if sv.diskmode and os.path.exists(sv.diskpowerfile): 5508 mode = 'disk' 5509 sv.testVal(sv.diskpowerfile, 'radio', sv.diskmode) 5510 if sv.acpidebug: 5511 sv.testVal(sv.acpipath, 'acpi', '0xe') | 5493 mode = sv.suspendmode 5494 if sv.memmode and os.path.exists(sv.mempowerfile): 5495 mode = 'mem' 5496 sv.testVal(sv.mempowerfile, 'radio', sv.memmode) 5497 if sv.diskmode and os.path.exists(sv.diskpowerfile): 5498 mode = 'disk' 5499 sv.testVal(sv.diskpowerfile, 'radio', sv.diskmode) 5500 if sv.acpidebug: 5501 sv.testVal(sv.acpipath, 'acpi', '0xe') |
5512 if mode == 'freeze' and sv.haveTurbostat(): | 5502 if ((mode == 'freeze') or (sv.memmode == 's2idle')) \ 5503 and sv.haveTurbostat(): |
5513 # execution will pause here | 5504 # execution will pause here |
5514 turbo = sv.turbostat() | 5505 turbo = sv.turbostat(s0ixready) |
5515 if turbo: 5516 tdata['turbo'] = turbo 5517 else: 5518 pf = open(sv.powerfile, 'w') 5519 pf.write(mode) 5520 # execution will pause here 5521 try: 5522 pf.close() 5523 except Exception as e: 5524 tdata['error'] = str(e) | 5506 if turbo: 5507 tdata['turbo'] = turbo 5508 else: 5509 pf = open(sv.powerfile, 'w') 5510 pf.write(mode) 5511 # execution will pause here 5512 try: 5513 pf.close() 5514 except Exception as e: 5515 tdata['error'] = str(e) |
5525 sv.dlog('system returned from resume') | 5516 sv.fsetVal('CMD COMPLETE', 'trace_marker') 5517 sv.dlog('system returned') |
5526 # reset everything 5527 sv.testVal('restoreall') 5528 if(sv.rtcwake): 5529 sv.dlog('disable RTC wake alarm') 5530 sv.rtcWakeAlarmOff() 5531 # postdelay delay 5532 if(count == sv.execcount and sv.postdelay > 0): 5533 sv.fsetVal('WAIT %d' % sv.postdelay, 'trace_marker') 5534 time.sleep(sv.postdelay/1000.0) 5535 sv.fsetVal('WAIT END', 'trace_marker') 5536 # return from suspend 5537 pprint('RESUME COMPLETE') | 5518 # reset everything 5519 sv.testVal('restoreall') 5520 if(sv.rtcwake): 5521 sv.dlog('disable RTC wake alarm') 5522 sv.rtcWakeAlarmOff() 5523 # postdelay delay 5524 if(count == sv.execcount and sv.postdelay > 0): 5525 sv.fsetVal('WAIT %d' % sv.postdelay, 'trace_marker') 5526 time.sleep(sv.postdelay/1000.0) 5527 sv.fsetVal('WAIT END', 'trace_marker') 5528 # return from suspend 5529 pprint('RESUME COMPLETE') |
5538 sv.fsetVal(datetime.now().strftime(sv.tmend), 'trace_marker') | 5530 if(count < sv.execcount): 5531 sv.fsetVal(datetime.now().strftime(sv.tmend), 'trace_marker') 5532 elif(not sv.wifitrace): 5533 sv.fsetVal(datetime.now().strftime(sv.tmend), 'trace_marker') 5534 sv.stop(pm) |
5539 if sv.wifi and wifi: 5540 tdata['wifi'] = sv.pollWifi(wifi) 5541 sv.dlog('wifi check, %s' % tdata['wifi']) | 5535 if sv.wifi and wifi: 5536 tdata['wifi'] = sv.pollWifi(wifi) 5537 sv.dlog('wifi check, %s' % tdata['wifi']) |
5542 if sv.netfix: 5543 netfixout = sv.netfixon('wired') 5544 elif sv.netfix: 5545 netfixout = sv.netfixon() 5546 if sv.netfix and netfixout: 5547 tdata['netfix'] = netfixout | 5538 if(count == sv.execcount and sv.wifitrace): 5539 sv.fsetVal(datetime.now().strftime(sv.tmend), 'trace_marker') 5540 sv.stop(pm) 5541 if sv.netfix: 5542 tdata['netfix'] = sv.netfixon() |
5548 sv.dlog('netfix, %s' % tdata['netfix']) 5549 if(sv.suspendmode == 'mem' or sv.suspendmode == 'command'): 5550 sv.dlog('read the ACPI FPDT') 5551 tdata['fw'] = getFPDT(False) 5552 testdata.append(tdata) | 5543 sv.dlog('netfix, %s' % tdata['netfix']) 5544 if(sv.suspendmode == 'mem' or sv.suspendmode == 'command'): 5545 sv.dlog('read the ACPI FPDT') 5546 tdata['fw'] = getFPDT(False) 5547 testdata.append(tdata) |
5553 sv.dlog('run the cmdinfo list after') | 5548 sv.dlog('cmdinfo after') |
5554 cmdafter = sv.cmdinfo(False) | 5549 cmdafter = sv.cmdinfo(False) |
5555 # stop ftrace 5556 if sv.useftrace: 5557 if sv.useprocmon: 5558 sv.dlog('stop the process monitor') 5559 pm.stop() 5560 sv.fsetVal('0', 'tracing_on') | |
5561 # grab a copy of the dmesg output 5562 if not quiet: 5563 pprint('CAPTURING DMESG') | 5550 # grab a copy of the dmesg output 5551 if not quiet: 5552 pprint('CAPTURING DMESG') |
5564 sysvals.dlog('EXECUTION TRACE END') | |
5565 sv.getdmesg(testdata) 5566 # grab a copy of the ftrace output 5567 if sv.useftrace: 5568 if not quiet: 5569 pprint('CAPTURING TRACE') 5570 op = sv.writeDatafileHeader(sv.ftracefile, testdata) 5571 fp = open(tp+'trace', 'r') 5572 for line in fp: --- 772 unchanged lines hidden (view full) --- 6345 for line in html.split('\n'): 6346 m = re.match(' *<div id=\"[a,0-9]*\" *title=\"(?P<title>.*)\" class=\"thread.*', line) 6347 if not m or 'thread kth' in line or 'thread sec' in line: 6348 continue 6349 m = re.match('(?P<n>.*) \((?P<t>[0-9,\.]*) ms\) (?P<p>.*)', m.group('title')) 6350 if not m: 6351 continue 6352 name, time, phase = m.group('n'), m.group('t'), m.group('p') | 5553 sv.getdmesg(testdata) 5554 # grab a copy of the ftrace output 5555 if sv.useftrace: 5556 if not quiet: 5557 pprint('CAPTURING TRACE') 5558 op = sv.writeDatafileHeader(sv.ftracefile, testdata) 5559 fp = open(tp+'trace', 'r') 5560 for line in fp: --- 772 unchanged lines hidden (view full) --- 6333 for line in html.split('\n'): 6334 m = re.match(' *<div id=\"[a,0-9]*\" *title=\"(?P<title>.*)\" class=\"thread.*', line) 6335 if not m or 'thread kth' in line or 'thread sec' in line: 6336 continue 6337 m = re.match('(?P<n>.*) \((?P<t>[0-9,\.]*) ms\) (?P<p>.*)', m.group('title')) 6338 if not m: 6339 continue 6340 name, time, phase = m.group('n'), m.group('t'), m.group('p') |
6341 if name == 'async_synchronize_full': 6342 continue |
|
6353 if ' async' in name or ' sync' in name: 6354 name = ' '.join(name.split(' ')[:-1]) 6355 if phase.startswith('suspend'): 6356 d = 'suspend' 6357 elif phase.startswith('resume'): 6358 d = 'resume' 6359 else: 6360 continue --- 335 unchanged lines hidden (view full) --- 6696 ' default: suspend-{date}-{time}\n'\ 6697 ' -rtcwake t Wakeup t seconds after suspend, set t to "off" to disable (default: 15)\n'\ 6698 ' -addlogs Add the dmesg and ftrace logs to the html output\n'\ 6699 ' -noturbostat Dont use turbostat in freeze mode (default: disabled)\n'\ 6700 ' -srgap Add a visible gap in the timeline between sus/res (default: disabled)\n'\ 6701 ' -skiphtml Run the test and capture the trace logs, but skip the timeline (default: disabled)\n'\ 6702 ' -result fn Export a results table to a text file for parsing.\n'\ 6703 ' -wifi If a wifi connection is available, check that it reconnects after resume.\n'\ | 6343 if ' async' in name or ' sync' in name: 6344 name = ' '.join(name.split(' ')[:-1]) 6345 if phase.startswith('suspend'): 6346 d = 'suspend' 6347 elif phase.startswith('resume'): 6348 d = 'resume' 6349 else: 6350 continue --- 335 unchanged lines hidden (view full) --- 6686 ' default: suspend-{date}-{time}\n'\ 6687 ' -rtcwake t Wakeup t seconds after suspend, set t to "off" to disable (default: 15)\n'\ 6688 ' -addlogs Add the dmesg and ftrace logs to the html output\n'\ 6689 ' -noturbostat Dont use turbostat in freeze mode (default: disabled)\n'\ 6690 ' -srgap Add a visible gap in the timeline between sus/res (default: disabled)\n'\ 6691 ' -skiphtml Run the test and capture the trace logs, but skip the timeline (default: disabled)\n'\ 6692 ' -result fn Export a results table to a text file for parsing.\n'\ 6693 ' -wifi If a wifi connection is available, check that it reconnects after resume.\n'\ |
6694 ' -wifitrace Trace kernel execution through wifi reconnect.\n'\ |
|
6704 ' -netfix Use netfix to reset the network in the event it fails to resume.\n'\ 6705 ' [testprep]\n'\ 6706 ' -sync Sync the filesystems before starting the test\n'\ 6707 ' -rs on/off Enable/disable runtime suspend for all devices, restore all after test\n'\ 6708 ' -display m Change the display mode to m for the test (on/off/standby/suspend)\n'\ 6709 ' [advanced]\n'\ 6710 ' -gzip Gzip the trace and dmesg logs to save space\n'\ 6711 ' -cmd {s} Run the timeline over a custom command, e.g. "sync -d"\n'\ --- 111 unchanged lines hidden (view full) --- 6823 elif(arg == '-proc'): 6824 sysvals.useprocmon = True 6825 elif(arg == '-dev'): 6826 sysvals.usedevsrc = True 6827 elif(arg == '-sync'): 6828 sysvals.sync = True 6829 elif(arg == '-wifi'): 6830 sysvals.wifi = True | 6695 ' -netfix Use netfix to reset the network in the event it fails to resume.\n'\ 6696 ' [testprep]\n'\ 6697 ' -sync Sync the filesystems before starting the test\n'\ 6698 ' -rs on/off Enable/disable runtime suspend for all devices, restore all after test\n'\ 6699 ' -display m Change the display mode to m for the test (on/off/standby/suspend)\n'\ 6700 ' [advanced]\n'\ 6701 ' -gzip Gzip the trace and dmesg logs to save space\n'\ 6702 ' -cmd {s} Run the timeline over a custom command, e.g. "sync -d"\n'\ --- 111 unchanged lines hidden (view full) --- 6814 elif(arg == '-proc'): 6815 sysvals.useprocmon = True 6816 elif(arg == '-dev'): 6817 sysvals.usedevsrc = True 6818 elif(arg == '-sync'): 6819 sysvals.sync = True 6820 elif(arg == '-wifi'): 6821 sysvals.wifi = True |
6822 elif(arg == '-wifitrace'): 6823 sysvals.wifitrace = True |
|
6831 elif(arg == '-netfix'): 6832 sysvals.netfix = True 6833 elif(arg == '-gzip'): 6834 sysvals.gzip = True 6835 elif(arg == '-info'): 6836 try: 6837 val = next(args) 6838 except: --- 303 unchanged lines hidden --- | 6824 elif(arg == '-netfix'): 6825 sysvals.netfix = True 6826 elif(arg == '-gzip'): 6827 sysvals.gzip = True 6828 elif(arg == '-info'): 6829 try: 6830 val = next(args) 6831 except: --- 303 unchanged lines hidden --- |