Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
372d1fff
Commit
372d1fff
authored
Feb 13, 2017
by
Brenden Blanco
Committed by
GitHub
Feb 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #965 from r4f4/fix-tools-py2
fixes #962 - fix lambda on both py2 and py3
parents
06a1c85f
c465a242
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
tools/uobjnew.py
tools/uobjnew.py
+3
-3
tools/ustat.py
tools/ustat.py
+3
-3
No files found.
tools/uobjnew.py
View file @
372d1fff
...
@@ -147,13 +147,13 @@ while True:
...
@@ -147,13 +147,13 @@ while True:
print
()
print
()
data
=
bpf
[
"allocs"
]
data
=
bpf
[
"allocs"
]
if
args
.
top_count
:
if
args
.
top_count
:
data
=
sorted
(
data
.
items
(),
key
=
lambda
k
,
v
:
v
.
num_allocs
)
data
=
sorted
(
data
.
items
(),
key
=
lambda
k
v
:
kv
[
1
]
.
num_allocs
)
data
=
data
[
-
args
.
top_count
:]
data
=
data
[
-
args
.
top_count
:]
elif
args
.
top_size
:
elif
args
.
top_size
:
data
=
sorted
(
data
.
items
(),
key
=
lambda
k
,
v
:
v
.
total_size
)
data
=
sorted
(
data
.
items
(),
key
=
lambda
k
v
:
kv
[
1
]
.
total_size
)
data
=
data
[
-
args
.
top_size
:]
data
=
data
[
-
args
.
top_size
:]
else
:
else
:
data
=
sorted
(
data
.
items
(),
key
=
lambda
k
,
v
:
v
.
total_size
)
data
=
sorted
(
data
.
items
(),
key
=
lambda
k
v
:
kv
[
1
]
.
total_size
)
print
(
"%-30s %8s %12s"
%
(
"TYPE"
,
"# ALLOCS"
,
"# BYTES"
))
print
(
"%-30s %8s %12s"
%
(
"TYPE"
,
"# ALLOCS"
,
"# BYTES"
))
for
key
,
value
in
data
:
for
key
,
value
in
data
:
if
args
.
language
==
"c"
:
if
args
.
language
==
"c"
:
...
...
tools/ustat.py
View file @
372d1fff
...
@@ -244,10 +244,10 @@ class Tool(object):
...
@@ -244,10 +244,10 @@ class Tool(object):
counts
.
update
(
probe
.
get_counts
(
self
.
bpf
))
counts
.
update
(
probe
.
get_counts
(
self
.
bpf
))
targets
.
update
(
probe
.
targets
)
targets
.
update
(
probe
.
targets
)
if
self
.
args
.
sort
:
if
self
.
args
.
sort
:
counts
=
sorted
(
counts
.
items
(),
key
=
lambda
_
,
v
:
counts
=
sorted
(
counts
.
items
(),
key
=
lambda
k
v
:
-
v
.
get
(
self
.
args
.
sort
.
upper
(),
0
))
-
kv
[
1
]
.
get
(
self
.
args
.
sort
.
upper
(),
0
))
else
:
else
:
counts
=
sorted
(
counts
.
items
(),
key
=
lambda
k
,
_
:
k
)
counts
=
sorted
(
counts
.
items
(),
key
=
lambda
k
v
:
kv
[
0
]
)
for
pid
,
stats
in
counts
:
for
pid
,
stats
in
counts
:
print
(
"%-6d %-20s %-10d %-6d %-10d %-8d %-6d %-6d"
%
(
print
(
"%-6d %-20s %-10d %-6d %-10d %-8d %-6d %-6d"
%
(
pid
,
targets
[
pid
][:
20
],
pid
,
targets
[
pid
][:
20
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment