summaryrefslogtreecommitdiff
path: root/src/vm/sampleprofiler.cpp
diff options
context:
space:
mode:
authorBrian Robbins <brianrob@microsoft.com>2017-12-12 14:19:19 -0800
committerGitHub <noreply@github.com>2017-12-12 14:19:19 -0800
commit59f8f6632a8a4ca0973cef8e2694937635ef96c0 (patch)
tree44356183a7fb31b68f6640e198c3624f6cf13b8b /src/vm/sampleprofiler.cpp
parent2e92b4a71071c1c99d1b39d8441c42d805d93310 (diff)
downloadcoreclr-59f8f6632a8a4ca0973cef8e2694937635ef96c0.tar.gz
coreclr-59f8f6632a8a4ca0973cef8e2694937635ef96c0.tar.bz2
coreclr-59f8f6632a8a4ca0973cef8e2694937635ef96c0.zip
Don't create the sampling thread if the threadtime event is disabled. (#15473)
Diffstat (limited to 'src/vm/sampleprofiler.cpp')
-rw-r--r--src/vm/sampleprofiler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vm/sampleprofiler.cpp b/src/vm/sampleprofiler.cpp
index 4a858e9b4a..d99667eea2 100644
--- a/src/vm/sampleprofiler.cpp
+++ b/src/vm/sampleprofiler.cpp
@@ -45,6 +45,12 @@ void SampleProfiler::Enable()
false /* NeedStack */);
}
+ // Check to see if the sample profiler event is enabled. If it is not, do not spin up the sampling thread.
+ if(!s_pThreadTimeEvent->IsEnabled())
+ {
+ return;
+ }
+
if(s_pPayloadExternal == NULL)
{
s_pPayloadExternal = new BYTE[sizeof(unsigned int)];