Skip to content

Commit

Permalink
PreviousCState can have values > 1. Do not use not only CState 1 for …
Browse files Browse the repository at this point in the history
…calculation of CPU wakeup time.
  • Loading branch information
AloisKraus committed Feb 2, 2024
1 parent 0314afb commit c0e8fc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ETWAnalyzer/Extractors/CPU/CPUMethodData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ internal void AddExtendedReadyMetrics(ICpuThreadActivity2 slice)
ThreadId = slice.Thread.Id,
// We are interested in the performance impact of deep sleep states which is the processor power up time.
// All other delays are the ready times from shallow sleep states (should be fast) and thread interference from other threads of the same or other processes.
// Windows abstracts shallow sleep states (C1/C1E) as CState = 0 and all deeper sleep states as CState = 1
DeepSleepReady = slice.PreviousActivityOnProcessor?.Process?.Id == WindowsConstants.IdleProcessId && slice?.SwitchIn?.ContextSwitch?.PreviousCState == 1,
// Windows abstracts shallow sleep states (C1/C1E) as CState = 0 and all deeper sleep states as CState > 0. Usual values are 0, 1, 2
DeepSleepReady = slice.PreviousActivityOnProcessor?.Process?.Id == WindowsConstants.IdleProcessId && slice?.SwitchIn?.ContextSwitch?.PreviousCState > 0,
});
}
}
Expand Down

0 comments on commit c0e8fc3

Please sign in to comment.