diff options
author | Sung Yoon Whang <suwhang@microsoft.com> | 2019-04-12 17:11:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 17:11:49 -0700 |
commit | 411fb39bc45067d47b4189bdf7288b9224ced487 (patch) | |
tree | 7abfe315c296cd9b580c2f92663d9eb8d0274880 /src/vm/eventpipebuffermanager.cpp | |
parent | d5865236e7898b730de28a7a6f034e975bb7282e (diff) | |
download | coreclr-411fb39bc45067d47b4189bdf7288b9224ced487.tar.gz coreclr-411fb39bc45067d47b4189bdf7288b9224ced487.tar.bz2 coreclr-411fb39bc45067d47b4189bdf7288b9224ced487.zip |
Fix EventPipe IPC streaming (#23768)
* Make events stream out faster when we are doing IPC
* Block size should be less during IPC session
* Modify some comments
* Address PR feedback
* more pr feedback
* Fix high volume scenario
* Fix flush
* cleanup
* Only flush when we have buffers written
Diffstat (limited to 'src/vm/eventpipebuffermanager.cpp')
-rw-r--r-- | src/vm/eventpipebuffermanager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vm/eventpipebuffermanager.cpp b/src/vm/eventpipebuffermanager.cpp index e15676e15e..f08a2b3640 100644 --- a/src/vm/eventpipebuffermanager.cpp +++ b/src/vm/eventpipebuffermanager.cpp @@ -434,6 +434,7 @@ void EventPipeBufferManager::WriteAllBuffersToFile(EventPipeFile *pFile, LARGE_I SpinLockHolder _slh(&m_lock); // Naively walk the circular buffer, writing the event stream in timestamp order. + m_numEventsWritten = 0; while(true) { EventPipeEventInstance *pOldestInstance = NULL; @@ -470,13 +471,14 @@ void EventPipeBufferManager::WriteAllBuffersToFile(EventPipeFile *pFile, LARGE_I // Write the oldest event. pFile->WriteEvent(*pOldestInstance); -#ifdef _DEBUG - m_numEventsWritten++; -#endif // _DEBUG + m_numEventsWritten++; // Pop the event from the buffer. pOldestContainingList->PopNextEvent(stopTimeStamp); } + + if (m_numEventsWritten > 0) + pFile->Flush(); } EventPipeEventInstance* EventPipeBufferManager::GetNextEvent() |