WPP_DEBUG operation

> #define WPP_DEBUG(b) DbgPrint b, DbgPrint(“\n”);
(…)

1- Locate the address of the WPP control structure in Vista is
WPP_MAIN_CB, else use WPP_GLOBAL_Control
(…)
+0x01d Level : 0x0 ‘’ <— Set the Level
+0x01e Reserved : 0
+0x020 Flags : [1] 0x0 <— Set the Flag

Are you saying that WPP_DEBUG will ONLY get called when the message meets
the filtering criteria of level and flags?

  • Jan

Let’s step back a little.

WPP is a layer on top of ETW which provides fine grain tracing control,
using levels, flags.

Both of the values are set on the driver when a trace session is started
either by tracelog or traceview.

By default WPP_DEBUG is not defined, that option was added for people
who wanted to also view their traces in the debugger because of the
problem we had with the public symbols and also because user mode
clients wanted that too.

The only problem is that WPP_DEBUG when defined is part of the trace
macro, so if you do not have tracing enabled then you will not get the
debug code to run. So some customers wanted to see the debugprint
without starting an ETW trace session and that is the documentation I
provided. What happens is when you follow those instructions.

WPP_DEBUG macro will be called followed by WmiTraceMessage, but
WmiTraceMessage will not log because no trace session would be defined.

Hope that explains.

Thanks,

Jose Sua

Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jan Bottorff
Sent: Thursday, May 11, 2006 11:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] WPP_DEBUG operation

#define WPP_DEBUG(b) DbgPrint b, DbgPrint(“\n”);
(…)
1- Locate the address of the WPP control structure in Vista is
WPP_MAIN_CB, else use WPP_GLOBAL_Control
(…)
+0x01d Level : 0x0 ‘’ <— Set the Level
+0x01e Reserved : 0
+0x020 Flags : [1] 0x0 <— Set the Flag

Are you saying that WPP_DEBUG will ONLY get called when the message
meets
the filtering criteria of level and flags?

  • Jan

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> WPP_DEBUG macro will be called followed by WmiTraceMessage, but

WmiTraceMessage will not log because no trace session would be defined.

I guess I’m not understanding when WPP_DEBUG will be called. If I remember
correctly, the template has an #ifdef WPP_DEBUG and if defined it’s called
with

WPP_DEBUG(MSG,…)

Notice there is no level or flags passed, so if the filtering isn’t done by
whatever wraps this, then every message will get printed. I am making the
assumption (possible incorrect) that since no flags/level are passed, then
every message will be displayed, which is not what I want. Had the call
looked like WPP_DEBUG(LEVEL, FLAGS, MSG,…) then I can write a function to
filter things.

I understand all you said about manually activating the trace session by
munging the data structure. Let’s just assume I activate a global logger
trace session in the registry, do your magic data structure munging.

My driver is a virtual bus driver, which may have a virtual boot disk on it,
so by the time I could use the GUI to enable a normal trace session, my
driver has already done a giant amount of work. My target machine is also
off in a computer room, because it’s connected to a variety of other boxes,
so generally, I can’t interact with it until I’m able to sign in through a
remote desktop.

As a bit of feedback, you should try running traceview over a DSL connected
remote desktop some time. It needlessly refreshes the window in really ugly
ways. I’m sure on a local high performance display adapter, all that
needless refreshing goes by instantly, but over a 1.5 mbps T1 line, it’s
really painful. Like many developers now, I work from my home over the
Internet a non-trivial part of the time, so need all the tools to work WELL
over remote desktops at DSL speeds. In general, remote desktop works fairly
well, but a few apps do silly things.

  • Jan

I was referring to the Vista templates

#ifdef WPP_DEBUG

Calls WPP_DEBUG;

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jan Bottorff
Sent: Friday, May 12, 2006 4:20 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] WPP_DEBUG operation

WPP_DEBUG macro will be called followed by WmiTraceMessage, but
WmiTraceMessage will not log because no trace session would be
defined.

I guess I’m not understanding when WPP_DEBUG will be called. If I
remember
correctly, the template has an #ifdef WPP_DEBUG and if defined it’s
called
with

WPP_DEBUG(MSG,…)

Notice there is no level or flags passed, so if the filtering isn’t done
by
whatever wraps this, then every message will get printed. I am making
the
assumption (possible incorrect) that since no flags/level are passed,
then
every message will be displayed, which is not what I want. Had the call
looked like WPP_DEBUG(LEVEL, FLAGS, MSG,…) then I can write a function
to
filter things.

I understand all you said about manually activating the trace session by
munging the data structure. Let’s just assume I activate a global logger
trace session in the registry, do your magic data structure munging.

My driver is a virtual bus driver, which may have a virtual boot disk on
it,
so by the time I could use the GUI to enable a normal trace session, my
driver has already done a giant amount of work. My target machine is
also
off in a computer room, because it’s connected to a variety of other
boxes,
so generally, I can’t interact with it until I’m able to sign in through
a
remote desktop.

As a bit of feedback, you should try running traceview over a DSL
connected
remote desktop some time. It needlessly refreshes the window in really
ugly
ways. I’m sure on a local high performance display adapter, all that
needless refreshing goes by instantly, but over a 1.5 mbps T1 line, it’s
really painful. Like many developers now, I work from my home over the
Internet a non-trivial part of the time, so need all the tools to work
WELL
over remote desktops at DSL speeds. In general, remote desktop works
fairly
well, but a few apps do silly things.

  • Jan

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer