Created
January 28, 2016 22:47
-
-
Save amithegde/a0e35951e2e18d1d9b10 to your computer and use it in GitHub Desktop.
capturing EWT events
This file contains 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
void Main() | |
{ | |
//include nuget package: http://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.TraceEvent/ | |
using (var session = new TraceEventSession("My session", null)) | |
using (var source = new ETWTraceEventSource("My session", TraceEventSourceType.Session)) | |
{ | |
var parser = new DynamicTraceEventParser(source); | |
parser.All += delegate (TraceEvent data) | |
{ | |
Console.WriteLine("Got Event: " + data.ToString()); | |
}; | |
session.EnableProvider("provider guid"); | |
source.Process(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment