从用户模式使用 WPP 进行事件跟踪,使用 Visual Studio 的本机应用程序

发布于 2024-10-08 11:26:15 字数 227 浏览 0 评论 0原文

我正在寻找一个使用 WPP(预处理器)的“Windows 事件跟踪”(ETW) 的示例,用于在 Visual Studio 环境中开发的应用程序。 虽然 MSDN 文档承诺 WPP 也可用于用户模式、本机应用程序,但它仅包含针对设备驱动程序执行此操作的示例,并且还严重依赖于与 makefile 的集成。

所以我想知道是否有人能够做到这一点,以及他是否愿意分享他的发现或工作示例代码。 谢谢! 尤里·科恩

I'm looking for an example of utilizing "Event Tracing for Windows" (ETW) using WPP (a pre-processor) for applications developed in the Visual Studio environment.
Whilst MSDN documentation promise that WPP is usable also for user mode, native application, it contains only examples of doing so for a device driver and also relies heavily on integrating with makefiles.

So I wonder if someone was able to have this working and if he's willing to share his findings or working sample code.
Thanks!
Uri Cohen

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情魔剑神 2024-10-15 11:26:15

WPP绝对可以在用户模式下使用,你只需要从WDK中取出TraceWPP.exe即可。

但是,如果您不使用大量遗留代码或者您对监控应用程序性能感兴趣,我会考虑使用基于清单的 ETW 事件;由于每条消息都被明确描述为一个结构,因此在 XPerf 中进行分析或围绕它编写其他工具会更容易。 WPP 实际上只是将字符串记录到 ETL 跟踪中,您稍后必须对其进行解析。

您还可以在同一应用程序中同时使用 WPP 和基于清单的 ETW - 指导是,将 WPP 用于专用/一次性调试字符串,并将清单事件用于您想要跟踪的更多公共“官方”事件。

WPP can definitely be used in user-mode, you just need to grab out the TraceWPP.exe from the WDK.

However, if you're not working with a lot of legacy code or you're interested in monitoring app performance, I'd consider using manifest-based ETW events instead; since each message is explicitly described as a structure, it's easier to analyze in XPerf or write other tooling around it. WPP literally just logs strings to the ETL trace that you'll have to parse later.

You can also use both WPP and manifest-based ETW in the same application - the guidance is, use WPP for private-only / one-off debug strings, and manifest events for more public, "official" events that you want to trace.

初心未许 2024-10-15 11:26:15

在文章中找到了我想要的答案:
"视觉中的 WPP 跟踪C++ 2010 项目” 作者:Trey Nash!

Found the answer I was looking for in the article:
"WPP Tracing in Visual C++ 2010 Projects" by Trey Nash!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文