diff options
author | David Kruger <David.Kruger@jdsu.com> | 2013-04-02 19:10:47 +0200 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2019-05-03 18:31:09 -0700 |
commit | 55da31779d51b74b87374f31287499a7c45217ae (patch) | |
tree | d1ae2478b485293f9d73d82bf42da82f46ace42e | |
parent | 74a7a93bbe7ffda19823ab251209bb31979c465d (diff) | |
download | openembedded-core-contrib-55da31779d51b74b87374f31287499a7c45217ae.tar.gz |
pybootchartgui: skip proc_stat.log entries without any times
This fixes a rare IndexError exception when 'times' is empty due to an
incomplete entry in proc_stat.log.
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | scripts/pybootchartgui/pybootchartgui/parsing.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py index 6e139bfbd1..0b5063b4f3 100644 --- a/scripts/pybootchartgui/pybootchartgui/parsing.py +++ b/scripts/pybootchartgui/pybootchartgui/parsing.py @@ -426,8 +426,10 @@ def _parse_proc_stat_log(file): # skip emtpy lines if not lines: continue - # CPU times {user, nice, system, idle, io_wait, irq, softirq} tokens = lines[0].split() + if len(tokens) < 8: + continue + # CPU times {user, nice, system, idle, io_wait, irq, softirq} times = [ int(token) for token in tokens[1:] ] if ltimes: user = float((times[0] + times[1]) - (ltimes[0] + ltimes[1])) |