diff --git a/linux-ramdump-parser-v2/dmesglib.py b/linux-ramdump-parser-v2/dmesglib.py index 2375f59f4f2d6145de43ad1b99b08400990be673..8275b31a6952e5e61b24bf997d2652ceb048afca 100644 --- a/linux-ramdump-parser-v2/dmesglib.py +++ b/linux-ramdump-parser-v2/dmesglib.py @@ -1,4 +1,4 @@ -# Copyright (c) 2014, The Linux Foundation. All rights reserved. +# Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 and @@ -132,10 +132,8 @@ class DmesgLib(object): curr_idx = self.verify_log(curr_idx, logbuf_addr, last_idx) def extract_dmesg(self): - match = re.search('(\d+)\.(\d+)\.(\d+)', self.ramdump.version) - if match is not None: - major, minor, patch = map(int, match.groups()) - if (major, minor) >= (3, 7): - self.extract_dmesg_binary() - return + major, minor, patch = self.ramdump.kernel_version + if (major, minor) >= (3, 7): + self.extract_dmesg_binary() + return self.extract_dmesg_flat() diff --git a/linux-ramdump-parser-v2/parsers/vmalloc.py b/linux-ramdump-parser-v2/parsers/vmalloc.py index 54ff28e589b7a87ab14d12d002db18276ce93b0c..062b7406333939a66249b4211ca8ea834269b234 100644 --- a/linux-ramdump-parser-v2/parsers/vmalloc.py +++ b/linux-ramdump-parser-v2/parsers/vmalloc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 and @@ -120,8 +120,8 @@ class Vmalloc(RamParser): def parse(self): out_path = self.ramdump.outdir - ver = self.ramdump.version - if re.search('3\.10\.\d', ver) is not None: + major, minor, patch = self.ramdump.kernel_version + if (major, minor) == (3, 10): self.print_vmalloc_info_3_10(out_path) else: self.print_vmalloc_info(out_path) diff --git a/linux-ramdump-parser-v2/parsers/workqueue.py b/linux-ramdump-parser-v2/parsers/workqueue.py index dcecd4297b8c7141da5456d3f92fb84dea0e5774..5df616d28c099852c8b807d7dfa9dec76d25b911 100644 --- a/linux-ramdump-parser-v2/parsers/workqueue.py +++ b/linux-ramdump-parser-v2/parsers/workqueue.py @@ -440,9 +440,7 @@ class Workqueues(RamParser): pending_list.walk(self.ramdump.read_word(worklist_addr), self.pending_list_walk) def parse(self): - ver = self.ramdump.version - match = re.search('(\d+)\.(\d+)\.(\d+)', ver) - major, minor, patch = map(int, match.groups()) + major, minor, patch = self.ramdump.kernel_version if (major, minor) == (3, 0): print_workqueue_state_3_0(self.ramdump) elif (major, minor) == (3, 4):