.net 4.5 .NET ETW-意外关键字-会话n

.net 4.5 .NET ETW-意外关键字-会话n,.net-4.5,etw,.net 4.5,Etw,使用.NET 4.5上的Microsoft.Diagnostics.Tracing.*ETW 最终结果为所有日志创建了额外的关键字:Session0、Session1、Session2、Session3 ETW库示例代码甚至出现了这种情况 已知问题? 看起来是个已知的问题 我确实可以在清单文件中找到这些有趣的关键字。 看起来是个已知的问题 我确实可以在清单文件中找到这些有趣的关键字。 它由中的CreateManifestAndDescriptors()创建(参见第3346行) //使用反射查看类

使用.NET 4.5上的Microsoft.Diagnostics.Tracing.*ETW 最终结果为所有日志创建了额外的关键字:Session0、Session1、Session2、Session3

ETW库示例代码甚至出现了这种情况

已知问题?

看起来是个已知的问题

我确实可以在清单文件中找到这些有趣的关键字。

看起来是个已知的问题

我确实可以在清单文件中找到这些有趣的关键字。

它由中的
CreateManifestAndDescriptors()
创建(参见第3346行)

//使用反射查看类的属性,并为其生成清单(如UTF8)和
//返回UTF8字节。它还设置了调度事件所需的代码:EventData结构
//在运行时。”“源”是放置描述符的事件源。如果为空,
//然后不创建描述符,只生成清单。
私有静态字节[]createManifestandDescriptor(类型eventSourceType、字符串eventSourceDllName、EventSource source、,
EventManifestOptions标志=EventManifestOptions.None)
{
///...
//确保我们有会话过滤保留位的关键字
// 
{
manifest.AddKeyword(“Session3”(长)0x1000

它由中的
CreateManifestAndDescriptors()
创建(参见第3346行)

//使用反射查看类的属性,并为其生成清单(如UTF8)和
//返回UTF8字节。它还设置分派事件所需的代码:EventData结构
//在运行时,“source”是放置描述符的事件源。如果为null,
//然后不创建描述符,只生成清单。
私有静态字节[]createManifestandDescriptor(类型eventSourceType、字符串eventSourceDllName、EventSource source、,
EventManifestOptions标志=EventManifestOptions.None)
{
///...
//确保我们有会话过滤保留位的关键字
// 
{

manifest.AddKeyword(“Session3”(长)0x1000如何捕获事件?没有捕获器/侦听器,只有事件发布器。实际上与库示例代码一样,我不知道这是什么意思。我通过Perfview或WPR捕获事件。我只需要事件查看器中显示事件,因此我不需要其他工具来捕获事件。如何捕获事件?没有捕获器/列表ener,只是事件发布者。实际上与库示例代码一样,我不知道这是什么意思。我通过Perfview或WPR捕获事件。我只需要事件查看器中显示事件,因此不需要其他工具来捕获
// Use reflection to look at the attributes of a class, and generate a manifest for it (as UTF8) and
// return the UTF8 bytes.  It also sets up the code:EventData structures needed to dispatch events
// at run time.  'source' is the event source to place the descriptors.  If it is null,
// then the descriptors are not creaed, and just the manifest is generated.  
private static byte[] CreateManifestAndDescriptors(Type eventSourceType, string eventSourceDllName, EventSource source,
    EventManifestOptions flags = EventManifestOptions.None)
{
    ///...
    // ensure we have keywords for the session-filtering reserved bits
    // 
    {
        manifest.AddKeyword("Session3", (long)0x1000 << 32);
        manifest.AddKeyword("Session2", (long)0x2000 << 32);
        manifest.AddKeyword("Session1", (long)0x4000 << 32);
        manifest.AddKeyword("Session0", (long)0x8000 << 32);
    }
//...
}