Monday, March 19, 2007

Viewing WPP Tracing in Drivers.

Few days back i had to view trace messages in my code, sadly no one knew how to use it.
The code already contained wpp tracing which is mainly used for tracing messages in windows kernel drivers.
Here's how to view them very briefly !!!

1. -D RUN_WPP compile with it, basically code would be written in #ifdefs of this macro.
Using trace api's is not what i did, see link for it.
2. tracepdb -p abc.pdb -f c:\trace
This creates a .tmf file in c:\trace directory.
3. Create file with following content
c:\trace>cat abc.ctl
10oabe15e-c3ea-4fx24-x9x91-efb5bcdxxef
This long number is the control guid.
4. traceview
this is a gui application, I will ask for .ctl file & .tmf file, give it
and it will start tracing & showing in real time.
5. traceview will also create log file with .etl extension
To view it, convert to text:
tracefmt.exe -o logfile.txt -f logfile.etl

All command line utilities, tracepdb.exe, traceview, tracefmt.exe are part of WDDK (Windows Driver Development Kit), see tools directory.

Yea this is also called ETW (Event Tracing for Windows)

Link: http://download.microsoft.com/download/5/d/6/5d6eaf2b-7ddf-476b-93dc-7cf0072878e6/WPP_Intro.doc

No comments: