Reputation: 31
I can successfully generate ETW events with EventSource in a C# console app; however if I store the events in a an ETL file and use Windows Performance Analyzer, the columns corresponding to the payload values, the event name and the provider name show are empty.
QUESTION
Are there any extra configurations for the EventSource that would allow the columns in WPA to get populated?
Notes:
Minimal code:
using System.Diagnostics.Tracing;
namespace EtwConsoleApp {
class Program {
static void Main(string[] args) {
MyEventSource.Instance.MyEvent("x");
MyEventSource.Instance.MyEvent("y");
MyEventSource.Instance.MyEvent("z");
}
}
[EventSource(Guid = "56ff7ff6-0418-4501-945f-c12737bc1c70")]
sealed class MyEventSource : EventSource {
[Event(1, Level = EventLevel.Verbose, Opcode = EventOpcode.Info)]
public void MyEvent(string value) {
this.WriteEvent(1, value);
}
public static MyEventSource Instance = new MyEventSource();
}
}
See the empty rows in WPA:
Upvotes: 0
Views: 967
Reputation: 31
System.Diagnostics.Tracing.EventSource from .NET 4.5 does not produce events that are correctly visualized by WPA.
Solution was to use: Microsoft.Diagnostics.Tracing.EventSource
Another solution is to use: System.Diagnostics.Tracing.EventSource from .NET 4.6 (which in my case was not possible)
Upvotes: 1
Reputation: 28776
System.Diagnostics.Tracing
shows that you use the inbox version of the .net framework 4.5. Try the Nuget version Microsoft.Diagnostics.Tracing.EventSource which gets updated more often to get new features.
Upvotes: 0