From: Vicent Marti Date: Sat, 30 Apr 2016 12:13:26 +0000 (+0200) Subject: lua: Do not try to detach buffers as kprobes X-Git-Tag: v0.2.0~102^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3dd67316f0f69ae8abbc8fdcc552234ee07e993;p=platform%2Fupstream%2Fbcc.git lua: Do not try to detach buffers as kprobes --- diff --git a/src/lua/bcc/bpf.lua b/src/lua/bcc/bpf.lua index 6472672..e76e608 100644 --- a/src/lua/bcc/bpf.lua +++ b/src/lua/bcc/bpf.lua @@ -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) diff --git a/src/lua/bcc/table.lua b/src/lua/bcc/table.lua index 33f1cb1..af269d8 100644 --- a/src/lua/bcc/table.lua +++ b/src/lua/bcc/table.lua @@ -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)