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

Feature: monitor cache-related perf events for L1D & LLC accesses/misses #121

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dssgabriel
Copy link

@dssgabriel dssgabriel commented Nov 8, 2024

This PR adds support for monitoring L1D and LLC cache accesses & misses using Linux perf events.

Changelog:

  • added cache events to the PerfCountSet and Measure data types;
  • added cache events to the list of monitored hardware counters in the PerformanceCounters ctor:
    • needed to use the private monitor method because cache events require special configuration and would fail to compile due to -Wconversion and -Werror being enabled.
  • added cache events to the benchmark's output;
  • added cache events to the Mustache-like templates;
  • changed miss% column to bra miss% for the sake of explicitness.

Sample output of this new feature:

| relative |                s/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |  bra miss% |     L1D$ ref/op | L1D$ miss% |      LL$ ref/op |  LL$ miss% |     total | serial
|---------:|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|-----------:|----------------:|-----------:|----------------:|-----------:|----------:|:-------
|   100.0% |                0.24 |                4.12 |    0.3% |  439,623,472.00 |  585,519,984.00 |  0.751 |  17,564,921.00 |       1.5% |  268,438,282.00 |     50.24% |  119,018,261.00 |      0.02% |      2.69 | `GEMM w/ standard layout`
|   169.8% |                0.14 |                7.00 |    0.3% |2,086,674,645.00 |  344,725,668.00 |  6.053 |  67,896,469.00 |       0.4% |  269,224,102.00 |     67.12% |    3,846,202.00 |      0.06% |      1.57 | `GEMM w/ tiled layout`

Rendered as:

relative s/op op/s err% ins/op cyc/op IPC bra/op bra miss% L1D$ ref/op L1D$ miss% LL$ ref/op LL$ miss% total serial
100.0% 0.24 4.12 0.3% 439,623,472.00 585,519,984.00 0.751 17,564,921.00 1.5% 268,438,282.00 50.24% 119,018,261.00 0.02% 2.69 GEMM w/ standard layout
169.8% 0.14 7.00 0.3% 2,086,674,645.00 344,725,668.00 6.053 67,896,469.00 0.4% 269,224,102.00 67.12% 3,846,202.00 0.06% 1.57 GEMM w/ tiled layout

@dssgabriel
Copy link
Author

I'm not sure which test is failing and why it does.
I may have missed something for handling Mustache-like templates, do you have any pointers that I can look into @martinus? Thanks in advance!

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.

1 participant