tud-zih-energy / lo2s

Linux OTF2 Sampling - A Lightweight Node-Level Performance Monitoring Tool
https://tu-dresden.de/zih/forschung/projekte/lo2s?set_language=en
GNU General Public License v3.0
44 stars 13 forks source link

Add support for parsing event names with libpfm4 #309

Open cvonelm opened 8 months ago

cvonelm commented 8 months ago

libpfm4 contains information about hundreds of events for dozens of architectures. With this, a user interested in the count of retired instructions on, for example, A64Fx can now use the name "INST_RETIRED".

There are some beauty issues we have to discuss here:

libpfms event name format is hierarchical: pmu::event:[sub event]. in --list-events I currently just flatten this hierarchy:

  amd64_fam19h_zen3::RETIRED_SSE_AVX_FLOPS:ADD_SUB_FLOPS
  amd64_fam19h_zen3::RETIRED_SSE_AVX_FLOPS:ANY
  amd64_fam19h_zen3::RETIRED_SSE_AVX_FLOPS:DIV_FLOPS
  amd64_fam19h_zen3::RETIRED_SSE_AVX_FLOPS:MAC_FLOPS
  amd64_fam19h_zen3::RETIRED_SSE_AVX_FLOPS:MULT_FLOPS

but maybe we want

    amd64_fam19h_zen3::RETIRED_SSE_AVX_FLOPS
                       - ADD_SUB_FLOPS
                       - ANY
                       - DIV_FLOPS
                       - MAC_FLOPS
                       - MULT_FLOPS

or even

amd64_fam19h_zen3::
           RETIRED_SSE_AVX_FLOPS
                       - ADD_SUB_FLOPS
                       - ANY
                       - DIV_FLOPS
                       - MAC_FLOPS
                       - MULT_FLOPS

Also libpfm has detailed descriptionts for events. Including them in --list-events is probably too noisy, so may by introduce something like --list-event-details?

Lastly, libpfm also contains the the pre-defined perf events that we have hard-coded into lo2s, like cache-misses cpu-clock etc. Throwing our hard-coded values away is probably not an option on grounds of backwards compatibility, so maybe filter them from libpfm?