#ifdef PROFILING_SUPPORTED
+ // We might have already torn down the profiler, if so we need to abort.
+ if (g_profControlBlock.curProfStatus.Get() != kProfStatusActive
#ifdef PROF_TEST_ONLY_FORCE_ELT
- // If this test-only flag is set, it's possible we might not have a profiler
- // attached, or might not have any of the hooks set. See
- // code:ProfControlBlock#TestOnlyELT
- if (g_profControlBlock.fTestOnlyForceEnterLeave)
+ // If this test-only flag is set, it's possible we might not have a profiler
+ // attached, or might not have any of the hooks set. See
+ // code:ProfControlBlock#TestOnlyELT
+ || g_profControlBlock.fTestOnlyForceEnterLeave
+#endif // PROF_TEST_ONLY_FORCE_ELT
+ )
{
if ((g_profControlBlock.pProfInterface.Load() == NULL) ||
(
return;
}
}
-#endif // PROF_TEST_ONLY_FORCE_ELT
// ELT3 Fast-Path hooks should be NULL when ELT intermediary is used.
_ASSERTE(g_profControlBlock.pProfInterface->GetEnter3Hook() == NULL);
#ifdef PROFILING_SUPPORTED
+ // We might have already torn down the profiler, if so we need to abort.
+ if (g_profControlBlock.curProfStatus.Get() != kProfStatusActive
#ifdef PROF_TEST_ONLY_FORCE_ELT
- // If this test-only flag is set, it's possible we might not have a profiler
- // attached, or might not have any of the hooks set. See
- // code:ProfControlBlock#TestOnlyELT
- if (g_profControlBlock.fTestOnlyForceEnterLeave)
+ // If this test-only flag is set, it's possible we might not have a profiler
+ // attached, or might not have any of the hooks set. See
+ // code:ProfControlBlock#TestOnlyELT
+ || g_profControlBlock.fTestOnlyForceEnterLeave
+#endif // PROF_TEST_ONLY_FORCE_ELT
+ )
{
if ((g_profControlBlock.pProfInterface.Load() == NULL) ||
(
return;
}
}
-#endif // PROF_TEST_ONLY_FORCE_ELT
// ELT3 Fast-Path hooks should be NULL when ELT intermediary is used.
_ASSERTE(g_profControlBlock.pProfInterface->GetLeave3Hook() == NULL);
#ifdef PROFILING_SUPPORTED
+ // We might have already torn down the profiler, if so we need to abort.
+ if (g_profControlBlock.curProfStatus.Get() != kProfStatusActive
#ifdef PROF_TEST_ONLY_FORCE_ELT
- // If this test-only flag is set, it's possible we might not have a profiler
- // attached, or might not have any of the hooks set. See
- // code:ProfControlBlock#TestOnlyELT
- if (g_profControlBlock.fTestOnlyForceEnterLeave)
+ // If this test-only flag is set, it's possible we might not have a profiler
+ // attached, or might not have any of the hooks set. See
+ // code:ProfControlBlock#TestOnlyELT
+ || g_profControlBlock.fTestOnlyForceEnterLeave
+#endif // PROF_TEST_ONLY_FORCE_ELT
+ )
{
if ((g_profControlBlock.pProfInterface.Load() == NULL) ||
(
return;
}
}
-#endif // PROF_TEST_ONLY_FORCE_ELT
// ELT3 fast-path hooks should be NULL when ELT intermediary is used.
_ASSERTE(g_profControlBlock.pProfInterface->GetTailcall3Hook() == NULL);