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
1888c167
Commit
1888c167
authored
Jan 25, 2017
by
Derek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename event_name for lua
parent
c2233534
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/lua/bcc/bpf.lua
src/lua/bcc/bpf.lua
+7
-2
src/lua/bcc/libbcc.lua
src/lua/bcc/libbcc.lua
+2
-2
No files found.
src/lua/bcc/bpf.lua
View file @
1888c167
...
...
@@ -14,6 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
]]
local
ffi
=
require
(
"ffi"
)
ffi
.
cdef
[[
int getpid(void);
]]
local
libbcc
=
require
(
"bcc.libbcc"
)
local
TracerPipe
=
require
(
"bcc.tracerpipe"
)
...
...
@@ -47,9 +51,9 @@ function Bpf.static.cleanup()
log
.
info
(
"detaching %s"
,
desc
)
if
probe_type
==
"kprobes"
then
libbcc
.
bpf_detach_kprobe
(
desc
)
libbcc
.
bpf_detach_kprobe
(
desc
,
key
)
elseif
probe_type
==
"uprobes"
then
libbcc
.
bpf_detach_uprobe
(
desc
)
libbcc
.
bpf_detach_uprobe
(
desc
,
key
)
end
end
all_probes
[
key
]
=
nil
...
...
@@ -209,6 +213,7 @@ function Bpf:attach_kprobe(args)
local
event
=
args
.
event
or
""
local
ptype
=
args
.
retprobe
and
"r"
or
"p"
local
ev_name
=
string.format
(
"%s_%s"
,
ptype
,
event
:
gsub
(
"
[
%+%.
]
"
,
"_"
))
local
ev_name
=
string.format
(
"%s_bcc_%s"
,
ev_name
,
ffi
.
C
.
getpid
());
local
desc
=
string.format
(
"%s:kprobes/%s %s"
,
ptype
,
ev_name
,
event
)
log
.
info
(
desc
)
...
...
src/lua/bcc/libbcc.lua
View file @
1888c167
...
...
@@ -42,11 +42,11 @@ typedef void (*perf_reader_raw_cb)(void *cb_cookie, void *raw, int raw_size);
void * bpf_attach_kprobe(int progfd, const char *event, const char *event_desc,
int pid, int cpu, int group_fd, perf_reader_cb cb, void *cb_cookie);
int bpf_detach_kprobe(const char *event_desc);
int bpf_detach_kprobe(const char *event_desc
, const char *event
);
void * bpf_attach_uprobe(int progfd, const char *event, const char *event_desc,
int pid, int cpu, int group_fd, perf_reader_cb cb, void *cb_cookie);
int bpf_detach_uprobe(const char *event_desc);
int bpf_detach_uprobe(const char *event_desc
, const char *event
);
void * bpf_open_perf_buffer(perf_reader_raw_cb raw_cb, void *cb_cookie, int pid, int cpu);
]]
...
...
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