.NET ETW - 非预期关键字 - 会话

问题描述 投票:1回答:2

在.NET 4.5上使用Microsoft.Diagnostics.Tracing。* ETW,最终结果以某种方式为所有日志创建了附加关键字:Session0,Session1,Session2,Session3

这甚至发生在ETW库样本代码中

已知问题?

.net-4.5 etw
2个回答
0
投票

http://www.shujaat.net/2013/09/net-45-eventsource-windows-event-log.html?showComment=1410351588387#c5917443851300280552

看起来像一个已知问题

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


0
投票

log in Event Viewer: see the Keywords source

它是由CreateManifestAndDescriptors()eventsource.cs创建的(见第3346行)

// 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);
    }
//...
}
© www.soinside.com 2019 - 2024. All rights reserved.