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

i#6728 sched time stats: Fix time accounting problems #6784

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

derekbruening
Copy link
Contributor

The schedule_stats tool was incorrectly counting instructions since the last context switch leading up to an idle record as all idle time. It was also failing to count the final idle record in a sequence. We fix that here by simplifying and clarifying the time accounting.

While at it, a 3rd time bucket for wait time is added.

Adds a better test with a mock class with deterministic time to avoid wall-clock timing problems in testing.

Fixes #6728

The schedule_stats tool was incorrectly counting instructions since
the last context switch leading up to an idle record as all idle time.
It was also failing to count the final idle record in a sequence.
We fix that here by simplifying and clarifying the time accounting.

While at it, a 3rd time bucket for wait time is added.

Adds a better test with a mock class with deterministic time to avoid
wall-clock timing problems in testing.

Fixes #6728
@derekbruening derekbruening merged commit 427bcc0 into master Apr 29, 2024
16 checks passed
@derekbruening derekbruening deleted the i6728-sched-stats-idle-time branch April 29, 2024 16:02
derekbruening added a commit that referenced this pull request Apr 29, 2024
Relaxes an assert added in PR #6784 to allow zero time to have elapsed
when updating the schedule_stats time buckets.

Issue: #6728
derekbruening added a commit that referenced this pull request Apr 29, 2024
Relaxes an assert added in PR #6784 to allow zero time to have elapsed
when updating the schedule_stats time buckets.

Issue: #6728
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.

schedule_stats overcounts idle time
2 participants