Skip to content

Instantly share code, notes, and snippets.

@Criteo-dotnet-blog
Last active July 26, 2018 12:45
Show Gist options
  • Select an option

  • Save Criteo-dotnet-blog/68c2c0edbbe22d988e25c9f96bf7f5c1 to your computer and use it in GitHub Desktop.

Select an option

Save Criteo-dotnet-blog/68c2c0edbbe22d988e25c9f96bf7f5c1 to your computer and use it in GitHub Desktop.
string sessionName = "EtwSessionForCLR_" + Guid.NewGuid().ToString();
Console.WriteLine($"Starting {sessionName}...\r\n");
using (TraceEventSession userSession = new TraceEventSession(sessionName, TraceEventSessionOptions.Create))
{
Task.Run(() =>
{
// register handlers for events on the session source
// more on this later...
// decide which provider to listen to with filters if needed
// process the events in a blocking call
});
// wait for the user to dismiss the session
Console.WriteLine("Presse ENTER to exit...");
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment