]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
pybootchartgui: be more tolerant when parsing proc_meminfo.log
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Fri, 17 Aug 2012 16:02:12 +0000 (18:02 +0200)
committerArmin Kuster <akuster808@gmail.com>
Sat, 4 May 2019 01:29:33 +0000 (18:29 -0700)
waasdorp reports in bug #40 that we are raising an exception if
a line in proc_meminfo.log is not well formed.
He is right because we were trying to access matches of a regexp
that did not match.

That is obviously silly but it is also silly to stop processing
all the data if a line is wrong, even a line that we are not
interested in it. Instead ignore the line and skip the sample
if it is not valid.

Example of broken line:

Shmem:

While at it remove an unused variable

Signed-off-by: Armin Kuster <akuster808@gmail.com>
scripts/pybootchartgui/pybootchartgui/parsing.py

index bcfb2da569819182fb44ad78bc81ff6673c2ea92..b7b2546ff1c8e52d06b4465cf20fa9d74fa75cfa 100644 (file)
@@ -513,8 +513,6 @@ def _parse_proc_meminfo_log(file):
     Parse file for global memory statistics.
     The format of relevant lines should be: ^key: value( unit)?
     """
-    used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)
-
     mem_stats = []
     meminfo_re = re.compile(r'([^ \t:]+):\s*(\d+).*')