mirror of
https://git.yoctoproject.org/poky
synced 2026-04-23 00:32:12 +02:00
scripts/pybootchart: Port to python3
This updates the pybootchart code (used for viewing build timing profiles) to use python3. The bulk of the changes are to use gi instead of pygtk, i.e. port from gtk+2 to gtk+3. The main change is to make the bootchart widget inherit gtk.Scrollable and change the way the scrollbars are implemented to match the new method upstream. The drawing code used cairo already so can remain unchanged, (From OE-Core rev: 949144681ad7f536732169351cab6d0612e9c566) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -19,6 +19,7 @@ import math
|
||||
import re
|
||||
import random
|
||||
import colorsys
|
||||
import functools
|
||||
from operator import itemgetter
|
||||
|
||||
class RenderOptions:
|
||||
@@ -449,7 +450,7 @@ def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w):
|
||||
[(sample.time,
|
||||
# Sum up used space of all volumes including the current one
|
||||
# so that the graphs appear as stacked on top of each other.
|
||||
reduce(lambda x,y: x+y,
|
||||
functools.reduce(lambda x,y: x+y,
|
||||
[sample.records[volume] - min_used[volume]
|
||||
for volume in volumes[0:i]
|
||||
if volume in sample.records],
|
||||
@@ -501,7 +502,7 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w):
|
||||
TASK_COLOR_SYSROOT, off_x+360, curr_y + 45, leg_s)
|
||||
draw_legend_box (ctx, "Package", \
|
||||
TASK_COLOR_PACKAGE, off_x+480, curr_y + 45, leg_s)
|
||||
draw_legend_box (ctx, "Package Write",
|
||||
draw_legend_box (ctx, "Package Write", \
|
||||
TASK_COLOR_PACKAGE_WRITE, off_x+600, curr_y + 45, leg_s)
|
||||
|
||||
ctx.set_font_size(PROC_TEXT_FONT_SIZE)
|
||||
@@ -518,13 +519,14 @@ def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w):
|
||||
trace.processes[val][1] - s < options.app_options.mintime:
|
||||
continue
|
||||
task = val.split(":")[1]
|
||||
#print val
|
||||
#print trace.processes[val][1]
|
||||
#print s
|
||||
#print(val)
|
||||
#print(trace.processes[val][1])
|
||||
#print(s)
|
||||
|
||||
x = chart_rect[0] + (s - offset) * sec_w
|
||||
w = ((trace.processes[val][1] - s) * sec_w)
|
||||
|
||||
#print "proc at %s %s %s %s" % (x, y, w, proc_h)
|
||||
#print("proc at %s %s %s %s" % (x, y, w, proc_h))
|
||||
col = None
|
||||
if task == "do_compile":
|
||||
col = TASK_COLOR_COMPILE
|
||||
|
||||
Reference in New Issue
Block a user