Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for parsing event names with libpfm4 #309

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

cvonelm
Copy link
Member

@cvonelm cvonelm commented Nov 15, 2023

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?

include/lo2s/perf/pfm.hpp Outdated Show resolved Hide resolved
include/lo2s/perf/pfm.hpp Show resolved Hide resolved
include/lo2s/perf/pfm.hpp Outdated Show resolved Hide resolved
include/lo2s/perf/pfm.hpp Outdated Show resolved Hide resolved
include/lo2s/perf/pfm.hpp Outdated Show resolved Hide resolved
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".
@cvonelm cvonelm merged commit 92f68a8 into master Jul 26, 2024
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants