1、如果新建工程时没有使能WPP,则在工程属性中的 Wpp Tracing->General->Run Wpp Tracing->Yes;

Wpp Tracing->File Options->Scan Configuration Data->Trace.h; 然后复制Trace.h文件到工程目录下。

2、打开Trace.h, 修改#define WPP_CONTROL_GUIDS 的定义。需要使用新的GUID,改为工程名,文件名。

#define WPP_CONTROL_GUIDS                                              \
    WPP_DEFINE_CONTROL_GUID(                                           \
        工程名Guid, (xxxxxxxx,xxxx,xxxx,xxxx,xxxxxxxxxxxx),      \
                                                                       \
        WPP_DEFINE_BIT(FILE_NAME1)                                   \
        WPP_DEFINE_BIT(FILE_NAME2)                                   \
        WPP_DEFINE_BIT(FILE_NAME3)                                    \
        WPP_DEFINE_BIT(FILE_NAME4)                                    \
        )

其中新的GUID可以用Tools中的Create GUID 产生,可选不同的格式。

3、在需要打印log的源文件开始处添加头文件等,如 driver.c 文件需要添加#include "Trace.h" 和 #include "driver.tmh"

#include "driver.h"  //  原来就有

#include "Trace.h"
#include "driver.tmh"

4、在需要打印log的地方使用

FUNC TraceEvents(LEVEL, FLAGS, MSG, ...);

如 TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DRIVER, "%!FUNC! Entry");

----------------------------------------------------------------------------

https://docs.microsoft.com/zh-tw/windows-hardware/drivers/devtest/wpp-software-tracing

https://docs.microsoft.com/zh-cn/windows-hardware/drivers/devtest/wpp-software-tracing

Use Windows software trace preprocessor (WPP) to trace the operation of a software component (trace provider). A trace provider can be one of the following:

  • A kernel-mode driver.

  • A user-mode driver, application, or dynamic-link library (DLL).

    When should you use WPP software tracing?

    WPP software tracing is primarily intended for debugging code during development. If you want to publish events that can be consumed by applications interested in structured ETW events, in addition to tracing during development, use the following:

    • For kernel-mode drivers, use the Event Tracing for Windows (ETW) API.
    • For user-mode drivers or applications, use the Event Tracing (Windows Desktop) API.

WPP Software Tracing相关推荐

  1. Event Tracing for Windows

    突然ですが.皆さんは.馬に乗ったことはありますか?・・・このお話にご興味のある方は本文の最後の[閑話休題]までどうぞ. さて.今回は. Event Tracing for Windows (ETW) ...

  2. 数据上采样和下采样_采样不足以配置您的ml数据

    数据上采样和下采样 By Isaac Backus and Bernease Herman 艾萨克·巴库斯(Isaac Backus)和伯尼瑟斯·赫曼(Bernease Herman) It's 20 ...

  3. Windows驱动_WSK驱动之四WSK例程

    最近看了好多文章,也写了好多博客,但是,最近少了很多实践的关系,这一部分是项目的问题,其实大部分还是自己的问题,今天,竟然,知道,随便修改一点微软的例子还可以赚钱,之前自己还真是没有想到的.后续,自己 ...

  4. c语言随机函数1 qp,QP/C初步入门

    参考:http://www.state-machine.com/qpc/index.html 转载请标明出处:http://blog.csdn.net/chenbb8/article/details/ ...

  5. QP/C API 参考

    QP/C API 链接:QP/C API Reference API Reference QEP (Hierarchical State Machines) QEP is a universal, U ...

  6. [转贴]Ultimate List of Free Windows Software from Microsoft

    [原文连接]http://bhandler.spaces.live.com/blog/cns!70F64BC910C9F7F3!1231.entry Ultimate List of Free Win ...

  7. 问题三十:《Ray Tracing In One Weekend》封面图形生成

    30.1 封面图片 先完成封面图片. Code如下: ----------------------------------------------main.cpp------------------- ...

  8. HEVC的WPP(Wavefront Parallel Processing)并行处理方式

    Unlike H.264/AVC, where parallelism was an afterthought, the current HEVC draft contains several pro ...

  9. Nginx Unique Tracing ID

    背景 方案一 实现步骤 问题 方案二 问题 方案三 实现步骤 问题 方案四 问题 方案五 终记 参考 背景 我们想要从Nginx接受请求开始,生成一个Unique Tracing ID,不仅记录在Ng ...

最新文章

  1. PHP Webservice的发布与调用
  2. Spring注解@Component、@Repository、@Service、@Controller,@Autowired、@Resource用法
  3. 关于计算机中 原码, 反码, 补码 详解
  4. Python Split函数的用法总结
  5. ASP+COM 组件开发
  6. 生成jar文件的方法
  7. Codeforces Round #636 (Div. 3) D. Constant Palindrome Sum 思维 + 差分
  8. DT CMS致力于Spring Boot2.3.5 Vue前后端分离的RBAC权限框架(盛世美颜!)
  9. ConcurrentHashMap是如何保证线程安全的,你知道么?
  10. 快速入门上手第一课 | 从云计算到 Serverless
  11. 【React】JSX
  12. 利用Expect实现telnet自动登录并执行command
  13. 相似矩阵和相似对角化
  14. 【Proteus仿真】51单片机+TLC5615输出三角波
  15. EXCEL表格如何实现隔行填充颜色
  16. css动画和js动画_CSS与JS动画:哪个更快?
  17. 贝叶斯网络的联合概率到底有什么用:贝叶斯理论(4)
  18. 2016-1-21高博活动
  19. 不同鸟的叫声Java编程_飞扬小鸟java版(3种版本一次下载)
  20. 安装Ubuntu 21.04后要做的事

热门文章

  1. 铲雪车(snow) UVA10203 Snow Clearing 题解 优化版
  2. 每周读书#6 - 《写给大家的中国美术史》
  3. 「新拟物化」过时了!此刻你最应该拥抱的是「玻璃拟物化」
  4. listview的属性
  5. PDF编辑管理工具Cisdem PDFMaster Mac
  6. wpf的path画三角形、四边形
  7. ## 虚幻四引擎学习——初学者
  8. [每日一题]152:仅仅反转字母
  9. nginx中location介绍
  10. 高并发下的服务器架构演变