加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 05:41:24 所属栏目:Windows 来源:网络整理
导读:我正在尝试通过WPP实现使用“ Windows事件跟踪”.根据 Getting Started with Software Tracing in Windows Drivers中的文档,可以从单个驱动程序向多个提供程序发出跟踪,但我没有看到这样做的示例: A driver can specify more than one control GUID. Each c
我正在尝试通过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.

我试图创建两个头文件,每个文件都使用不同的guid WPP_CONTROL_GUIDS.然后我包含来自c / cpp文件的不同头文件,我希望将这些文件发布到不同的提供者.但似乎主文件中的定义覆盖了这个分隔,并且所有跟踪都到达了它使用的提供程序……

有什么建议吗?有样品吗?谢谢!!

解决方法

我现在避免像瘟疫那样的WPP跟踪,但跟踪模板提供了如何执行此操作的示例.您应该在某个TMH文件中的某处看到此注释:

// template C:WinDDK7600.16385.1binwppconfigrev1control.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,
//       WPP_DEFINE_BIT(Entry)      
//       WPP_DEFINE_BIT(Exit)       
//       WPP_DEFINE_BIT(ApiCalls)   
//       WPP_DEFINE_BIT(RandomJunk) 
//       WPP_DEFINE_BIT(LovePoem)   
//    )

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读