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

[BUG] Perf counters not multiplexed #1813

Closed
jan-wassenberg opened this issue Jul 11, 2024 · 0 comments · Fixed by #1814
Closed

[BUG] Perf counters not multiplexed #1813

jan-wassenberg opened this issue Jul 11, 2024 · 0 comments · Fixed by #1814
Assignees

Comments

@jan-wassenberg
Copy link
Member

Describe the bug

We do not seem to fully support multiplexing in benchmark perf_counters, which can result in undercounting by a factor of 2..3.

There is an attempt to have multiple 'leaders' and we do specify PERF_FORMAT_GROUP, but not PERF_FORMAT_TOTAL_TIME_ENABLED nor PERF_FORMAT_TOTAL_TIME_RUNNING. The latter two are required to extrapolate the counter values according to how long they are running.

System

  • OS: Linux
  • Compiler and version: clang near trunk

To reproduce
Request many (>6) counters.

Expected behavior
Values are scaled according to the relative time during which the counter was enabled/bound to HW.

Additional context

From the manual:

If PERF_FORMAT_GROUP was specified to allow reading all events
in a group at once:

          struct read_format {
              u64 nr;            /* The number of events */
              u64 time_enabled;  /* if PERF_FORMAT_TOTAL_TIME_ENABLED */
              u64 time_running;  /* if PERF_FORMAT_TOTAL_TIME_RUNNING */
              struct {
                  u64 value;     /* The value of the event */
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 a pull request may close this issue.

2 participants