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
b2f8db9c
Commit
b2f8db9c
authored
Apr 12, 2017
by
4ast
Committed by
GitHub
Apr 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1107 from Eichhoernchen/patch-1
Fixed SEGFAULT due to perf buffer overflow if lost_cb unset
parents
d5e5bb3b
b2d792cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/python/bcc/table.py
src/python/bcc/table.py
+2
-2
No files found.
src/python/bcc/table.py
View file @
b2f8db9c
...
...
@@ -525,7 +525,7 @@ class PerfEventArray(ArrayBase):
def
_open_perf_buffer
(
self
,
cpu
,
callback
,
page_cnt
,
lost_cb
):
fn
=
_RAW_CB_TYPE
(
lambda
_
,
data
,
size
:
callback
(
cpu
,
data
,
size
))
lost_fn
=
_LOST_CB_TYPE
(
lambda
lost
:
lost_cb
(
lost
)
if
lost_cb
else
-
1
)
lost_fn
=
_LOST_CB_TYPE
(
lambda
lost
:
lost_cb
(
lost
)
)
if
lost_cb
else
ct
.
cast
(
None
,
_LOST_CB_TYPE
)
reader
=
lib
.
bpf_open_perf_buffer
(
fn
,
lost_fn
,
None
,
-
1
,
cpu
,
page_cnt
)
if
not
reader
:
raise
Exception
(
"Could not open perf buffer"
)
...
...
@@ -533,7 +533,7 @@ class PerfEventArray(ArrayBase):
self
[
self
.
Key
(
cpu
)]
=
self
.
Leaf
(
fd
)
self
.
bpf
.
_add_kprobe
((
id
(
self
),
cpu
),
reader
)
# keep a refcnt
self
.
_cbs
[
cpu
]
=
fn
self
.
_cbs
[
cpu
]
=
(
fn
,
lost_fn
)
def
close_perf_buffer
(
self
,
key
):
reader
=
self
.
bpf
.
open_kprobes
.
get
((
id
(
self
),
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