From b6020c8cd4c2cdfab86dfeac94729899b0075257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Wed, 11 Dec 2024 17:53:08 +0100 Subject: [PATCH] Disable COR_PRF_HIGH_DISABLE_TIERED_COMPILATION --- .../cor_profiler.cpp | 3 ++- test/IntegrationTests/ContinuousProfilerTests.cs | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp b/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp index bea3fc3d87..b4af5d5114 100644 --- a/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp +++ b/src/OpenTelemetry.AutoInstrumentation.Native/cor_profiler.cpp @@ -248,7 +248,8 @@ HRESULT STDMETHODCALLTYPE CorProfiler::Initialize(IUnknown* cor_profiler_info_un } // set event mask to subscribe to events and disable NGEN images - hr = this->info_->SetEventMask2(event_mask, COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES); + hr = this->info_->SetEventMask2(event_mask, + COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES | COR_PRF_HIGH_DISABLE_TIERED_COMPILATION); if (FAILED(hr)) { FailProfiler(Warn, "Failed to attach profiler: unable to set event mask.") diff --git a/test/IntegrationTests/ContinuousProfilerTests.cs b/test/IntegrationTests/ContinuousProfilerTests.cs index 04a2df6664..2ca3516381 100644 --- a/test/IntegrationTests/ContinuousProfilerTests.cs +++ b/test/IntegrationTests/ContinuousProfilerTests.cs @@ -63,14 +63,10 @@ private static List CreateExpectedStackTrace() { var stackTrace = new List { - "System.Threading.Thread.Sleep(System.TimeSpan)", "TestApplication.ContinuousProfiler.Fs.ClassFs.methodFs(System.String)", - "TestApplication.ContinuousProfiler.Vb.ClassVb.MethodVb(System.String)", "My.Custom.Test.Namespace.TestDynamicClass.TryInvoke(System.Dynamic.InvokeBinder, System.Object[], System.Object\u0026)", "System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0, T1, T2](System.Runtime.CompilerServices.CallSite, T0, T1, T2)", "My.Custom.Test.Namespace.ClassENonStandardCharacters\u0104\u0118\u00D3\u0141\u017B\u0179\u0106\u0105\u0119\u00F3\u0142\u017C\u017A\u015B\u0107\u011C\u0416\u13F3\u2CC4\u02A4\u01CB\u2093\u06BF\u0B1F\u0D10\u1250\u3023\u203F\u0A6E\u1FAD_\u00601.GenericMethodDFromGenericClass[TMethod, TMethod2](TClass, TMethod, TMethod2)", - "My.Custom.Test.Namespace.ClassD`21.MethodD(T01, T02, T03, T04, T05, T06, T07, T08, T09, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, Unknown)", - "My.Custom.Test.Namespace.GenericClassC`1.GenericMethodCFromGenericClass[T01, T02, T03, T04, T05, T06, T07, T08, T09, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](T01, T02, T03, T04, T05, T06, T07, T08, T09, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, Unknown)", "My.Custom.Test.Namespace.GenericClassC`1.GenericMethodCFromGenericClass(T)" }; @@ -82,7 +78,6 @@ private static List CreateExpectedStackTrace() stackTrace.Add("Unknown_Native_Function(unknown)"); } #endif - stackTrace.Add("My.Custom.Test.Namespace.ClassA.InternalClassB`2.DoubleInternalClassB.TripleInternalClassB`1.MethodB[TB](System.Int32, TC[], TB, TD, System.Collections.Generic.IList`1[TA], System.Collections.Generic.IList`1[System.String])"); stackTrace.Add("My.Custom.Test.Namespace.ClassA.g__Action|7_0[T](System.Int32)"); stackTrace.Add("My.Custom.Test.Namespace.ClassA.MethodAOthers[T](System.String, System.Object, My.Custom.Test.Namespace.CustomClass, My.Custom.Test.Namespace.CustomStruct, My.Custom.Test.Namespace.CustomClass[], My.Custom.Test.Namespace.CustomStruct[], System.Collections.Generic.List`1[T])"); stackTrace.Add("My.Custom.Test.Namespace.ClassA.MethodAPointer(System.Int32*)");