diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2016-11-30 10:50:08 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-07 10:36:11 +0000 |
commit | 263d189d066b578debf08b2bd07494a69b70f70d (patch) | |
tree | 1d19b430d7f020df07093a0261772fbd63e24ade /scripts/pybootchartgui/pybootchartgui/parsing.py | |
parent | ddfea21e06a2e6b1a1e766969f8c134a6de7388a (diff) | |
download | openembedded-core-contrib-263d189d066b578debf08b2bd07494a69b70f70d.tar.gz |
pybootchartgui: render disk space usage
This adds a new, separate chart showing the amount of disk space used
over time for each volume monitored during the build. The hight of the
graph entries represents the delta between current usage and minimal
usage during the build.
That's more useful than showing just the current usage, because then a
graph showing changes in the order of MBs in a volume that is several
GB large would be just flat.
The legend shows the maximum of those deltas, i.e. maximum amount of
space needed for the build. Minor caveat: sampling of disk space usage
starts a bit later than the initial task, so the displayed value may
be slightly lower than the actual amount of space needed because
sampling does not record the actual initial state.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/pybootchartgui/pybootchartgui/parsing.py')
-rw-r--r-- | scripts/pybootchartgui/pybootchartgui/parsing.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py index 48eb048dae..301145ab67 100644 --- a/scripts/pybootchartgui/pybootchartgui/parsing.py +++ b/scripts/pybootchartgui/pybootchartgui/parsing.py @@ -48,6 +48,7 @@ class Trace: self.filename = None self.parent_map = None self.mem_stats = [] + self.monitor_disk = None self.times = [] # Always empty, but expected by draw.py when drawing system charts. if len(paths): @@ -506,6 +507,29 @@ def _parse_proc_meminfo_log(file): return mem_stats +def _parse_monitor_disk_log(file): + """ + Parse file with information about amount of diskspace used. + The format of relevant lines should be: ^volume path: number-of-bytes? + """ + disk_stats = [] + diskinfo_re = re.compile(r'^(.+):\s*(\d+)$') + + for time, lines in _parse_timed_blocks(file): + sample = DiskSpaceSample(time) + + for line in lines: + match = diskinfo_re.match(line) + if not match: + raise ParseError("Invalid monitor_disk line \"%s\"" % line) + sample.add_value(match.group(1), int(match.group(2))) + + if sample.valid(): + disk_stats.append(sample) + + return disk_stats + + # if we boot the kernel with: initcall_debug printk.time=1 we can # get all manner of interesting data from the dmesg output # We turn this into a pseudo-process tree: each event is @@ -684,6 +708,8 @@ def _do_parse(writer, state, filename, file): state.mem_stats = _parse_proc_meminfo_log(file) elif name == "cmdline2.log": state.cmdline = _parse_cmdline_log(writer, file) + elif name == "monitor_disk.log": + state.monitor_disk = _parse_monitor_disk_log(file) elif not filename.endswith('.log'): _parse_bitbake_buildstats(writer, state, filename, file) t2 = clock() |