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
bfec33a4
Commit
bfec33a4
authored
Mar 01, 2018
by
yonghong-song
Committed by
GitHub
Mar 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1614 from palmtenor/fix_lua
Fix bugs introduced in Lua Perf Buffer handling
parents
d2bd4aff
1e9140b6
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 @
bfec33a4
...
@@ -246,10 +246,10 @@ function Bpf:probe_store(t, id, fd)
...
@@ -246,10 +246,10 @@ function Bpf:probe_store(t, id, fd)
log
.
info
(
"%s -> %s"
,
id
,
fd
)
log
.
info
(
"%s -> %s"
,
id
,
fd
)
end
end
function
Bpf
:
perf_buffer_store
(
t
,
id
,
reader
)
function
Bpf
:
perf_buffer_store
(
id
,
reader
)
Bpf
.
perf_buffers
[
id
]
=
reader
Bpf
.
perf_buffers
[
id
]
=
reader
log
.
info
(
"%s -> %s"
,
id
,
fd
)
log
.
info
(
"%s -> %s"
,
id
,
reader
)
end
end
function
Bpf
:
probe_lookup
(
t
,
id
)
function
Bpf
:
probe_lookup
(
t
,
id
)
...
@@ -277,7 +277,7 @@ function Bpf:_perf_buffer_array()
...
@@ -277,7 +277,7 @@ function Bpf:_perf_buffer_array()
end
end
function
Bpf
:
kprobe_poll_loop
()
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
()
return
pcall
(
function
()
while
true
do
while
true
do
libbcc
.
perf_reader_poll
(
perf_buffer_count
,
perf_buffers
,
-
1
)
libbcc
.
perf_reader_poll
(
perf_buffer_count
,
perf_buffers
,
-
1
)
...
@@ -286,7 +286,7 @@ function Bpf:kprobe_poll_loop()
...
@@ -286,7 +286,7 @@ function Bpf:kprobe_poll_loop()
end
end
function
Bpf
:
kprobe_poll
(
timeout
)
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
)
libbcc
.
perf_reader_poll
(
perf_buffer_count
,
perf_buffers
,
timeout
or
-
1
)
end
end
...
...
src/lua/bcc/table.lua
View file @
bfec33a4
...
@@ -258,7 +258,7 @@ function PerfEventArray:_open_perf_buffer(cpu, callback, ctype, page_cnt, lost_c
...
@@ -258,7 +258,7 @@ function PerfEventArray:_open_perf_buffer(cpu, callback, ctype, page_cnt, lost_c
end
end
-- default to 8 pages per buffer
-- 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"
)
assert
(
reader
,
"failed to open perf buffer"
)
local
fd
=
libbcc
.
perf_reader_fd
(
reader
)
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