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
e6b7c740
Commit
e6b7c740
authored
Mar 30, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpf.lua: Implement `load_funcs`
parent
e7893607
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
src/lua/bcc/bpf.lua
src/lua/bcc/bpf.lua
+14
-0
No files found.
src/lua/bcc/bpf.lua
View file @
e6b7c740
...
...
@@ -129,6 +129,20 @@ function Bpf:initialize(args)
assert
(
self
.
module
~=
nil
,
"failed to compile BPF module"
)
end
function
Bpf
:
load_funcs
(
prog_type
)
prog_type
=
prog_type
or
"BPF_PROG_TYPE_KPROBE"
local
result
=
{}
local
fn_count
=
tonumber
(
libbcc
.
bpf_num_functions
(
self
.
module
))
for
i
=
0
,
fn_count
-
1
do
local
name
=
ffi
.
string
(
libbcc
.
bpf_function_name
(
self
.
module
,
i
))
table.insert
(
result
,
self
:
load_func
(
name
,
prog_type
))
end
return
result
end
function
Bpf
:
load_func
(
fn_name
,
prog_type
)
if
self
.
funcs
[
fn_name
]
~=
nil
then
return
self
.
funcs
[
fn_name
]
...
...
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