MCPcopy Create free account
hub / github.com/iovisor/bcc / open_perf_buffer

Method open_perf_buffer

src/python/bcc/table.py:973–987  ·  view source on GitHub ↗

open_perf_buffers(callback) Opens a set of per-cpu ring buffer to receive custom perf event data from the bpf program. The callback will be invoked for each event submitted from the kernel, up to millions per second. Use page_cnt to change the size of the per-cpu rin

(self, callback, page_cnt=8, lost_cb=None, wakeup_events=1)

Source from the content-addressed store, hash-verified

971 return ct.cast(data, ct.POINTER(self._event_class)).contents
972
973 def open_perf_buffer(self, callback, page_cnt=8, lost_cb=None, wakeup_events=1):
974 """open_perf_buffers(callback)
975
976 Opens a set of per-cpu ring buffer to receive custom perf event
977 data from the bpf program. The callback will be invoked for each
978 event submitted from the kernel, up to millions per second. Use
979 page_cnt to change the size of the per-cpu ring buffer. The value
980 must be a power of two and defaults to 8.
981 """
982
983 if page_cnt & (page_cnt - 1) != 0:
984 raise Exception("Perf buffer page_cnt must be a power of two")
985
986 for i in get_online_cpus():
987 self._open_perf_buffer(i, callback, page_cnt, lost_cb, wakeup_events)
988
989 def _open_perf_buffer(self, cpu, callback, page_cnt, lost_cb, wakeup_events):
990 def raw_cb_(_, data, size):

Callers

nothing calls this directly

Calls 2

_open_perf_bufferMethod · 0.95
get_online_cpusFunction · 0.70

Tested by

no test coverage detected