Hi All
I have implemented WPP event and level tracing in a large driver with
roughly 1800 trace statements. This has led me to some interesting
management questions regarding the WPP tool in general. I am hoping there
is a WPP expert out there (Microsoft??) who can answer some of these
questions, or at least point me to the documentation.
My current project required multiple control GUIDS in order to have enough
control bits.Thus, my trace.h file looks something like this:
**************************************************************************
#define BLUESCREEN 1
#define FATAL 2
#define SERIOUS 3
#define ERROR 4
#define UNWIND 5
#define WARNING 6
#define API 7
#define INFO 8
#define MINOR_INFO 9
#define NOISE 10
#define EXTREME_NOISE 11
#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID (TraceGuid1,(1E3D7528,
D907, 42ea, 9144, 6DD88D467DD2), \
WPP_DEFINE_BIT (TRACE_FLAG_1_1) \
WPP_DEFINE_BIT (TRACE_FLAG_1_2) \
…
WPP_DEFINE_BIT (TRACE_FLAG_1_32) ) \
WPP_DEFINE_CONTROL_GUID (TraceGuid2, (0BDCADA5,
2335, 47ba, A479, 2E5A3CC4E216), \
WPP_DEFINE_BIT (TRACE_FLAG_2_1) \
WPP_DEFINE_BIT (TRACE_FLAG_2_2) \
…
WPP_DEFINE_BIT (TRACE_FLAG_2_32) ) \
WPP_DEFINE_CONTROL_GUID
(TraceGuid3,(08C23C0F,D1C0,4367,88DE,90EB24B75393), \
WPP_DEFINE_BIT (TRACE_FLAG_3_1) \
WPP_DEFINE_BIT (TRACE_FLAG_3_2) \
…
WPP_DEFINE_BIT (TRACE_FLAG_3_32) ) \
#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)
#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) (WPP_LEVEL_ENABLED(flags) &&
WPP_CONTROL(WPP_BIT_## flags).Level <= lvl)
#define WPP_FLAG_ENABLED(flag) 1 //what do I need here?
************************************************************************
This leads me to the real questions.
-
Obviously each of the three GUIDS has 32 flags (I didn’t define them
all here, but in my real code they are there). Is it possible for a single
tracing session to attach to all three control guids and still
individually control the flags in each of the three control guids? -
If not, is it possibile for three different sessions to each attach to
one GUID but then to mingle their output into one single trace file. -
Because of what I have found above, I am considering restructuring my
code to use a different control GUID for every flag bit. Thus my
WPP_CONTROL_GUIDS statement above would have 70 GUIDS, each with a single
control bit. Then I could control which messages I got by which GUIDS I
attached to. I would just always set the single bit to 1. Is there a
hidden downside to doing this? -
Some places in my code, it is important to know if a given trace flag
is currently enabled. This is because it is time-consuming to gather the
information that is being traced. I only want to gather that info if the
particluar trace flag is set. What I need is a sort of
boolean WPP_FLAG_ENABLED(flag);
function. I am sure something like this exists, I just don’t know where to
find it.
- What I have seen of the TraceView V2 Beta looks very nice. Does anyone
know of a way that I can buy, borrow, or if necessary stealthat
program since I was unable to attend WinHec. (Just kidding, I stop short
at stealing).
I would truely appreciate help on all or any of these subjects.
Thanks,
Don