I would like to fire ETW events using EventSource
and view them with Windows Performance Analyzer.
I have a basic EventSource
:
[EventSource(Name = "BasicEventSource")]
public class ETWLogger : EventSource
{
#if DEBUG
private const bool ThrowOnError = true;
#else
private const bool ThrowOnError = false;
#endif
private ETWLogger(bool throwOnError) : base(throwOnError) { }
private static ETWLogger _log;
public static ETWLogger Log
{ get { return _log ?? (_log = new ETWLogger(ThrowOnError)); } }
private static class Keywords
{
public const EventKeywords Perf = (EventKeywords) 1;
}
[Event(1, Keywords = Keywords.Perf, Level = EventLevel.Informational)]
public void Startup() { WriteEvent(1, "StartUp"); }
}
When I record with Windows Performance Recorder (WPR), I don't see my provider or events in the Generic Events graph of Windows Performance Analyzer (WPA).
Thanks for your time :)