From 1e8c566562c2a9f0ec06bb7ac98c52643338bbe9 Mon Sep 17 00:00:00 2001 From: lateralusX Date: Fri, 28 Jul 2023 12:43:04 +0200 Subject: [PATCH] Add more verification in EventPipe rundownvalidation test. Subtle changes like: https://github.com/dotnet/runtime/commit/2f2aaae4e4fc1c33d6a7db316fcc0cac4df7af3f Knocked out a couple of rundown events on Mono that was detected and fixed in https://github.com/dotnet/runtime/pull/88634. It would been ideal to catch this issue as part of CI, but turns out that our existing rundownvalidation test only tests a couple of rundown events, and not any of the module/assembly events that was affected by above change. This commit adds validation that the following additional rundown events are included in the rundown event stream: RuntimeStart MethodDCStopInit MethodDCStopComplete LoaderModuleDCStop LoaderDomainModuleDCStop LoadAssemblyDCStop LoadAppDomainDCStop --- .../rundownvalidation/rundownvalidation.cs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/tests/tracing/eventpipe/rundownvalidation/rundownvalidation.cs b/src/tests/tracing/eventpipe/rundownvalidation/rundownvalidation.cs index 1756f4ec94557..e7f2e78724570 100644 --- a/src/tests/tracing/eventpipe/rundownvalidation/rundownvalidation.cs +++ b/src/tests/tracing/eventpipe/rundownvalidation/rundownvalidation.cs @@ -42,12 +42,30 @@ public static int Main() private static Func> _DoesRundownContainMethodEvents = (source) => { + bool hasRuntimeStart = false; + bool hasMethodDCStopInit = false; + bool hasMethodDCStopComplete = false; + bool hasLoaderModuleDCStop = false; + bool hasLoaderDomainModuleDCStop = false; + bool hasAssemblyModuleDCStop = false; bool hasMethodDCStopVerbose = false; bool hasMethodILToNativeMap = false; + bool hasAppDomainDCStop = false; + ClrRundownTraceEventParser rundownParser = new ClrRundownTraceEventParser(source); + rundownParser.RuntimeStart += (eventData) => hasRuntimeStart = true; + rundownParser.MethodDCStopInit += (eventData) => hasMethodDCStopInit = true; + rundownParser.MethodDCStopComplete += (eventData) => hasMethodDCStopComplete = true; + rundownParser.LoaderModuleDCStop += (eventData) => hasLoaderModuleDCStop = true; + rundownParser.LoaderDomainModuleDCStop += (eventData) => hasLoaderDomainModuleDCStop = true; + rundownParser.LoaderAssemblyDCStop += (eventData) => hasAssemblyModuleDCStop = true; rundownParser.MethodDCStopVerbose += (eventData) => hasMethodDCStopVerbose = true; rundownParser.MethodILToNativeMapDCStop += (eventData) => hasMethodILToNativeMap = true; - return () => hasMethodDCStopVerbose && hasMethodILToNativeMap ? 100 : -1; + rundownParser.LoaderAppDomainDCStop += (eventData) => hasAppDomainDCStop = true; + return () => + hasRuntimeStart && hasMethodDCStopInit && hasMethodDCStopComplete && + hasLoaderModuleDCStop && hasLoaderDomainModuleDCStop && hasAssemblyModuleDCStop && + hasMethodDCStopVerbose && hasMethodILToNativeMap && hasAppDomainDCStop ? 100 : -1; }; } }