@@ -32,26 +32,21 @@ void SetOutputRecordingState(bool record)
3232{
3333 auto const & args = GetCommandLineArgs ();
3434
35- if (gIsRecording == record) {
36- return ;
37- }
35+ EnterCriticalSection (&gRecordingToggleCS );
3836
39- // When capturing from an ETL file, just use the current recording state.
40- // It's not clear how best to map realtime to ETL QPC time, and there
41- // aren't any realtime cues in this case.
42- if (args.mEtlFileName != nullptr ) {
43- EnterCriticalSection (&gRecordingToggleCS );
37+ if (gIsRecording != record) {
4438 gIsRecording = record;
45- LeaveCriticalSection (&gRecordingToggleCS );
46- return ;
47- }
4839
49- uint64_t qpc = 0 ;
50- QueryPerformanceCounter ((LARGE_INTEGER*) &qpc);
40+ // When capturing from an ETL file, just use the current recording state.
41+ // It's not clear how best to map realtime to ETL QPC time, and there
42+ // aren't any realtime cues in this case.
43+ if (args.mEtlFileName == nullptr ) {
44+ uint64_t qpc = 0 ;
45+ QueryPerformanceCounter ((LARGE_INTEGER*) &qpc);
46+ gRecordingToggleHistory .emplace_back (qpc);
47+ }
48+ }
5149
52- EnterCriticalSection (&gRecordingToggleCS );
53- gRecordingToggleHistory .emplace_back (qpc);
54- gIsRecording = record;
5550 LeaveCriticalSection (&gRecordingToggleCS );
5651}
5752
@@ -233,7 +228,7 @@ static void HandleTerminatedProcess(uint32_t processId)
233228 }
234229 }
235230
236- gProcesses .erase (iter);
231+ gProcesses .erase (std::move ( iter) );
237232}
238233
239234static void UpdateProcesses (std::vector<ProcessEvent> const & processEvents, std::vector<std::pair<uint32_t , uint64_t >>* terminatedProcesses)
0 commit comments