Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
40d9308
Proof of concept synchronous profiler EventPipe events
davmason May 24, 2020
7e2bbd8
Add provider callback and ability to query provider name
davmason May 25, 2020
a6ecda8
add guids to API
davmason May 26, 2020
af29c79
stop creating a buffer manager for synchronous sessions
davmason May 26, 2020
7198ac5
Take lock before adding provider to session
davmason May 26, 2020
7f3642c
fix linux build error
davmason May 26, 2020
1eb39d7
refactoring
davmason May 28, 2020
ce70d00
Get rid of enablecpusampling argument
davmason Jun 19, 2020
d644cba
move EventPipeProviderCreated profiler callback outside of lock
davmason Jun 19, 2020
8d1b5bc
refactor SuspendWriteEvent so it covers the synchronous callback case…
davmason Jun 20, 2020
7cb9a1a
after EventPipe starts shutting down return an error for EventPipeSta…
davmason Jun 21, 2020
c132d07
switch to spinlock since we can't use crst in gc_notrigger/coop
davmason Jun 22, 2020
ee9aee8
Add assert and remove unused variable
davmason Jun 23, 2020
540d8e3
Move storing null to the session array before EventPipeSession::Suspe…
davmason Jun 23, 2020
5eca5ef
remove spurious assert
davmason Jun 23, 2020
619f4b8
Fix SampleProfiler refcount issue, double profiler callback, remove u…
davmason Jun 24, 2020
7905bcf
remove the concept of m_writeEventSuspending from the buffer manager …
davmason Jun 24, 2020
96d8cc4
Add test
davmason May 26, 2020
87ceca4
add description of filter data format
davmason Jun 25, 2020
0cc9a28
fix x86 test build issues
davmason Jun 25, 2020
008dabd
exlcude test from mono
davmason Jun 26, 2020
68e3479
move waiting on threads to finish writing outside of the lock
davmason Jun 26, 2020
2c3429e
allow call to GetProviderInfo to get the length of the name
davmason Jun 27, 2020
5ab6fd0
Fix formatting
davmason Jun 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move waiting on threads to finish writing outside of the lock
  • Loading branch information
davmason committed Jun 26, 2020
commit 68e34797e7d63a1a58c9677101ba6d7012508949
26 changes: 19 additions & 7 deletions src/coreclr/src/vm/eventpipesession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,25 +542,37 @@ void EventPipeSession::SuspendWriteEvent()
}
CONTRACTL_END;

// Collect all threads that are currently active so we don't have to
// wait for events to finish writing under the lock.
CQuickArrayList<EventPipeThread *> threadList;
{
SpinLockHolder holder(EventPipeThread::GetGlobalThreadLock());

EventPipeThreadIterator eventPipeThreads = EventPipeThread::GetThreads();
EventPipeThread *pThread = nullptr;
while (eventPipeThreads.Next(&pThread))
{
// Wait for the thread to finish any writes to this session
YIELD_WHILE(pThread->GetSessionWriteInProgress() == GetIndex());

// Since we've already disabled the session, the thread won't call back in to this
// session once its done with the current write
// Add ref so the thread doesn't disappear when we release the lock
pThread->AddRef();
threadList.Push(pThread);
}
}

for (size_t i = 0; i < threadList.Size(); i++)
{
EventPipeThread *pThread = threadList[i];
// Wait for the thread to finish any writes to this session
YIELD_WHILE(pThread->GetSessionWriteInProgress() == GetIndex());

// Since we've already disabled the session, the thread won't call back in to this
// session once its done with the current write

pThread->Release();
}

if (m_pBufferManager != nullptr)
{
// Force all in-progress writes to either finish or cancel
// This is required to ensure we can safely flush and delete the buffers
// Convert all buffers to read only to ensure they get flushed
m_pBufferManager->SuspendWriteEvent(GetIndex());
}
}
Expand Down