在.NET 4.5上使用Microsoft.Diagnostics.Tracing。* ETW,最终结果以某种方式为所有日志创建了附加关键字:Session0,Session1,Session2,Session3
这甚至发生在ETW库样本代码中
已知问题?
看起来像一个已知问题
我可以在清单文件中找到这些有趣的关键字。
它是由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);
}
//...
}