Skip to content

Commit

Permalink
Add more verification in EventPipe rundownvalidation test.
Browse files Browse the repository at this point in the history
Subtle changes like:
dotnet@2f2aaae

Knocked out a couple of rundown events on Mono that was detected and
fixed in dotnet#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
  • Loading branch information
lateralusX committed Jul 28, 2023
1 parent e40303b commit 1e8c566
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,30 @@ public static int Main()

private static Func<EventPipeEventSource, Func<int>> _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;
};
}
}

0 comments on commit 1e8c566

Please sign in to comment.