Skip to content

Commit 263fb3c

Browse files
Updated app provider event attachment to present stop to accomodate driver low latency
1 parent 6dfe116 commit 263fb3c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

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)