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
cad89009
Commit
cad89009
authored
6 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "lrdp_v2 : Fix for broken memstat.py for kernel 4.14"
parents
424a03e4
3506649d
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/memstat.py
+30
-19
30 additions, 19 deletions
linux-ramdump-parser-v2/parsers/memstat.py
with
30 additions
and
19 deletions
linux-ramdump-parser-v2/parsers/memstat.py
+
30
−
19
View file @
cad89009
...
...
@@ -96,6 +96,8 @@ class MemStats(RamParser):
offset_total_allocated
=
\
self
.
ramdump
.
field_offset
(
'
struct ion_heap
'
,
'
total_allocated
'
)
if
offset_total_allocated
is
None
:
return
"
ion buffer debugging change is not there in this kernel
"
size
=
self
.
ramdump
.
sizeof
(
'
((struct ion_heap *)0x0)->total_allocated
'
)
if
self
.
ramdump
.
arm64
:
...
...
@@ -140,19 +142,26 @@ class MemStats(RamParser):
#others
other_mem
=
self
.
calculate_vm_stat
()
else
:
# Free Memory
total_free
=
self
.
ramdump
.
read_word
(
'
vm_zone_stat[NR_FREE_PAGES]
'
)
total_free
=
self
.
pages_to_mb
(
total_free
)
# Free Memory
total_free
=
self
.
ramdump
.
read_word
(
'
vm_zone_stat[NR_FREE_PAGES]
'
)
total_free
=
self
.
pages_to_mb
(
total_free
)
# slab Memory
if
(
self
.
ramdump
.
kernel_version
>=
(
4
,
14
)):
slab_rec
=
self
.
ramdump
.
read_word
(
'
vm_node_stat[NR_SLAB_RECLAIMABLE]
'
)
slab_unrec
=
self
.
ramdump
.
read_word
(
'
vm_node_stat[NR_SLAB_UNRECLAIMABLE]
'
)
else
:
slab_rec
=
self
.
ramdump
.
read_word
(
'
vm_zone_stat[NR_SLAB_RECLAIMABLE]
'
)
slab_unrec
=
self
.
ramdump
.
read_word
(
'
vm_zone_stat[NR_SLAB_UNRECLAIMABLE]
'
)
# slab Memory
slab_rec
=
\
self
.
ramdump
.
read_word
(
'
vm_zone_stat[NR_SLAB_RECLAIMABLE]
'
)
slab_unrec
=
\
self
.
ramdump
.
read_word
(
'
vm_zone_stat[NR_SLAB_UNRECLAIMABLE]
'
)
total_slab
=
self
.
pages_to_mb
(
slab_rec
+
slab_unrec
)
#others
other_mem
=
self
.
calculate_vm_node_zone_stat
()
cached
=
self
.
calculate_cached
()
total_slab
=
self
.
pages_to_mb
(
slab_rec
+
slab_unrec
)
# others
other_mem
=
self
.
calculate_vm_node_zone_stat
()
cached
=
self
.
calculate_cached
()
# ion memory
ion_mem
=
self
.
calculate_ionmem
()
...
...
@@ -166,17 +175,19 @@ class MemStats(RamParser):
kgsl_memory
=
0
# zcompressed ram
if
self
.
ramdump
.
kernel_version
>=
(
4
,
4
)
:
if
self
.
ramdump
.
kernel_version
>=
(
4
,
14
):
stat_val
=
0
elif
self
.
ramdump
.
kernel_version
>=
(
4
,
4
):
zram_index_idr
=
self
.
ramdump
.
read_word
(
'
zram_index_idr
'
)
idr_layer_ary_offset
=
self
.
ramdump
.
field_offset
\
(
'
struct idr_layer
'
,
'
ary
'
)
idr_layer_ary_offset
=
self
.
ramdump
.
field_offset
(
'
struct idr_layer
'
,
'
ary
'
)
idr_layer_ary
=
self
.
ramdump
.
read_word
(
zram_index_idr
+
idr_layer_ary_offset
)
zram_meta
=
idr_layer_ary
+
self
.
ramdump
.
field_offset
\
(
'
struct zram
'
,
'
meta
'
)
zram_meta
=
idr_layer_ary
+
self
.
ramdump
.
field_offset
(
'
struct zram
'
,
'
meta
'
)
zram_meta
=
self
.
ramdump
.
read_word
(
zram_meta
)
mem_pool
=
zram_meta
+
self
.
ramdump
.
field_offset
\
(
'
struct zram_meta
'
,
'
mem_pool
'
)
mem_pool
=
zram_meta
+
self
.
ramdump
.
field_offset
(
'
struct zram_meta
'
,
'
mem_pool
'
)
mem_pool
=
self
.
ramdump
.
read_word
(
mem_pool
)
if
mem_pool
is
None
:
stat_val
=
0
...
...
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