Lines Matching refs:data

29 #	 will capture dmesg and ftrace data until resume is complete. This data
624 data = ''
631 data += '_'
633 data += c
639 m = re.match('.* '+arg+'=(?P<arg>.*) ', data);
643 m = re.match('.* '+arg+'=(?P<arg>.*)', data);
859 # files needed for any trace data
862 # files needed for callgraph trace data
962 def b64unzip(self, data):
964 out = codecs.decode(base64.b64decode(data), 'zlib').decode()
966 out = data
968 def b64zip(self, data):
969 out = base64.b64encode(codecs.encode(data.encode(), 'zlib')).decode()
1075 data = line.split(delim, 1)
1076 num = re.search(r'[\d]+', data[1])
1078 out[data[0].strip()] = num.group()
1080 out[data[0].strip()] = data[1]
1162 data = fp.read().strip()
1164 if '[s2idle]' in data:
1438 # The primary container for suspend/resume test data. There is one for
1439 # each test run. The data is organized into a cronological hierarchy:
1443 # contents: times for phase start/end, order/color data for html
1451 # optionally includes dev/ps data
1501 self.fwValid = False # is firmware data available
1516 self.dmesg = dict() # root data structure
1675 # place the call data inside the src element of the tgtdev
1749 for data in testlist:
1750 data.usurpTouchingThread(devname, dev)
2226 # A container for kprobe function data we want in the dev timeline
2274 # A container for a single line of ftrace data. There are six basic types:
2281 # suspend_resume: phase or custom exec block data
2435 # ignore data til we return to the current depth
2517 pprint('WARNING: ftrace data missing, corrections made:')
2580 pprint('Too much data for '+id+\
2654 def deviceMatch(self, pid, data):
2656 # add the callgraph data to the device hierarchy
2663 list = data.dmesg[p]['list']
2674 for p in data.sortedPhases():
2675 if(data.dmesg[p]['start'] <= self.start and
2676 self.start <= data.dmesg[p]['end']):
2677 list = data.dmesg[p]['list']
2688 def newActionFromFunction(self, data):
2694 if fs < data.start or fe > data.end:
2697 for p in data.sortedPhases():
2698 if(data.dmesg[p]['start'] <= self.start and
2699 self.start < data.dmesg[p]['end']):
2704 out = data.newActionGlobal(name, fs, fe, -2)
2707 data.dmesg[phase]['list'][myname]['ftrace'] = self
3016 self.data = 0
3060 def parseStamp(self, data, sv):
3061 # global test data
3064 doError('data does not include the expected stamp')
3065 data.stamp = {'time': '', 'host': '', 'mode': ''}
3069 data.stamp['time'] = dt.strftime('%B %d %Y, %I:%M:%S %p')
3070 data.stamp['host'] = m.group('host')
3071 data.stamp['mode'] = m.group('mode')
3072 data.stamp['kernel'] = m.group('kernel')
3080 data.stamp[key] = val
3081 sv.hostname = data.stamp['host']
3082 sv.suspendmode = data.stamp['mode']
3094 data.stamp['mode'] = sv.suspendmode
3099 sv.stamp = data.stamp
3100 # firmware data
3101 if sv.suspendmode == 'mem' and len(self.fwdata) > data.testnumber:
3102 m = re.match(self.firmwarefmt, self.fwdata[data.testnumber])
3104 data.fwSuspend, data.fwResume = int(m.group('s')), int(m.group('r'))
3105 if(data.fwSuspend > 0 or data.fwResume > 0):
3106 data.fwValid = True
3107 # turbostat data
3108 if len(self.turbostat) > data.testnumber:
3109 m = re.match(self.tstatfmt, self.turbostat[data.testnumber])
3111 data.turbostat = m.group('t')
3112 # wifi data
3113 if len(self.wifi) > data.testnumber:
3114 m = re.match(self.wififmt, self.wifi[data.testnumber])
3116 data.wifi = {'dev': m.group('d'), 'stat': m.group('s'),
3118 data.stamp['wifi'] = m.group('d')
3120 if len(self.testerror) > data.testnumber:
3121 m = re.match(self.testerrfmt, self.testerror[data.testnumber])
3123 data.enterfail = m.group('e')
3124 def devprops(self, data):
3126 devlist = data.split(';')
3171 self.data = dataobj
3185 data = ascii(line).split()
3186 pid = data[0]
3187 name = re.sub('[()]', '', data[1])
3188 user = int(data[13])
3189 kern = int(data[14])
3262 # Adds callgraph data which lacks trace event data. This is only
3271 for data in testruns:
3272 testrun.append(TestRun(data))
3274 # extract the callgraph and traceevent data
3275 sysvals.vprint('Analyzing the ftrace data (%s)...' % \
3279 data = 0
3289 # gather the basic message data from the line
3307 data = testrun[testidx].data
3308 tp.parseStamp(data, sysvals)
3309 data.setStart(t.time, t.name)
3311 if(not data):
3315 data.setEnd(t.time, t.name)
3325 # create a callgraph object for the data
3339 # add the callgraph data to the device hierarchy
3351 for p in test.data.sortedPhases():
3352 if(test.data.dmesg[p]['start'] <= callstart and
3353 callstart <= test.data.dmesg[p]['end']):
3354 list = test.data.dmesg[p]['list']
3369 tp, data, lines, trace = TestProps(), dict(), [], []
3386 # group the data by timestamp
3388 if t in data:
3389 data[t].append(info)
3391 data[t] = [info]
3397 for t in sorted(data):
3398 first, last, blk = [], [], data[t]
3421 # the execution phase. Used when the ftrace log is the primary data source
3427 sysvals.vprint('Analyzing the ftrace data (%s)...' % \
3441 # extract the callgraph and traceevent data
3444 testrun, data, limbo = 0, 0, True
3448 # gather the basic message data from the line
3459 data, limbo = Data(len(testdata)), False
3460 testdata.append(data)
3461 testrun = TestRun(data)
3463 tp.parseStamp(data, sysvals)
3464 data.setStart(t.time, t.name)
3465 data.first_suspend_prepare = True
3466 phase = data.setPhase('suspend_prepare', t.time, True)
3468 if(not data or limbo):
3472 if t.name == 'CMD COMPLETE' and data.tKernRes == 0:
3473 data.tKernRes = t.time
3495 data.pstl[t.time] = proclist
3497 data.pstl[tp.multiproctime] = proclist
3502 if data.tKernRes == 0:
3503 data.tKernRes = t.time
3504 data.handleEndMarker(t.time, t.name)
3534 if(isbegin and data.tKernSus == 0):
3535 data.tKernSus = t.time
3539 if isbegin and data.first_suspend_prepare:
3540 data.first_suspend_prepare = False
3541 if data.tKernSus == 0:
3542 data.tKernSus = t.time
3544 phase = data.setPhase('suspend_prepare', t.time, isbegin)
3548 phase = data.setPhase('suspend', t.time, isbegin)
3552 phase = data.setPhase('suspend_late', t.time, isbegin)
3556 phase = data.setPhase('suspend_noirq', t.time, isbegin)
3560 lp = data.lastPhase()
3565 llp = data.lastPhase(2)
3567 if 'waking' not in data.dmesg[llp]:
3568 data.dmesg[llp]['waking'] = [0, 0.0]
3569 data.dmesg[llp]['waking'][0] += 1
3570 data.dmesg[llp]['waking'][1] += \
3571 t.time - data.dmesg[lp]['start']
3572 data.currphase = ''
3573 del data.dmesg[lp]
3575 phase = data.setPhase('suspend_machine', data.dmesg[lp]['end'], True)
3576 data.setPhase(phase, t.time, False)
3577 if data.tSuspended == 0:
3578 data.tSuspended = t.time
3581 data.dmesg[lp]['end'] = t.time
3583 phase = data.setPhase('resume_machine', t.time, True)
3586 if susp in data.dmesg:
3587 data.dmesg[susp]['end'] = t.time
3588 data.tSuspended = t.time
3589 data.tResumed = t.time
3593 phase = data.setPhase('resume_noirq', t.time, isbegin)
3597 phase = data.setPhase('resume_early', t.time, isbegin)
3601 phase = data.setPhase('resume', t.time, isbegin)
3605 phase = data.setPhase('resume_complete', t.time, isbegin)
3608 if(not data.isTraceEventOutsideDeviceCalls(pid, t.time)):
3636 if phase not in data.dmesg:
3646 data.newAction(phase, n, pid, p, t.time, -1, drv)
3647 if pid not in data.devpids:
3648 data.devpids.append(pid)
3651 if phase not in data.dmesg:
3657 dev = data.findDevice(phase, n)
3666 # displayname is generated from kprobe data
3683 if(data.tKernSus == 0 and phase == 'suspend_prepare' \
3685 data.tKernSus = t.time
3699 if phase in data.dmesg:
3700 data.dmesg[phase]['end'] = t.time
3701 data.tKernRes = t.time
3705 # create a callgraph object for the data
3719 if data and not data.devicegroups:
3721 data.handleEndMarker(t.time, t.name)
3725 for p in test.data.sortedPhases():
3727 test.data.dmesg[p]['start'] = test.data.start
3728 test.data.dmesg[p]['end'] = test.data.end
3730 test.data.dmesg[p]['start'] = test.data.end
3731 test.data.dmesg[p]['end'] = test.data.end
3732 test.data.tSuspended = test.data.end
3733 test.data.tResumed = test.data.end
3734 test.data.fwValid = False
3741 for data in testdata:
3742 lp = data.sortedPhases()[0]
3743 for p in data.sortedPhases():
3745 data.dmesg[lp]['end'] = data.dmesg[p]['start']
3750 data = test.data
3752 tlb, tle = data.start, data.end
3754 tle = testruns[i+1].data.start
3755 # add the process usage data to the timeline
3757 data.createProcessUsageEvents()
3758 # add the traceevent data to the device hierarchy
3768 data.newActionGlobal(title, event['begin'], event['end'], event['pid'])
3774 if pid not in data.devpids:
3775 data.devpids.append(pid)
3781 data.newActionGlobal(e['name'], kb, ke, pid, color)
3792 data.addDeviceFunctionCall(e['name'], name, e['proc'], pid, kb,
3795 # add the callgraph data to the device hierarchy
3807 # match cg data to devices
3810 devname = cg.deviceMatch(pid, data)
3817 # create blocks for orphan cg data
3823 cg.newActionFromFunction(data)
3829 for data in testdata:
3830 tn = '' if len(testdata) == 1 else ('%d' % (data.testnumber + 1))
3832 phasedef = data.phasedef
3835 if p not in data.dmesg:
3847 if data.tSuspended == 0:
3848 data.tSuspended = data.dmesg[lp]['end']
3849 if data.tResumed == 0:
3850 data.tResumed = data.dmesg[lp]['end']
3851 data.fwValid = False
3854 if not terr and 'dev' in data.wifi and data.wifi['stat'] == 'timeout':
3856 (sysvals.suspendmode, tn, data.wifi['dev'], data.wifi['time'])
3858 if not terr and data.enterfail:
3859 pprint('test%s FAILED: enter %s failed with %s' % (tn, sysvals.suspendmode, data.enterfail))
3862 if data.tSuspended == 0:
3863 data.tSuspended = data.tKernRes
3864 if data.tResumed == 0:
3865 data.tResumed = data.tSuspended
3868 data.deviceFilter(sysvals.devicefilter)
3869 data.fixupInitcallsThatDidntReturn()
3871 data.optimizeDevSrc()
3889 sysvals.vprint('Analyzing the dmesg data (%s)...' % \
3898 data = 0
3913 if(data):
3914 testruns.append(data)
3915 data = Data(len(testruns))
3916 tp.parseStamp(data, sysvals)
3917 if(not data):
3927 data.dmesgtext.append(line)
3934 if data:
3935 testruns.append(data)
3937 doError('dmesg log has no suspend/resume data: %s' \
3941 for data in testruns:
3943 for line in data.dmesgtext:
3944 ct, cf, n, p = data.initcall_debug_call(line)
3945 rt, rf, l = data.initcall_debug_return(last)
3947 i = data.dmesgtext.index(last)
3948 j = data.dmesgtext.index(line)
3949 data.dmesgtext[i] = line
3950 data.dmesgtext[j] = last
3960 # data lacks the suspend_resume or device_pm_callbacks trace events.
3962 # data: an empty Data object (with dmesgtext) obtained from loadKernelLog
3965 def parseKernelLog(data):
3968 if(data.fwValid):
3970 (data.fwSuspend, data.fwResume))
4022 for line in data.dmesgtext:
4032 # initialize data start to first line time
4034 data.setStart(ktime)
4051 data.initcall_debug_call(line, True)):
4052 data.setPhase(phase, ktime, False)
4054 data.setPhase(phase, ktime, True)
4058 data.setPhase(phase, ktime, True)
4059 data.setStart(ktime)
4060 data.tKernSus = ktime
4062 lp = data.lastPhase()
4064 data.setPhase(lp, ktime, False)
4065 data.setPhase(phase, ktime, True)
4067 lp = data.lastPhase()
4069 data.setPhase(lp, ktime, False)
4070 data.setPhase(phase, ktime, True)
4072 lp = data.lastPhase()
4074 data.setPhase(lp, ktime, False)
4075 data.setPhase(phase, ktime, True)
4077 lp = data.lastPhase()
4079 data.setPhase(lp, ktime, False)
4080 data.setPhase(phase, ktime, True)
4082 lp = data.lastPhase()
4084 data.tSuspended = prevktime
4086 data.setPhase(lp, prevktime, False)
4088 data.tSuspended = ktime
4090 data.setPhase(lp, prevktime, False)
4091 data.tResumed = ktime
4092 data.setPhase(phase, ktime, True)
4094 lp = data.lastPhase()
4096 data.setPhase(lp, ktime, False)
4097 data.setPhase(phase, ktime, True)
4099 lp = data.lastPhase()
4101 data.setPhase(lp, ktime, False)
4102 data.setPhase(phase, ktime, True)
4104 lp = data.lastPhase()
4106 data.setPhase(lp, ktime, False)
4107 data.setPhase(phase, ktime, True)
4109 lp = data.lastPhase()
4111 data.setPhase(lp, ktime, False)
4112 data.setPhase(phase, ktime, True)
4114 lp = data.lastPhase()
4116 data.setPhase(lp, ktime, False)
4117 data.setEnd(ktime)
4118 data.tKernRes = ktime
4122 if(phase in data.sortedPhases()):
4124 t, f, n, p = data.initcall_debug_call(line)
4126 data.newAction(phase, f, int(n), p, ktime, -1, '')
4129 t, f, l = data.initcall_debug_return(line)
4131 list = data.dmesg[phase]['list']
4174 data.initDevicegroups()
4177 phasedef = data.phasedef
4179 if lp not in data.dmesg:
4182 if p not in data.dmesg:
4186 if data.tSuspended == 0:
4187 data.tSuspended = data.dmesg[lp]['end']
4188 if data.tResumed == 0:
4189 data.tResumed = data.dmesg[lp]['end']
4192 lp = data.sortedPhases()[0]
4193 for p in data.sortedPhases():
4195 data.dmesg[lp]['end'] = data.dmesg[p]['start']
4197 if data.tSuspended == 0:
4198 data.tSuspended = data.tKernRes
4199 if data.tResumed == 0:
4200 data.tResumed = data.tSuspended
4205 data.newActionGlobal(name, event['begin'], event['end'])
4208 data.deviceFilter(sysvals.devicefilter)
4209 data.fixupInitcallsThatDidntReturn()
4247 def addCallgraphs(sv, hf, data):
4249 # write out the ftrace data converted to html
4251 for p in data.sortedPhases():
4254 list = data.dmesg[p]['list']
4255 for d in data.sortedDevices(p):
4260 if 'color' in data.dmesg[p]:
4261 color = data.dmesg[p]['color']
4312 # extract the test data into list
4320 for data in sorted(testruns, key=lambda v:(v['mode'], v['host'], v['kernel'], v['time'])):
4321 mode = data['mode']
4323 list[mode] = {'data': [], 'avg': [0,0], 'min': [0,0], 'max': [0,0], 'med': [0,0]}
4337 if 'pkgpc10' in data and 'syslpi' in data:
4338 pkgpc10, syslpi, useturbo = data['pkgpc10'], data['syslpi'], True
4339 if 'wifi' in data:
4340 wifi, usewifi = data['wifi'], True
4341 res = data['result']
4342 tVal = [float(data['suspend']), float(data['resume'])]
4343 list[mode]['data'].append([data['host'], data['kernel'],
4344 data['time'], tVal[0], tVal[1], data['url'], res,
4345 data['issues'], data['sus_worst'], data['sus_worsttime'],
4346 data['res_worst'], data['res_worsttime'], pkgpc10, syslpi, wifi])
4347 idx = len(list[mode]['data']) - 1
4423 count = len(list[mode]['data'])
4434 for d in list[mode]['data']:
4441 idx = list[mode]['data'].index(d)
4451 html += td.format("%d" % (list[mode]['data'].index(d) + 1)) # row
4473 # flush the data to file
4483 for data in testruns:
4484 host, url, devlist = data['host'], data['url'], data['devlist']
4488 mdevlist, devlist = devall[type], data['devlist'][type]
4521 data = devall[type][name]
4522 data['average'] = data['total'] / data['count']
4523 if data['average'] < limit:
4528 html += tdr.format(data['name']) # name
4529 html += td.format('%.3f ms' % data['average']) # average
4530 html += td.format(data['count']) # count
4531 html += td.format('%.3f ms' % data['worst']) # worst
4532 html += td.format(data['host']) # host
4533 html += tdlink.format(data['url']) # url
4538 # flush the data to file
4582 # flush the data to file
4601 # Create the output html file from the resident test data
4608 pprint('ERROR: Not enough test data to build a timeline')
4612 for data in testruns:
4613 if data.kerror:
4616 data.trimFreezeTime(testruns[-1].tSuspended)
4618 data.getMemTime()
4654 for data in testruns:
4655 tTotal = data.end - data.start
4657 doError('No timeline data')
4665 testdesc = ordinal(data.testnumber+1)+' '+testdesc
4670 stot, rtot = sktime, rktime = data.getTimeValues()
4672 if data.fwValid:
4673 stot += (data.fwSuspend/1000000.0)
4674 rtot += (data.fwResume/1000000.0)
4678 if 'time' in data.wifi and data.wifi['stat'] != 'timeout':
4679 rtot += data.end - data.tKernRes + (data.wifi['time'] * 1000.0)
4688 testdesc = testdesc2 = ordinal(data.testnumber+1)
4690 if(len(data.tLow) == 0):
4694 low_time = '+'.join(data.tLow)
4698 if not data.fwValid and 'dev' not in data.wifi:
4703 if data.fwValid:
4704 sftime = '%.3f'%(data.fwSuspend / 1000000.0)
4705 rftime = '%.3f'%(data.fwResume / 1000000.0)
4709 if 'time' in data.wifi:
4710 if data.wifi['stat'] != 'timeout':
4711 wtime = '%.0f ms'%(data.end - data.tKernRes + (data.wifi['time'] * 1000.0))
4714 thtml += html_wifdesc.format(testdesc2, wtime, data.wifi['dev'])
4730 for data in testruns:
4731 data.selectTimelineDevices('%f', tTotal, sysvals.mindevlen)
4732 for group in data.devicegroups:
4735 for devname in sorted(data.tdevlist[phase]):
4736 d = DevItem(data.testnumber, phase, data.dmesg[phase]['list'][devname])
4767 for data in testruns:
4770 for phase in data.sortedPhases():
4771 if data.dmesg[phase]['start'] >= data.tSuspended:
4778 bname = '%s%d' % (dir[0], data.testnumber)
4780 m0 = data.start
4781 mMax = data.tSuspended
4784 m0 = data.tSuspended
4785 mMax = data.end
4787 if len(testruns) > 1 and data.testnumber == 0:
4798 phase = data.dmesg[b]
4804 data.dmesg[b]['color'], '')
4805 for e in data.errorinfo[dir]:
4813 phaselist = data.dmesg[b]['list']
4814 for d in sorted(data.tdevlist[b]):
4830 rowheight = devtl.phaseRowHeight(data.testnumber, b, dev['row'])
4831 rowtop = devtl.phaseRowTop(data.testnumber, b, dev['row'])
4905 for data in testruns:
4906 hf.write('<div id="devicedetail%d">\n' % data.testnumber)
4910 for b in data.sortedPhases():
4911 phase = data.dmesg[b]
4916 data.dmesg[b]['color']))
4924 # write the ftrace data (callgraph)
4926 data = testruns[sysvals.cgtest]
4928 data = testruns[-1]
4930 addCallgraphs(sysvals, hf, data)
5018 .pf:'+cgchk+' + label {background:url(\'data:image/svg+xml;utf,<?xml version="1.0" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" height="18" width="18" version="1.1"><circle cx="9" cy="9" r="8" stroke="black" stroke-width="1" fill="white"/><rect x="4" y="8" width="10" height="2" style="fill:black;stroke-width:0"/><rect x="8" y="4" width="2" height="10" style="fill:black;stroke-width:0"/></svg>\') no-repeat left center;}\n\
5019 .pf:'+cgnchk+' ~ label {background:url(\'data:image/svg+xml;utf,<?xml version="1.0" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" height="18" width="18" version="1.1"><circle cx="9" cy="9" r="8" stroke="black" stroke-width="1" fill="white"/><rect x="4" y="8" width="10" height="2" style="fill:black;stroke-width:0"/></svg>\') no-repeat left center;}\n\
5066 for data in testruns:
5067 topo = data.deviceTopology()
5068 detail += ' devtable[%d] = "%s";\n' % (data.testnumber, topo)
5070 # add the code which will manipulate the data in the browser
5771 pprint('WARNING: /dev/mem is not readable, ignoring DMI data')
5802 pprint('WARNING: /dev/mem is not readable, ignoring DMI data')
5815 data = buf[i+size:n+2].split(b'\0')
5820 if idx > 0 and idx < len(data) - 1:
5821 s = data[idx-1].decode('utf-8')
5830 # Read the acpi bios tables and pull out FPDT, the firmware data
5865 doError('Invalid FPDT table data, should '+\
5898 pprint('WARNING: /dev/mem is not readable, ignoring the FPDT data')
6031 # what data source are we using
6040 pprint(' timeline data source: %s' % res)
6135 for data in testruns:
6136 data.extractErrorInfo()
6139 for data in testruns:
6140 parseKernelLog(data)
6144 pprint('ERROR: data does not include the expected stamp')
6153 for data in testruns:
6154 if data.turbostat:
6156 for val in data.turbostat.split('|'):
6163 data.printDetails()
6171 for data in testruns:
6172 data.debugPrint()
6175 pprint('ERROR: Not enough test data to build a timeline')
6181 data = testruns[0]
6182 stamp = data.stamp
6183 stamp['suspend'], stamp['resume'] = data.getTimeValues()
6184 if data.fwValid:
6185 stamp['fwsuspend'], stamp['fwresume'] = data.fwSuspend, data.fwResume
6240 for data in testruns:
6241 del data
6385 data = {
6403 data[key] = extra[key]
6405 data['funclist'] = find_in_html(html, '<div title="', '" class="traceevent"', False)
6409 data['target'] = tp.cmdline[tp.cmdline.find(arg):].split()[1]
6411 return data
6446 data = data_from_html(os.path.join(dirname, filename), outpath, issues)
6447 if(not data):
6449 if 'target' in data:
6450 target = data['target']
6451 testruns.append(data)
6453 if data[key] not in desc[key]:
6454 desc[key].append(data[key])
6463 pprint(' summary.html - tabular list of test data found')
6633 data = text.split()
6635 for val in data:
6687 ' capture dmesg and ftrace data until resume is complete. This data is\n'\
6738 ' -maxdepth N limit the callgraph data to N call levels (default: 0=all)\n'\
6739 ' -expandcg pre-expand the callgraph data in the html output (default: disabled)\n'\
6743 ' -cgphase P Only show callgraph data for phase P (e.g. suspend_late)\n'\
6744 ' -cgtest N Only show callgraph data for test N (e.g. 0 or 1 in an x2 run)\n'\
6749 ' -devdump Print out all the raw device data for each phase\n'\
6750 ' -cgdump Print out all the raw callgraph data\n'\
7082 # if instructed, re-analyze existing data files