Skip to content
Snippets Groups Projects
Commit a8caacd7 authored by Laura Abbott's avatar Laura Abbott
Browse files

linux-ramdump-parser-v2: Parse re-sized logbuffer

The logbuf for kernel dmesg logs may be re-sized at bootup to
be non-static. Account for this by parsing the non-static version
which should should also point to the static version.

Change-Id: Id5a2da0036b31ac0b5f4622a5e1cd74e38e8dae4
parent bd15a348
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2013, The Linux Foundation. All rights reserved. # Copyright (c) 2013-2014, 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
...@@ -30,8 +30,8 @@ class Dmesg(RamParser): ...@@ -30,8 +30,8 @@ class Dmesg(RamParser):
return ''.join([c for c in unclean_str if c in string.printable]) return ''.join([c for c in unclean_str if c in string.printable])
def extract_dmesg_flat(self, ramdump): def extract_dmesg_flat(self, ramdump):
addr = ramdump.addr_lookup('__log_buf') addr = ramdump.read_word(ramdump.addr_lookup('log_buf'))
size = ramdump.sizeof('__log_buf') size = ramdump.read_word(ramdump.addr_lookup('log_buf_len'))
dmesg = ramdump.read_physical(ramdump.virt_to_phys(addr), size) dmesg = ramdump.read_physical(ramdump.virt_to_phys(addr), size)
print_out_str(self.cleanupString(dmesg.decode('ascii', 'ignore'))) print_out_str(self.cleanupString(dmesg.decode('ascii', 'ignore')))
...@@ -59,7 +59,7 @@ class Dmesg(RamParser): ...@@ -59,7 +59,7 @@ class Dmesg(RamParser):
def extract_dmesg_binary(self, ramdump): def extract_dmesg_binary(self, ramdump):
first_idx_addr = ramdump.addr_lookup('log_first_idx') first_idx_addr = ramdump.addr_lookup('log_first_idx')
last_idx_addr = ramdump.addr_lookup('log_next_idx') last_idx_addr = ramdump.addr_lookup('log_next_idx')
logbuf_addr = ramdump.addr_lookup('__log_buf') logbuf_addr = ramdump.addr_lookup('log_buf')
time_offset = ramdump.field_offset('struct log', 'ts_nsec') time_offset = ramdump.field_offset('struct log', 'ts_nsec')
len_offset = ramdump.field_offset('struct log', 'len') len_offset = ramdump.field_offset('struct log', 'len')
text_len_offset = ramdump.field_offset('struct log', 'text_len') text_len_offset = ramdump.field_offset('struct log', 'text_len')
......
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