Skip to content

Commit 54e97ec

Browse files
Merge branch 'feature/app_provider_and_inst_lat_update' into release-gtd-external/rc2.3.0
2 parents 8514150 + 263fb3c commit 54e97ec

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

IntelPresentMon/PresentMonMiddleware/ConcreteMiddleware.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,6 @@ static void ReportMetricsHelper(
685685
chain->mDisplayLatency .push_back(metrics.mDisplayLatency);
686686
chain->mDisplayedTime .push_back(metrics.mDisplayedTime);
687687
chain->mDropped .push_back(0.0);
688-
chain->mInstrumentedDisplayLatency .push_back(metrics.mInstrumentedDisplayLatency);
689-
chain->mInstrumentedReadyTimeToDisplayLatency.push_back(metrics.mInstrumentedReadyTimeToDisplayLatency);
690688
} else {
691689
chain->mDropped .push_back(1.0);
692690
}
@@ -708,8 +706,16 @@ static void ReportMetricsHelper(
708706
}
709707
}
710708

711-
if (displayed && displayIndex == appIndex && metrics.mInstrumentedRenderLatency != 0) {
712-
chain->mInstrumentedRenderLatency.push_back(metrics.mInstrumentedRenderLatency);
709+
if (displayed && displayIndex == appIndex) {
710+
if (metrics.mInstrumentedRenderLatency != 0) {
711+
chain->mInstrumentedRenderLatency.push_back(metrics.mInstrumentedRenderLatency);
712+
}
713+
if (metrics.mInstrumentedDisplayLatency != 0) {
714+
chain->mInstrumentedDisplayLatency.push_back(metrics.mInstrumentedDisplayLatency);
715+
}
716+
if (metrics.mInstrumentedReadyTimeToDisplayLatency != 0) {
717+
chain->mInstrumentedReadyTimeToDisplayLatency.push_back(metrics.mInstrumentedReadyTimeToDisplayLatency);
718+
}
713719
}
714720

715721
displayIndex += 1;

PresentData/PresentMonTraceConsumer.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,6 +2298,22 @@ void PMTraceConsumer::RuntimePresentStart(Runtime runtime, EVENT_HEADER const& h
22982298

22992299
ApplyPresentFrameType(present);
23002300

2301+
TrackPresent(present, &mOrderedPresentsByProcessId[present->ProcessId]);
2302+
}
2303+
2304+
// No TRACK_PRESENT instrumentation here because each runtime Present::Start
2305+
// event is instrumented and we assume we'll see the corresponding Stop event
2306+
// for any completed present.
2307+
void PMTraceConsumer::RuntimePresentStop(Runtime runtime, EVENT_HEADER const& hdr, uint32_t result)
2308+
{
2309+
// Present_Start and Present_Stop happen on the same thread, so Lookup the PresentEvent
2310+
// most-recently operated on by the same thread. If there is none, ignore this event.
2311+
auto eventIter = mPresentByThreadId.find(hdr.ThreadId);
2312+
if (eventIter == mPresentByThreadId.end()) {
2313+
return;
2314+
}
2315+
auto present = eventIter->second;
2316+
23012317
if (mNextAppFrameId != 0) {
23022318
auto ii = mPendingAppTimingDataByAppFrameId.find(mNextAppFrameId);
23032319
if (ii != mPendingAppTimingDataByAppFrameId.end()) {
@@ -2322,22 +2338,6 @@ void PMTraceConsumer::RuntimePresentStart(Runtime runtime, EVENT_HEADER const& h
23222338
}
23232339
}
23242340

2325-
TrackPresent(present, &mOrderedPresentsByProcessId[present->ProcessId]);
2326-
}
2327-
2328-
// No TRACK_PRESENT instrumentation here because each runtime Present::Start
2329-
// event is instrumented and we assume we'll see the corresponding Stop event
2330-
// for any completed present.
2331-
void PMTraceConsumer::RuntimePresentStop(Runtime runtime, EVENT_HEADER const& hdr, uint32_t result)
2332-
{
2333-
// Present_Start and Present_Stop happen on the same thread, so Lookup the PresentEvent
2334-
// most-recently operated on by the same thread. If there is none, ignore this event.
2335-
auto eventIter = mPresentByThreadId.find(hdr.ThreadId);
2336-
if (eventIter == mPresentByThreadId.end()) {
2337-
return;
2338-
}
2339-
auto present = eventIter->second;
2340-
23412341
// Set the runtime and Present_Stop time.
23422342
VerboseTraceBeforeModifyingPresent(present.get());
23432343
present->Runtime = runtime;

0 commit comments

Comments
 (0)