From d9d187471fecfb760cdd213bebfec64a223e729f Mon Sep 17 00:00:00 2001 From: Douglas RAILLARD Date: Mon, 2 Sep 2019 18:31:50 +0100 Subject: [PATCH] trace: dmesg: Ignore empty lines dmesg output seems to sometimes include an empty line. Ignore them, so we don't fail to match with the regexes. --- devlib/trace/dmesg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/trace/dmesg.py b/devlib/trace/dmesg.py index 3887093..851c9e8 100644 --- a/devlib/trace/dmesg.py +++ b/devlib/trace/dmesg.py @@ -166,6 +166,7 @@ class DmesgCollector(TraceCollector): return [ KernelLogEntry.from_str(line) for line in dmesg_out.splitlines() + if line.strip() ] def reset(self): @@ -195,4 +196,3 @@ class DmesgCollector(TraceCollector): def get_trace(self, outfile): with open(outfile, 'wt') as f: f.write(self.dmesg_out + '\n') -