diff options
Diffstat (limited to 'src/python/bcc/__init__.py')
-rw-r--r-- | src/python/bcc/__init__.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py index 2ff5cf02..1118698e 100644 --- a/src/python/bcc/__init__.py +++ b/src/python/bcc/__init__.py @@ -957,7 +957,8 @@ class BPF(object): ct.cast(None, ct.POINTER(bcc_symbol_option)), ct.byref(sym), ) < 0: - raise Exception("could not determine address of symbol %s" % symname) + raise Exception("could not determine address of symbol %s in %s" + % (symname.decode(), module.decode())) new_addr = sym.offset + sym_off module_path = ct.cast(sym.module, ct.c_char_p).value lib.bcc_procutils_free(sym.module) @@ -1667,6 +1668,18 @@ class BPF(object): readers[i] = v lib.perf_reader_poll(len(readers), readers, timeout) + def perf_buffer_consume(self): + """perf_buffer_consume(self) + + Consume all open perf buffers, regardless of whether or not + they currently contain events data. Necessary to catch 'remainder' + events when wakeup_events > 1 is set in open_perf_buffer + """ + readers = (ct.c_void_p * len(self.perf_buffers))() + for i, v in enumerate(self.perf_buffers.values()): + readers[i] = v + lib.perf_reader_consume(len(readers), readers) + def kprobe_poll(self, timeout = -1): """kprobe_poll(self) |