From ff7cecc8bd22becdb1dad16bf61ba8ce03960882 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 17 Aug 2012 18:02:12 +0200 Subject: 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 --- scripts/pybootchartgui/pybootchartgui/parsing.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py index bcfb2da569..b7b2546ff1 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+).*') -- cgit 1.2.3-korg