我想使用EventSource
来启动ETW事件并使用Windows性能分析器查看它们。如何使用Windows性能分析器查看由EventSource创建的ETW事件?
我有一个基本的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"); }
}
当我与Windows性能记录器(WPR)记录,我没有看到我的供应商或事件在Windows性能分析器(WPA)的一般事件图表。
感谢您的时间:)
你是怎么开始你的会议?这是我们一直在使用的方法 - http://svcperf.codeplex.com/wikipage?title=Realtime%2bWCF%2bSession&referringTitle=常见问题解答 – Sajay