From e579e0ebd34633e6d514ec26b82343be817da32c Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Tue, 19 Dec 2017 07:35:49 +0100 Subject: [PATCH] Remove "Call Trace" line of kernel stack trace The kernel stack trace started with a line "Call Trace:". This line will be removed from the output. Leading spaces are stripped to adjust the output. --- OOMAnalyser.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OOMAnalyser.py b/OOMAnalyser.py index d77ac07..41c42ed 100644 --- a/OOMAnalyser.py +++ b/OOMAnalyser.py @@ -578,7 +578,15 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k self.details.update(match.groupdict()) self.details['hardware_info'] = self._extract_block_from_next_pos('Hardware name:') - self.details['call_trace'] = self._extract_block_from_next_pos('Call Trace:') + + # strip "Call Trace" line at beginning and remove leading spaces + call_trace = '' + block = self._extract_block_from_next_pos('Call Trace:') + for line in block.split('\n'): + if line.startswith('Call Trace'): + continue + call_trace += "{}\n".format(line.strip()) + self.details['call_trace'] = call_trace match = self.REC_MEMINFO_1.search(self.oom.text) if match: