summaryrefslogtreecommitdiffstats
path: root/scripts/pybootchartgui
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-19 15:18:04 +0000
commit220b071fd8d1cc6bdbca58f75489e3c9b34921ca (patch)
tree0f08fa6126a4dffa537a46cef657f9d844123ae1 /scripts/pybootchartgui
parent9b5660ee0e507852a02ba5281b571f3e55dffc18 (diff)
downloadopenembedded-core-contrib-220b071fd8d1cc6bdbca58f75489e3c9b34921ca.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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/pybootchartgui')
-rw-r--r--scripts/pybootchartgui/pybootchartgui/draw.py53
-rw-r--r--scripts/pybootchartgui/pybootchartgui/parsing.py29
2 files changed, 48 insertions, 34 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):
offset = min(res.start.keys())
for s in sorted(res.start.keys()):
- task = res.start[s].split(":")[1]
- #print res.start[s]
- #print res.processes[res.start[s]][1]
- #print s
- x = (s - offset) * sec_w
- w = ((res.processes[res.start[s]][1] - s) * sec_w)
-
- #print "proc at %s %s %s %s" % (x, y, w, proc_h)
- col = None
- if task == "do_compile":
- col = TASK_COLOR_COMPILE
- elif task == "do_configure":
- col = TASK_COLOR_CONFIGURE
- elif task == "do_install":
- col = TASK_COLOR_INSTALL
- elif task == "do_package":
- col = TASK_COLOR_PACKAGE
- elif task == "do_populate_sysroot":
- col = TASK_COLOR_SYSROOT
-
- draw_rect(ctx, PROC_BORDER_COLOR, (x, y, w, proc_h))
- if col:
- draw_fill_rect(ctx, col, (x, y, w, proc_h))
-
- draw_label_in_box(ctx, PROC_TEXT_COLOR, res.start[s], x, y + proc_h - 4, w, proc_h)
- y = y + proc_h
+ for val in sorted(res.start[s]):
+ task = val.split(":")[1]
+ #print val
+ #print res.processes[val][1]
+ #print s
+ x = (s - offset) * sec_w
+ w = ((res.processes[val][1] - s) * sec_w)
+
+ #print "proc at %s %s %s %s" % (x, y, w, proc_h)
+ col = None
+ if task == "do_compile":
+ col = TASK_COLOR_COMPILE
+ elif task == "do_configure":
+ col = TASK_COLOR_CONFIGURE
+ elif task == "do_install":
+ col = TASK_COLOR_INSTALL
+ elif task == "do_package":
+ col = TASK_COLOR_PACKAGE
+ elif task == "do_populate_sysroot":
+ col = TASK_COLOR_SYSROOT
+
+ draw_rect(ctx, PROC_BORDER_COLOR, (x, y, w, proc_h))
+ if col:
+ draw_fill_rect(ctx, col, (x, y, w, proc_h))
+
+ draw_label_in_box(ctx, PROC_TEXT_COLOR, val, x, y + proc_h - 4, w, proc_h)
+ y = y + proc_h
# draw process boxes
#draw_process_bar_chart(ctx, proc_tree, curr_y + bar_h, w, h)
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):
='n398' href='#n398'>398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570