Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
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
bpftrace
Commits
97001f83
Commit
97001f83
authored
Sep 13, 2018
by
Brendan Gregg
Committed by
GitHub
Sep 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #96 from iovisor/bug
fix print() top logic
parents
7404d0e8
80b54e9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/bpftrace.cpp
src/bpftrace.cpp
+2
-2
No files found.
src/bpftrace.cpp
View file @
97001f83
...
@@ -645,6 +645,7 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div)
...
@@ -645,6 +645,7 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div)
if
(
div
==
0
)
if
(
div
==
0
)
div
=
1
;
div
=
1
;
uint32_t
i
=
0
;
uint32_t
i
=
0
;
int
total
=
values_by_key
.
size
();
for
(
auto
&
pair
:
values_by_key
)
for
(
auto
&
pair
:
values_by_key
)
{
{
auto
key
=
pair
.
first
;
auto
key
=
pair
.
first
;
...
@@ -652,10 +653,9 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div)
...
@@ -652,10 +653,9 @@ int BPFtrace::print_map(IMap &map, uint32_t top, uint32_t div)
if
(
top
)
if
(
top
)
{
{
if
(
i
<
(
values_by_key
.
size
()
-
top
))
if
(
total
>
top
&&
i
++
<
(
total
-
top
))
continue
;
continue
;
}
}
i
++
;
std
::
cout
<<
map
.
name_
<<
map
.
key_
.
argument_value_list
(
*
this
,
key
)
<<
": "
;
std
::
cout
<<
map
.
name_
<<
map
.
key_
.
argument_value_list
(
*
this
,
key
)
<<
": "
;
...
...
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