Skip to content

Commit

Permalink
Support local traces in QuicTrace (microsoft#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse authored Jun 25, 2021
1 parent 27c8288 commit 200dd6c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/plugins/trace/exe/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//

using System;
using System.Threading;
using Microsoft.Diagnostics.Tracing.Session;
using Microsoft.Performance.SDK.Extensibility;
using Microsoft.Performance.Toolkit.Engine;
using QuicTrace.DataModel;
Expand Down Expand Up @@ -41,8 +43,17 @@ static void PrintArgs()

static string? CaptureLocalTrace()
{
Console.WriteLine("--local capture is not currently supported!");
return null; // TODO - Support local trace collection
const string fileName = "C:\\Windows\\System32\\LogFiles\\WMI\\quicetw.etl";
const string name = "quicetw";
Guid providerGuid = Guid.Parse("{ff15e657-4f26-570e-88ab-0796b258d11c}");


using var session = new TraceEventSession(name, fileName);
Console.WriteLine(session.EnableProvider(providerGuid, Microsoft.Diagnostics.Tracing.TraceEventLevel.Verbose, matchAnyKeywords: 0));

Thread.Sleep(250); // Just let the rundowns fire.

return fileName;
}

static QuicState ProcessTraceFile(string filePath)
Expand Down

0 comments on commit 200dd6c

Please sign in to comment.