• Brenden Blanco's avatar
    add open_perf_event api for reading perf counters (#643) · 3069caa0
    Brenden Blanco authored
    * 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: default avatarBrenden 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: default avatarBrenden Blanco <bblanco@plumgrid.com>
    3069caa0
reference_guide.md 40.7 KB