Lines Matching refs:data
29 # will capture dmesg and ftrace data until resume is complete. This data
582 data = ''
589 data += '_'
591 data += c
597 m = re.match('.* '+arg+'=(?P<arg>.*) ', data);
601 m = re.match('.* '+arg+'=(?P<arg>.*)', data);
814 # files needed for any trace data
817 # files needed for callgraph trace data
903 def b64unzip(self, data):
905 out = codecs.decode(base64.b64decode(data), 'zlib').decode()
907 out = data
909 def b64zip(self, data):
910 out = base64.b64encode(codecs.encode(data.encode(), 'zlib')).decode()
1021 data = line.split(delim, 1)
1022 num = re.search(r'[\d]+', data[1])
1024 out[data[0].strip()] = num.group()
1026 out[data[0].strip()] = data[1]
1259 # The primary container for suspend/resume test data. There is one for
1260 # each test run. The data is organized into a cronological hierarchy:
1264 # contents: times for phase start/end, order/color data for html
1272 # optionally includes dev/ps data
1321 self.fwValid = False # is firmware data available
1336 self.dmesg = dict() # root data structure
1493 # place the call data inside the src element of the tgtdev
1566 for data in testlist:
1567 data.usurpTouchingThread(devname, dev)
1960 # get the cpu exec data
1989 # get a list of data points for suspend and resume
2038 # A container for kprobe function data we want in the dev timeline
2086 # A container for a single line of ftrace data. There are six basic types:
2093 # suspend_resume: phase or custom exec block data
2247 # ignore data til we return to the current depth
2329 pprint('WARNING: ftrace data missing, corrections made:')
2392 pprint('Too much data for '+id+\
2466 def deviceMatch(self, pid, data):
2468 # add the callgraph data to the device hierarchy
2475 list = data.dmesg[p]['list']
2486 for p in data.sortedPhases():
2487 if(data.dmesg[p]['start'] <= self.start and
2488 self.start <= data.dmesg[p]['end']):
2489 list = data.dmesg[p]['list']
2500 def newActionFromFunction(self, data):
2506 if fs < data.start or fe > data.end:
2509 for p in data.sortedPhases():
2510 if(data.dmesg[p]['start'] <= self.start and
2511 self.start < data.dmesg[p]['end']):
2516 out = data.newActionGlobal(name, fs, fe, -2)
2519 data.dmesg[phase]['list'][myname]['ftrace'] = self
2824 self.data = 0
2868 def parseStamp(self, data, sv):
2869 # global test data
2872 doError('data does not include the expected stamp')
2873 data.stamp = {'time': '', 'host': '', 'mode': ''}
2877 data.stamp['time'] = dt.strftime('%B %d %Y, %I:%M:%S %p')
2878 data.stamp['host'] = m.group('host')
2879 data.stamp['mode'] = m.group('mode')
2880 data.stamp['kernel'] = m.group('kernel')
2888 data.stamp[key] = val
2889 sv.hostname = data.stamp['host']
2890 sv.suspendmode = data.stamp['mode']
2902 data.stamp['mode'] = sv.suspendmode
2907 sv.stamp = data.stamp
2908 # firmware data
2909 if sv.suspendmode == 'mem' and len(self.fwdata) > data.testnumber:
2910 m = re.match(self.firmwarefmt, self.fwdata[data.testnumber])
2912 data.fwSuspend, data.fwResume = int(m.group('s')), int(m.group('r'))
2913 if(data.fwSuspend > 0 or data.fwResume > 0):
2914 data.fwValid = True
2915 # turbostat data
2916 if len(self.turbostat) > data.testnumber:
2917 m = re.match(self.tstatfmt, self.turbostat[data.testnumber])
2919 data.turbostat = m.group('t')
2920 # wifi data
2921 if len(self.wifi) > data.testnumber:
2922 m = re.match(self.wififmt, self.wifi[data.testnumber])
2924 data.wifi = {'dev': m.group('d'), 'stat': m.group('s'),
2926 data.stamp['wifi'] = m.group('d')
2928 if len(self.testerror) > data.testnumber:
2929 m = re.match(self.testerrfmt, self.testerror[data.testnumber])
2931 data.enterfail = m.group('e')
2932 def devprops(self, data):
2934 devlist = data.split(';')
2979 self.data = dataobj
2992 data = ascii(line).split()
2993 pid = data[0]
2994 name = re.sub('[()]', '', data[1])
2995 user = int(data[13])
2996 kern = int(data[14])
3066 # Adds callgraph data which lacks trace event data. This is only
3075 for data in testruns:
3076 testrun.append(TestRun(data))
3078 # extract the callgraph and traceevent data
3079 sysvals.vprint('Analyzing the ftrace data (%s)...' % \
3083 data = 0
3093 # gather the basic message data from the line
3111 data = testrun[testidx].data
3112 tp.parseStamp(data, sysvals)
3113 data.setStart(t.time, t.name)
3115 if(not data):
3119 data.setEnd(t.time, t.name)
3129 # create a callgraph object for the data
3143 # add the callgraph data to the device hierarchy
3155 for p in test.data.sortedPhases():
3156 if(test.data.dmesg[p]['start'] <= callstart and
3157 callstart <= test.data.dmesg[p]['end']):
3158 list = test.data.dmesg[p]['list']
3170 # the execution phase. Used when the ftrace log is the primary data source
3176 sysvals.vprint('Analyzing the ftrace data (%s)...' % \
3190 # extract the callgraph and traceevent data
3194 testrun, data, limbo = 0, 0, True
3209 # gather the basic message data from the line
3228 data, limbo = Data(len(testdata)), False
3229 testdata.append(data)
3230 testrun = TestRun(data)
3232 tp.parseStamp(data, sysvals)
3233 data.setStart(t.time, t.name)
3234 data.first_suspend_prepare = True
3235 phase = data.setPhase('suspend_prepare', t.time, True)
3237 if(not data or limbo):
3250 data.pstl[t.time] = proclist
3254 if data.tKernRes == 0:
3255 data.tKernRes = t.time
3256 data.handleEndMarker(t.time, t.name)
3286 if(isbegin and data.tKernSus == 0):
3287 data.tKernSus = t.time
3291 if isbegin and data.first_suspend_prepare:
3292 data.first_suspend_prepare = False
3293 if data.tKernSus == 0:
3294 data.tKernSus = t.time
3296 phase = data.setPhase('suspend_prepare', t.time, isbegin)
3300 phase = data.setPhase('suspend', t.time, isbegin)
3304 phase = data.setPhase('suspend_late', t.time, isbegin)
3308 phase = data.setPhase('suspend_noirq', t.time, isbegin)
3312 lp = data.lastPhase()
3317 llp = data.lastPhase(2)
3319 if 'trying' not in data.dmesg[llp]:
3320 data.dmesg[llp]['trying'] = 0
3321 data.dmesg[llp]['trying'] += \
3322 t.time - data.dmesg[lp]['start']
3323 data.currphase = ''
3324 del data.dmesg[lp]
3326 phase = data.setPhase('suspend_machine', data.dmesg[lp]['end'], True)
3327 data.setPhase(phase, t.time, False)
3328 if data.tSuspended == 0:
3329 data.tSuspended = t.time
3332 data.dmesg[lp]['end'] = t.time
3334 phase = data.setPhase('resume_machine', t.time, True)
3337 if susp in data.dmesg:
3338 data.dmesg[susp]['end'] = t.time
3339 data.tSuspended = t.time
3340 data.tResumed = t.time
3344 phase = data.setPhase('resume_noirq', t.time, isbegin)
3348 phase = data.setPhase('resume_early', t.time, isbegin)
3352 phase = data.setPhase('resume', t.time, isbegin)
3356 phase = data.setPhase('resume_complete', t.time, isbegin)
3359 if(not data.isTraceEventOutsideDeviceCalls(pid, t.time)):
3387 if phase not in data.dmesg:
3397 data.newAction(phase, n, pid, p, t.time, -1, drv)
3398 if pid not in data.devpids:
3399 data.devpids.append(pid)
3402 if phase not in data.dmesg:
3408 dev = data.findDevice(phase, n)
3417 # displayname is generated from kprobe data
3434 if(data.tKernSus == 0 and phase == 'suspend_prepare' \
3436 data.tKernSus = t.time
3447 if phase in data.dmesg:
3448 data.dmesg[phase]['end'] = t.time
3449 data.tKernRes = t.time
3453 # create a callgraph object for the data
3468 if data and not data.devicegroups:
3470 data.handleEndMarker(t.time, t.name)
3474 for p in test.data.sortedPhases():
3476 test.data.dmesg[p]['start'] = test.data.start
3477 test.data.dmesg[p]['end'] = test.data.end
3479 test.data.dmesg[p]['start'] = test.data.end
3480 test.data.dmesg[p]['end'] = test.data.end
3481 test.data.tSuspended = test.data.end
3482 test.data.tResumed = test.data.end
3483 test.data.fwValid = False
3490 for data in testdata:
3491 lp = data.sortedPhases()[0]
3492 for p in data.sortedPhases():
3494 data.dmesg[lp]['end'] = data.dmesg[p]['start']
3499 data = test.data
3501 tlb, tle = data.start, data.end
3503 tle = testruns[i+1].data.start
3504 # add the process usage data to the timeline
3506 data.createProcessUsageEvents()
3507 # add the traceevent data to the device hierarchy
3517 data.newActionGlobal(title, event['begin'], event['end'], event['pid'])
3523 if pid not in data.devpids:
3524 data.devpids.append(pid)
3530 data.newActionGlobal(e['name'], kb, ke, pid, color)
3541 data.addDeviceFunctionCall(e['name'], name, e['proc'], pid, kb,
3544 # add the callgraph data to the device hierarchy
3556 # match cg data to devices
3559 devname = cg.deviceMatch(pid, data)
3566 # create blocks for orphan cg data
3572 cg.newActionFromFunction(data)
3578 for data in testdata:
3579 tn = '' if len(testdata) == 1 else ('%d' % (data.testnumber + 1))
3581 phasedef = data.phasedef
3584 if p not in data.dmesg:
3590 if data.tSuspended == 0:
3591 data.tSuspended = data.dmesg[lp]['end']
3592 if data.tResumed == 0:
3593 data.tResumed = data.dmesg[lp]['end']
3594 data.fwValid = False
3597 if not terr and 'dev' in data.wifi and data.wifi['stat'] == 'timeout':
3599 (sysvals.suspendmode, tn, data.wifi['dev'], data.wifi['time'])
3601 if not terr and data.enterfail:
3602 pprint('test%s FAILED: enter %s failed with %s' % (tn, sysvals.suspendmode, data.enterfail))
3605 if data.tSuspended == 0:
3606 data.tSuspended = data.tKernRes
3607 if data.tResumed == 0:
3608 data.tResumed = data.tSuspended
3611 data.deviceFilter(sysvals.devicefilter)
3612 data.fixupInitcallsThatDidntReturn()
3614 data.optimizeDevSrc()
3634 sysvals.vprint('Analyzing the dmesg data (%s)...' % \
3643 data = 0
3657 if(data):
3658 testruns.append(data)
3659 data = Data(len(testruns))
3660 tp.parseStamp(data, sysvals)
3661 if(not data):
3669 data.dmesgtext.append(line)
3672 if data:
3673 testruns.append(data)
3675 doError('dmesg log has no suspend/resume data: %s' \
3679 for data in testruns:
3681 for line in data.dmesgtext:
3688 i = data.dmesgtext.index(last)
3689 j = data.dmesgtext.index(line)
3690 data.dmesgtext[i] = line
3691 data.dmesgtext[j] = last
3702 # data lacks the suspend_resume or device_pm_callbacks trace events.
3704 # data: an empty Data object (with dmesgtext) obtained from loadKernelLog
3707 def parseKernelLog(data):
3710 if(data.fwValid):
3712 (data.fwSuspend, data.fwResume))
3764 for line in data.dmesgtext:
3774 # initialize data start to first line time
3776 data.setStart(ktime)
3793 data.setPhase(phase, ktime, False)
3795 data.setPhase(phase, ktime, True)
3799 data.setPhase(phase, ktime, True)
3800 data.setStart(ktime)
3801 data.tKernSus = ktime
3803 lp = data.lastPhase()
3805 data.setPhase(lp, ktime, False)
3806 data.setPhase(phase, ktime, True)
3808 lp = data.lastPhase()
3810 data.setPhase(lp, ktime, False)
3811 data.setPhase(phase, ktime, True)
3813 lp = data.lastPhase()
3815 data.setPhase(lp, ktime, False)
3816 data.setPhase(phase, ktime, True)
3818 lp = data.lastPhase()
3820 data.setPhase(lp, ktime, False)
3821 data.setPhase(phase, ktime, True)
3823 lp = data.lastPhase()
3825 data.tSuspended = prevktime
3827 data.setPhase(lp, prevktime, False)
3829 data.tSuspended = ktime
3831 data.setPhase(lp, prevktime, False)
3832 data.tResumed = ktime
3833 data.setPhase(phase, ktime, True)
3835 lp = data.lastPhase()
3837 data.setPhase(lp, ktime, False)
3838 data.setPhase(phase, ktime, True)
3840 lp = data.lastPhase()
3842 data.setPhase(lp, ktime, False)
3843 data.setPhase(phase, ktime, True)
3845 lp = data.lastPhase()
3847 data.setPhase(lp, ktime, False)
3848 data.setPhase(phase, ktime, True)
3850 lp = data.lastPhase()
3852 data.setPhase(lp, ktime, False)
3853 data.setPhase(phase, ktime, True)
3855 lp = data.lastPhase()
3857 data.setPhase(lp, ktime, False)
3858 data.setEnd(ktime)
3859 data.tKernRes = ktime
3863 if(phase in data.sortedPhases()):
3872 data.newAction(phase, f, int(n), p, ktime, -1, '')
3880 list = data.dmesg[phase]['list']
3921 data.initDevicegroups()
3924 phasedef = data.phasedef
3927 if p not in data.dmesg:
3931 if data.tSuspended == 0:
3932 data.tSuspended = data.dmesg[lp]['end']
3933 if data.tResumed == 0:
3934 data.tResumed = data.dmesg[lp]['end']
3937 lp = data.sortedPhases()[0]
3938 for p in data.sortedPhases():
3940 data.dmesg[lp]['end'] = data.dmesg[p]['start']
3942 if data.tSuspended == 0:
3943 data.tSuspended = data.tKernRes
3944 if data.tResumed == 0:
3945 data.tResumed = data.tSuspended
3950 data.newActionGlobal(name, event['begin'], event['end'])
3953 data.deviceFilter(sysvals.devicefilter)
3954 data.fixupInitcallsThatDidntReturn()
3990 def addCallgraphs(sv, hf, data):
3992 # write out the ftrace data converted to html
3994 for p in data.sortedPhases():
3997 list = data.dmesg[p]['list']
3998 for d in data.sortedDevices(p):
4003 if 'color' in data.dmesg[p]:
4004 color = data.dmesg[p]['color']
4055 # extract the test data into list
4063 for data in sorted(testruns, key=lambda v:(v['mode'], v['host'], v['kernel'], v['time'])):
4064 mode = data['mode']
4066 list[mode] = {'data': [], 'avg': [0,0], 'min': [0,0], 'max': [0,0], 'med': [0,0]}
4080 if 'pkgpc10' in data and 'syslpi' in data:
4081 pkgpc10, syslpi, useturbo = data['pkgpc10'], data['syslpi'], True
4082 if 'wifi' in data:
4083 wifi, usewifi = data['wifi'], True
4084 res = data['result']
4085 tVal = [float(data['suspend']), float(data['resume'])]
4086 list[mode]['data'].append([data['host'], data['kernel'],
4087 data['time'], tVal[0], tVal[1], data['url'], res,
4088 data['issues'], data['sus_worst'], data['sus_worsttime'],
4089 data['res_worst'], data['res_worsttime'], pkgpc10, syslpi, wifi])
4090 idx = len(list[mode]['data']) - 1
4166 count = len(list[mode]['data'])
4177 for d in list[mode]['data']:
4184 idx = list[mode]['data'].index(d)
4194 html += td.format("%d" % (list[mode]['data'].index(d) + 1)) # row
4216 # flush the data to file
4226 for data in testruns:
4227 host, url, devlist = data['host'], data['url'], data['devlist']
4231 mdevlist, devlist = devall[type], data['devlist'][type]
4264 data = devall[type][name]
4265 data['average'] = data['total'] / data['count']
4266 if data['average'] < limit:
4271 html += tdr.format(data['name']) # name
4272 html += td.format('%.3f ms' % data['average']) # average
4273 html += td.format(data['count']) # count
4274 html += td.format('%.3f ms' % data['worst']) # worst
4275 html += td.format(data['host']) # host
4276 html += tdlink.format(data['url']) # url
4281 # flush the data to file
4325 # flush the data to file
4344 # Create the output html file from the resident test data
4351 pprint('ERROR: Not enough test data to build a timeline')
4355 for data in testruns:
4356 if data.kerror:
4359 data.trimFreezeTime(testruns[-1].tSuspended)
4361 data.getMemTime()
4397 for data in testruns:
4398 tTotal = data.end - data.start
4400 doError('No timeline data')
4408 testdesc = ordinal(data.testnumber+1)+' '+testdesc
4413 stot, rtot = sktime, rktime = data.getTimeValues()
4415 if data.fwValid:
4416 stot += (data.fwSuspend/1000000.0)
4417 rtot += (data.fwResume/1000000.0)
4421 if 'time' in data.wifi and data.wifi['stat'] != 'timeout':
4422 rtot += data.end - data.tKernRes + (data.wifi['time'] * 1000.0)
4431 testdesc = testdesc2 = ordinal(data.testnumber+1)
4433 if(len(data.tLow) == 0):
4437 low_time = '+'.join(data.tLow)
4441 if not data.fwValid and 'dev' not in data.wifi:
4446 if data.fwValid:
4447 sftime = '%.3f'%(data.fwSuspend / 1000000.0)
4448 rftime = '%.3f'%(data.fwResume / 1000000.0)
4452 if 'time' in data.wifi:
4453 if data.wifi['stat'] != 'timeout':
4454 wtime = '%.0f ms'%(data.end - data.tKernRes + (data.wifi['time'] * 1000.0))
4457 thtml += html_wifdesc.format(testdesc2, wtime, data.wifi['dev'])
4473 for data in testruns:
4474 data.selectTimelineDevices('%f', tTotal, sysvals.mindevlen)
4475 for group in data.devicegroups:
4478 for devname in sorted(data.tdevlist[phase]):
4479 d = DevItem(data.testnumber, phase, data.dmesg[phase]['list'][devname])
4510 for data in testruns:
4513 for phase in data.sortedPhases():
4514 if data.dmesg[phase]['start'] >= data.tSuspended:
4521 bname = '%s%d' % (dir[0], data.testnumber)
4523 m0 = data.start
4524 mMax = data.tSuspended
4527 m0 = data.tSuspended
4528 mMax = data.end
4530 if len(testruns) > 1 and data.testnumber == 0:
4541 phase = data.dmesg[b]
4547 data.dmesg[b]['color'], '')
4548 for e in data.errorinfo[dir]:
4556 phaselist = data.dmesg[b]['list']
4557 for d in sorted(data.tdevlist[b]):
4573 rowheight = devtl.phaseRowHeight(data.testnumber, b, dev['row'])
4574 rowtop = devtl.phaseRowTop(data.testnumber, b, dev['row'])
4651 for data in testruns:
4652 hf.write('<div id="devicedetail%d">\n' % data.testnumber)
4656 for b in data.sortedPhases():
4657 phase = data.dmesg[b]
4662 data.dmesg[b]['color']))
4670 # write the ftrace data (callgraph)
4672 data = testruns[sysvals.cgtest]
4674 data = testruns[-1]
4676 addCallgraphs(sysvals, hf, data)
4764 .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\
4765 .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\
4812 for data in testruns:
4813 topo = data.deviceTopology()
4814 detail += ' devtable[%d] = "%s";\n' % (data.testnumber, topo)
4816 # add the code which will manipulate the data in the browser
5532 pprint('WARNING: /dev/mem is not readable, ignoring DMI data')
5563 pprint('WARNING: /dev/mem is not readable, ignoring DMI data')
5576 data = buf[i+size:n+2].split(b'\0')
5581 if idx > 0 and idx < len(data) - 1:
5582 s = data[idx-1].decode('utf-8')
5624 # Read the acpi bios tables and pull out FPDT, the firmware data
5659 doError('Invalid FPDT table data, should '+\
5692 pprint('WARNING: /dev/mem is not readable, ignoring the FPDT data')
5819 # what data source are we using
5828 pprint(' timeline data source: %s' % res)
5923 for data in testruns:
5924 data.extractErrorInfo()
5927 for data in testruns:
5928 parseKernelLog(data)
5932 pprint('ERROR: data does not include the expected stamp')
5941 for data in testruns:
5942 if data.turbostat:
5944 for val in data.turbostat.split('|'):
5951 data.printDetails()
5959 for data in testruns:
5960 data.debugPrint()
5963 pprint('ERROR: Not enough test data to build a timeline')
5969 data = testruns[0]
5970 stamp = data.stamp
5971 stamp['suspend'], stamp['resume'] = data.getTimeValues()
5972 if data.fwValid:
5973 stamp['fwsuspend'], stamp['fwresume'] = data.fwSuspend, data.fwResume
6015 for data in testruns:
6016 del data
6147 data = {
6165 data[key] = extra[key]
6167 data['funclist'] = find_in_html(html, '<div title="', '" class="traceevent"', False)
6171 data['target'] = tp.cmdline[tp.cmdline.find(arg):].split()[1]
6173 return data
6208 data = data_from_html(os.path.join(dirname, filename), outpath, issues)
6209 if(not data):
6211 if 'target' in data:
6212 target = data['target']
6213 testruns.append(data)
6215 if data[key] not in desc[key]:
6216 desc[key].append(data[key])
6225 pprint(' summary.html - tabular list of test data found')
6395 data = text.split()
6397 for val in data:
6449 ' capture dmesg and ftrace data until resume is complete. This data is\n'\
6498 ' -maxdepth N limit the callgraph data to N call levels (default: 0=all)\n'\
6499 ' -expandcg pre-expand the callgraph data in the html output (default: disabled)\n'\
6503 ' -cgphase P Only show callgraph data for phase P (e.g. suspend_late)\n'\
6504 ' -cgtest N Only show callgraph data for test N (e.g. 0 or 1 in an x2 run)\n'\
6509 ' -devdump Print out all the raw device data for each phase\n'\
6510 ' -cgdump Print out all the raw callgraph data\n'\
6831 # if instructed, re-analyze existing data files