A gentle reminder that TraceGC is turned off (#79183)
authorAndrew Au <andrewau@microsoft.com>
Fri, 9 Dec 2022 22:55:10 +0000 (14:55 -0800)
committerGitHub <noreply@github.com>
Fri, 9 Dec 2022 22:55:10 +0000 (14:55 -0800)
src/coreclr/gc/gc.cpp
src/coreclr/inc/gcmsg.inl
src/coreclr/tools/StressLogAnalyzer/StressLogPlugin.cpp

index f02ace0..448acc0 100644 (file)
@@ -45187,6 +45187,9 @@ HRESULT GCHeap::Init(size_t hn)
 //System wide initialization
 HRESULT GCHeap::Initialize()
 {
+#ifndef TRACE_GC
+    STRESS_LOG_VA (1, (ThreadStressLog::gcLoggingIsOffMsg()));
+#endif
     HRESULT hr = S_OK;
 
     qpf = (uint64_t)GCToOSInterface::QueryPerformanceFrequency();
index bb95800..14e81ad 100644 (file)
         STATIC_CONTRACT_LEAF;
         return "Relocating reference *(%p) from %p to %p";
     }
+
+    static const char* gcLoggingIsOffMsg()
+    {
+        STATIC_CONTRACT_LEAF;
+        return "TraceGC is not turned on";
+    }
index eb27675..85bc4b5 100644 (file)
@@ -151,6 +151,7 @@ d(IS_DESIRED_NEW_ALLOCATION,    ThreadStressLog::gcDesiredNewAllocationMsg())
 d(IS_MAKE_UNUSED_ARRAY,         ThreadStressLog::gcMakeUnusedArrayMsg())                                                    \
 d(IS_START_BGC_THREAD,          ThreadStressLog::gcStartBgcThread())                                                        \
 d(IS_RELOCATE_REFERENCE,        ThreadStressLog::gcRelocateReferenceMsg())                                                  \
+d(IS_LOGGING_OFF,               ThreadStressLog::gcLoggingIsOffMsg())                                                       \
 d(IS_UNINTERESTING,             "")
 
 enum InterestingStringId : unsigned char
@@ -386,6 +387,9 @@ bool FilterMessage(StressLog::StressLogHeader* hdr, ThreadStressLog* tsl, uint32
         break;
     }
 
+    case    IS_LOGGING_OFF:
+        return true;
+
     case    IS_GCSTART:
     {
         int gcIndex = (int)(size_t)args[0];