diff options
author | Brian Robbins <brianrob@microsoft.com> | 2017-12-12 14:19:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-12 14:19:19 -0800 |
commit | 59f8f6632a8a4ca0973cef8e2694937635ef96c0 (patch) | |
tree | 44356183a7fb31b68f6640e198c3624f6cf13b8b /src/vm/sampleprofiler.cpp | |
parent | 2e92b4a71071c1c99d1b39d8441c42d805d93310 (diff) | |
download | coreclr-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.cpp | 6 |
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)]; |