Skip to content

Instantly share code, notes, and snippets.

@Criteo-dotnet-blog
Created July 24, 2018 13:38
Show Gist options
  • Save Criteo-dotnet-blog/8b142495ce1a63c4a47ae91889dd43e4 to your computer and use it in GitHub Desktop.
Save Criteo-dotnet-blog/8b142495ce1a63c4a47ae91889dd43e4 to your computer and use it in GitHub Desktop.
// register handlers for events on the session source
// more on this later...
// decide which provider to listen to with filters if needed
userSession.EnableProvider(
ClrTraceEventParser.ProviderGuid,
TraceEventLevel.Verbose,
(ulong)(
ClrTraceEventParser.Keywords.Contention | // thread contention timing
ClrTraceEventParser.Keywords.Threading | // threadpool events
ClrTraceEventParser.Keywords.Exception | // get the first chance exceptions
ClrTraceEventParser.Keywords.GCHeapAndTypeNames |
ClrTraceEventParser.Keywords.Type | // for finalizer and exceptions type names
ClrTraceEventParser.Keywords.GC // garbage collector details
)
);
// this is a blocking call until the session is disposed
userSession.Source.Process();
Console.WriteLine("End of session");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment