gpt4 book ai didi

windows - 使用 WPP 跟踪到多个 ETW 提供程序

转载 作者:可可西里 更新时间:2023-11-01 14:25:34 26 4
gpt4 key购买 nike

我正在尝试通过 WPP 工具使用“Windows 事件跟踪”。根据 Getting Started with Software Tracing in Windows Drivers 中的文档可以从单个驱动程序向多个提供程序发出跟踪,但我没有看到这样做的示例:

A driver can specify more than one control GUID. Each control GUID identifies a unique provider. For example, if a driver defines two control GUIDs, one for a shared library and one for the driver, the library and the driver can be enabled as two different providers. Tracing can be enabled for either the library or the driver, or both.

我尝试创建两个头文件,每个头文件的 WPP_CONTROL_GUIDS 使用不同的 guid。然后我包含来自 c/cpp 文件的不同头文件,我希望这些头文件向不同的提供者发出跟踪。但似乎主文件中的定义覆盖了这种分离,所有的痕迹都到达了它使用的提供者......

有什么建议吗?有 sample 吗?谢谢!!

最佳答案

我现在像避免瘟疫一样避免 WPP 跟踪,但跟踪模板提供了如何执行此操作的示例。您应该会在您的某个 TMH 文件中的某处看到这条评论:

// template C:\WinDDK\7600.16385.1\bin\wppconfig\rev1\control.tpl
//
// Defines a set of macro that expand control model specified
// with WPP_CONTROL_GUIDS (example shown below)
// into an enum of trace levels and required structures that
// contain the mask of levels, logger handle and some information
// required for registration.
//

///////////////////////////////////////////////////////////////////////////////////
//
// #define WPP_CONTROL_GUIDS \
// WPP_DEFINE_CONTROL_GUID(Regular,(81b20fea,73a8,4b62,95bc,354477c97a6f), \
// WPP_DEFINE_BIT(Error) \
// WPP_DEFINE_BIT(Unusual) \
// WPP_DEFINE_BIT(Noise) \
// ) \
// WPP_DEFINE_CONTROL_GUID(HiFreq,(91b20fea,73a8,4b62,95bc,354477c97a6f), \
// WPP_DEFINE_BIT(Entry) \
// WPP_DEFINE_BIT(Exit) \
// WPP_DEFINE_BIT(ApiCalls) \
// WPP_DEFINE_BIT(RandomJunk) \
// WPP_DEFINE_BIT(LovePoem) \
// )

因此,您应该在同一个 WPP_CONTROL_GUIDS 宏中定义两个 GUID。

关于windows - 使用 WPP 跟踪到多个 ETW 提供程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12271850/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com