Jitdump fixes (#87547)
authorDavid Mason <davmason@microsoft.com>
Thu, 15 Jun 2023 07:03:13 +0000 (00:03 -0700)
committerGitHub <noreply@github.com>
Thu, 15 Jun 2023 07:03:13 +0000 (00:03 -0700)
src/coreclr/pal/src/misc/perfjitdump.cpp
src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h
src/coreclr/vm/perfmap.cpp

index 7c7601ea45c834c48139288bd449d52a942454bc..50b0f2c6dadcf67373b7e3a4f10758edfec2bae9 100644 (file)
@@ -213,9 +213,6 @@ struct PerfJitDumpState
         enabled = true;
 
 exit:
-        if (result != 0)
-            return FatalError();
-
         return 0;
     }
 
@@ -298,10 +295,8 @@ exit:
                 } while (result > 0);
             } while (true);
 
-exit:
-            if (result != 0)
-                return FatalError();
         }
+exit:
         return 0;
     }
 
@@ -337,10 +332,8 @@ exit:
                 return FatalError();
 
             fd = -1;
-exit:
-            if (result != 0)
-                return -1;
         }
+exit:
         return 0;
     }
 };
index 7ea2201b9787b7ab6e8469282158311eda4ee7b3..a860846d5f50d2b5843f8353cbd8dab94eca5855 100644 (file)
@@ -303,7 +303,7 @@ ds_rt_enable_perfmap (uint32_t type)
 
 #ifdef FEATURE_PERFMAP
        PerfMap::PerfMapType perfMapType = (PerfMap::PerfMapType)type;
-       if (perfMapType == PerfMap::PerfMapType::DISABLED || perfMapType > PerfMap::PerfMapType::JITDUMP)
+       if (perfMapType == PerfMap::PerfMapType::DISABLED || perfMapType > PerfMap::PerfMapType::PERFMAP)
        {
                return DS_IPC_E_INVALIDARG;
        }
index d4828cd80dc4899b4c0da1446e70178fc1adf1fe..25f4ead7353b567ecf4fd0e771af4e149e2e9e37 100644 (file)
@@ -157,6 +157,7 @@ void PerfMap::Enable(PerfMapType type, bool sendExisting)
                 IJitManager::MethodRegionInfo methodRegionInfo;
                 codeInfo.GetMethodRegionInfo(&methodRegionInfo);
                 _ASSERTE(methodRegionInfo.hotStartAddress == codeStart);
+                _ASSERTE(methodRegionInfo.hotSize > 0);
                     
                 PrepareCodeConfig config(!nativeCodeVersion.IsNull() ? nativeCodeVersion : NativeCodeVersion(pMethod), FALSE, FALSE);
                 PerfMap::LogJITCompiledMethod(pMethod, codeStart, methodRegionInfo.hotSize, &config);