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

hbt/bperf: Fix time accounting in PerThreadReader #311

Closed

Conversation

liu-song-6
Copy link
Contributor

Summary:
Two major fixes here:

  1. Make a copy of bperf_thread_data in seqlock'ed region and use the copy
    later. This makes sure the data in a sample is consistent.
  2. Fix schedin_time and runtime_since_schedin, so that the runtime is
    accounted correctly. Before this fix, there was double accounting in
    some corner cases.

Also add a commont to enable() to explain the check for mapping the same
tid twice. I got confused myself when reading the code.

Differential Revision: D63996323

Summary:
Two major fixes here:
1. Make a copy of bperf_thread_data in seqlock'ed region and use the copy
   later. This makes sure the data in a sample is consistent.
2. Fix schedin_time and runtime_since_schedin, so that the runtime is
   accounted correctly. Before this fix, there was double accounting in
   some corner cases.

Also add a commont to enable() to explain the check for mapping the same
tid twice. I got confused myself when reading the code.

Differential Revision: D63996323
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 7, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D63996323

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 26a8877.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants