Skip to content

Commit

Permalink
Split kernel and userspace by free_area()
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoldlu committed Jun 19, 2018
1 parent e80f226 commit 6195fa7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bootgraph.py
Expand Up @@ -63,6 +63,7 @@ class SystemValues(aslib.SystemValues):
timeformat = '%.6f'
bootloader = 'grub'
blexec = []
last_init=0
def __init__(self):
self.hostname = platform.node()
self.testtime = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
Expand Down Expand Up @@ -223,7 +224,7 @@ def __init__(self, num):
'kernel': {'list': dict(), 'start': -1.0, 'end': -1.0, 'row': 0,
'order': 0, 'color': 'linear-gradient(to bottom, #fff, #bcf)'},
'user': {'list': dict(), 'start': -1.0, 'end': -1.0, 'row': 0,
'order': 1, 'color': '#fff'}
'order': 1, 'color': 'linear-gradient(to bottom, #456, #cde)'}
}
def deviceTopology(self):
return ''
Expand Down Expand Up @@ -345,17 +346,18 @@ def parseKernelLog():
m = re.match('^initcall *(?P<f>.*)\+.* returned (?P<r>.*) after (?P<t>.*) usecs', msg)
if(m):
data.valid = True
data.end = ktime
sysvals.last_init = '%.0f'%(ktime*1000)
f, r, t = m.group('f', 'r', 't')
if(f in devtemp):
start, pid = devtemp[f]
data.newAction(phase, f, pid, start, ktime, int(r), int(t))
del devtemp[f]
continue
if(re.match('^Freeing unused kernel memory.*', msg)):
if(re.match('^Freeing init kernel memory.*', msg)):
data.tUserMode = ktime
data.dmesg['kernel']['end'] = ktime
data.dmesg['user']['start'] = ktime
data.end = ktime+0.1
phase = 'user'

if tp.stamp:
Expand Down Expand Up @@ -531,8 +533,8 @@ def createBootGraph(data):
print('ERROR: No timeline data')
return False
user_mode = '%.0f'%(data.tUserMode*1000)
last_init = '%.0f'%(tTotal*1000)
devtl.html += html_timetotal.format(user_mode, last_init)
#last_init = '%.0f'%(tTotal*1000)
devtl.html += html_timetotal.format(user_mode, sysvals.last_init)

# determine the maximum number of rows we need to draw
devlist = []
Expand Down

0 comments on commit 6195fa7

Please sign in to comment.