iovisor / bcc

BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Apache License 2.0
20.59k stars 3.88k forks source link

bcc/python: add perf_custom_event_open #4829

Closed lorenzocarrozzo closed 11 months ago

lorenzocarrozzo commented 11 months ago

Allow for the creation of custom perf events. In my case I need access to the attributes sample_type and branch_sample_type which is not allowed with the current api. I have tried skipping perf_event_open() and just using _open_for_cpu(). However doing so generates warning as the pid is set outside of the Perf class and it is not part of perf_event_attr's ctypes.