From 295f1608b050af3bf73b3cd6eaadb9a52a6b4822 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 19 Nov 2012 15:02:18 +0000 Subject: scripts/pybootchart: Fix missing entries bug If two entries have the same start time, the data store used will cause all but one of the entries to be lost. This patch enhances the data storage structure to avoid this problem and allow more than one event to start at the same time. (From OE-Core rev: 220b071fd8d1cc6bdbca58f75489e3c9b34921ca) Signed-off-by: Richard Purdie --- scripts/pybootchartgui/pybootchartgui/parsing.py | 29 +++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'scripts/pybootchartgui/pybootchartgui/parsing.py') diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py index c64eba0a4d..a0f6e8e0eb 100644 --- a/scripts/pybootchartgui/pybootchartgui/parsing.py +++ b/scripts/pybootchartgui/pybootchartgui/parsing.py @@ -184,9 +184,16 @@ def _do_parse(state, filename, file): elif line.startswith("Ended:"): end = int(float(line.split()[-1])) if start and end and (end - start) > 8: + k = pn + ":" + task state.processes[pn + ":" + task] = [start, end] - state.start[start] = pn + ":" + task - state.end[end] = pn + ":" + task + if start not in state.start: + state.start[start] = [] + if k not in state.start[start]: + state.start[start].append(pn + ":" + task) + if end not in state.end: + state.end[end] = [] + if k not in state.end[end]: + state.end[end].append(pn + ":" + task) return state def parse_file(state, filename): @@ -248,12 +255,18 @@ def split_res(res, n): #state.processes[pn + ":" + task] = [start, end] #state.start[start] = pn + ":" + task #state.end[end] = pn + ":" + task - p = res.start[s_list[i]] - s = s_list[i] - e = res.processes[p][1] - state.processes[p] = [s, e] - state.start[s] = p - state.end[e] = p + for p in res.start[s_list[i]]: + s = s_list[i] + e = res.processes[p][1] + state.processes[p] = [s, e] + if s not in state.start: + state.start[s] = [] + if p not in state.start[s]: + state.start[s].append(p) + if e not in state.end: + state.end[e] = [] + if p not in state.end[e]: + state.end[e].append(p) start = end end = end + frag_size if end > len(s_list): -- cgit v1.2.3-54-g00ecf