Use TraceView to trace windows driver log
For the windows driver development as I am doing these days, Microsoft provides a log printing and log viewing mechanism, which can view the logs of specified driver files, filter the logs according to
FLAG, or save them as files. This mechanism is WPP and
How to use?
The usage is simple, the WDF framework has built in the function and enclosed the WPP into the
The driver program imports the header file and adds
TraceEvents() method to the place where needs to print log. Use the
TraceView.exe application to capture and view the logs when the driver program running.
The first two parameters of this method represent the
FLAG which will be used to control the logs output level and type.
- In Windows10, the
TraceView.exeis putted into the folder at
WDK install path, normally the default installation path is
- Run the
TraceView.exeapplication and create a new log section.
Add Providerand select the PDB file of your driver program.
The trace provider will generate trace event messages.
Nextbutton and choose
Set Flag and Level, in the pop window right click
Leveland select the
print levelof the log. Suggest selecting
verboseto print the logs as much as possible in the debug phase.
Click ‘OK’ button to complete the configuration.
- Start running the driver program and the TraceView will output the logs printed by TraceEvents() in the code.
Recommend some articles for the WPP/TraceView introduction.