limitations under the License.
]]
local ffi = require("ffi")
+ffi.cdef[[
+ int getpid(void);
+]]
+
local libbcc = require("bcc.libbcc")
local TracerPipe = require("bcc.tracerpipe")
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
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)
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);
]]