Commit dacb8ad1 authored by Brenden Blanco's avatar Brenden Blanco

python3 compat: tracepoint fixes

Signed-off-by: default avatarBrenden Blanco <bblanco@gmail.com>
parent 341ec67a
......@@ -1046,7 +1046,8 @@ class BPF(object):
for k, v in self.open_tracepoints.items():
lib.perf_reader_free(v)
(tp_category, tp_name) = k.split(':')
lib.bpf_detach_tracepoint(tp_category, tp_name)
lib.bpf_detach_tracepoint(tp_category.encode("ascii"),
tp_name.encode("ascii"))
self.open_tracepoints.clear()
for (ev_type, ev_config) in list(self.open_perf_events.keys()):
self.detach_perf_event(ev_type, ev_config)
......
......@@ -61,10 +61,8 @@ class TestTracepointDataLoc(unittest.TestCase):
b = bcc.BPF(text=text)
subprocess.check_output(["/bin/ls"])
sleep(1)
found = False
for k, v in b["execs"].items():
found = "ls" in v.filename
self.assertTrue(found, "'ls' was not found in map")
self.assertTrue("/bin/ls" in [v.filename.decode()
for v in b["execs"].values()])
if __name__ == "__main__":
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment