Last active
July 26, 2018 12:45
-
-
Save Criteo-dotnet-blog/68c2c0edbbe22d988e25c9f96bf7f5c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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