Skip to content
Snippets Groups Projects
Commit a3ce43a2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "lrdp-v2: Move users of RamDump.version to RamDump.kernel_version"

parents bcf6f5ee 6d8b8510
No related branches found
No related tags found
No related merge requests found
# 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 # 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 # it under the terms of the GNU General Public License version 2 and
...@@ -132,10 +132,8 @@ class DmesgLib(object): ...@@ -132,10 +132,8 @@ class DmesgLib(object):
curr_idx = self.verify_log(curr_idx, logbuf_addr, last_idx) curr_idx = self.verify_log(curr_idx, logbuf_addr, last_idx)
def extract_dmesg(self): def extract_dmesg(self):
match = re.search('(\d+)\.(\d+)\.(\d+)', self.ramdump.version) major, minor, patch = self.ramdump.kernel_version
if match is not None: if (major, minor) >= (3, 7):
major, minor, patch = map(int, match.groups()) self.extract_dmesg_binary()
if (major, minor) >= (3, 7): return
self.extract_dmesg_binary()
return
self.extract_dmesg_flat() self.extract_dmesg_flat()
...@@ -74,7 +74,7 @@ class IrqParse(RamParser): ...@@ -74,7 +74,7 @@ class IrqParse(RamParser):
def radix_tree_lookup_element(self, ram_dump, root_addr, index): def radix_tree_lookup_element(self, ram_dump, root_addr, index):
rnode_offset = ram_dump.field_offset('struct radix_tree_root', 'rnode') rnode_offset = ram_dump.field_offset('struct radix_tree_root', 'rnode')
if (ram_dump.major[0], ram_dump.major[1]) >= (3, 18): if (ram_dump.kernel_version[0], ram_dump.kernel_version[1]) >= (3, 18):
rnode_height_offset = ram_dump.field_offset( rnode_height_offset = ram_dump.field_offset(
'struct radix_tree_node', 'path') 'struct radix_tree_node', 'path')
else: else:
...@@ -98,7 +98,7 @@ class IrqParse(RamParser): ...@@ -98,7 +98,7 @@ class IrqParse(RamParser):
node_addr = ram_dump.read_word(root_addr + rnode_offset) & 0xfffffffffffffffe node_addr = ram_dump.read_word(root_addr + rnode_offset) & 0xfffffffffffffffe
height = ram_dump.read_int(node_addr + rnode_height_offset) height = ram_dump.read_int(node_addr + rnode_height_offset)
if (ram_dump.major[0], ram_dump.major[1]) >= (3, 18): if (ram_dump.kernel_version[0], ram_dump.kernel_version[1]) >= (3, 18):
height = height & radix_tree_height_mask height = height & radix_tree_height_mask
if height > len(height_to_maxindex): if height > len(height_to_maxindex):
......
# 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 # 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 # it under the terms of the GNU General Public License version 2 and
...@@ -120,8 +120,8 @@ class Vmalloc(RamParser): ...@@ -120,8 +120,8 @@ class Vmalloc(RamParser):
def parse(self): def parse(self):
out_path = self.ramdump.outdir out_path = self.ramdump.outdir
ver = self.ramdump.version major, minor, patch = self.ramdump.kernel_version
if re.search('3\.10\.\d', ver) is not None: if (major, minor) == (3, 10):
self.print_vmalloc_info_3_10(out_path) self.print_vmalloc_info_3_10(out_path)
else: else:
self.print_vmalloc_info(out_path) self.print_vmalloc_info(out_path)
...@@ -440,9 +440,7 @@ class Workqueues(RamParser): ...@@ -440,9 +440,7 @@ class Workqueues(RamParser):
pending_list.walk(self.ramdump.read_word(worklist_addr), self.pending_list_walk) pending_list.walk(self.ramdump.read_word(worklist_addr), self.pending_list_walk)
def parse(self): def parse(self):
ver = self.ramdump.version major, minor, patch = self.ramdump.kernel_version
match = re.search('(\d+)\.(\d+)\.(\d+)', ver)
major, minor, patch = map(int, match.groups())
if (major, minor) == (3, 0): if (major, minor) == (3, 0):
print_workqueue_state_3_0(self.ramdump) print_workqueue_state_3_0(self.ramdump)
elif (major, minor) == (3, 4): elif (major, minor) == (3, 4):
......
...@@ -466,7 +466,7 @@ class RamDump(): ...@@ -466,7 +466,7 @@ class RamDump():
self.ipc_log_debug = options.ipc_debug self.ipc_log_debug = options.ipc_debug
self.ipc_log_help = options.ipc_help self.ipc_log_help = options.ipc_help
self.use_stdout = options.stdout self.use_stdout = options.stdout
self.major = [0, 0, 0] self.kernel_version = [0, 0, 0]
if options.ram_addr is not None: if options.ram_addr is not None:
# TODO sanity check to make sure the memory regions don't overlap # TODO sanity check to make sure the memory regions don't overlap
for file_path, start, end in options.ram_addr: for file_path, start, end in options.ram_addr:
...@@ -634,7 +634,7 @@ class RamDump(): ...@@ -634,7 +634,7 @@ class RamDump():
self.version = v.group(1) self.version = v.group(1)
match = re.search('(\d+)\.(\d+)\.(\d+)', self.version) match = re.search('(\d+)\.(\d+)\.(\d+)', self.version)
if match is not None: if match is not None:
self.major[0], self.major[1], self.major[2] = map(int, match.groups()) self.kernel_version = map(int, match.groups())
else: else:
print_out_str('!!! Could not extract version info! {0}'.format(self.version)) print_out_str('!!! Could not extract version info! {0}'.format(self.version))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment