summaryrefslogtreecommitdiff
path: root/src/vm/sampleprofiler.cpp
diff options
context:
space:
mode:
authorBrian Robbins <brianrob@microsoft.com>2017-05-12 10:51:31 -0700
committerGitHub <noreply@github.com>2017-05-12 10:51:31 -0700
commitfca97d0ca72524b3bdd61817f7a172dd47d53287 (patch)
tree2cd8ca575969c94f487e7e9d175099b31fcf6ff6 /src/vm/sampleprofiler.cpp
parentf70698458849e3541dc96fac8d6c0d6b52ccf048 (diff)
downloadcoreclr-fca97d0ca72524b3bdd61817f7a172dd47d53287.tar.gz
coreclr-fca97d0ca72524b3bdd61817f7a172dd47d53287.tar.bz2
coreclr-fca97d0ca72524b3bdd61817f7a172dd47d53287.zip
EventPipe Circular Buffer Support and Ability to Start/Stop Tracing (#11507)
Diffstat (limited to 'src/vm/sampleprofiler.cpp')
-rw-r--r--src/vm/sampleprofiler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vm/sampleprofiler.cpp b/src/vm/sampleprofiler.cpp
index 6a6a23a03b..7c6429a211 100644
--- a/src/vm/sampleprofiler.cpp
+++ b/src/vm/sampleprofiler.cpp
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
#include "common.h"
+#include "eventpipebuffermanager.h"
#include "eventpipeeventinstance.h"
#include "sampleprofiler.h"
#include "hosting.h"
@@ -136,7 +137,7 @@ DWORD WINAPI SampleProfiler::ThreadProc(void *args)
}
}
- // Destroy the sampling thread when done running.
+ // Destroy the sampling thread when it is done running.
DestroyThread(s_pSamplingThread);
s_pSamplingThread = NULL;
@@ -158,19 +159,18 @@ void SampleProfiler::WalkManagedThreads()
}
CONTRACTL_END;
- Thread *pThread = NULL;
+ Thread *pTargetThread = NULL;
// Iterate over all managed threads.
// Assumes that the ThreadStoreLock is held because we've suspended all threads.
- while ((pThread = ThreadStore::GetThreadList(pThread)) != NULL)
+ while ((pTargetThread = ThreadStore::GetThreadList(pTargetThread)) != NULL)
{
- SampleProfilerEventInstance instance(pThread);
- StackContents &stackContents = *(instance.GetStack());
+ StackContents stackContents;
// Walk the stack and write it out as an event.
- if(EventPipe::WalkManagedStackForThread(pThread, stackContents) && !stackContents.IsEmpty())
+ if(EventPipe::WalkManagedStackForThread(pTargetThread, stackContents) && !stackContents.IsEmpty())
{
- EventPipe::WriteSampleProfileEvent(instance);
+ EventPipe::WriteSampleProfileEvent(s_pSamplingThread, pTargetThread, stackContents);
}
}
}