add open_perf_event api for reading perf counters (#643)
* add open_perf_event api for reading perf counters Though the rewriter table method existed, we were not yet opening up the perf counter in the proper way for it to be read. Introduce a c function to enable attaching perf counters to cpu-indexed table slots. The python side opens, assigns, then immediately closes the fd. Only the kernel keeps a reference, so closing the table or deleting the entry will be sufficient to free up the fd when finished. Signed-off-by: Brenden Blanco <bblanco@plumgrid.com> * Skip perf array hw counter test if unsupported Hardware counters are not available in all places (some VM environments), so gracefully skip on the particular error condition. Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
Showing
Please register or sign in to comment