我一直致力于使用 .NET4.5 新功能 ETW(EventSource)。我无法使用 perfmon->Data Collector Sets 将其显示在跟踪提供程序列表中。我能够使用 perfview 查看日志。
我能够使用其静态方法 GenerateManifest 从 EventSource 类生成 list 。这将在 EventSource 类中提供 myevents 的 list ,但它不包含有关 channel 的详细信息。
我的问题是如何在为 perfmon 跟踪 session 生成 list 文件后添加 channel 特定信息?我还想使用 Perfmon 的跟踪 session 来启用提供程序而不是 perfview。
任何输入都非常感谢。
最佳答案
MS 发布了一个 Nuget 包,它在构建后注册 EventSource 类:
http://blogs.msdn.com/b/dotnet/archive/2013/08/09/announcing-the-eventsource-nuget-package-write-to-the-windows-event-log.aspx
Registering your EventSource
When you install the EventSource NuGet package, the build step previously mentioned generates the following files for each EventSource in your application:
<AssemblyName>.<EventSourceTypeName>.etwManifest.man <AssemblyName>.<EventSourceTypeName>.etwManifest.dll.
These files need to be registered with the operating system to enable channel support. To do this you run the following command after the files are in their final deployed location:
wevtutil.exe im <EtwManifestManFile> /rf:"<EtwManifestDllFile>" /mf:"<EtwManifestDllFile>"
Once this registration command is executed, all subsequent calls to MinimalEventSource.Log.Load(), from any process on that machine, will automatically result in events in the Windows Event log.
注册后,您应该会在所有读取已安装提供程序的工具中看到它。
关于.net-4.5 - .Net 4.5 EventSource ETW 提供程序未显示在提供程序列表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17560826/