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: Let per thread reader handle lead exit event. #317

Closed

Conversation

liu-song-6
Copy link
Contributor

Summary:
When the leader process exits, the per thread readers will not be able to
read data. This is by design. The readers need to detect such event and
renable the reader after the leader process comes back.

An enabled_ flag is added to the reader. We need a heuristic algorithm to
detect when the leader exits. Currently, the algorithm is simple: if we
read same value for the first hardware counter twice, the leader is most
likely gone. We may need to revisit this later.

A unit test is added to cover this. We also need to adjust close()
function of BPerfEventsGroup to make it easier for the reader to detect
leader exit events.

Differential Revision: D64486001

Summary:
When the leader process exits, the per thread readers will not be able to
read data. This is by design. The readers need to detect such event and
renable the reader after the leader process comes back.

An enabled_ flag is added to the reader. We need a heuristic algorithm to
detect when the leader exits. Currently, the algorithm is simple: if we
read same value for the first hardware counter twice, the leader is most
likely gone. We may need to revisit this later.

A unit test is added to cover this. We also need to adjust close()
function of BPerfEventsGroup to make it easier for the reader to detect
leader exit events.

Differential Revision: D64486001
@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 16, 2024
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in bc3362d.

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