summaryrefslogtreecommitdiffstats
path: root/scripts/pybootchartgui
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2014-01-21 16:22:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-23 10:17:33 +0000
commit9d492a46fa273747fa29b92680d86619717f158c (patch)
tree726dfab76650f7c3a5ec9e8ff5fe7315aeafef6e /scripts/pybootchartgui
parentea27845a67651ef832b2149411c5a2e3104abec7 (diff)
downloadpoky-9d492a46fa273747fa29b92680d86619717f158c.tar.gz
pybootchartgui: Simplify adding processes to the trace
(From OE-Core rev: 5fa869007b5ba762bf5679197cf98b1d14a34a22) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/pybootchartgui')
-rw-r--r--scripts/pybootchartgui/pybootchartgui/parsing.py39
1 files changed, 14 insertions, 25 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py
index 0600b5162b..1cb4466e6d 100644
--- a/scripts/pybootchartgui/pybootchartgui/parsing.py
+++ b/scripts/pybootchartgui/pybootchartgui/parsing.py
@@ -96,6 +96,16 @@ class Trace:
96 return self.headers != None and self.disk_stats != None and \ 96 return self.headers != None and self.disk_stats != None and \
97 self.ps_stats != None and self.cpu_stats != None 97 self.ps_stats != None and self.cpu_stats != None
98 98
99 def add_process(self, process, start, end):
100 self.processes[process] = [start, end]
101 if start not in self.start:
102 self.start[start] = []
103 if process not in self.start[start]:
104 self.start[start].append(process)
105 if end not in self.end:
106 self.end[end] = []
107 if process not in self.end[end]:
108 self.end[end].append(process)
99 109
100 def compile(self, writer): 110 def compile(self, writer):
101 111
@@ -645,16 +655,7 @@ def _do_parse(writer, state, filename, file):
645 elif line.startswith("Ended:"): 655 elif line.startswith("Ended:"):
646 end = int(float(line.split()[-1])) 656 end = int(float(line.split()[-1]))
647 if start and end: 657 if start and end:
648 k = pn + ":" + task 658 state.add_process(pn + ":" + task, start, end)
649 state.processes[pn + ":" + task] = [start, end]
650 if start not in state.start:
651 state.start[start] = []
652 if k not in state.start[start]:
653 state.start[start].append(pn + ":" + task)
654 if end not in state.end:
655 state.end[end] = []
656 if k not in state.end[end]:
657 state.end[end].append(pn + ":" + task)
658 t2 = clock() 659 t2 = clock()
659 writer.info(" %s seconds" % str(t2-t1)) 660 writer.info(" %s seconds" % str(t2-t1))
660 return state 661 return state
@@ -716,22 +717,10 @@ def split_res(res, n):
716 while start < end: 717 while start < end:
717 state = Trace(None, [], None) 718 state = Trace(None, [], None)
718 for i in range(start, end): 719 for i in range(start, end):
719 # Add these lines for reference 720 # Add this line for reference
720 #state.processes[pn + ":" + task] = [start, end] 721 #state.add_process(pn + ":" + task, start, end)
721 #state.start[start] = pn + ":" + task
722 #state.end[end] = pn + ":" + task
723 for p in res.start[s_list[i]]: 722 for p in res.start[s_list[i]]:
724 s = s_list[i] 723 state.add_process(p, s_list[i], res.processes[p][1])
725 e = res.processes[p][1]
726 state.processes[p] = [s, e]
727 if s not in state.start:
728 state.start[s] = []
729 if p not in state.start[s]:
730 state.start[s].append(p)
731 if e not in state.end:
732 state.end[e] = []
733 if p not in state.end[e]:
734 state.end[e].append(p)
735 start = end 724 start = end
736 end = end + frag_size 725 end = end + frag_size
737 if end > len(s_list): 726 if end > len(s_list):