OK, so I understand that:

* ETW is Event Tracing for Windows (technology).
* WPP is the PreProcessor (a tool used with this technology).

There is an excellent sample demonstrating the use of WPP (toaster.c).
It helped me implement WPP in my driver so that I can now view trace
messages in TraceView.

I would like to do the same in my user mode application. I found the
documentation and sample (TraceDp.c) for ETW in the Platform SDK. I
figured out how to RegisterTraceGuids() and implement the
ControlCallback(). I could even see how to use:

TraceEvent(LoggerHandle, (PEVENT_TRACE_HEADER) &UserEvent);

But... I don't like this TraceEvent API. I very much prefer the WPP
API which provide an "intuitive" interface like:

ToasterDebugPrint(ERROR, "function failed (%x)\n", status);

However, I couldn't find anywhere a sample or documentation that could
help me take a shortcut from TraceEvent() to MyDebugPrint().

So I am wondering: is there a WPP-like API/interface for user-mode
applications? If so, where do I find it? If not, how do I get from
TraceEvent() to MyDebugPrint() so that it can be displaed using
TraceView?

If I understand correctly, in order for ETW trace events to be
displayed in TraceView, I need to "publish" my "Event Schema". But
this seems to be cumbersome given the fact that this schema is already
implemented in WPP. How do I avoid "re-inventing the wheel"?

Thanks,
Don

Re: WPP-like API in User Mode ETW ? by 0dbell

0dbell
Tue Mar 18 22:03:21 CDT 2008

On Mar 15, 9:05=A0pm, 0db...@gmail.com wrote:
> OK, so I understand that:
>
> * ETW is Event Tracing for Windows (technology).
> * WPP is the PreProcessor (a tool used with this technology).
>
> There is an excellent sample demonstrating the use of WPP (toaster.c).
> It helped me implement WPP in my driver so that I can now view trace
> messages in TraceView.
>
> I would like to do the same in my user mode application. I found the
> documentation and sample (TraceDp.c) for ETW in the Platform SDK. I
> figured out how to RegisterTraceGuids() and implement the
> ControlCallback(). I could even see how to use:
>
> TraceEvent(LoggerHandle, (PEVENT_TRACE_HEADER) &UserEvent);
>
> But... I don't like this TraceEvent API. I very much prefer the WPP
> API which provide an "intuitive" interface like:
>
> ToasterDebugPrint(ERROR, =A0"function failed (%x)\n", status);
>
> However, I couldn't find anywhere a sample or documentation that could
> help me take a shortcut from TraceEvent() to MyDebugPrint().
>
> So I am wondering: is there a WPP-like API/interface for user-mode
> applications? If so, where do I find it? If not, how do I get from
> TraceEvent() to MyDebugPrint() so that it can be displaed using
> TraceView?
>
> If I understand correctly, in order for ETW trace events to be
> displayed in TraceView, I need to "publish" my "Event Schema". But
> this seems to be cumbersome given the fact that this schema is already
> implemented in WPP. How do I avoid "re-inventing the wheel"?
>
> Thanks,
> Don

Wow! seems like this topic is extremely difficult - or very rarely
explored/utilized.

Don