Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
vendor
qcom-opensource
tools
Commits
e06c1ac4
Commit
e06c1ac4
authored
7 years ago
by
lnx build
Committed by
Gerrit - the friendly Code Review server
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "lrdp_v2 : Fix for broken vmalloc.py" into opensource-tools.lnx.1.0
parents
ba7ec138
26db76ee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
linux-ramdump-parser-v2/parsers/vmalloc.py
+20
-12
20 additions, 12 deletions
linux-ramdump-parser-v2/parsers/vmalloc.py
with
20 additions
and
12 deletions
linux-ramdump-parser-v2/parsers/vmalloc.py
+
20
−
12
View file @
e06c1ac4
# 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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment