Skip to content
Snippets Groups Projects
Commit e06c1ac4 authored by lnx build's avatar lnx build Committed by Gerrit - the friendly Code Review server
Browse files

Merge "lrdp_v2 : Fix for broken vmalloc.py" into opensource-tools.lnx.1.0

parents ba7ec138 26db76ee
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. # Copyright (c) 2012-2015,2017 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
...@@ -49,20 +49,19 @@ class Vmalloc(RamParser): ...@@ -49,20 +49,19 @@ class Vmalloc(RamParser):
if addr is None: if addr is None:
return return
vmalloc_str = '{0:x}-{1:x} {2:x}'.format(addr, addr + size, size) vmalloc_str = 'v.v (struct vmap_area)0x{0:16x} '.format(vm)
vmalloc_str = vmalloc_str + '{0:18x}-{1:x} {2:8x}'\
.format(addr, addr + size, size)
vmalloc_str = vmalloc_str + ' {0:10x} '.format(phys_addr)
if (caller != 0): if (caller != 0):
a = self.ramdump.unwind_lookup(caller) a = self.ramdump.unwind_lookup(caller)
if a is not None: if a is not None:
symname, offset = a symname, offset = a
sym = symname + '0x' + str(hex(offset))
vmalloc_str = vmalloc_str + \ vmalloc_str = vmalloc_str + \
' {0}+0x{1:x}'.format(symname, offset) ' {0:46}'.format(sym)
if (nr_pages != 0):
vmalloc_str = vmalloc_str + ' pages={0}'.format(nr_pages)
if (phys_addr != 0):
vmalloc_str = vmalloc_str + ' phys={0:x}'.format(phys_addr)
if (flags & VM_IOREMAP) != 0: if (flags & VM_IOREMAP) != 0:
vmalloc_str = vmalloc_str + ' ioremap' vmalloc_str = vmalloc_str + ' ioremap'
...@@ -79,6 +78,9 @@ class Vmalloc(RamParser): ...@@ -79,6 +78,9 @@ class Vmalloc(RamParser):
if (flags & VM_VPAGES) != 0: if (flags & VM_VPAGES) != 0:
vmalloc_str = vmalloc_str + ' vpages' vmalloc_str = vmalloc_str + ' vpages'
if (nr_pages != 0):
vmalloc_str = vmalloc_str + ' pages={0}'.format(nr_pages)
vmalloc_str = vmalloc_str + '\n' vmalloc_str = vmalloc_str + '\n'
self.vmalloc_out.write(vmalloc_str) self.vmalloc_out.write(vmalloc_str)
...@@ -89,7 +91,7 @@ class Vmalloc(RamParser): ...@@ -89,7 +91,7 @@ class Vmalloc(RamParser):
self.print_vm(vm) self.print_vm(vm)
def print_vmalloc_info_3_10(self, out_path): def print_vmalloc_info_v2(self, out_path):
vmalloc_out = self.ramdump.open_file('vmalloc.txt') vmalloc_out = self.ramdump.open_file('vmalloc.txt')
next_offset = self.ramdump.field_offset('struct vmap_area', 'list') next_offset = self.ramdump.field_offset('struct vmap_area', 'list')
...@@ -98,6 +100,12 @@ class Vmalloc(RamParser): ...@@ -98,6 +100,12 @@ class Vmalloc(RamParser):
list_walker = llist.ListWalker(self.ramdump, vmlist, next_offset) list_walker = llist.ListWalker(self.ramdump, vmlist, next_offset)
self.vmalloc_out = vmalloc_out self.vmalloc_out = vmalloc_out
vmalloc_str = 'Memory mapped region allocated by Vmalloc\n\n'
vmalloc_str = vmalloc_str + '{0:42} {1:36} {2:6} {3:12} {4:46} {5:8}'\
.format('VM_STRUCT','ADDRESS_RANGE','SIZE','PHYS_ADDR','CALLER',
'Flag')
vmalloc_str = vmalloc_str + '\n'
self.vmalloc_out.write(vmalloc_str)
list_walker.walk(vmlist, self.list_func) list_walker.walk(vmlist, self.list_func)
print_out_str('---wrote vmalloc to vmalloc.txt') print_out_str('---wrote vmalloc to vmalloc.txt')
vmalloc_out.close() vmalloc_out.close()
...@@ -121,7 +129,7 @@ class Vmalloc(RamParser): ...@@ -121,7 +129,7 @@ class Vmalloc(RamParser):
def parse(self): def parse(self):
out_path = self.ramdump.outdir out_path = self.ramdump.outdir
major, minor, patch = self.ramdump.kernel_version major, minor, patch = self.ramdump.kernel_version
if (major, minor) == (3, 10): if (major, minor) >= (3, 10):
self.print_vmalloc_info_3_10(out_path) self.print_vmalloc_info_v2(out_path)
else: else:
self.print_vmalloc_info(out_path) self.print_vmalloc_info(out_path)
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