summaryrefslogtreecommitdiffstats
path: root/scripts/pybootchartgui/pybootchartgui/parsing.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/pybootchartgui/pybootchartgui/parsing.py')
-rw-r--r--scripts/pybootchartgui/pybootchartgui/parsing.py26
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:
48 self.filename = None 48 self.filename = None
49 self.parent_map = None 49 self.parent_map = None
50 self.mem_stats = [] 50 self.mem_stats = []
51 self.monitor_disk = None
51 self.times = [] # Always empty, but expected by draw.py when drawing system charts. 52 self.times = [] # Always empty, but expected by draw.py when drawing system charts.
52 53
53 if len(paths): 54 if len(paths):
@@ -506,6 +507,29 @@ def _parse_proc_meminfo_log(file):
506 507
507 return mem_stats 508 return mem_stats
508 509
510def _parse_monitor_disk_log(file):
511 """
512 Parse file with information about amount of diskspace used.
513 The format of relevant lines should be: ^volume path: number-of-bytes?
514 """
515 disk_stats = []
516 diskinfo_re = re.compile(r'^(.+):\s*(\d+)$')
517
518 for time, lines in _parse_timed_blocks(file):
519 sample = DiskSpaceSample(time)
520
521 for line in lines:
522 match = diskinfo_re.match(line)
523 if not match:
524 raise ParseError("Invalid monitor_disk line \"%s\"" % line)
525 sample.add_value(match.group(1), int(match.group(2)))
526
527 if sample.valid():
528 disk_stats.append(sample)
529
530 return disk_stats
531
532
509# if we boot the kernel with: initcall_debug printk.time=1 we can 533# if we boot the kernel with: initcall_debug printk.time=1 we can
510# get all manner of interesting data from the dmesg output 534# get all manner of interesting data from the dmesg output
511# We turn this into a pseudo-process tree: each event is 535# We turn this into a pseudo-process tree: each event is
@@ -684,6 +708,8 @@ def _do_parse(writer, state, filename, file):
684 state.mem_stats = _parse_proc_meminfo_log(file) 708 state.mem_stats = _parse_proc_meminfo_log(file)
685 elif name == "cmdline2.log": 709 elif name == "cmdline2.log":
686 state.cmdline = _parse_cmdline_log(writer, file) 710 state.cmdline = _parse_cmdline_log(writer, file)
711 elif name == "monitor_disk.log":
712 state.monitor_disk = _parse_monitor_disk_log(file)
687 elif not filename.endswith('.log'): 713 elif not filename.endswith('.log'):
688 _parse_bitbake_buildstats(writer, state, filename, file) 714 _parse_bitbake_buildstats(writer, state, filename, file)
689 t2 = clock() 715 t2 = clock()