Skip to content

Commit

Permalink
Fix for ms to secs conversion issue for gpu and cpu telemetery sampling.
Browse files Browse the repository at this point in the history
  • Loading branch information
markgalvan-intel authored and planetchili committed Sep 13, 2024
1 parent d429f3d commit 40a7810
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions IntelPresentMon/PresentMonService/PMMainThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ void PowerTelemetryThreadEntry_(Service* const srv, PresentMon* const pm,
for (auto& adapter : ptc->GetPowerTelemetryAdapters()) {
adapter->Sample();
}
waiter.SetInterval(pm->GetGpuTelemetryPeriod());
// Convert from the ms to seconds as GetTelemetryPeriod returns back
// ms and SetInterval expects seconds.
waiter.SetInterval(pm->GetGpuTelemetryPeriod()/1000.);
waiter.Wait();
// go dormant if there are no active streams left
// TODO: consider race condition here if client stops and starts streams rapidly
Expand Down Expand Up @@ -163,7 +165,9 @@ void CpuTelemetryThreadEntry_(Service* const srv, PresentMon* const pm,
}
while (WaitForSingleObject(srv->GetServiceStopHandle(), 0) != WAIT_OBJECT_0) {
cpu->Sample();
waiter.SetInterval(pm->GetGpuTelemetryPeriod());
// Convert from the ms to seconds as GetTelemetryPeriod returns back
// ms and SetInterval expects seconds.
waiter.SetInterval(pm->GetGpuTelemetryPeriod() / 1000.);
waiter.Wait();
// Get the number of currently active streams
auto num_active_streams = pm->GetActiveStreams();
Expand Down

0 comments on commit 40a7810

Please sign in to comment.