none
Migration from Debug Print Statements (DbgPrint / DEBUGP) to RUN_WPP -func: RRS feed

  • Question

  • Hi,

    In the book "Developing Drivers with the Windows Driver Framework" by Penny Orwick and Guy Smith (Microsoft Press) at chapter 11 (Driver Tracing and Diagnosability) there is a paragraph which states an "Easy Migration from Debug Print Statements" [to WPP software tracing] by instructing WPP to convert the old DbgPrint calls.

    But i found no further notice on how to reach this goal.

    I tried the obvious:

    RUN_WPP= $(SOURCES) -km -func:DbgPrint(MSG)

    but this only gets me a lot of compiler errors like "1>my_driver.c(61): error C4013: 'WPP_CALL_my_driver_c61' undefined; assuming extern returning int" (after a clean build)

    So how exactly can i use this parameter (if it is to be achieved by this parameter) to get my old DbgPrints in a WPP fashion?

    For your convenience i added the whole pragraph here: (on page 413) somewhere after "Advantages of WPP Software Tracing"

    "Easy Migration from Debug Print Statements      If a driver currently uses debug print statements for tracing, WPP can be instructed to convert your existing trace instrumentation to a more efficient form without requiring you to rewrite the code."

    Monday, March 25, 2013 3:51 PM

All replies

  • You still need to do the following:

    1.  Add:  #include <filename.tmh>      where filename is name of the C file to each file where there are dbgprint statements

    2.  Add WPP_INIT_TRACING to DriverEntry

    3.  Add WPP_CLEANUP to Unload


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Monday, March 25, 2013 3:56 PM
  • i already did that of course, and WPP driver tracing works perfectly with the built in DoTraceMessage Macro. - I just wanted to re-use my already available code like it's described in the book.

    Can i do that with the -func: parameter?

    If not, how?

    (Thanks for the fast reply)

    Monday, March 25, 2013 4:27 PM
  • You should try:

    RUN_WPP=$(SOURCES) -km -func:DebugPrint(MSG,...)

    The "..." I believe is required.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Monday, March 25, 2013 4:36 PM
  • Hi Don,

    We tried that already too.

    Compiler-Errors are basically the same:

    (Of course i deleted all generated files in advance, just to be sure it works properly) - We also tried to build it multiple times to rule out some dependency issues. And it works okay without the -func parameter.

    Do you know if there is any more detailed documentation of -func and its behaviour other than the msdn article for the WPP Preprocessor?

    (by the way.. an answer might then only be useful for archiving purposes, we decided to use the DoTraceMessage-Macro instead and throw away the old DbgPrint-Statements because of our deadline for a solution, tough it might be interesting for other projects and other people looking for help)

    Tuesday, March 26, 2013 7:48 AM