Lines Matching +full:event +full:- +full:touch +full:- +full:alt
22 # git@github.com:01org/pm-graph
49 # ----------------- LIBRARIES --------------------
64 # ----------------- CLASSES --------------------
68 # A global, single-instance container used to
85 cgtest = -1
144 procexecfmt = 'ps - (?P<ps>.*)$'
147 firmwarefmt = '# fwsuspend (?P<s>[0-9]*) fwresume (?P<r>[0-9]*)$'
258 self.testdir = datetime.now().strftime('suspend-%y%m%d-%H%M%S')
311 if 'baseboard-manufacturer' in info:
312 m = info['baseboard-manufacturer']
313 elif 'system-manufacturer' in info:
314 m = info['system-manufacturer']
315 if 'baseboard-product-name' in info:
316 p = info['baseboard-product-name']
317 elif 'system-product-name' in info:
318 p = info['system-product-name']
319 if 'processor-version' in info:
320 c = info['processor-version']
321 if 'bios-version' in info:
322 b = info['bios-version']
330 fmt = '%-24s: %s'
340 if re.match('^processor[ \t]*:[ \t]*[0-9]*', line):
345 m = re.match('^MemTotal:[ \t]*(?P<sz>[0-9]*) *kB', line)
348 m = re.match('^MemFree:[ \t]*(?P<sz>[0-9]*) *kB', line)
356 fmt = name+'-%m%d%y-%H%M%S'
404 m = re.match('[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
418 m = re.match('[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
524 if re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', func):
526 for arg in re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', fmt):
541 # sort kprobes: trace, ub-dev, custom, dev
573 linesack = (len(check.split('\n')) - 1) / 2
657 tgtsize -= 65536
668 self.fsetVal('print-parent', 'trace_options')
669 self.fsetVal('funcgraph-abstime', 'trace_options')
670 self.fsetVal('funcgraph-cpu', 'trace_options')
671 self.fsetVal('funcgraph-duration', 'trace_options')
672 self.fsetVal('funcgraph-proc', 'trace_options')
673 self.fsetVal('funcgraph-tail', 'trace_options')
674 self.fsetVal('nofuncgraph-overhead', 'trace_options')
675 self.fsetVal('context-info', 'trace_options')
676 self.fsetVal('graph-time', 'trace_options')
742 cmd = 'chown -R {0}:{0} {1} > /dev/null 2>&1'
848 # 10 sequential, non-overlapping phases of S/R
868 tSuspended = 0.0 # low-level suspend start
869 tResumed = 0.0 # low-level resume start
872 tLow = 0.0 # time spent in low-level suspend (standby/freeze)
893 'suspend_prepare': {'list': dict(), 'start': -1.0, 'end': -1.0,
895 'suspend': {'list': dict(), 'start': -1.0, 'end': -1.0,
897 'suspend_late': {'list': dict(), 'start': -1.0, 'end': -1.0,
899 'suspend_noirq': {'list': dict(), 'start': -1.0, 'end': -1.0,
901 'suspend_machine': {'list': dict(), 'start': -1.0, 'end': -1.0,
903 'resume_machine': {'list': dict(), 'start': -1.0, 'end': -1.0,
905 'resume_noirq': {'list': dict(), 'start': -1.0, 'end': -1.0,
907 'resume_early': {'list': dict(), 'start': -1.0, 'end': -1.0,
909 'resume': {'list': dict(), 'start': -1.0, 'end': -1.0,
911 'resume_complete': {'list': dict(), 'start': -1.0, 'end': -1.0,
934 m = re.match('[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
993 # device target event is entirely inside the source boundary
997 # thread target event will expand the source boundary
1018 threadname = 'kthread-%d' % (pid)
1020 threadname = '%s-%d' % (proc, pid)
1026 sysvals.vprint('[%f - %f] %s-%d %s %s %s' % \
1072 o = min(dev['end'], tdev['end']) - max(dev['start'], tdev['start'])
1086 if tdev['start'] - dev['end'] < 0.1:
1095 # merge any threads between tests that touch
1113 for e in sorted(src, key=lambda event: event.time):
1119 p.length = p.end - p.time
1125 if(t - dT < t0):
1127 return t - dT
1174 self.tResumed-self.tSuspended, True)
1177 self.tResumed-self.tSuspended, False)
1179 sktime = (self.dmesg['suspend_machine']['end'] - \
1181 rktime = (self.dmesg['resume_complete']['end'] - \
1249 def newActionGlobal(self, name, start, end, pid=-1, color=''):
1259 o = max(0, min(end, pend) - max(start, pstart))
1274 targetphase = self.phases[-1]
1275 if pid == -2:
1277 elif pid == -3:
1291 length = -1.0
1293 length = end - start
1294 if pid == -2:
1320 sysvals.vprint(' %16s: %f - %f (%d devices)' % (phase, \
1354 info += ('<li>%s: %.3fms</li>' % (phase, (e-s)*1000))
1373 # list of top-most root devices
1380 if(pid < 0 or re.match('[0-9]*-[0-9]*\.[0-9]*[\.0-9]*\:[\.0-9]*$', pdev)):
1396 length = (list[dev]['end'] - list[dev]['start']) * 1000
1397 width = widfmt % (((list[dev]['end']-list[dev]['start'])*100)/tTotal)
1403 self.newAction(phase, devname, -2, '', \
1414 start = -1
1415 end = -1
1421 if start == -1 or tlast < start:
1423 if end == -1 or t > end:
1426 if start == -1 or end == -1:
1429 out = self.newActionGlobal(name, start, end, -3)
1501 self.length = end - start
1513 title = '%s(%s)%s <- %s, %s(%s)' % \
1526 dt = self.time - tgt.end
1527 # only combine calls if -all- attributes are identical
1544 # trace event:
1562 # is this a trace event
1565 # nop format trace event
1568 # function_graph format trace event
1613 if(m[-1] == '{'):
1618 elif(m[-1] == ';'):
1636 print(' -- %12.6f (depth=%02d): %s(); (%.3f us) %s' % (self.time, \
1639 print(' -- %12.6f (depth=%02d): %s} (%.3f us) %s' % (self.time, \
1642 print(' -- %12.6f (depth=%02d): %s() { (%.3f us) %s' % (self.time, \
1679 start = -1.0
1680 end = -1.0
1691 self.start = -1.0
1692 self.end = -1.0
1712 self.list[-1].freturn = True
1713 self.list[-1].length = line.time - self.list[-1].time
1721 # compare current depth with this lines pre-call depth
1728 last = self.list[-1]
1733 mismatch = prelinedep - self.depth
1740 self.depth -= 1
1745 last.length = line.time - last.time
1771 prelinedep -= 1
1799 if (md and self.depth >= md - 1) or (line.name in self.sv.cgblacklist):
1804 self.depth -= 1
1809 while len(self.list) > 0 and self.list[-1].depth > line.depth:
1810 self.list.pop(-1)
1814 self.list[-1].freturn = True
1815 self.list[-1].length = line.time - self.list[-1].time
1816 self.list[-1].name = line.name
1822 if mismatch < 0 and self.list[-1].depth == 0 and self.list[-1].freturn:
1823 line = self.list[-1]
1825 res = -1
1836 if res == -1:
1847 window = '(%f - %f)' % (self.start, line.time)
1857 mydepth = -1
1869 l.depth -= mydepth
1877 last = self.list[-1]
1897 if last.length > l.time - last.time:
1898 last.length = l.time - last.time
1910 cl.length = l.time - cl.time
1915 cnt -= 1
1976 out = data.newActionGlobal(name, fs, fe, -2)
1981 print('%s pid=%d [%f - %f] %.3f us') % \
1983 (self.end - self.start)*1000000)
2058 item.row = -1
2084 remaining -= 1
2101 # initialize all device rows to -1 and calculate devrows
2107 dev['row'] = -1
2110 sortdict[item] = (-1*float(dev['start']), float(dev['end']) - float(dev['start']))
2113 sortdict[item] = (float(dev['end']) - float(dev['start']), item.dev['name'])
2120 if item.dev['pid'] == -2:
2146 remaining -= 1
2191 self.bodyH = self.height - self.scaleH
2198 …html_zoombox = '<center><button id="zoomin">ZOOM IN +</button><button id="zoomout">ZOOM OUT -</but…
2222 rline = '<div class="t" style="left:0;border-left:1px solid black;border-right:0;">{0}</div>\n'
2225 mTotal = mMax - m0
2232 divEdge = (mTotal - tS*(divTotal-1))*100/mTotal
2236 pos = '%0.3f' % (100 - ((float(i)*tS*100)/mTotal) - divEdge)
2237 val = '%0.fms' % (float(i-divTotal+1)*tS*1000)
2238 if(i == divTotal - 1):
2242 pos = '%0.3f' % (100 - ((float(i)*tS*100)/mTotal))
2260 stampfmt = '# [a-z]*-(?P<m>[0-9]{2})(?P<d>[0-9]{2})(?P<y>[0-9]{2})-'+\
2261 '(?P<H>[0-9]{2})(?P<M>[0-9]{2})(?P<S>[0-9]{2})'+\
2267 '^ *(?P<time>[0-9\.]*) *\| *(?P<cpu>[0-9]*)\)'+\
2268 ' *(?P<proc>.*)-(?P<pid>[0-9]*) *\|'+\
2269 '[ +!#\*@$]*(?P<dur>[0-9\.]*) .*\| (?P<msg>.*)'
2271 ' *(?P<proc>.*)-(?P<pid>[0-9]*) *\[(?P<cpu>[0-9]*)\] *'+\
2272 '(?P<flags>.{4}) *(?P<time>[0-9\.]*): *'+\
2345 c = ['cat /proc/[1-9]*/stat 2>/dev/null']
2359 ujiff = user - val['user']
2360 kjiff = kern - val['kern']
2372 out += '%s-%s %d' % (val['name'], pid, jiffies)
2373 return 'ps - '+out
2386 # ----------------- FUNCTIONS --------------------
2489 # the line should be a call, return, or event
2507 # trace event processing
2516 m = re.match('(?P<name>.*)\[(?P<val>[0-9]*)\] .*', t.name)
2581 # store each trace event in ttemp
2587 # finish off matching trace event in ttemp
2589 testrun[testidx].ttemp[name][-1]['end'] = t.time
2597 cg = testrun[testidx].ftemp[pid][-1]
2601 if(res == -1):
2602 testrun[testidx].ftemp[pid][-1].addLine(t)
2609 for event in test.ttemp[name]:
2610 test.data.newActionGlobal(name, event['begin'], event['end'])
2615 if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
2712 # the line should be a call, return, or event
2737 name = val[0].replace('--', '-')
2755 # the event we used to trigger resume end
2758 testrun.ttemp['thaw_processes'][-1]['end'] = t.time
2761 # trace event processing
2773 m = re.match('(?P<name>.*)\[(?P<val>[0-9]*)\] .*', t.name)
2786 # -- phase changes --
2834 data.tLow = data.tResumed - data.tSuspended
2883 testrun.ttemp[name][-1]['end'] = t.time
2899 data.newAction(phase, n, pid, p, t.time, -1, drv)
2911 dev['length'] = t.time - dev['start']
2913 # kprobe event processing
2937 e = tp.ktemp[key][-1]
2938 if e['begin'] < 0.0 or t.time - e['begin'] < 0.000001:
2957 cg = testrun.ftemp[key][-1]
2961 if(res == -1):
2962 testrun.ftemp[key][-1].addLine(t)
2988 if i < len(testruns) - 1:
2997 for event in test.ttemp[name]:
2998 data.newActionGlobal(name, event['begin'], event['end'], event['pid'])
3028 if len(cg.list) < 1 or cg.invalid or (cg.end - cg.start == 0):
3050 …sysvals.vprint('Callgraph found for task %d: %.3fms, %s' % (cg.pid, (cg.end - cg.start)*1000, name…
3089 for i in range(tc - 1):
3111 tp.stamp = datetime.now().strftime('# suspend-%m%d%y-%H%M%S localhost mem unknown')
3134 m = re.match('[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
3149 m = re.match('.* *(?P<k>[0-9]\.[0-9]{2}\.[0-9]-.*) .*', msg)
3168 mc = re.match('.*(\[ *)(?P<t>[0-9\.]*)(\]) calling '+\
3170 mr = re.match('.*(\[ *)(?P<t>[0-9\.]*)(\]) call '+\
3203 'suspend': 'PM: Entering [a-z]* sleep.*',
3207 'resume_machine': 'ACPI: Low-level resume complete.*',
3237 'emsg': 'PM: Entering (?P<mode>[a-z,A-Z]*) sleep.*' },
3243 'emsg': 'Disabling non-boot CPUs .*' },
3246 t0 = -1.0
3247 cpu_start = -1.0
3248 prevktime = -1.0
3252 m = re.match('[ \t]*(\[ *)(?P<ktime>[0-9\.]*)(\]) (?P<msg>.*)', line)
3311 data.tLow = data.tResumed - data.tSuspended
3340 # -- device callbacks --
3350 data.newAction(phase, f, int(n), p, ktime, -1, '')
3374 actions[a][-1]['end'] = ktime
3376 if(re.match('Disabling non-boot CPUs .*', msg)):
3379 elif(re.match('Enabling non-boot CPUs .*', msg)):
3382 elif(re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)):
3384 m = re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)
3390 elif(re.match('CPU(?P<cpu>[0-9]*) is up', msg)):
3392 m = re.match('CPU(?P<cpu>[0-9]*) is up', msg)
3420 for event in actions[name]:
3421 data.newActionGlobal(name, event['begin'], event['end'])
3437 cglen = (cg.end - cg.start) * 1000
3501 <meta http-equiv="content-type" content="text/html; charset=UTF-8">\n\
3504 ….stamp {width: 100%;text-align:center;background:#888;line-height:30px;color:white;font: 25px Aria…
3505 table {width:100%;border-collapse: collapse;}\n\
3508 td {font: 16px "Times New Roman";text-align: center;}\n\
3510 tr.alt {background-color:#ddd;}\n\
3512 .minval {background-color:#BBFFBB;}\n\
3513 .medval {background-color:#BBBBFF;}\n\
3514 .maxval {background-color:#FFBBBB;}\n\
3515 .head a {color:#000;text-decoration: none;}\n\
3545 idx = len(list[mode]['data']) - 1
3616 iMin = iMed = iMax = [-1, -1, -1]
3619 # row classes - alternate row color
3620 rcls = ['alt'] if num % 2 == 1 else []
3680 data.normalizeTime(testruns[-1].tSuspended)
3684 …lass="traceevent{6}" style="left:{1}%;top:{2}px;height:{3}px;width:{4}%;line-height:{3}px;{7}">{5}…
3692 …'<td class="gray" title="time spent in low-power mode with clock running">'+sysvals.suspendmode+' …
3720 tTotal = data.end - data.start
3727 run_time = '%.0f'%((data.end-data.start)*1000)
3741 …stitle = 'time from kernel enter_state(%s) to low-power mode [kernel & firmware time]' % sysvals.s…
3742 …rtitle = 'time from low-power mode to return from kernel enter_state(%s) [firmware & kernel time]'…
3778 tMax = testruns[-1].end
3779 tTotal = tMax - t0
3812 d = testruns[0].addHorizontalDivider(msg, testruns[-1].end)
3816 d = testruns[0].addHorizontalDivider('asynchronous kernel threads', testruns[-1].end)
3839 left = '%f' % (((m0-t0)*100.0)/tTotal)
3846 left = '%f' % ((((m0-t0)*100.0)+sysvals.srgap/2)/tTotal)
3847 mTotal = mMax - m0
3851 width = '%f' % (((mTotal*100.0)-sysvals.srgap/2)/tTotal)
3856 length = phase['end']-phase['start']
3857 left = '%f' % (((phase['start']-m0)*100.0)/mTotal)
3866 right = '%f' % (((mMax-t)*100.0)/mTotal)
3893 left = '%f' % (((dev['start']-m0)*100)/mTotal)
3894 width = '%f' % (((dev['end']-dev['start'])*100)/mTotal)
3895 length = ' (%0.3f ms) ' % ((dev['end']-dev['start'])*1000)
3917 left = '%f' % (((start-m0)*100)/mTotal)
3918 width = '%f' % ((end-start)*100/mTotal)
3928 left = '%f' % (((e.time-m0)*100)/mTotal)
3945 data = testruns[-1]
3970 pscolor = 'linear-gradient(to top left, #ccc, #eee)'
3975 length = phase['end']-phase['start']
3976 left = '%.3f' % (((phase['start']-t0)*100.0)/tTotal)
3991 data = testruns[-1]
4037 hoverZ = 'z-index:8;'
4051 <meta http-equiv="content-type" content="text/html; charset=UTF-8">\n\
4054 body {overflow-y:scroll;}\n\
4055 ….stamp {width:100%;text-align:center;background:gray;line-height:30px;color:white;font:25px Arial;…
4057 .callgraph {margin-top:30px;box-shadow:5px 5px 20px black;}\n\
4058 .callgraph article * {padding-left:28px;}\n\
4063 t3 {color:black;font:20px Times;white-space:nowrap;}\n\
4064 t4 {color:black;font:bold 30px Times;line-height:60px;white-space:nowrap;}\n\
4073 .time2 {font:15px Arial;border-bottom:1px solid;border-left:1px solid;border-right:1px solid;}\n\
4075 td {text-align:center;}\n\
4081 …-width="1" fill="white"/><rect x="4" y="8" width="10" height="2" style="fill:black;stroke-width:0"…
4082 …troke="black" stroke-width="1" fill="white"/><rect x="4" y="8" width="10" height="2" style="fill:b…
4083 .pf:'+cgchk+' ~ *:not(:nth-child(2)) {display:none;}\n\
4084 …oombox {position:relative;width:100%;overflow-x:scroll;-webkit-user-select:none;-moz-user-select:n…
4085 ….timeline {position:relative;font-size:14px;cursor:pointer;width:100%; overflow:hidden;background:…
4086 …bsolute;height:0%;overflow:hidden;z-index:7;line-height:30px;font-size:14px;border:1px solid;text-…
4087 .thread.ps {border-radius:3px;background:linear-gradient(to top, #ccc, #eee);}\n\
4089 ….thread.sec,.thread.sec:hover {background:black;border:0;color:white;line-height:15px;font-size:10…
4093 .jiffie {position:absolute;pointer-events: none;z-index:8;}\n\
4094 …font-size:10px;z-index:7;overflow:hidden;color:black;text-align:center;white-space:nowrap;border-r…
4095 .traceevent:hover {color:white;font-weight:bold;border:1px solid white;}\n\
4096 .phase {position:absolute;overflow:hidden;border:0px;text-align:center;}\n\
4097 ….phaselet {float:left;overflow:hidden;border:0px;text-align:center;min-height:100px;font-size:24px…
4098 ….t {position:absolute;line-height:'+('%d'%scaleTH)+'px;pointer-events:none;top:0;height:100%;borde…
4099 …err {position:absolute;top:0%;height:100%;border-right:3px solid red;color:red;font:bold 14px Time…
4100 .legend {position:relative; width:100%; height:40px; text-align:center;margin-bottom:20px}\n\
4101 …ion:absolute;cursor:pointer;top:10px; width:0px;height:20px;border:1px solid;padding-left:20px;}\n\
4102 button {height:40px;width:200px;margin-bottom:20px;margin-top:20px;font-size:24px;}\n\
4103 …ion:relative;float:right;height:25px;width:auto;margin-top:3px;margin-bottom:0;font-size:10px;text…
4105 a:link {color:white;text-decoration:none;}\n\
4109 ….version {position:relative;float:left;color:white;font-size:10px;line-height:30px;margin-left:10p…
4110 #devicedetail {min-height:100px;box-shadow:5px 5px 20px black;}\n\
4112 .tback {position:absolute;width:100%;background:linear-gradient(#ccc, #ddd);}\n\
4113 .bg {z-index:1;}\n\
4126 tMax = testruns[-1].end * 1000
4136 ' var resolution = -1;\n'\
4139 ' var rline = \'<div class="t" style="left:0;border-left:1px solid black;border-right:0;">\';\n'\
4140 ' var tTotal = tMax - t0;\n'\
4150 ' var divEdge = (mTotal - tS*(divTotal-1))*100/mTotal;\n'\
4156 ' pos = 100 - (((j)*tS*100)/mTotal) - divEdge;\n'\
4157 ' val = (j-divTotal+1)*tS;\n'\
4158 ' if(j == divTotal - 1)\n'\
4163 ' pos = 100 - (((j)*tS*100)/mTotal);\n'\
4188 ' zoombox.scrollLeft = ((left + sh) * newval / val) - sh;\n'\
4193 ' zoombox.scrollLeft = ((left + sh) * newval / val) - sh;\n'\
4201 ' var tTotal = tMax - t0;\n'\
4205 ' if(i >= tS.length) i = tS.length - 1;\n'\
4218 ' var cpu = -1;\n'\
4219 ' if(name.match("CPU_ON\[[0-9]*\]"))\n'\
4221 ' else if(name.match("CPU_OFF\[[0-9]*\]"))\n'\
4273 ' var cpu = -1;\n'\
4274 ' if(name.match("CPU_ON\[[0-9]*\]"))\n'\
4276 ' else if(name.match("CPU_OFF\[[0-9]*\]"))\n'\
4302 ' var pname = info[info.length-1];\n'\
4303 ' pd[pname] = parseFloat(info[info.length-3].slice(1));\n'\
4327 ' var time = "<t4 style=\\"font-size:"+fs+"px\\">"+pd[phases[i].id]+" ms<br></t4>";\n'\
4328 …' var pname = "<t3 style=\\"font-size:"+fs2+"px\\">"+phases[i].id.replace(new RegExp("_", "g")…
4356 ' var name = tmp[0], phase = tmp[tmp.length-1];\n'\
4376 ' var html = \'<div style="padding-top:\'+pad+\'px"><t3> <b>\'+name+\':</b>\';\n'\
4385 …' html += \'<table class=fstat style="padding-top:\'+(maxlen*5)+\'px;"><tr><th>Function</th>\';\…
4420 ' " ul {list-style-type:circle;padding-left:10px;margin-left:10px;}"+\n'\
4464 ' zoombox.scrollLeft = dragval[1] + dragval[0] - e.clientX;\n'\
4533 # runtime suspend re-enable or re-disable
4550 call('xset -d :0.0 dpms force suspend', shell=True)
4551 call('xset -d :0.0 dpms force on', shell=True)
4554 call('xset -d :0.0 dpms force suspend', shell=True)
4643 return os.readlink(file).split('/')[-1]
4677 …print('-------------------------------------------------------------------------------------------…
4682 …print('-------------------------------------------------------------------------------------------…
4684 …print('-------------------------------------------------------------------------------------------…
4695 dirname = dirname[:-6]
4696 device = dirname.split('/')[-1]
4716 lines[dirname] = '%-26s %-26s %1s %1s %1s %1s %1s %10s %10s' % \
4796 dev = dirname.split('/')[-2]
4798 props[dev].syspath = dirname[:-6]
4869 modes.append('mem-%s' % memmode)
4888 'bios-vendor': (0, 4),
4889 'bios-version': (0, 5),
4890 'bios-release-date': (0, 8),
4891 'system-manufacturer': (1, 4),
4892 'system-product-name': (1, 5),
4893 'system-version': (1, 6),
4894 'system-serial-number': (1, 7),
4895 'baseboard-manufacturer': (2, 4),
4896 'baseboard-product-name': (2, 5),
4897 'baseboard-version': (2, 6),
4898 'baseboard-serial-number': (2, 7),
4899 'chassis-manufacturer': (3, 4),
4900 'chassis-type': (3, 5),
4901 'chassis-version': (3, 6),
4902 'chassis-serial-number': (3, 7),
4903 'processor-manufacturer': (4, 7),
4904 'processor-version': (4, 16),
4947 if buf[i:i+4] == '_SM_' and i < memsize - 16:
4976 while(count < num and i <= len(buf) - 4):
4979 while n < len(buf) - 1:
4988 if idx > 0 and idx < len(data) - 1:
4989 s = data[idx-1].strip()
4991 out[name] = data[idx-1]
5098 recdata = fp.read(rechead[1]-8)
5129 fwData[0] = record[1] - record[0]
5184 print(' please choose one with -m')
5264 doError(name+': non-integer value given', True)
5283 doError(name+': non-numerical value given', True)
5373 num = re.search(r'[-+]?\d*\.\d+|\d+', str)
5385 # create a summary of tests in a sub-directory
5428 e = find_in_html(html, 'class="err"[\w=":;\.%\- ]*>', '→</div>', False)
5455 doError('invalid boolean --> (%s: %s), use "true/false" or "1/0"' % (name, value), True)
5485 elif(option == 'override-timeline-functions'):
5487 elif(option == 'override-dev-timeline-functions'):
5496 sysvals.rs = -1
5500 doError('invalid value --> (%s: %s), use "enable/disable"' % (option, value), True)
5504 sysvals.display = -1
5508 doError('invalid value --> (%s: %s), use "on/off"' % (option, value), True)
5525 doError('invalid phase --> (%s: %s), valid phases are %s'\
5571 elif(option == 'callloop-maxgap'):
5572 sysvals.callloopmaxgap = getArgFloat('callloop-maxgap', value, 0.0, 1.0, False)
5573 elif(option == 'callloop-maxlen'):
5574 sysvals.callloopmaxgap = getArgFloat('callloop-maxlen', value, 0.0, 1.0, False)
5579 elif(option == 'output-dir'):
5587 doError('-dev is not compatible with -f')
5589 doError('-proc is not compatible with -f')
5620 if val[0] == '[' and val[-1] == ']':
5621 for prop in val[1:-1].split(','):
5640 for arg in re.findall('{(?P<n>[a-z,A-Z,0-9]*)}', format):
5679 print(' Generates output files in subdirectory: suspend-yymmdd-HHMMSS')
5685 print(' -h Print this help text')
5686 print(' -v Print the current tool version')
5687 print(' -config fn Pull arguments and config options from file fn')
5688 print(' -verbose Print extra information during execution and analysis')
5689 print(' -m mode Mode to initiate for suspend (default: %s)') % (sysvals.suspendmode)
5690 print(' -o name Overrides the output subdirectory name when running a new test')
5691 print(' default: suspend-{date}-{time}')
5692 print(' -rtcwake t Wakeup t seconds after suspend, set t to "off" to disable (default: 15)')
5693 print(' -addlogs Add the dmesg and ftrace logs to the html output')
5694 print(' -srgap Add a visible gap in the timeline between sus/res (default: disabled)')
5695 …print(' -skiphtml Run the test and capture the trace logs, but skip the timeline (default: di…
5696 print(' -result fn Export a results table to a text file for parsing.')
5698 print(' -sync Sync the filesystems before starting the test')
5699 print(' -rs on/off Enable/disable runtime suspend for all devices, restore all after test')
5700 print(' -display on/off Turn the display on or off for the test')
5702 print(' -gzip Gzip the trace and dmesg logs to save space')
5703 print(' -cmd {s} Run the timeline over a custom command, e.g. "sync -d"')
5704 print(' -proc Add usermode process info into the timeline (default: disabled)')
5705 print(' -dev Add kernel function calls and threads to the timeline (default: disabled)')
5706 print(' -x2 Run two suspend/resumes back to back (default: disabled)')
5707 print(' -x2delay t Include t ms delay between multiple test runs (default: 0 ms)')
5708 print(' -predelay t Include t ms delay before 1st suspend (default: 0 ms)')
5709 print(' -postdelay t Include t ms delay after last resume (default: 0 ms)')
5710 print(' -mindev ms Discard all device blocks shorter than ms milliseconds (e.g. 0.001 for us)')
5711 print(' -multi n d Execute <n> consecutive tests at <d> seconds intervals. The outputs will')
5714 print(' -f Use ftrace to create device callgraphs (default: disabled)')
5715 print(' -maxdepth N limit the callgraph data to N call levels (default: 0=all)')
5716 print(' -expandcg pre-expand the callgraph data in the html output (default: disabled)')
5717 print(' -fadd file Add functions to be graphed in the timeline from a list in a text file')
5718 print(' -filter "d1,d2,..." Filter out all but this comma-delimited list of device names')
5719 print(' -mincg ms Discard all callgraphs shorter than ms milliseconds (e.g. 0.001 for us)')
5720 print(' -cgphase P Only show callgraph data for phase P (e.g. suspend_late)')
5721 print(' -cgtest N Only show callgraph data for test N (e.g. 0 or 1 in an x2 run)')
5722 print(' -timeprec N Number of significant digits in timestamps (0:S, [3:ms], 6:us)')
5723 print(' -cgfilter S Filter the callgraph output in the timeline')
5724 print(' -cgskip file Callgraph functions to skip, off to disable (default: cgskip.txt)')
5725 print(' -bufsize N Set trace buffer size to N kilo-bytes (default: all of free memory)')
5728 print(' -modes List available suspend modes')
5729 print(' -status Test to see if the system is enabled to run this tool')
5730 print(' -fpdt Print out the contents of the ACPI Firmware Performance Data Table')
5731 print(' -battery Print out battery info (if available)')
5732 print(' -sysinfo Print out system info extracted from BIOS')
5733 print(' -devinfo Print out the pm settings of all devices which support runtime suspend')
5734 print(' -flist Print the list of functions currently being captured in ftrace')
5735 print(' -flistall Print all functions capable of being captured in ftrace')
5736 print(' -summary dir Create a summary of tests in this dir [-genhtml builds missing html]')
5738 print(' -ftrace ftracefile Create HTML output using ftrace input (used with -dmesg)')
5739 print(' -dmesg dmesgfile Create HTML output using dmesg (used with -ftrace)')
5743 # ----------------- MAIN --------------------
5748 …simplecmds = ['-sysinfo', '-modes', '-fpdt', '-flist', '-flistall', '-devinfo', '-status', '-batte…
5749 if '-f' in sys.argv:
5754 if(arg == '-m'):
5764 elif(arg == '-h'):
5767 elif(arg == '-v'):
5770 elif(arg == '-x2'):
5772 elif(arg == '-x2delay'):
5773 sysvals.x2delay = getArgInt('-x2delay', args, 0, 60000)
5774 elif(arg == '-predelay'):
5775 sysvals.predelay = getArgInt('-predelay', args, 0, 60000)
5776 elif(arg == '-postdelay'):
5777 sysvals.postdelay = getArgInt('-postdelay', args, 0, 60000)
5778 elif(arg == '-f'):
5780 elif(arg == '-skiphtml'):
5782 elif(arg == '-cgdump'):
5784 elif(arg == '-genhtml'):
5786 elif(arg == '-addlogs'):
5788 elif(arg == '-verbose'):
5790 elif(arg == '-proc'):
5792 elif(arg == '-dev'):
5794 elif(arg == '-sync'):
5796 elif(arg == '-gzip'):
5798 elif(arg == '-rs'):
5802 doError('-rs requires "enable" or "disable"', True)
5805 sysvals.rs = -1
5810 elif(arg == '-display'):
5814 doError('-display requires "on" or "off"', True)
5817 sysvals.display = -1
5822 elif(arg == '-maxdepth'):
5823 sysvals.max_graph_depth = getArgInt('-maxdepth', args, 0, 1000)
5824 elif(arg == '-rtcwake'):
5833 sysvals.rtcwaketime = getArgInt('-rtcwake', val, 0, 3600, False)
5834 elif(arg == '-timeprec'):
5835 sysvals.setPrecision(getArgInt('-timeprec', args, 0, 6))
5836 elif(arg == '-mindev'):
5837 sysvals.mindevlen = getArgFloat('-mindev', args, 0.0, 10000.0)
5838 elif(arg == '-mincg'):
5839 sysvals.mincglen = getArgFloat('-mincg', args, 0.0, 10000.0)
5840 elif(arg == '-bufsize'):
5841 sysvals.bufsize = getArgInt('-bufsize', args, 1, 1024*1024*8)
5842 elif(arg == '-cgtest'):
5843 sysvals.cgtest = getArgInt('-cgtest', args, 0, 1)
5844 elif(arg == '-cgphase'):
5851 doError('invalid phase --> (%s: %s), valid phases are %s'\
5854 elif(arg == '-cgfilter'):
5860 elif(arg == '-cgskip'):
5871 elif(arg == '-callloop-maxgap'):
5872 sysvals.callloopmaxgap = getArgFloat('-callloop-maxgap', args, 0.0, 1.0)
5873 elif(arg == '-callloop-maxlen'):
5874 sysvals.callloopmaxlen = getArgFloat('-callloop-maxlen', args, 0.0, 1.0)
5875 elif(arg == '-cmd'):
5882 elif(arg == '-expandcg'):
5884 elif(arg == '-srgap'):
5886 elif(arg == '-multi'):
5888 sysvals.multitest['count'] = getArgInt('-multi n d (exec count)', args, 2, 1000000)
5889 sysvals.multitest['delay'] = getArgInt('-multi n d (delay between tests)', args, 0, 3600)
5890 elif(arg == '-o'):
5896 elif(arg == '-config'):
5905 elif(arg == '-fadd'):
5914 elif(arg == '-dmesg'):
5923 elif(arg == '-ftrace'):
5932 elif(arg == '-summary'):
5942 elif(arg == '-filter'):
5948 elif(arg == '-result'):
5959 doError('-dev is not compatible with -f')
5961 doError('-proc is not compatible with -f')
5998 # if instructed, re-analyze existing data files
6011 if '-' in mode:
6012 memmode = mode.split('-')[-1]
6028 call('xset -d :0.0 dpms 0 0 0', shell=True)
6029 call('xset -d :0.0 s off', shell=True)
6033 s = 'suspend-x%d' % sysvals.multitest['count']
6034 sysvals.outdir = datetime.now().strftime(s+'-%y%m%d-%H%M%S')
6042 fmt = 'suspend-%y%m%d-%H%M%S'
6056 call('xset -d :0.0 s reset', shell=True)