The toaster sample has a very nice demo that shows how one can switch
from WPP based tracing to KdPrint base tracing, just by defining/
udefining EVENT_TRACING.

The "trick" is done in the 'sources' file by defining:

RUN_WPP=$(SOURCES)\
-km\
-func:ToasterDebugPrint(LEVEL,MSG,...)

So that specially made function, ToasterDebugPrint exists even when
WPP is enabled and serves *both* KdPrint and WPP.

But so far I based my driver's tracing on the DPF, which is a *macro*,
not a func (it is basically defining _DbgPrintF).

I could have mimicked the toaster sample by defining my own driver's
ToasterDebugPrint() function, replacing each and every DPF with it,
but it seems too tedious and somewhat dumb. Surely there is a shortcut
to reuse my DPF macro, right?

How do I let WPP know about the syntax and format of the macro DPF?

A tip regarding how to go about this would be highly appreciated.

Thanks,
Don

Re: Replacing DPF with WPP - what's the trick? by Jose

Jose
Mon Mar 10 16:42:21 CDT 2008

WPP is very flexible and it can easly adapt your debug funtion, all you need
to do is tell the WPP preprocessor which is the tracing funtion that it
should parse for :

tracewpp /? gives all the options.

Take a look in MSDN for WPP FAQ or software tracing FAQ.
http://msdn2.microsoft.com/en-us/library/ms797204.aspx

So it should look something like this :

RUN_WPP= -func:DPF{LEVEL=Noise}(MSG,...) $(SOURCES) //assuming that you
have defined a control guid with Noise as FLAG.

You can further customize which is the format of the trace function by
looking
http://msdn2.microsoft.com/en-us/library/ms797211.aspx


How does you function look like ?




Jose Sua
Microsoft Corporation
This posting is provided "AS IS" with no warranties and confers no rights.


<0dbell@gmail.com> wrote in message
news:13b5981f-9e3e-4f0a-a83c-f0965fe9651f@m36g2000hse.googlegroups.com...
> The toaster sample has a very nice demo that shows how one can switch
> from WPP based tracing to KdPrint base tracing, just by defining/
> udefining EVENT_TRACING.
>
> The "trick" is done in the 'sources' file by defining:
>
> RUN_WPP=$(SOURCES)\
> -km\
> -func:ToasterDebugPrint(LEVEL,MSG,...)
>
> So that specially made function, ToasterDebugPrint exists even when
> WPP is enabled and serves *both* KdPrint and WPP.
>
> But so far I based my driver's tracing on the DPF, which is a *macro*,
> not a func (it is basically defining _DbgPrintF).
>
> I could have mimicked the toaster sample by defining my own driver's
> ToasterDebugPrint() function, replacing each and every DPF with it,
> but it seems too tedious and somewhat dumb. Surely there is a shortcut
> to reuse my DPF macro, right?
>
> How do I let WPP know about the syntax and format of the macro DPF?
>
> A tip regarding how to go about this would be highly appreciated.
>
> Thanks,
> Don


Re: Replacing DPF with WPP - what's the trick? by 0dbell

0dbell
Mon Mar 10 17:00:20 CDT 2008

Jose, thank you for your help.

On Mar 10, 4:42=A0pm, "Jose Sua [MSFT]"
<Jose...@discussions.microsoft.com> wrote:

> WPP is very flexible and it can easly adapt your debug funtion, all you ne=
ed
> to do is tell the WPP preprocessor which is the tracing funtion that it
> should parse for :
>
> tracewpp /? gives all the options.
>
> Take a look in MSDN for WPP FAQ or software tracing FAQ.
> http://msdn2.microsoft.com/en-us/library/ms797204.aspx
>
> So it should look something like this :
>
> RUN_WPP=3D -func:DPF{LEVEL=3DNoise}(MSG,...) $(SOURCES)
>
>=A0//assuming that you have defined a control guid with Noise as FLAG.
>

Wow! I didn't know that the -func option can take MACROs too. This is
indeed very flexible and I will shortly try it.

> You can further customize which is the format of the trace function by
> lookinghttp://msdn2.microsoft.com/en-us/library/ms797211.aspx
>
> How does your function look like ?
>

My "function", DPF, is actually not a function but a macro. It is
defined as:

#define DPF _DbgPrintF

_DbgPrintF, in turn, is also not a function but a macro. It is defined
in:

c:/WinDDK/6000/inc/api/ksdebug.h

I will shortly check your suggestions and see how it goes.

Thanks,
Don