Skip to content

Commit 456079e

Browse files
Fix for ms to secs conversion issue for gpu and cpu telemetery sampling.
1 parent d429f3d commit 456079e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

IntelPresentMon/PresentMonService/PMMainThread.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ void PowerTelemetryThreadEntry_(Service* const srv, PresentMon* const pm,
129129
for (auto& adapter : ptc->GetPowerTelemetryAdapters()) {
130130
adapter->Sample();
131131
}
132-
waiter.SetInterval(pm->GetGpuTelemetryPeriod());
132+
// Convert from the ms to seconds as GetTelemetryPeriod returns back
133+
// ms and SetInterval expects seconds.
134+
waiter.SetInterval(pm->GetGpuTelemetryPeriod()/1000.);
133135
waiter.Wait();
134136
// go dormant if there are no active streams left
135137
// TODO: consider race condition here if client stops and starts streams rapidly
@@ -163,7 +165,9 @@ void CpuTelemetryThreadEntry_(Service* const srv, PresentMon* const pm,
163165
}
164166
while (WaitForSingleObject(srv->GetServiceStopHandle(), 0) != WAIT_OBJECT_0) {
165167
cpu->Sample();
166-
waiter.SetInterval(pm->GetGpuTelemetryPeriod());
168+
// Convert from the ms to seconds as GetTelemetryPeriod returns back
169+
// ms and SetInterval expects seconds.
170+
waiter.SetInterval(pm->GetGpuTelemetryPeriod() / 1000.);
167171
waiter.Wait();
168172
// Get the number of currently active streams
169173
auto num_active_streams = pm->GetActiveStreams();

0 commit comments

Comments
 (0)