Lines Matching +full:slice +full:- +full:per +full:- +full:line

2 # SPDX-License-Identifier: GPL-2.0-only
21 # https://www.intel.com/content/www/us/en/developer/topic-technology/open/pm-graph/overview.html
23 # git@github.com:intel/pm-graph
51 # ----------------- LIBRARIES --------------------
74 print('[%09.3f] %s' % (time.time()-mystarttime, msg))
82 # ----------------- CLASSES --------------------
86 # A global, single-instance container used to
108 cgtest = -1
183 tmstart = 'SUSPEND START %Y%m%d-%H:%M:%S.%f'
184 tmend = 'RESUME COMPLETE %Y%m%d-%H:%M:%S.%f'
299 [0, 'sysinfo', 'uname', '-a'],
300 [0, 'cpuinfo', 'head', '-7', '/proc/cpuinfo'],
303 [0, 'pcidevices', 'lspci', '-tv'],
304 [0, 'usbdevices', 'lsusb', '-tv'],
305 [0, 'acpidevices', 'sh', '-c', 'ls -l /sys/bus/acpi/devices/*/physical_node'],
312 [2, 'gpecounts', 'sh', '-c', 'grep -v invalid /sys/firmware/acpi/interrupts/*'],
313 [2, 'suspendstats', 'sh', '-c', 'grep -v invalid /sys/power/suspend_stats/*'],
314 …[2, 'cpuidle', 'sh', '-c', 'grep -v invalid /sys/devices/system/cpu/cpu*/cpuidle/state*/s2idle/*'],
315 [2, 'battery', 'sh', '-c', 'grep -v invalid /sys/class/power_supply/*/*'],
316 [2, 'thermal', 'sh', '-c', 'grep . /sys/class/thermal/thermal_zone*/temp'],
338 self.testdir = datetime.now().strftime('suspend-%y%m%d-%H%M%S')
357 msg = '%s caused a tool exit, line %d' % (signame, frame.f_lineno)
443 if 'baseboard-manufacturer' in info:
444 m = info['baseboard-manufacturer']
445 elif 'system-manufacturer' in info:
446 m = info['system-manufacturer']
447 if 'system-product-name' in info:
448 p = info['system-product-name']
449 elif 'baseboard-product-name' in info:
450 p = info['baseboard-product-name']
451 if m[:5].lower() == 'intel' and 'baseboard-product-name' in info:
452 p = info['baseboard-product-name']
453 c = info['processor-version'] if 'processor-version' in info else ''
454 b = info['bios-version'] if 'bios-version' in info else ''
455 r = info['bios-release-date'] if 'bios-release-date' in info else ''
465 fmt = '%-24s: %s'
467 print(fmt % ('os-version', self.osversion))
477 for line in fp:
478 if re.match(r'^processor[ \t]*:[ \t]*[0-9]*', line):
482 for line in fp:
483 m = re.match(r'^MemTotal:[ \t]*(?P<sz>[0-9]*) *kB', line)
486 m = re.match(r'^MemFree:[ \t]*(?P<sz>[0-9]*) *kB', line)
489 if os.path.exists('/etc/os-release'):
490 with open('/etc/os-release', 'r') as fp:
491 for line in fp:
492 if line.startswith('PRETTY_NAME='):
493 self.osversion = line[12:].strip().replace('"', '')
498 fmt = name+'-%m%d%y-%H%M%S'
548 for line in reversed(lines):
549 line = ascii(line).replace('\r\n', '')
550 idx = line.find('[')
552 line = line[idx:]
553 m = re.match(r'[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
562 for line in fp:
563 line = ascii(line).replace('\r\n', '')
564 idx = line.find('[')
566 line = line[idx:]
567 m = re.match(r'[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
572 op.write(line)
673 if re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', func):
675 for arg in re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', fmt):
690 # sort kprobes: trace, ub-dev, custom, dev
722 linesack = (len(check.split('\n')) - 1) // 2
815 tgtsize -= 65536
819 self.vprint('Setting trace buffers to %d kB (%d kB per cpu)' % (tgtsize, tgtsize/cpus))
830 self.fsetVal('print-parent', 'trace_options')
831 self.fsetVal('funcgraph-abstime', 'trace_options')
832 self.fsetVal('funcgraph-cpu', 'trace_options')
833 self.fsetVal('funcgraph-duration', 'trace_options')
834 self.fsetVal('funcgraph-proc', 'trace_options')
835 self.fsetVal('funcgraph-tail', 'trace_options')
836 self.fsetVal('nofuncgraph-overhead', 'trace_options')
837 self.fsetVal('context-info', 'trace_options')
838 self.fsetVal('graph-time', 'trace_options')
921 cmd = 'chown -R {0}:{0} {1} > /dev/null 2>&1'
932 for line in testdata['stack']:
933 fp.write(line)
1000 # add test command string line if need be
1002 footer += '# platform-testcmd: %s\n' % (self.testcommand)
1008 for line in tf:
1009 if tp.stampInfo(line, self):
1012 m = re.match(tp.ftrace_line_fmt, line)
1013 if(not m or 'device_pm_callback_start' not in line):
1026 dev = dirname.split('/')[-2]
1028 props[dev].syspath = dirname[:-6]
1065 # add a devinfo line to the bottom of ftrace
1069 footer += '# platform-devinfo: %s\n' % self.b64zip(out)
1071 # add a line for each of these commands with their outputs
1073 footer += '# platform-%s: %s | %s\n' % (name, cmdline, self.b64zip(info))
1082 prefix = prefix[:len(prefix)-1]
1085 if '/' in prefix and prefix[-1] != '/':
1092 for line in text.split('\n'):
1094 header, out['@'] = False, line
1096 line = line.strip()
1097 if delim in line:
1098 data = line.split(delim, 1)
1108 cmd = [self.getExec('ip'), '-4', '-o', '-br', 'addr']
1114 for line in info.split('\n'):
1115 if line[0] == 'e' and 'UP' in line:
1116 return line.split()[0]
1126 if args[i][0] == '{' and args[i][-1] == '}':
1127 args[i] = self.cmdinfovar(args[i][1:-1])
1148 dinfo += '\t%s : %s -> %s\n' % \
1173 line = fp.read().strip().split('\n')[-1]
1174 m = re.match(r'.* (?P<v>[0-9A-Fx]*) .*', line)
1196 fp = Popen([cmd, '-v'], stdout=PIPE, stderr=PIPE).stderr
1206 fullcmd = '%s -q -S echo freeze > %s' % (cmd, self.powerfile)
1207 fp = Popen(['sh', '-c', fullcmd], stdout=PIPE, stderr=PIPE)
1208 for line in fp.stderr:
1209 line = ascii(line)
1210 rawout += line
1213 if re.match(r'(?i)Avg_MHz.*', line):
1214 keyline = line.strip().split()
1216 valline = line.strip().split()
1238 fp = Popen([cmd, '-s', net, 'on'], stdout=PIPE, stderr=PIPE).stdout
1250 vals.append(prop.split('=')[-1])
1257 for line in reversed(w.split('\n')):
1258 m = re.match(r' *(?P<dev>.*): (?P<stat>[0-9a-f]*) .*', line)
1265 while (time.time() - start) < timeout:
1269 (self.wifiDetails(dev), max(0, time.time() - start))
1287 if re.match(r'^[0-9,\-\.]*$', arr[j]):
1288 arr[j] = r'[0-9,\-\.]*'
1297 'line': msg,
1314 dt = t - self.multitest['last']
1318 pprint('TEST (%s) COMPLETE -- Duration %.1fs' % (id, dt))
1324 left = finish - datetime.now()
1325 left -= timedelta(microseconds=left.microseconds)
1327 left = timedelta(seconds=((self.multitest['count'] - idx) * int(avg)))
1328 pprint('TEST (%s) START - Avg Duration %.1fs, Time left %s' % \
1333 sz, unit, c = 'time', c[-1], c[:-1]
1342 xset, ret = 'timeout 10 xset -d :0.0 {0}', 0
1344 xset = 'sudo -u %s %s' % (self.sudouser, xset)
1356 self.vprint('Display Switched: %s -> %s' % (b4, curr))
1365 for line in fp:
1366 m = re.match(r'[\s]*Monitor is (?P<m>.*)', ascii(line))
1388 # runtime suspend re-enable or re-disable
1465 # 10 sequential, non-overlapping phases of S/R
1507 'ACPI' : r'.*\bACPI *(?P<b>[A-Za-z]*) *Error[: ].*',
1509 'USBERR' : r'.*usb .*device .*, error [0-9-]*',
1510 'ATAERR' : r' *ata[0-9\.]*: .*failed.*',
1512 'TPMERR' : r'(?i) *tpm *tpm[0-9]*: .*error.*',
1520 self.tSuspended = 0.0 # low-level suspend start
1521 self.tResumed = 0.0 # low-level resume start
1541 self.tLow = [] # time spent in low-level suspends (standby/freeze)
1566 return plist[-1*depth]
1570 for line in self.dmesgtext:
1571 m = re.match(tp.tstatfmt, line)
1576 out['syslpi'] = i.split('=')[-1]+'%'
1578 out['pkgpc10'] = i.split('=')[-1]+'%'
1588 for line in lf:
1590 if tp.stampInfo(line, sysvals):
1592 m = re.match(r'[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
1685 threadname = 'kthread-%d' % (pid)
1687 threadname = '%s-%d' % (proc, pid)
1695 sysvals.vprint('[%f - %f] %s-%d %s %s %s' % \
1742 o = min(dev['end'], tdev['end']) - max(dev['start'], tdev['start'])
1756 if tdev['start'] - dev['end'] < 0.1:
1789 p.length = p.end - p.time
1795 if(t - dT < t0):
1797 return t - dT
1823 d['length'] = d['end'] - d['start']
1828 for line in cg.list:
1829 line.time = self.trimTimeVal(line.time, t0, dT, left)
1834 e.length = e.end - e.time
1856 tL = tR - tS
1875 stime = (self.tSuspended - self.start) * 1000000
1876 rtime = (self.end - self.tResumed) * 1000000
1878 hwr = self.hwend - timedelta(microseconds=rtime)
1879 self.tLow.append('%.0f'%((hwr - hws).total_seconds() * 1000))
1881 s = (self.tSuspended - self.tKernSus) * 1000
1882 r = (self.tKernRes - self.tResumed) * 1000
1884 def setPhase(self, phase, ktime, isbegin, order=-1):
1897 self.dmesg[phase] = {'list': dict(), 'start': -1.0, 'end': -1.0,
1960 def newActionGlobal(self, name, start, end, pid=-1, color=''):
1971 o = max(0, min(end, pend) - max(start, pstart))
1986 targetphase = phases[-1]
1987 if pid == -2:
1989 elif pid == -3:
2003 length = -1.0
2005 length = end - start
2006 if pid >= -2:
2023 if name == devname or re.match(r'^%s\[(?P<num>[0-9]*)\]$' % name, devname):
2055 sysvals.vprint('%20s: %f - %f (%d devices)' % (phase, ps, pe, dc))
2057 sysvals.vprint(''.join('-' for i in range(80)))
2059 fmt = '%3d) %'+maxname+'s - %f - %f'
2066 sysvals.vprint(''.join('-' for i in range(80)))
2099 info += ('<li>%s: %.3fms</li>' % (phase, (e-s)*1000))
2118 # list of top-most root devices
2125 if(pid < 0 or re.match(r'[0-9]*-[0-9]*\.[0-9]*[\.0-9]*\:[\.0-9]*$', pdev)):
2141 length = (list[dev]['end'] - list[dev]['start']) * 1000
2142 width = widfmt % (((list[dev]['end']-list[dev]['start'])*100)/tTotal)
2148 self.newAction(phase, devname, -2, '', \
2158 tlast = start = end = -1
2167 maxj = (t - tlast) * 1024.0
2173 out = self.newActionGlobal(name, start, end, -3)
2215 def initcall_debug_call(self, line, quick=False): argument
2216 m = re.match(r'.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: '+\
2217 r'PM: *calling .* @ (?P<n>.*), parent: (?P<p>.*)', line)
2219 m = re.match(r'.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: '+\
2220 r'calling .* @ (?P<n>.*), parent: (?P<p>.*)', line)
2222 m = re.match(r'.*(\[ *)(?P<t>[0-9\.]*)(\]) calling '+\
2223 r'(?P<f>.*)\+ @ (?P<n>.*), parent: (?P<p>.*)', line)
2227 def initcall_debug_return(self, line, quick=False): argument
2228 m = re.match(r'.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: PM: '+\
2229 r'.* returned (?P<r>[0-9]*) after (?P<dt>[0-9]*) usecs', line)
2231 m = re.match(r'.*(\[ *)(?P<t>[0-9\.]*)(\]) .* (?P<f>.*)\: '+\
2232 r'.* returned (?P<r>[0-9]*) after (?P<dt>[0-9]*) usecs', line)
2234 m = re.match(r'.*(\[ *)(?P<t>[0-9\.]*)(\]) call '+\
2235 r'(?P<f>.*)\+ returned .* after (?P<dt>.*) usecs', line)
2259 self.length = end - start
2271 title = '%s(%s)%s <- %s, %s(%s)' % \
2284 dt = self.time - tgt.end
2285 # only combine calls if -all- attributes are identical
2297 # A container for a single line of ftrace data. There are six basic types:
2298 # callgraph line:
2370 if(m[-1] == '{'):
2375 elif(m[-1] == ';'):
2393 pprint(' -- %12.6f (depth=%02d): %s(); (%.3f us) %s' % (self.time, \
2396 pprint(' -- %12.6f (depth=%02d): %s} (%.3f us) %s' % (self.time, \
2399 pprint(' -- %12.6f (depth=%02d): %s() { (%.3f us) %s' % (self.time, \
2402 # Is this the starting line of a suspend?
2415 # Is this the ending line of a resume?
2442 self.start = -1.0
2443 self.end = -1.0
2448 def addLine(self, line): argument
2451 if(line.depth == 0 and line.freturn):
2456 self.invalidate(line)
2460 if line.depth > self.depth:
2463 self.list[-1].freturn = True
2464 self.list[-1].length = line.time - self.list[-1].time
2467 if line.depth == self.depth and line.isReturn():
2468 if line.depth == 0:
2469 self.end = line.time
2472 # compare current depth with this lines pre-call depth
2473 prelinedep = line.depth
2474 if line.isReturn():
2477 lasttime = line.time
2479 last = self.list[-1]
2484 mismatch = prelinedep - self.depth
2491 self.depth -= 1
2496 last.length = line.time - last.time
2511 info.append(('', line))
2519 if idx == 0 and line.isReturn():
2521 line.fcall = True
2522 prelinedep -= 1
2524 info.append(('[make leaf]', line))
2537 if warning and ('[make leaf]', line) not in info:
2538 info.append(('', line))
2548 if line.isCall():
2550 if (md and self.depth >= md - 1) or (line.name in self.sv.cgblacklist):
2554 elif line.isReturn():
2555 self.depth -= 1
2557 if (last and last.isCall() and last.depth == line.depth) or \
2559 (line.name in self.sv.cgblacklist):
2560 while len(self.list) > 0 and self.list[-1].depth > line.depth:
2561 self.list.pop(-1)
2565 self.list[-1].freturn = True
2566 self.list[-1].length = line.time - self.list[-1].time
2567 self.list[-1].name = line.name
2570 self.start = line.time
2573 if mismatch < 0 and self.list[-1].depth == 0 and self.list[-1].freturn:
2574 line = self.list[-1]
2576 res = -1
2578 self.list.append(line)
2579 if(line.depth == 0 and line.freturn):
2581 self.start = line.time
2582 self.end = line.time
2583 if line.fcall:
2584 self.end += line.length
2587 if res == -1:
2591 def invalidate(self, line): argument
2598 window = '(%f - %f)' % (self.start, line.time)
2605 def slice(self, dev): member in FTraceCallGraph
2608 mydepth = -1
2620 l.depth -= mydepth
2628 last = self.list[-1]
2648 if last.length > l.time - last.time:
2649 last.length = l.time - last.time
2661 cl.length = l.time - cl.time
2666 cnt -= 1
2692 cg = self.slice(dev)
2727 out = data.newActionGlobal(name, fs, fe, -2)
2732 pprint('%s pid=%d [%f - %f] %.3f us' % \
2734 (self.end - self.start)*1000000))
2780 'us/en/developer/topic-technology/open/pm-graph/overview.html">%s v%s</a></div>' \
2807 item.row = -1
2833 remaining -= 1
2850 # initialize all device rows to -1 and calculate devrows
2856 dev['row'] = -1
2859 sortdict[item] = (-1*float(dev['start']), float(dev['end']) - float(dev['start']))
2862 sortdict[item] = (float(dev['end']) - float(dev['start']), item.dev['name'])
2869 if item.dev['pid'] == -2:
2895 remaining -= 1
2940 self.bodyH = self.height - self.scaleH
2941 # if there is 1 line per row, draw them the standard way
2947 …html_zoombox = '<center><button id="zoomin">ZOOM IN +</button><button id="zoomout">ZOOM OUT -</but…
2971 rline = '<div class="t" style="left:0;border-left:1px solid black;border-right:0;">{0}</div>\n'
2974 mTotal = mMax - m0
2981 divEdge = (mTotal - tS*(divTotal-1))*100/mTotal
2985 pos = '%0.3f' % (100 - ((float(i)*tS*100)/mTotal) - divEdge)
2986 val = '%0.fms' % (float(i-divTotal+1)*tS*1000)
2987 if(i == divTotal - 1):
2991 pos = '%0.3f' % (100 - ((float(i)*tS*100)/mTotal))
3003 stampfmt = r'# [a-z]*-(?P<m>[0-9]{2})(?P<d>[0-9]{2})(?P<y>[0-9]{2})-'+\
3004 r'(?P<H>[0-9]{2})(?P<M>[0-9]{2})(?P<S>[0-9]{2})'+\
3006 wififmt = r'^# wifi *(?P<d>\S*) *(?P<s>\S*) *(?P<t>[0-9\.]+).*'
3013 pinfofmt = r'# platform-(?P<val>[a-z,A-Z,0-9,_]*): (?P<info>.*)'
3015 firmwarefmt = r'# fwsuspend (?P<s>[0-9]*) fwresume (?P<r>[0-9]*)$'
3016 procexecfmt = r'ps - (?P<ps>.*)$'
3017 procmultifmt = r'@(?P<n>[0-9]*)\|(?P<ps>.*)$'
3019 r'^ *(?P<time>[0-9\.]*) *\| *(?P<cpu>[0-9]*)\)'+\
3020 r' *(?P<proc>.*)-(?P<pid>[0-9]*) *\|'+\
3021 r'[ +!#\*@$]*(?P<dur>[0-9\.]*) .*\| (?P<msg>.*)'
3023 r' *(?P<proc>.*)-(?P<pid>[0-9]*) *\[(?P<cpu>[0-9]*)\] *'+\
3024 r'(?P<flags>\S*) *(?P<time>[0-9\.]*): *'+\
3050 def stampInfo(self, line, sv): argument
3051 if re.match(self.stampfmt, line):
3052 self.stamp = line
3054 elif re.match(self.sysinfofmt, line):
3055 self.sysinfo = line
3057 elif re.match(self.tstatfmt, line):
3058 self.turbostat.append(line)
3060 elif re.match(self.wififmt, line):
3061 self.wifi.append(line)
3063 elif re.match(self.testerrfmt, line):
3064 self.testerror.append(line)
3066 elif re.match(self.firmwarefmt, line):
3067 self.fwdata.append(line)
3069 elif(re.match(self.devpropfmt, line)):
3070 self.parseDevprops(line, sv)
3072 elif(re.match(self.pinfofmt, line)):
3073 self.parsePlatformInfo(line, sv)
3075 m = re.match(self.cmdlinefmt, line)
3079 m = re.match(self.tracertypefmt, line)
3114 for line in fp:
3115 m = re.match(r'.* machine_suspend\[(?P<mode>.*)\]', line)
3163 def parseDevprops(self, line, sv): argument
3164 idx = line.index(': ') + 2
3165 if idx >= len(line):
3167 props = self.devprops(line[idx:])
3171 def parsePlatformInfo(self, line, sv): argument
3172 m = re.match(self.pinfofmt, line)
3205 c = ['cat /proc/[1-9]*/stat 2>/dev/null']
3208 for line in process.stdout:
3209 data = ascii(line).split()
3219 ujiff = user - val['user']
3220 kjiff = kern - val['kern']
3230 if len(out[-1]) > self.maxchars:
3232 elif len(out[-1]) > 0:
3233 out[-1] += ','
3234 out[-1] += '%s-%s %d' % (val['name'], pid, jiffies)
3236 for line in out:
3237 sysvals.fsetVal('ps - @%d|%s' % (len(out), line), 'trace_marker')
3239 sysvals.fsetVal('ps - %s' % out[0], 'trace_marker')
3250 # ----------------- FUNCTIONS --------------------
3262 for line in fp:
3266 if i in line:
3271 if i in line:
3277 if i in line:
3304 for line in tf:
3306 line = line.replace('\r\n', '')
3307 if tp.stampInfo(line, sysvals):
3310 m = re.match(tp.ftrace_line_fmt, line)
3313 # gather the basic message data from the line
3326 # the line should be a call, return, or event
3354 cg = testrun[testidx].ftemp[pid][-1]
3358 if(res == -1):
3359 testrun[testidx].ftemp[pid][-1].addLine(t)
3366 if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
3395 for line in tf:
3397 line = line.replace('\r\n', '')
3398 if tp.stampInfo(line, sysvals):
3401 if line[0] == '#':
3403 # ftrace line: parse only valid lines
3404 m = re.match(tp.ftrace_line_fmt, line)
3472 # gather the basic message data from the line
3478 # the line should be a call, return, or event
3494 # process cpu exec line
3516 name = val[0].replace('--', '-')
3534 testrun.ttemp['thaw_processes'][-1]['end'] = t.time
3555 # -- phase changes --
3595 t.time - data.dmesg[lp]['start']
3643 testrun.ttemp[name][-1]['end'] = t.time
3644 testrun.ttemp[name][-1]['loop'] += 1
3657 testrun.ttemp[name][-1]['end'] = t.time
3670 data.newAction(phase, n, pid, p, t.time, -1, drv)
3683 dev['length'] = t.time - dev['start']
3701 'end': -1,
3716 if (t.time - e['begin']) * 1000 < sysvals.mindevlen:
3735 cg = testrun.ftemp[key][-1]
3739 if(res == -1):
3740 testrun.ftemp[key][-1].addLine(t)
3777 if i < len(testruns) - 1:
3787 if event['end'] - event['begin'] <= 0:
3802 if ke - kb < 0.000001 or tlb > kb or tle <= kb:
3814 if ke - kb < 0.000001 or tlb > kb or tle <= kb:
3824 if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
3846 …sysvals.vprint('Callgraph found for task %d: %.3fms, %s' % (cg.pid, (cg.end - cg.start)*1000, name…
3900 for i in range(tc - 1):
3920 tp.stamp = datetime.now().strftime('# suspend-%m%d%y-%H%M%S localhost mem unknown')
3924 for line in lf:
3925 line = line.replace('\r\n', '')
3926 idx = line.find('[')
3928 line = line[idx:]
3929 if tp.stampInfo(line, sysvals):
3931 m = re.match(r'[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
3943 m = re.match(r'.* *(?P<k>[0-9]\.[0-9]{2}\.[0-9]-.*) .*', msg)
3951 data.dmesgtext.append(line)
3967 for line in data.dmesgtext:
3968 ct, cf, n, p = data.initcall_debug_call(line)
3972 j = data.dmesgtext.index(line)
3973 data.dmesgtext[i] = line
3975 last = line
3999 'suspend': ['PM: Entering [a-z]* sleep.*', 'Suspending console.*',
4005 'suspend_machine': ['PM: suspend-to-idle',
4009 'ACPI: Low-level resume complete.*',
4011 r'Suspended for [0-9\.]* seconds'],
4012 'resume_noirq': ['PM: resume from suspend-to-idle',
4028 'emsg': 'PM: Preparing system for[a-z]* sleep.*' },
4040 'emsg': 'Disabling non-boot CPUs .*' },
4043 t0 = -1.0
4044 cpu_start = -1.0
4045 prevktime = -1.0
4047 for line in data.dmesgtext:
4048 # parse each dmesg line into the time and message
4049 m = re.match(r'[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
4057 # initialize data start to first line time
4064 # check for a phase change line
4076 data.initcall_debug_call(line, True)):
4146 # -- device callbacks --
4149 t, f, n, p = data.initcall_debug_call(line)
4151 data.newAction(phase, f, int(n), p, ktime, -1, '')
4154 t, f, l = data.initcall_debug_return(line)
4170 if(a in actions and actions[a][-1]['begin'] == actions[a][-1]['end']):
4171 actions[a][-1]['end'] = ktime
4173 if(re.match(r'Disabling non-boot CPUs .*', msg)):
4176 elif(re.match(r'Enabling non-boot CPUs .*', msg)):
4179 elif(re.match(r'smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg) \
4180 or re.match(r'psci: CPU(?P<cpu>[0-9]*) killed.*', msg)):
4182 m = re.match(r'smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)
4184 m = re.match(r'psci: CPU(?P<cpu>[0-9]*) killed.*', msg)
4190 elif(re.match(r'CPU(?P<cpu>[0-9]*) is up', msg)):
4192 m = re.match(r'CPU(?P<cpu>[0-9]*) is up', msg)
4246 cglen = (cg.end - cg.start) * 1000
4254 for line in cg.list:
4255 if(line.length < 0.000000001):
4259 flen = fmt % (line.length*1000, line.time)
4260 if line.isLeaf():
4261 if line.length * 1000 < sv.mincglen:
4263 hf.write(html_func_leaf.format(line.name, flen))
4264 elif line.freturn:
4267 hf.write(html_func_start.format(num, line.name, flen))
4309 tdcenter = 'text-align:center;' if center else ''
4311 <meta http-equiv="content-type" content="text/html; charset=UTF-8">\n\
4314 ….stamp {width: 100%;text-align:center;background:#888;line-height:30px;color:white;font: 25px Aria…
4315 table {width:100%;border-collapse: collapse;border:1px solid;}\n\
4319 tr.alt {background-color:#ddd;}\n\
4321 .minval {background-color:#BBFFBB;}\n\
4322 .medval {background-color:#BBBBFF;}\n\
4323 .maxval {background-color:#FFBBBB;}\n\
4324 .head a {color:#000;text-decoration: none;}\n\
4335 html = summaryCSS('Summary - SleepGraph')
4373 idx = len(list[mode]['data']) - 1
4445 # header line for each suspend mode
4458 iMin = iMed = iMax = [-1, -1, -1]
4461 # row classes - alternate row color
4466 # figure out if the line has sus or res highlighted
4505 html = summaryCSS('Device Summary - SleepGraph', False)
4551 # row classes - alternate row color
4572 html = summaryCSS('Issues Summary - SleepGraph', False)
4595 # row classes - alternate row color
4598 html += td.format('left', e['line']) # issue
4642 data.trimFreezeTime(testruns[-1].tSuspended)
4648 … class="traceevent{6}" style="left:{1}%;top:{2}px;height:{3}px;width:{4}%;line-height:{3}px;{7}">{…
4656 …'<td class="gray" title="time spent in low-power mode with clock running">'+sysvals.suspendmode+' …
4681 tTotal = data.end - data.start
4705 rtot += data.end - data.tKernRes + (data.wifi['time'] * 1000.0)
4737 wtime = '%.0f ms'%(data.end - data.tKernRes + (data.wifi['time'] * 1000.0))
4748 tMax = testruns[-1].end
4749 tTotal = tMax - t0
4782 d = testruns[0].addHorizontalDivider(msg, testruns[-1].end)
4786 d = testruns[0].addHorizontalDivider('asynchronous kernel threads', testruns[-1].end)
4808 left = '%f' % (((m0-t0)*100.0)/tTotal)
4815 left = '%f' % ((((m0-t0)*100.0)+sysvals.srgap/2)/tTotal)
4816 mTotal = mMax - m0
4820 width = '%f' % (((mTotal*100.0)-sysvals.srgap/2)/tTotal)
4825 length = phase['end']-phase['start']
4826 left = '%f' % (((phase['start']-m0)*100.0)/mTotal)
4835 right = '%f' % (((mMax-t)*100.0)/mTotal)
4859 left = '%f' % (((dev['start']-m0)*100)/mTotal)
4860 width = '%f' % (((dev['end']-dev['start'])*100)/mTotal)
4861 length = ' (%0.3f ms) ' % ((dev['end']-dev['start'])*1000)
4880 left = '%f' % (((start-m0)*100)/mTotal)
4881 width = '%f' % ((end-start)*100/mTotal)
4893 left = '%f' % (((e.time-m0)*100)/mTotal)
4910 phasedef = testruns[-1].phasedef
4933 pscolor = 'linear-gradient(to top left, #ccc, #eee)'
4938 length = phase['end']-phase['start']
4939 left = '%.3f' % (((phase['start']-t0)*100.0)/tTotal)
4954 data = testruns[-1]
4965 for line in lf:
4966 line = line.replace('<', '&lt').replace('>', '&gt')
4967 hf.write(line)
4974 for line in lf:
4975 hf.write(line)
5000 hoverZ = 'z-index:8;'
5014 <meta http-equiv="content-type" content="text/html; charset=UTF-8">\n\
5017 body {overflow-y:scroll;}\n\
5018 ….stamp {width:100%;text-align:center;background:gray;line-height:30px;color:white;font:25px Arial;…
5020 .callgraph {margin-top:30px;box-shadow:5px 5px 20px black;}\n\
5021 .callgraph article * {padding-left:28px;}\n\
5026 t3 {color:black;font:20px Times;white-space:nowrap;}\n\
5027 t4 {color:black;font:bold 30px Times;line-height:60px;white-space:nowrap;}\n\
5036 .time2 {font:15px Arial;border-bottom:1px solid;border-left:1px solid;border-right:1px solid;}\n\
5038 td {text-align:center;}\n\
5044-width="1" fill="white"/><rect x="4" y="8" width="10" height="2" style="fill:black;stroke-width:0"…
5045 …troke="black" stroke-width="1" fill="white"/><rect x="4" y="8" width="10" height="2" style="fill:b…
5046 .pf:'+cgchk+' ~ *:not(:nth-child(2)) {display:none;}\n\
5047 …oombox {position:relative;width:100%;overflow-x:scroll;-webkit-user-select:none;-moz-user-select:n…
5048 ….timeline {position:relative;font-size:14px;cursor:pointer;width:100%; overflow:hidden;background:…
5049 …bsolute;height:0%;overflow:hidden;z-index:7;line-height:30px;font-size:14px;border:1px solid;text-
5050 .thread.ps {border-radius:3px;background:linear-gradient(to top, #ccc, #eee);}\n\
5052 ….thread.sec,.thread.sec:hover {background:black;border:0;color:white;line-height:15px;font-size:10…
5056 .jiffie {position:absolute;pointer-events: none;z-index:8;}\n\
5057 …font-size:10px;z-index:7;overflow:hidden;color:black;text-align:center;white-space:nowrap;border-r…
5058 .traceevent:hover {color:white;font-weight:bold;border:1px solid white;}\n\
5059 .phase {position:absolute;overflow:hidden;border:0px;text-align:center;}\n\
5060 ….phaselet {float:left;overflow:hidden;border:0px;text-align:center;min-height:100px;font-size:24px…
5061 ….t {position:absolute;line-height:'+('%d'%scaleTH)+'px;pointer-events:none;top:0;height:100%;borde…
5062 …err {position:absolute;top:0%;height:100%;border-right:3px solid red;color:red;font:bold 14px Time…
5063 .legend {position:relative; width:100%; height:40px; text-align:center;margin-bottom:20px}\n\
5064 …ion:absolute;cursor:pointer;top:10px; width:0px;height:20px;border:1px solid;padding-left:20px;}\n\
5065 button {height:40px;width:200px;margin-bottom:20px;margin-top:20px;font-size:24px;}\n\
5066 …ion:relative;float:right;height:25px;width:auto;margin-top:3px;margin-bottom:0;font-size:10px;text
5068 a:link {color:white;text-decoration:none;}\n\
5072 ….version {position:relative;float:left;color:white;font-size:10px;line-height:30px;margin-left:10p…
5073 #devicedetail {min-height:100px;box-shadow:5px 5px 20px black;}\n\
5075 .tback {position:absolute;width:100%;background:linear-gradient(#ccc, #ddd);}\n\
5076 .bg {z-index:1;}\n\
5089 tMax = testruns[-1].end * 1000
5099 script_code = r""" var resolution = -1;
5102 var rline = '<div class="t" style="left:0;border-left:1px solid black;border-right:0;">';
5103 var tTotal = tMax - t0;
5113 var divEdge = (mTotal - tS*(divTotal-1))*100/mTotal;
5119 pos = 100 - (((j)*tS*100)/mTotal) - divEdge;
5120 val = (j-divTotal+1)*tS;
5121 if(j == divTotal - 1)
5126 pos = 100 - (((j)*tS*100)/mTotal);
5151 zoombox.scrollLeft = ((left + sh) * newval / val) - sh;
5156 zoombox.scrollLeft = ((left + sh) * newval / val) - sh;
5164 var tTotal = tMax - t0;
5168 if(i >= tS.length) i = tS.length - 1;
5174 var name = title.slice(0, title.indexOf(" ("));
5181 var cpu = -1;
5182 if(name.match("CPU_ON\[[0-9]*\]"))
5183 cpu = parseInt(name.slice(7));
5184 else if(name.match("CPU_OFF\[[0-9]*\]"))
5185 cpu = parseInt(name.slice(8));
5188 var cname = dev[i].className.slice(dev[i].className.indexOf("thread"));
5202 dev[i].className = dev[i].className.slice(dev[i].className.indexOf("thread"));
5225 driver = title.slice(s+1, e) + " <t1>@</t1> ";
5236 var cpu = -1;
5237 if(name.match("CPU_ON\[[0-9]*\]"))
5238 cpu = parseInt(name.slice(7));
5239 else if(name.match("CPU_OFF\[[0-9]*\]"))
5240 cpu = parseInt(name.slice(8));
5265 var pname = info[info.length-1];
5266 var length = parseFloat(info[info.length-3].slice(1));
5294 var time = "<t4 style=\"font-size:"+fs+"px\">"+pd[phases[i].id].toFixed(3)+" ms<br></t4>";
5295 …var pname = "<t3 style=\"font-size:"+fs2+"px\">"+phases[i].id.replace(new RegExp("_", "g"), " ")+"…
5323 var name = tmp[0], phase = tmp[tmp.length-1];
5325 var total = parseFloat(tmp[1].slice(1));
5343 var html = '<div style="padding-top:'+pad+'px"><t3> <b>'+name+':</b>';
5352 html += '<table class=fstat style="padding-top:'+(maxlen*5)+'px;"><tr><th>Function</th>';
5387 " ul {list-style-type:circle;padding-left:10px;margin-left:10px;}"+
5417 var name = e.target.id.slice(4);
5431 zoombox.scrollLeft = dragval[1] + dragval[0] - e.clientX;
5622 return os.readlink(file).split('/')[-1]
5656 '---------------------------------------------------------------------------------------------\n'\
5661 '---------------------------------------------------------------------------------------------\n'\
5663 '---------------------------------------------------------------------------------------------')
5674 dirname = dirname[:-6]
5675 device = dirname.split('/')[-1]
5695 lines[dirname] = '%-26s %-26s %1s %1s %1s %1s %1s %10s %10s' % \
5727 modes.append('mem-%s' % memmode)
5734 modes.append('disk-%s' % m.strip('[]'))
5740 'bios-vendor': 'bios_vendor',
5741 'bios-version': 'bios_version',
5742 'bios-release-date': 'bios_date',
5743 'system-manufacturer': 'sys_vendor',
5744 'system-product-name': 'product_name',
5745 'system-version': 'product_version',
5746 'system-serial-number': 'product_serial',
5747 'baseboard-manufacturer': 'board_vendor',
5748 'baseboard-product-name': 'board_name',
5749 'baseboard-version': 'board_version',
5750 'baseboard-serial-number': 'board_serial',
5751 'chassis-manufacturer': 'chassis_vendor',
5752 'chassis-version': 'chassis_version',
5753 'chassis-serial-number': 'chassis_serial',
5760 if 'processor-version' not in out and os.path.exists(cpath):
5762 for line in fp:
5763 m = re.match(r'^model\s*name\s*\:\s*(?P<c>.*)', line)
5765 out['processor-version'] = m.group('c').strip()
5787 'bios-vendor': (0, 4),
5788 'bios-version': (0, 5),
5789 'bios-release-date': (0, 8),
5790 'system-manufacturer': (1, 4),
5791 'system-product-name': (1, 5),
5792 'system-version': (1, 6),
5793 'system-serial-number': (1, 7),
5794 'baseboard-manufacturer': (2, 4),
5795 'baseboard-product-name': (2, 5),
5796 'baseboard-version': (2, 6),
5797 'baseboard-serial-number': (2, 7),
5798 'chassis-manufacturer': (3, 4),
5799 'chassis-version': (3, 6),
5800 'chassis-serial-number': (3, 7),
5801 'processor-manufacturer': (4, 7),
5802 'processor-version': (4, 16),
5833 if buf[i:i+4] == b'_SM_' and i < memsize - 16:
5856 while(count < num and i <= len(buf) - 4):
5859 while n < len(buf) - 1:
5868 if idx > 0 and idx < len(data) - 1:
5869 s = data[idx-1].decode('utf-8')
5965 recdata = fp.read(rechead[1]-8)
5997 fwData[0] = record[1] - record[0]
6052 pprint(' please choose one with -m')
6062 status = efmt.format('-f')
6064 status = efmt.format('-dev')
6066 status = efmt.format('-proc')
6138 # pull out an integer argument from the command line with checks
6150 doError(name+': non-integer value given', True)
6157 # pull out a float argument from the command line with checks
6169 doError(name+': non-numerical value given', True)
6199 sysvals.vprint(' %-8s : %s' % (key.upper(), sysvals.stamp[key]))
6215 sysvals.vprint('[%s - %s]' % (info[0], info[1]))
6313 num = re.search(r'[-+]?\d*\.\d+|\d+', str)
6332 line = find_in_html(html, '<div class="stamp">', '</div>')
6333 stmp = line.split()
6344 m = re.match(r'[a-z0-9]* failed in (?P<p>\S*).*', error)
6374 line = find_in_html(log, '# wifi ', '\n')
6375 if line:
6376 extra['wifi'] = line
6377 line = find_in_html(log, '# netfix ', '\n')
6378 if line:
6379 extra['netfix'] = line
6380 line = find_in_html(log, '# command ', '\n')
6381 if line:
6382 m = re.match(r'.* -m (?P<m>\S*).*', line)
6394 m = re.match(r'.*waking *(?P<n>[0-9]*) *times.*', low)
6405 'match': issue, 'count': 1, 'line': issue,
6411 for line in html.split('\n'):
6412 m = re.match(r' *<div id=\"[a,0-9]*\" *title=\"(?P<title>.*)\" class=\"thread.*', line)
6413 if not m or 'thread kth' in line or 'thread sec' in line:
6415 m = re.match(r'(?P<n>.*) \((?P<t>[0-9,\.]*) ms\) (?P<p>.*)', m.group('title'))
6422 name = ' '.join(name.split(' ')[:-1])
6464 for arg in ['-multi ', '-info ']:
6490 # create a summary of tests in a sub-directory
6520 pprint(' summary.html - tabular list of test data found')
6521 createHTMLDeviceSummary(testruns, os.path.join(outpath, 'summary-devices.html'), title)
6522 pprint(' summary-devices.html - kernel device list sorted by total execution time')
6523 createHTMLIssuesSummary(testruns, issues, os.path.join(outpath, 'summary-issues.html'), title)
6524 pprint(' summary-issues.html - kernel issues found sorted by frequency')
6534 doError('invalid boolean --> (%s: %s), use "true/false" or "1/0"' % (name, value), True)
6564 elif(option == 'override-timeline-functions'):
6566 elif(option == 'override-dev-timeline-functions'):
6575 sysvals.rs = -1
6579 doError('invalid value --> (%s: %s), use "enable/disable"' % (option, value), True)
6583 doError('invalid value --> (%s: %s), use %s' % (option, value, disopt), True)
6601 doError('invalid phase --> (%s: %s), valid phases are %s'\
6645 elif(option == 'callloop-maxgap'):
6646 sysvals.callloopmaxgap = getArgFloat('callloop-maxgap', value, 0.0, 1.0, False)
6647 elif(option == 'callloop-maxlen'):
6648 sysvals.callloopmaxgap = getArgFloat('callloop-maxlen', value, 0.0, 1.0, False)
6653 elif(option == 'output-dir'):
6661 doError('-dev is not compatible with -f')
6663 doError('-proc is not compatible with -f')
6694 if val[0] == '[' and val[-1] == ']':
6695 for prop in val[1:-1].split(','):
6714 for arg in re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', format):
6752 ' Generates output files in subdirectory: suspend-yymmdd-HHMMSS\n'\
6758 ' -h Print this help text\n'\
6759 ' -v Print the current tool version\n'\
6760 ' -config fn Pull arguments and config options from file fn\n'\
6761 ' -verbose Print extra information during execution and analysis\n'\
6762 ' -m mode Mode to initiate for suspend (default: %s)\n'\
6763 ' -o name Overrides the output subdirectory name when running a new test\n'\
6764 ' default: suspend-{date}-{time}\n'\
6765 ' -rtcwake t Wakeup t seconds after suspend, set t to "off" to disable (default: 15)\n'\
6766 ' -addlogs Add the dmesg and ftrace logs to the html output\n'\
6767 ' -noturbostat Dont use turbostat in freeze mode (default: disabled)\n'\
6768 ' -srgap Add a visible gap in the timeline between sus/res (default: disabled)\n'\
6769 …' -skiphtml Run the test and capture the trace logs, but skip the timeline (default: disabled…
6770 ' -result fn Export a results table to a text file for parsing.\n'\
6771 ' -wifi If a wifi connection is available, check that it reconnects after resume.\n'\
6772 ' -wifitrace Trace kernel execution through wifi reconnect.\n'\
6773 ' -netfix Use netfix to reset the network in the event it fails to resume.\n'\
6774 ' -debugtiming Add timestamp to each printed line\n'\
6776 ' -sync Sync the filesystems before starting the test\n'\
6777 ' -rs on/off Enable/disable runtime suspend for all devices, restore all after test\n'\
6778 ' -display m Change the display mode to m for the test (on/off/standby/suspend)\n'\
6780 ' -gzip Gzip the trace and dmesg logs to save space\n'\
6781 ' -cmd {s} Run the timeline over a custom command, e.g. "sync -d"\n'\
6782 ' -proc Add usermode process info into the timeline (default: disabled)\n'\
6783 ' -dev Add kernel function calls and threads to the timeline (default: disabled)\n'\
6784 ' -x2 Run two suspend/resumes back to back (default: disabled)\n'\
6785 ' -x2delay t Include t ms delay between multiple test runs (default: 0 ms)\n'\
6786 ' -predelay t Include t ms delay before 1st suspend (default: 0 ms)\n'\
6787 ' -postdelay t Include t ms delay after last resume (default: 0 ms)\n'\
6788 ' -mindev ms Discard all device blocks shorter than ms milliseconds (e.g. 0.001 for us)\n'\
6789 ' -multi n d Execute <n> consecutive tests at <d> seconds intervals. If <n> is followed\n'\
6792 ' -maxfail n Abort a -multi run after n consecutive fails (default is 0 = never abort)\n'\
6794 ' -f Use ftrace to create device callgraphs (default: disabled)\n'\
6795 ' -ftop Use ftrace on the top level call: "%s" (default: disabled)\n'\
6796 ' -maxdepth N limit the callgraph data to N call levels (default: 0=all)\n'\
6797 ' -expandcg pre-expand the callgraph data in the html output (default: disabled)\n'\
6798 ' -fadd file Add functions to be graphed in the timeline from a list in a text file\n'\
6799 ' -filter "d1,d2,..." Filter out all but this comma-delimited list of device names\n'\
6800 ' -mincg ms Discard all callgraphs shorter than ms milliseconds (e.g. 0.001 for us)\n'\
6801 ' -cgphase P Only show callgraph data for phase P (e.g. suspend_late)\n'\
6802 ' -cgtest N Only show callgraph data for test N (e.g. 0 or 1 in an x2 run)\n'\
6803 ' -timeprec N Number of significant digits in timestamps (0:S, [3:ms], 6:us)\n'\
6804 ' -cgfilter S Filter the callgraph output in the timeline\n'\
6805 ' -cgskip file Callgraph functions to skip, off to disable (default: cgskip.txt)\n'\
6806 ' -bufsize N Set trace buffer size to N kilo-bytes (default: all of free memory)\n'\
6807 ' -devdump Print out all the raw device data for each phase\n'\
6808 ' -cgdump Print out all the raw callgraph data\n'\
6811 ' -modes List available suspend modes\n'\
6812 ' -status Test to see if the system is enabled to run this tool\n'\
6813 ' -fpdt Print out the contents of the ACPI Firmware Performance Data Table\n'\
6814 ' -wificheck Print out wifi connection info\n'\
6815 ' -x<mode> Test xset by toggling the given mode (on/off/standby/suspend)\n'\
6816 ' -sysinfo Print out system info extracted from BIOS\n'\
6817 ' -devinfo Print out the pm settings of all devices which support runtime suspend\n'\
6818 ' -cmdinfo Print out all the platform info collected before and after suspend/resume\n'\
6819 ' -flist Print the list of functions currently being captured in ftrace\n'\
6820 ' -flistall Print all functions capable of being captured in ftrace\n'\
6821 ' -summary dir Create a summary of tests in this dir [-genhtml builds missing html]\n'\
6823 ' -ftrace ftracefile Create HTML output using ftrace input (used with -dmesg)\n'\
6824 ' -dmesg dmesgfile Create HTML output using dmesg (used with -ftrace)\n'\
6828 # ----------------- MAIN --------------------
6833 simplecmds = ['-sysinfo', '-modes', '-fpdt', '-flist', '-flistall',
6834 '-devinfo', '-status', '-xon', '-xoff', '-xstandby', '-xsuspend',
6835 '-xinit', '-xreset', '-xstat', '-wificheck', '-cmdinfo']
6836 if '-f' in sys.argv:
6838 # loop through the command line arguments
6841 if(arg == '-m'):
6851 elif(arg == '-h'):
6854 elif(arg == '-v'):
6857 elif(arg == '-debugtiming'):
6859 elif(arg == '-x2'):
6861 elif(arg == '-x2delay'):
6862 sysvals.x2delay = getArgInt('-x2delay', args, 0, 60000)
6863 elif(arg == '-predelay'):
6864 sysvals.predelay = getArgInt('-predelay', args, 0, 60000)
6865 elif(arg == '-postdelay'):
6866 sysvals.postdelay = getArgInt('-postdelay', args, 0, 60000)
6867 elif(arg == '-f'):
6869 elif(arg == '-ftop'):
6873 elif(arg == '-skiphtml'):
6875 elif(arg == '-cgdump'):
6877 elif(arg == '-devdump'):
6879 elif(arg == '-genhtml'):
6881 elif(arg == '-addlogs'):
6883 elif(arg == '-nologs'):
6885 elif(arg == '-addlogdmesg'):
6887 elif(arg == '-addlogftrace'):
6889 elif(arg == '-noturbostat'):
6891 elif(arg == '-verbose'):
6893 elif(arg == '-proc'):
6895 elif(arg == '-dev'):
6897 elif(arg == '-sync'):
6899 elif(arg == '-wifi'):
6901 elif(arg == '-wifitrace'):
6903 elif(arg == '-netfix'):
6905 elif(arg == '-gzip'):
6907 elif(arg == '-info'):
6911 doError('-info requires one string argument', True)
6912 elif(arg == '-desc'):
6916 doError('-desc requires one string argument', True)
6917 elif(arg == '-rs'):
6921 doError('-rs requires "enable" or "disable"', True)
6924 sysvals.rs = -1
6929 elif(arg == '-display'):
6933 doError('-display requires an mode value', True)
6938 elif(arg == '-maxdepth'):
6939 sysvals.max_graph_depth = getArgInt('-maxdepth', args, 0, 1000)
6940 elif(arg == '-rtcwake'):
6949 sysvals.rtcwaketime = getArgInt('-rtcwake', val, 0, 3600, False)
6950 elif(arg == '-timeprec'):
6951 sysvals.setPrecision(getArgInt('-timeprec', args, 0, 6))
6952 elif(arg == '-mindev'):
6953 sysvals.mindevlen = getArgFloat('-mindev', args, 0.0, 10000.0)
6954 elif(arg == '-mincg'):
6955 sysvals.mincglen = getArgFloat('-mincg', args, 0.0, 10000.0)
6956 elif(arg == '-bufsize'):
6957 sysvals.bufsize = getArgInt('-bufsize', args, 1, 1024*1024*8)
6958 elif(arg == '-cgtest'):
6959 sysvals.cgtest = getArgInt('-cgtest', args, 0, 1)
6960 elif(arg == '-cgphase'):
6967 doError('invalid phase --> (%s: %s), valid phases are %s'\
6970 elif(arg == '-cgfilter'):
6976 elif(arg == '-skipkprobe'):
6982 elif(arg == '-cgskip'):
6993 elif(arg == '-callloop-maxgap'):
6994 sysvals.callloopmaxgap = getArgFloat('-callloop-maxgap', args, 0.0, 1.0)
6995 elif(arg == '-callloop-maxlen'):
6996 sysvals.callloopmaxlen = getArgFloat('-callloop-maxlen', args, 0.0, 1.0)
6997 elif(arg == '-cmd'):
7004 elif(arg == '-expandcg'):
7006 elif(arg == '-srgap'):
7008 elif(arg == '-maxfail'):
7009 sysvals.maxfail = getArgInt('-maxfail', args, 0, 1000000)
7010 elif(arg == '-multi'):
7014 doError('-multi requires two values', True)
7016 elif(arg == '-o'):
7022 elif(arg == '-config'):
7031 elif(arg == '-fadd'):
7040 elif(arg == '-dmesg'):
7049 elif(arg == '-ftrace'):
7058 elif(arg == '-summary'):
7068 elif(arg == '-filter'):
7074 elif(arg == '-result'):
7085 doError('-dev is not compatible with -f')
7087 doError('-proc is not compatible with -f')
7137 print('[%s - %s]\n%s\n' % out)
7140 # if instructed, re-analyze existing data files
7154 memmode = mode.split('-', 1)[-1] if '-' in mode else 'deep'
7163 if mode.startswith('disk-'):
7164 sysvals.diskmode = mode.split('-', 1)[-1]
7173 s = '-%dm' % sysvals.multitest['time']
7175 s = '-x%d' % sysvals.multitest['count']
7176 sysvals.outdir = datetime.now().strftime('suspend-%y%m%d-%H%M%S'+s)
7188 fmt = 'suspend-%y%m%d-%H%M%S'