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
1e9140b6
Commit
1e9140b6
authored
Feb 28, 2018
by
Teng Qin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bugs introduced in Lua Perf Buffer handling
parent
7f99ebdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/lua/bcc/bpf.lua
src/lua/bcc/bpf.lua
+4
-4
src/lua/bcc/table.lua
src/lua/bcc/table.lua
+1
-1
No files found.
src/lua/bcc/bpf.lua
View file @
1e9140b6
...
...
@@ -246,10 +246,10 @@ function Bpf:probe_store(t, id, fd)
log
.
info
(
"%s -> %s"
,
id
,
fd
)
end
function
Bpf
:
perf_buffer_store
(
t
,
id
,
reader
)
function
Bpf
:
perf_buffer_store
(
id
,
reader
)
Bpf
.
perf_buffers
[
id
]
=
reader
log
.
info
(
"%s -> %s"
,
id
,
fd
)
log
.
info
(
"%s -> %s"
,
id
,
reader
)
end
function
Bpf
:
probe_lookup
(
t
,
id
)
...
...
@@ -277,7 +277,7 @@ function Bpf:_perf_buffer_array()
end
function
Bpf
:
kprobe_poll_loop
()
local
perf_buffer
,
perf_buffer_count
=
self
:
_perf_buffer_array
()
local
perf_buffer
s
,
perf_buffer_count
=
self
:
_perf_buffer_array
()
return
pcall
(
function
()
while
true
do
libbcc
.
perf_reader_poll
(
perf_buffer_count
,
perf_buffers
,
-
1
)
...
...
@@ -286,7 +286,7 @@ function Bpf:kprobe_poll_loop()
end
function
Bpf
:
kprobe_poll
(
timeout
)
local
perf_buffer
,
perf_buffer_count
=
self
:
_perf_buffer_array
()
local
perf_buffer
s
,
perf_buffer_count
=
self
:
_perf_buffer_array
()
libbcc
.
perf_reader_poll
(
perf_buffer_count
,
perf_buffers
,
timeout
or
-
1
)
end
...
...
src/lua/bcc/table.lua
View file @
1e9140b6
...
...
@@ -258,7 +258,7 @@ function PerfEventArray:_open_perf_buffer(cpu, callback, ctype, page_cnt, lost_c
end
-- default to 8 pages per buffer
local
reader
=
libbcc
.
bpf_open_perf_buffer
(
_cb
,
nil
,
_lost_cb
,
-
1
,
cpu
,
page_cnt
or
8
)
local
reader
=
libbcc
.
bpf_open_perf_buffer
(
_cb
,
_lost_cb
,
nil
,
-
1
,
cpu
,
page_cnt
or
8
)
assert
(
reader
,
"failed to open perf buffer"
)
local
fd
=
libbcc
.
perf_reader_fd
(
reader
)
...
...
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