summaryrefslogtreecommitdiffstats
path: root/scripts/pybootchartgui/pybootchartgui/draw.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-19 15:02:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-11-20 15:31:48 +0000
commit295f1608b050af3bf73b3cd6eaadb9a52a6b4822 (patch)
treef937737e21cdf50bb10d28e593dc46ccea333daa /scripts/pybootchartgui/pybootchartgui/draw.py
parent6e6dcbe340c9ee4a4a23318ace3335a004a8d31b (diff)
downloadpoky-295f1608b050af3bf73b3cd6eaadb9a52a6b4822.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/pybootchartgui/pybootchartgui/draw.py')
-rw-r--r--scripts/pybootchartgui/pybootchartgui/draw.py53
1 files changed, 27 insertions, 26 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/draw.py b/scripts/pybootchartgui/pybootchartgui/draw.py
index 16830fa456..1b872de75e 100644
--- a/scripts/pybootchartgui/pybootchartgui/draw.py
+++ b/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -287,32 +287,33 @@ def render(ctx, res):
287 287
288 offset = min(res.start.keys()) 288 offset = min(res.start.keys())
289 for s in sorted(res.start.keys()): 289 for s in sorted(res.start.keys()):
290 task = res.start[s].split(":")[1] 290 for val in sorted(res.start[s]):
291 #print res.start[s] 291 task = val.split(":")[1]
292 #print res.processes[res.start[s]][1] 292 #print val
293 #print s 293 #print res.processes[val][1]
294 x = (s - offset) * sec_w 294 #print s
295 w = ((res.processes[res.start[s]][1] - s) * sec_w) 295 x = (s - offset) * sec_w
296 296 w = ((res.processes[val][1] - s) * sec_w)
297 #print "proc at %s %s %s %s" % (x, y, w, proc_h) 297
298 col = None 298 #print "proc at %s %s %s %s" % (x, y, w, proc_h)
299 if task == "do_compile": 299 col = None
300 col = TASK_COLOR_COMPILE 300 if task == "do_compile":
301 elif task == "do_configure": 301 col = TASK_COLOR_COMPILE
302 col = TASK_COLOR_CONFIGURE 302 elif task == "do_configure":
303 elif task == "do_install": 303 col = TASK_COLOR_CONFIGURE
304 col = TASK_COLOR_INSTALL 304 elif task == "do_install":
305 elif task == "do_package": 305 col = TASK_COLOR_INSTALL
306 col = TASK_COLOR_PACKAGE 306 elif task == "do_package":
307 elif task == "do_populate_sysroot": 307 col = TASK_COLOR_PACKAGE
308 col = TASK_COLOR_SYSROOT 308 elif task == "do_populate_sysroot":
309 309 col = TASK_COLOR_SYSROOT
310 draw_rect(ctx, PROC_BORDER_COLOR, (x, y, w, proc_h)) 310
311 if col: 311 draw_rect(ctx, PROC_BORDER_COLOR, (x, y, w, proc_h))
312 draw_fill_rect(ctx, col, (x, y, w, proc_h)) 312 if col:
313 313 draw_fill_rect(ctx, col, (x, y, w, proc_h))
314 draw_label_in_box(ctx, PROC_TEXT_COLOR, res.start[s], x, y + proc_h - 4, w, proc_h) 314
315 y = y + proc_h 315 draw_label_in_box(ctx, PROC_TEXT_COLOR, val, x, y + proc_h - 4, w, proc_h)
316 y = y + proc_h
316 317
317 # draw process boxes 318 # draw process boxes
318 #draw_process_bar_chart(ctx, proc_tree, curr_y + bar_h, w, h) 319 #draw_process_bar_chart(ctx, proc_tree, curr_y + bar_h, w, h)