From 3c2ebd5867f157bd48dcdc0344f9391ab6edad28 Mon Sep 17 00:00:00 2001 From: David Mason Date: Thu, 15 Jun 2023 00:03:13 -0700 Subject: [PATCH] Jitdump fixes (#87547) --- src/coreclr/pal/src/misc/perfjitdump.cpp | 11 ++--------- src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h | 2 +- src/coreclr/vm/perfmap.cpp | 1 + 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/coreclr/pal/src/misc/perfjitdump.cpp b/src/coreclr/pal/src/misc/perfjitdump.cpp index 7c7601ea45c83..50b0f2c6dadcf 100644 --- a/src/coreclr/pal/src/misc/perfjitdump.cpp +++ b/src/coreclr/pal/src/misc/perfjitdump.cpp @@ -213,9 +213,6 @@ struct PerfJitDumpState enabled = true; exit: - if (result != 0) - return FatalError(); - return 0; } @@ -298,10 +295,8 @@ struct PerfJitDumpState } while (result > 0); } while (true); -exit: - if (result != 0) - return FatalError(); } +exit: return 0; } @@ -337,10 +332,8 @@ struct PerfJitDumpState return FatalError(); fd = -1; -exit: - if (result != 0) - return -1; } +exit: return 0; } }; diff --git a/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h b/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h index 7ea2201b9787b..a860846d5f50d 100644 --- a/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h +++ b/src/coreclr/vm/eventing/eventpipe/ds-rt-coreclr.h @@ -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; } diff --git a/src/coreclr/vm/perfmap.cpp b/src/coreclr/vm/perfmap.cpp index d4828cd80dc48..25f4ead7353b5 100644 --- a/src/coreclr/vm/perfmap.cpp +++ b/src/coreclr/vm/perfmap.cpp @@ -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);