Skip to content

Commit

Permalink
lua: Do not try to detach buffers as kprobes
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed Apr 30, 2016
1 parent 06b5ce5 commit b3dd673
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lua/bcc/bpf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function Bpf.static.cleanup_probes()
local function detach_all(probe_type, all_probes)
for key, probe in pairs(all_probes) do
libbcc.perf_reader_free(probe)
if type(key) == "string" then
-- skip bcc-specific kprobes
if not key:starts("bcc:") then
local desc = string.format("-:%s/%s", probe_type, key)
log.info("detaching %s", desc)

Expand Down
2 changes: 1 addition & 1 deletion src/lua/bcc/table.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function PerfEventArray:initialize(bpf, map_id, map_fd, key_type, leaf_type)
end

local function _perf_id(id, cpu)
return string.format("perf_event_array:%d:%d", tonumber(id), cpu or 0)
return string.format("bcc:perf_event_array:%d:%d", tonumber(id), cpu or 0)
end

function PerfEventArray:_open_perf_buffer(cpu, callback, ctype)
Expand Down

0 comments on commit b3dd673

Please sign in to comment.