mirror of
https://git.yoctoproject.org/poky
synced 2026-07-15 15:37:03 +00:00
pybootchartgui: render cpu and io pressure
Add two new, separate charts showing the avg10 and delta total pressure over time for the CPU and IO resources. The height of the avg10 data in each chart represents the percentage of time "some" task was delayed over the specific resource during the last 10 seconds of the build. The height of the delta total data in each chart represents the total time "some" task was delayed since the last sample was collected. If the reduced_proc_pressure data is not present in the buildstats log, then the new charts are not shown at all rather than being present but unpopulated. Note that the delta total graphs may appear "spikey", oscillating from high values to low. This behaviour is fixed in a subsequent commit. (From OE-Core rev: fb9ff46dc3059cb3f4c8df8e4654184c3eab1571) Signed-off-by: Aryaman Gupta <aryaman.gupta@windriver.com> Signed-off-by: Randy MacLeod <randy.macleod@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
ac162116b3
commit
45f1e9d953
@@ -49,6 +49,8 @@ class Trace:
|
||||
self.parent_map = None
|
||||
self.mem_stats = []
|
||||
self.monitor_disk = None
|
||||
self.cpu_pressure = []
|
||||
self.io_pressure = []
|
||||
self.times = [] # Always empty, but expected by draw.py when drawing system charts.
|
||||
|
||||
if len(paths):
|
||||
@@ -554,6 +556,27 @@ def _parse_monitor_disk_log(file):
|
||||
|
||||
return disk_stats
|
||||
|
||||
def _parse_pressure_logs(file, filename):
|
||||
"""
|
||||
Parse file for "some" pressure with 'avg10', 'avg60' 'avg300' and delta total values
|
||||
(in that order) directly stored on one line for both CPU and IO, based on filename.
|
||||
"""
|
||||
pressure_stats = []
|
||||
if filename == "cpu.log":
|
||||
SamplingClass = CPUPressureSample
|
||||
else:
|
||||
SamplingClass = IOPressureSample
|
||||
for time, lines in _parse_timed_blocks(file):
|
||||
for line in lines:
|
||||
if not line: continue
|
||||
tokens = line.split()
|
||||
avg10 = float(tokens[0])
|
||||
avg60 = float(tokens[1])
|
||||
avg300 = float(tokens[2])
|
||||
delta = float(tokens[3])
|
||||
pressure_stats.append(SamplingClass(time, avg10, avg60, avg300, delta))
|
||||
|
||||
return pressure_stats
|
||||
|
||||
# if we boot the kernel with: initcall_debug printk.time=1 we can
|
||||
# get all manner of interesting data from the dmesg output
|
||||
@@ -741,6 +764,11 @@ def _do_parse(writer, state, filename, file):
|
||||
state.cmdline = _parse_cmdline_log(writer, file)
|
||||
elif name == "monitor_disk.log":
|
||||
state.monitor_disk = _parse_monitor_disk_log(file)
|
||||
#pressure logs are in a subdirectory
|
||||
elif name == "cpu.log":
|
||||
state.cpu_pressure = _parse_pressure_logs(file, name)
|
||||
elif name == "io.log":
|
||||
state.io_pressure = _parse_pressure_logs(file, name)
|
||||
elif not filename.endswith('.log'):
|
||||
_parse_bitbake_buildstats(writer, state, filename, file)
|
||||
t2 = time.process_time()
|
||||
|
||||
Reference in New Issue
Block a user