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
60c93de2
Commit
60c93de2
authored
8 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "lrdp_v2: Sorting of slabsummary based on its size."
parents
7f9ed666
aa102b0f
No related branches found
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/slabsummary.py
+14
-5
14 additions, 5 deletions
linux-ramdump-parser-v2/parsers/slabsummary.py
with
14 additions
and
5 deletions
linux-ramdump-parser-v2/parsers/slabsummary.py
+
14
−
5
View file @
60c93de2
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
# GNU General Public License for more details.
# GNU General Public License for more details.
import
math
import
math
import
operator
from
mm
import
pfn_to_page
from
mm
import
pfn_to_page
from
parser_util
import
register_parser
,
RamParser
from
parser_util
import
register_parser
,
RamParser
...
@@ -55,6 +55,8 @@ class Slabinfo_summary(RamParser):
...
@@ -55,6 +55,8 @@ class Slabinfo_summary(RamParser):
# Currently with assumption there is only one numa node
# Currently with assumption there is only one numa node
def
print_slab_summary
(
self
,
slab_out
):
def
print_slab_summary
(
self
,
slab_out
):
total_freeobjects
=
0
total_freeobjects
=
0
slab_summary
=
{}
nCounter
=
0
original_slab
=
self
.
ramdump
.
address_of
(
'
slab_caches
'
)
original_slab
=
self
.
ramdump
.
address_of
(
'
slab_caches
'
)
cpu_present_bits_addr
=
self
.
ramdump
.
address_of
(
'
cpu_present_bits
'
)
cpu_present_bits_addr
=
self
.
ramdump
.
address_of
(
'
cpu_present_bits
'
)
cpu_present_bits
=
self
.
ramdump
.
read_word
(
cpu_present_bits_addr
)
cpu_present_bits
=
self
.
ramdump
.
read_word
(
cpu_present_bits_addr
)
...
@@ -130,11 +132,18 @@ class Slabinfo_summary(RamParser):
...
@@ -130,11 +132,18 @@ class Slabinfo_summary(RamParser):
slab_size
=
int
(
math
.
pow
(
2
,
page_order
+
PAGE_SHIFT
))
slab_size
=
int
(
math
.
pow
(
2
,
page_order
+
PAGE_SHIFT
))
slab_size
=
slab_size
/
1024
slab_size
=
slab_size
/
1024
slab
=
self
.
ramdump
.
read_word
(
slab
+
slab_list_offset
)
slab
=
self
.
ramdump
.
read_word
(
slab
+
slab_list_offset
)
slab_summary
[
nCounter
]
=
[
slab_name
,
obj_size
,
total_allocated
,
nr_total_objects
,
(
objsize_w_metadata
*
nr_total_objects
)
/
1024
,
num_slabs
,
slab_size
]
nCounter
+=
1
sorted_summary
=
sorted
(
slab_summary
.
values
(),
key
=
operator
.
itemgetter
(
4
),
reverse
=
True
)
for
val
in
sorted_summary
:
slab_out
.
write
(
format_string
.
format
(
slab_out
.
write
(
format_string
.
format
(
slab_name
,
obj_size
,
total_allocated
,
val
[
0
],
val
[
1
],
val
[
2
],
val
[
3
],
val
[
4
],
nr_total_objects
,
val
[
5
],
val
[
6
]))
(
objsize_w_metadata
*
nr_total_objects
)
/
1024
,
num_slabs
,
slab_size
))
def
parse
(
self
):
def
parse
(
self
):
slab_out
=
self
.
ramdump
.
open_file
(
'
slabsummary.txt
'
)
slab_out
=
self
.
ramdump
.
open_file
(
'
slabsummary.txt
'
)
...
...
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