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
973a528d
Commit
973a528d
authored
May 24, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: Allow LuaJIT parameterized types in `open_perf_buffer`
parent
9bbe58f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
src/lua/bcc/table.lua
src/lua/bcc/table.lua
+2
-2
tools/stacksnoop.lua
tools/stacksnoop.lua
+3
-7
No files found.
src/lua/bcc/table.lua
View file @
973a528d
...
...
@@ -254,9 +254,9 @@ function PerfEventArray:_open_perf_buffer(cpu, callback, ctype)
self
.
_callbacks
[
cpu
]
=
_cb
end
function
PerfEventArray
:
open_perf_buffer
(
callback
,
data_type
)
function
PerfEventArray
:
open_perf_buffer
(
callback
,
data_type
,
...
)
assert
(
data_type
,
"a data type is needed for callback conversion"
)
local
ctype
=
ffi
.
typeof
(
data_type
..
"*"
)
local
ctype
=
ffi
.
typeof
(
data_type
..
"*"
,
...
)
for
i
=
0
,
Posix
.
cpu_count
()
-
1
do
self
:
_open_perf_buffer
(
i
,
callback
,
ctype
)
end
...
...
tools/stacksnoop.lua
View file @
973a528d
...
...
@@ -100,12 +100,8 @@ return function(BPF, utils)
local
TASK_COMM_LEN
=
16
-- linux/sched.h
bpf
:
get_table
(
"events"
):
open_perf_buffer
(
print_event
,
[[
struct {
uint64_t stack_id;
uint32_t pid;
char comm[%d];
}
]]
%
{
TASK_COMM_LEN
})
bpf
:
get_table
(
"events"
):
open_perf_buffer
(
print_event
,
"struct { uint64_t stack_id; uint32_t pid; char comm[$]; }"
,
TASK_COMM_LEN
)
bpf
:
kprobe_poll_loop
()
end
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