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: fix ctype warning when creating perf events #4837

Closed lorenzocarrozzo closed 10 months ago

lorenzocarrozzo commented 11 months ago

These changes should remove the incorrect generation of a warining when setting up a perf event. The warning says that pid is not part of the ctype (which is is not) but it is required to be set by _open_for_cpu. Therefore I moved the pid to be an extra argument which removes the need for it to be set in attr fixing the error.