A set of patches from IBM would introduce a C extension module for the Linux kernel’s libperf code to allow usage from the Python programming language.
Libperf is the Linux kernel’s perf event library that lives within the kernel source tree. In making it easier to leverage this API for accessing the Linux kernel’s perf events subsystem, the “request for comments” patches would introduce a C extension module so it’s easy to tap libperf from Python code.
This proposed module would allow calling the libperf API functions from Python as an alternative to C programs. IBM engineers will likely support all of the libperf library but for now the RFC patches are intended just for demonstration and to solicit feedback. With this initial code is also some simple demonstration Python code too.
Those interested in the prospects of leveraging the libperf API from Python code can see this RFC patch series for all the details.