From: Riccardo Magliocchetti Date: Fri, 17 Aug 2012 16:02:12 +0000 (+0200) Subject: pybootchartgui: be more tolerant when parsing proc_meminfo.log X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff7cecc8bd22becdb1dad16bf61ba8ce03960882;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git pybootchartgui: be more tolerant when parsing proc_meminfo.log 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 --- diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py index bcfb2da5698..b7b2546ff1c 100644 --- a/scripts/pybootchartgui/pybootchartgui/parsing.py +++ b/scripts/pybootchartgui/pybootchartgui/parsing.py @@ -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+).*')