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
e35d318c
Commit
e35d318c
authored
Sep 05, 2018
by
Brendan Gregg
Committed by
GitHub
Sep 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #49 from iovisor/lhist_trim
lhist truncate zero ranges
parents
92218a24
aa097ebb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
src/bpftrace.cpp
src/bpftrace.cpp
+18
-0
No files found.
src/bpftrace.cpp
View file @
e35d318c
...
...
@@ -913,7 +913,25 @@ int BPFtrace::print_lhist(const std::vector<uint64_t> &values, int min, int max,
lt
<<
"(...,"
<<
min
<<
"]"
;
std
::
ostringstream
gt
;
// trim empty values
int
start_value
=
-
1
;
int
end_value
=
0
;
for
(
int
i
=
0
;
i
<=
buckets
+
1
;
i
++
)
{
if
(
values
.
at
(
i
)
>
0
)
{
if
(
start_value
==
-
1
)
{
start_value
=
i
;
}
end_value
=
i
;
}
}
if
(
start_value
==
-
1
)
{
start_value
=
0
;
}
for
(
int
i
=
start_value
;
i
<=
end_value
;
i
++
)
{
int
max_width
=
52
;
int
bar_width
=
values
.
at
(
i
)
/
(
float
)
max_value
*
max_width
;
...
...
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