WPP Questions (Please Ignore my Thread from two days ago)

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.

  1. 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?

  2. 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.

  3. 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?

  4. 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.

  1. 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 steal :slight_smile: that
    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

I’ll answer most of these questions though I am not 100% sure of all the
capabilities of traceview.

  1. Yes, You can do this though I think it is a limitation of the current
    capabilities of TraceView that it has the same flags/levels settings for
    all guids connected to a logger. I could be wrong.
    However if you use the logman command (or Tracelog) you can I believe
    achieve the effect you want.
    For example
    logman start LogName -o LogFileName -pf control file -ets
    Where control file is
    {cbc7357a-d802-4950-bb14-817ead7e0176} 0xF
    {cbc7357a-d802-4950-bb14-817ead7e0177} 0x4

Note there are lots of other syntax’s you can use and you can create
little profiles you can re-use, see the Help and Support for Logman.

While not ideal you can then get TraceView to join to that session.

  1. Yes you can send all three sessions to different loggers and the
    tracefmt tool at least can display all three files interlaced, but this
    is often a pain to manage the files. I’d recommend 1.

  2. Don’t do that you will bloat the code with lots of little data
    structures and anyway as 1 works you should not need to do this.

  3. I assume you are using DoTraceMessage, in which case its
    WPP_LEVEL_ENABLED(flagname) it comes from the name of the parameter(s)
    before the MSG in the DoTraceMessage Definition in defaultwpp.ini. The
    name ended up being a bit confusing, sorry.
    If you use another name here, this changes.

  4. I don’t know the distribution status of Traceview V2…

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Edvalson
Sent: Monday, October 06, 2003 9:07 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] WPP Questions (Please Ignore my Thread from two days
ago)

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.

  1. 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?

  2. 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.

  3. 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?

  4. 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.

  1. 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 steal :slight_smile: that
    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


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

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com