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
8d0425cb
Commit
8d0425cb
authored
Sep 08, 2015
by
4ast
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #189 from iovisor/bblanco_dev
Suppress None return when trace_pipe drops lines
parents
79553c20
2a01f7c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/python/bcc/__init__.py
src/python/bcc/__init__.py
+4
-4
No files found.
src/python/bcc/__init__.py
View file @
8d0425cb
...
...
@@ -546,10 +546,11 @@ class BPF(object):
fields (task, pid, cpu, flags, timestamp, msg) or None if no
line was read (nonblocking=True)
"""
line
=
BPF
.
trace_readline
(
nonblocking
)
if
line
:
while
True
:
line
=
BPF
.
trace_readline
(
nonblocking
)
if
not
line
and
nonblocking
:
return
(
None
,)
*
6
# don't print messages related to lost events
if
line
.
startswith
(
"CPU:"
):
return
if
line
.
startswith
(
"CPU:"
):
continue
task
=
line
[:
16
].
lstrip
()
line
=
line
[
17
:]
ts_end
=
line
.
find
(
":"
)
...
...
@@ -557,7 +558,6 @@ class BPF(object):
cpu
=
cpu
[
1
:
-
1
]
msg
=
line
[
ts_end
+
4
:]
return
(
task
,
int
(
pid
),
int
(
cpu
),
flags
,
float
(
ts
),
msg
)
return
@
staticmethod
def
trace_readline
(
nonblocking
=
False
):
...
...
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