ETW?

Source code packaging is an important advantage of NMS. However, symbols are
only loaded during SI initialization or using user mode app. There should be
no problem to preload PDB + all sources the same way. But if we take
preloading as necessary, the advantage of native PDB support is probably
very low.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From:
xxxxx@compuware.com[SMTP:xxxxx@compuware.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, February 03, 2004 6:07 PM
To: xxxxx@lists.osr.com
Subject: RE: [ntdev] ETW?

SoftICE must be able to totally function when the Operating System is not
functional. Also, we use NMS to get source code into SoftICE. This is
because the OS may have gone out to lunch.

SoftICE must be able to run on the bare iron !

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Tuesday, February 03, 2004 11:39 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] ETW?

BTW - will SoftICE have native PDB support without converting it to
NMS?
This would increase the user experience a bit.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> ----------

From:
xxxxx@windows.microsoft.com[SMTP:xxxxx@windows.microsoft.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, February 03, 2004 7:16 PM
To: xxxxx@lists.osr.com
Subject: RE:[ntdev] ETW?

Then, change your SOURCES file’s RUN_WPP line from ‘-func:Dbg(NULL,
FLAG, MSG, …)’ to ‘-func:Dbg(LEVEL, FLAG, MSG, …)’. The LEVEL
applies to all FLAGs (global per-GUID setting), while you can use the
FLAG setting to separate your traces into logical groups.

This isn’t enough. What I need and use is one level per group. It allows,
for example, to see warnings for all groups and detailed traces for selected
one(s). It seems with ETW I’d need one GUID per group which doesn’t seem
usable. Or maybe emulate levels using several flags? We use 5 levels so
there would be 3 bits necessary per group and rather complicated setting
(special app?)

Real-world experience: If a customer calls PSS with a CD burning
problem, often times a trace is generated as the customer repro’s the
problem. If the PSS folks can’t determine the problem, I get the trace
and review it. With this method, I’ve been able to resolve 99%+ of
issues without anything other than a trace.

My experience (with our traces) is similar. There are only few problem which
really need live debugging.

I hope this answers some of your questions. LEVEL/FLAG use is something
I expect to go into in greater detail in a later post.

It does, thanks. Be so detailed as you can. I believe this can be useful for
a lot of people who read this list.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]

> ----------

From:
xxxxx@windows.microsoft.com[SMTP:xxxxx@windows.microsoft.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, February 03, 2004 7:35 PM
To: xxxxx@lists.osr.com
Subject: RE:[ntdev] ETW?

There are tools which allow you to schedule traces to occur, including
all the time (“at boot”). Each OS revision has enabled tracing at an
earlier and earlier time during the boot process. LOGMAN.EXE (XP PRO,
Server 2003, etc) already has this capability exposed to enable the
trace. Then, you just need to enable the debugger as Rob showed below
in order to capture/display the events.

I’ve never claimed it’s perfect, but realistically only us storage folks
are really affected by the slight delay in trace events being available.
If you’d like, I can get more info on exactly when traces start working
for each OS.

Yes, this is interesting. Could you explain how exactly it works? I.e. where
are settings stored, what and how actually enables traces. I mean techical
details, not producer controller presentation :slight_smile:

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]

See inline

Thanks,
Rob

  1. I believe the format string %08x would work if you were passing a
    non-pointer. ETW is more exacting about matching types, which I found
    to be a nice side benefit. It also will complain if you don’t have
    enough arguments for the given format string, which caught me a few
    times.

Yes I meant only when displaying pointers.

Another problem with this regard is displaying NTSTATUS codes… I am
currently using %08x which will work for 32 bit, but not 64 bit. Is there a
handy % for it?

I also have found bugs where there was not enough args, which is handy (and
contributed to at least one bsod when running debug on a customer machine).

(what is “%-*.*s” supposed to do?)

It is used to display a length specified string (such as a Unicode string
that isn’t formatted as Unicode (otherwise use %wZ). For example
IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME has a field where they specify the
length of the string and then the buffer. It should only display what is
there and it is not null terminated. So instead of copying into a separate
buffer and initing a unicode string, I do this:

Debug(DEBUG_DEVCON,
(“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
Link->UseOnlyIfThereAreNoOtherLinks,
Link->NameLength,
Link->NameLength/2,
Link->NameLength/2,
Link->Name));

I currently have it commented out since converting to ETW. You should be
able to look up format specs in the VC help.

  1. This is great feedback. I personally didn’t realize the problem of
    *requiring* the WXP method of enabling tracing. I can imagine a method
    to work around this, I’ll see if I can convince the trace guys that its
    worthwhile. As an added bonus, it won’t require new kernel/os changes.

As I said, it didn’t really affect me as a new binary was needed anyway. I
just needed to get the WXP way working for ia32 first, then I got the W2k
working, then 64bit, and specify in the SOURCES which one I want built for
each platform. I wouldn’t spend much time on this though as why support the
w2k way on a brand new platform?

  1. logman.exe, which uses different syntax than tracelog, is shipped in
    XP and higher. It’s also available for download, IIRC. I haven’t dealt
    with auto-enabling traces in the app/driver, but I’ll pass along that
    more docs are required for this.

The hardest part was figuring out how to fill in the event trace properties
structure. All the docs had info on how to enable existing OS tracing (such
as net, disk, kernel, etc…) and not how to enable your own event provider.

Looking at the docs for logman I don’t see how it is much different from
tracelog. What I mean is that both of them are complicated and seem to
provide the same functionality. For my purposes, I just say “Enable debug”
and then have the customer replicate the problem, then say “Disable debug”
and then have them email me the .ETL file.

I also don’t see how to enable logging for the next boot. I don’t need
logging in my DriverEntry but do in my AddDevice and StartDevice routines.

6b) I also do the same thing regarding having a compile-time switch for
use DebugPrint. It’s more work in SOURCES and you need to wrap the
init/unint/.TMH inclusion, but overall I’ve found it to be workable.

Yes, I had to do all of that, but I found I like this solution the best. It
is something I am comfortable with for every day debugging, and not so much
of pain for debugging customer issues.

I’ll pass you comments to the tracing team, see if they’re able to make
it better.

Also, all my files are .cpp which requires wrapping the .tmh file around and
extern c like so

#ifdef RUN_WPP
extern “C” {
#include “devcon.tmh”
}
#endif

> ----------

From:
xxxxx@windows.microsoft.com[SMTP:xxxxx@windows.microsoft.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, February 03, 2004 7:02 PM
To: xxxxx@lists.osr.com
Subject: RE:[ntdev] ETW?

6b) I also do the same thing regarding having a compile-time switch for
use DebugPrint. It’s more work in SOURCES and you need to wrap the
init/unint/.TMH inclusion, but overall I’ve found it to be workable.

It can work but the result is two different trace methods used. Different
code, different timing and different control. As result, different behaviour
and user experience. “Users” can be QA in this case; usually I give them
debug versions on the beginning and release with traces enabled later. They
don’t test only my driver; whole software package instead. If work with
traces is complicated and differs, it would cause problems and probably loss
of important traces.

The best would be if there is a kernel module which sends ETW traces to
debug output. It should be configurable for synchronous conversion (i.e
DbgPrint before return) with direct performance impact on driver and
buffered for near-to-real performance (with a way how to dump buffer from
inside debugger). It would allow to use the same binaries and trace control
for both development and testing.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]

For status, you can use %!STATUS! instead of %08x (case is important, it
must be in all caps). this will dump the numeric and name for the
status (ie STATUS_SUCCESS (0x0)). Works really well. Also, it should
be noted that NTSTATUS stays the same size on either 32 or 64 bit OS’s

D

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 Rob Green
Sent: Tuesday, February 03, 2004 11:43 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

See inline

Thanks,
Rob

  1. I believe the format string %08x would work if you were passing a
    non-pointer. ETW is more exacting about matching types, which I found
    to be a nice side benefit. It also will complain if you don’t have
    enough arguments for the given format string, which caught me a few
    times.

Yes I meant only when displaying pointers.

Another problem with this regard is displaying NTSTATUS codes… I am
currently using %08x which will work for 32 bit, but not 64 bit. Is
there a
handy % for it?

I also have found bugs where there was not enough args, which is handy
(and
contributed to at least one bsod when running debug on a customer
machine).

(what is “%-*.*s” supposed to do?)

It is used to display a length specified string (such as a Unicode
string
that isn’t formatted as Unicode (otherwise use %wZ). For example
IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME has a field where they specify
the
length of the string and then the buffer. It should only display what
is
there and it is not null terminated. So instead of copying into a
separate
buffer and initing a unicode string, I do this:

Debug(DEBUG_DEVCON,
(“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
Link->UseOnlyIfThereAreNoOtherLinks,
Link->NameLength,
Link->NameLength/2,
Link->NameLength/2,
Link->Name));

I currently have it commented out since converting to ETW. You should
be
able to look up format specs in the VC help.

  1. This is great feedback. I personally didn’t realize the problem of
    *requiring* the WXP method of enabling tracing. I can imagine a
    method
    to work around this, I’ll see if I can convince the trace guys that
    its
    worthwhile. As an added bonus, it won’t require new kernel/os
    changes.

As I said, it didn’t really affect me as a new binary was needed anyway.
I
just needed to get the WXP way working for ia32 first, then I got the
W2k
working, then 64bit, and specify in the SOURCES which one I want built
for
each platform. I wouldn’t spend much time on this though as why support
the
w2k way on a brand new platform?

  1. logman.exe, which uses different syntax than tracelog, is shipped
    in
    XP and higher. It’s also available for download, IIRC. I haven’t
    dealt
    with auto-enabling traces in the app/driver, but I’ll pass along that
    more docs are required for this.

The hardest part was figuring out how to fill in the event trace
properties
structure. All the docs had info on how to enable existing OS tracing
(such
as net, disk, kernel, etc…) and not how to enable your own event
provider.

Looking at the docs for logman I don’t see how it is much different from
tracelog. What I mean is that both of them are complicated and seem to
provide the same functionality. For my purposes, I just say “Enable
debug”
and then have the customer replicate the problem, then say “Disable
debug”
and then have them email me the .ETL file.

I also don’t see how to enable logging for the next boot. I don’t need
logging in my DriverEntry but do in my AddDevice and StartDevice
routines.

6b) I also do the same thing regarding having a compile-time switch
for
use DebugPrint. It’s more work in SOURCES and you need to wrap the
init/unint/.TMH inclusion, but overall I’ve found it to be workable.

Yes, I had to do all of that, but I found I like this solution the best.
It
is something I am comfortable with for every day debugging, and not so
much
of pain for debugging customer issues.

I’ll pass you comments to the tracing team, see if they’re able to
make
it better.

Also, all my files are .cpp which requires wrapping the .tmh file around
and
extern c like so

#ifdef RUN_WPP
extern “C” {
#include “devcon.tmh”
}
#endif


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

Whatever format the symbols are in, they must be in a format that SoftICE
can handle by the time SoftICE pops up - and that must not require the OS to
be operational. Therefore, SoftICE itself cannot handle PDB, it must do
things within its own format. The Symbol Loader, however, is just an app: it
should be able to convert PDB format into something that SoftICE can handle
at run time, and that’s what it does ! The format that SoftICE can handle is
the NMS format. Now, if PDB was a format instead of an API, we could write
our own machine level code to handle it, but I’m not sure I see the great
advantage.

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Michal Vodicka
Sent: Tuesday, February 03, 2004 2:15 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

Source code packaging is an important advantage of NMS. However, symbols are
only loaded during SI initialization or using user mode app. There should be
no problem to preload PDB + all sources the same way. But if we take
preloading as necessary, the advantage of native PDB support is probably
very low.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From:
xxxxx@compuware.com[SMTP:xxxxx@compuware.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, February 03, 2004 6:07 PM
To: xxxxx@lists.osr.com
Subject: RE: [ntdev] ETW?

SoftICE must be able to totally function when the Operating System is not
functional. Also, we use NMS to get source code into SoftICE. This is
because the OS may have gone out to lunch.

SoftICE must be able to run on the bare iron !

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Tuesday, February 03, 2004 11:39 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] ETW?

BTW - will SoftICE have native PDB support without converting it to
NMS?
This would increase the user experience a bit.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


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

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

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

> I will eventually post some of the “advanced” features. How about a

nice hexdump feature, something like “%!HEXDUMP!” resulting in a dump of

“for” operator + KdPrint does the same.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> ----------

From:
xxxxx@windows.microsoft.com[SMTP:xxxxx@windows.microsoft.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, February 03, 2004 7:37 PM
To: xxxxx@lists.osr.com
Subject: RE:[ntdev] ETW?

“I just wondered if ETW can give me some advantages.”

I will eventually post some of the “advanced” features. How about a
nice hexdump feature, something like “%!HEXDUMP!” resulting in a dump of
data similar to how the debugger shows data?

We have it, too, and don’t take is as advanced but standard feature :wink:

Well, I should explain what I expect from traces and what we use. Captured
example (without message prefixes to avoid wrapping):

==> SendServiceFrame(USB, 4, 12fb78, 11)
==> VerifyFrame(12facc, 1)
SetParams frame, protocol version 1, flags 0, WTX timeout 2100, MTU: 0.
<== (0.000) VerifyFrame() -> 0
Frame content:[len 13(0xd)], data follow
04 00 08 01 00 34 08 00 00 00 00 6b 14 …4…k.
==> LlUsbWriteFrame(12facc, 13)
==> UsbWriteData(750, 12f264, 17, 3000)
==> HandleAsyncIoResult(750, 12f208, 12f21c, 3000)
<== (0.000) HandleAsyncIoResult() -> 0 [17]
All 17 bytes successfully written to USB.
<== (0.000) UsbWriteData() -> 0 (0)
<== (0.000) LlUsbWriteFrame() -> 0.
<== (0.000) SendServiceFrame() -> 0

Part of above is generated by following code:

TTRACE_ENTER(LlPc, TDBG_DEBUG, (“SendServiceFrame(%s, %d, %x, %d)”,
Driver->Name, FrameType, Header, FrameSize));

TTRACE(LlPc, TDBG_DEBUG, (“SetParams frame, protocol version %d, flags %x,
WTX timeout %d, MTU: %d.”,
SetParams->ProtocolVersion, SetParams->Flags,
SetParams->WtxTimeout,
SetParams->MaxTransferSize));

TDUMP_EX(LlPc, TDBG_LOUD, “Frame content”, Buffer, FrameSize + sizeof(Crc));

TTRACE_LEAVE((“SendServiceFrame() -> %d”, Result));

ENTER/LEAVE are always used in pair and control proper trace indentation to
visualise nesting. Note LEAVE doesn’t have area and level and uses settings
from previous ENTER instead. It also measures and displays the time spent in
block.

It is possible to achieve the same via ETW? Ideally, with no source files
change (besides macro definitions, of course).

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]

> ----------

From: xxxxx@cdp.com[SMTP:xxxxx@cdp.com]
Reply To: xxxxx@lists.osr.com
Sent: Tuesday, February 03, 2004 8:42 PM
To: xxxxx@lists.osr.com
Subject: RE: [ntdev] ETW?

I also have found bugs where there was not enough args, which is handy
(and
contributed to at least one bsod when running debug on a customer
machine).

PC-lint catches such bugs for any kind of traces if properly configured.
Like this:

-printf(1, DbgPrint)

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]

So many questions, so little time. :slight_smile: Here’s a few quick answers.

  1. From tools\WppConfig\rev1\defaultwpp.ini:

DEFINE_FLAVOR(STATUS, UINT, ItemNTSTATUS, “s”);

This means you can convert to the ETW-only form “%!STATUS!” where you
previously dumped the hex code, and you’ll get a pretty-printed string.
(I don’t understand the problem with %08x?)

  1. It’s not much work to write, makes driver writing easier, and is
    fully in the templates ETW uses. This is just icing if they do it. :slight_smile:
    The hard part will be testing all the configurations.

  2. Good feedback. I’ll let the doc writers know this is what you really
    wanted to see when trying to enable debugging.

.

-----Original Message-----
From: Rob Green [mailto:xxxxx@cdp.com]
Sent: Tuesday, February 03, 2004 11:43 AM
Subject: RE: ETW?

See inline

Thanks,
Rob

  1. I believe the format string %08x would work if you were passing a
    non-pointer. ETW is more exacting about matching types, which I found

to be a nice side benefit. It also will complain if you don’t have
enough arguments for the given format string, which caught me a few
times.

Yes I meant only when displaying pointers.

Another problem with this regard is displaying NTSTATUS codes… I am
currently using %08x which will work for 32 bit, but not 64 bit. Is
there a handy % for it?

I also have found bugs where there was not enough args, which is handy
(and contributed to at least one bsod when running debug on a customer
machine).

(what is “%-*.*s” supposed to do?)

It is used to display a length specified string (such as a Unicode
string that isn’t formatted as Unicode (otherwise use %wZ). For example
IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME has a field where they specify
the length of the string and then the buffer. It should only display
what is there and it is not null terminated. So instead of copying into
a separate buffer and initing a unicode string, I do this:

Debug(DEBUG_DEVCON,
(“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
Link->UseOnlyIfThereAreNoOtherLinks,
Link->NameLength,
Link->NameLength/2,
Link->NameLength/2,
Link->Name));

I currently have it commented out since converting to ETW. You should
be able to look up format specs in the VC help.

  1. This is great feedback. I personally didn’t realize the problem of
    *requiring* the WXP method of enabling tracing. I can imagine a
    method to work around this, I’ll see if I can convince the trace guys
    that its worthwhile. As an added bonus, it won’t require new
    kernel/os changes.

As I said, it didn’t really affect me as a new binary was needed anyway.
I just needed to get the WXP way working for ia32 first, then I got the
W2k working, then 64bit, and specify in the SOURCES which one I want
built for each platform. I wouldn’t spend much time on this though as
why support the w2k way on a brand new platform?

  1. logman.exe, which uses different syntax than tracelog, is shipped
    in XP and higher. It’s also available for download, IIRC. I haven’t
    dealt with auto-enabling traces in the app/driver, but I’ll pass along

that more docs are required for this.

The hardest part was figuring out how to fill in the event trace
properties structure. All the docs had info on how to enable existing
OS tracing (such as net, disk, kernel, etc…) and not how to enable
your own event provider.

Looking at the docs for logman I don’t see how it is much different from
tracelog. What I mean is that both of them are complicated and seem to
provide the same functionality. For my purposes, I just say “Enable
debug”
and then have the customer replicate the problem, then say “Disable
debug”
and then have them email me the .ETL file.

I also don’t see how to enable logging for the next boot. I don’t need
logging in my DriverEntry but do in my AddDevice and StartDevice
routines.

6b) I also do the same thing regarding having a compile-time switch
for use DebugPrint. It’s more work in SOURCES and you need to wrap
the init/unint/.TMH inclusion, but overall I’ve found it to be
workable.

Yes, I had to do all of that, but I found I like this solution the best.
It is something I am comfortable with for every day debugging, and not
so much of pain for debugging customer issues.

I’ll pass you comments to the tracing team, see if they’re able to
make it better.

Also, all my files are .cpp which requires wrapping the .tmh file around
and extern c like so

#ifdef RUN_WPP
extern “C” {
#include “devcon.tmh”
}
#endif

Michal,
Do these indentations work across function calls on multi processor
machines?

-Srin.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Tuesday, February 03, 2004 12:18 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

> ----------
> From:
> xxxxx@windows.microsoft.com[SMTP:xxxxx@windows.microsoft.com]
> Reply To: xxxxx@lists.osr.com
> Sent: Tuesday, February 03, 2004 7:37 PM
> To: xxxxx@lists.osr.com
> Subject: RE:[ntdev] ETW?
>
>
> “I just wondered if ETW can give me some advantages.”
>
> I will eventually post some of the “advanced” features.
How about a
> nice hexdump feature, something like “%!HEXDUMP!” resulting
in a dump
> of data similar to how the debugger shows data?
>
We have it, too, and don’t take is as advanced but standard
feature :wink:

Well, I should explain what I expect from traces and what we
use. Captured example (without message prefixes to avoid wrapping):

==> SendServiceFrame(USB, 4, 12fb78, 11)
==> VerifyFrame(12facc, 1) > size 11, SEQ 0>
> SetParams frame, protocol version 1, flags 0, WTX timeout
> 2100, MTU: 0.
> <== (0.000) VerifyFrame() -> 0
> Frame content:[len 13(0xd)], data follow
> 04 00 08 01 00 34 08 00 00 00 00 6b 14 …4…k.
> ==> LlUsbWriteFrame(12facc, 13)
> ==> UsbWriteData(750, 12f264, 17, 3000)
> ==> HandleAsyncIoResult(750, 12f208, 12f21c, 3000)
> <== (0.000) HandleAsyncIoResult() -> 0 [17]
> All 17 bytes successfully written to USB.
> <== (0.000) UsbWriteData() -> 0 (0)
> <== (0.000) LlUsbWriteFrame() -> 0.
> <== (0.000) SendServiceFrame() -> 0
>
> Part of above is generated by following code:
>
> TTRACE_ENTER(LlPc, TDBG_DEBUG, (“SendServiceFrame(%s, %d, %x, %d)”,
> Driver->Name, FrameType, Header, FrameSize));
>
> TTRACE(LlPc, TDBG_DEBUG, (“SetParams frame, protocol version
> %d, flags %x, WTX timeout %d, MTU: %d.”,
> SetParams->ProtocolVersion,
> SetParams->Flags,
> SetParams->WtxTimeout,
> SetParams->MaxTransferSize));
>
> TDUMP_EX(LlPc, TDBG_LOUD, “Frame content”, Buffer, FrameSize
> + sizeof(Crc));
>
> TTRACE_LEAVE((“SendServiceFrame() -> %d”, Result));
>
> ENTER/LEAVE are always used in pair and control proper trace
> indentation to visualise nesting. Note LEAVE doesn’t have
> area and level and uses settings from previous ENTER instead.
> It also measures and displays the time spent in block.
>
> It is possible to achieve the same via ETW? Ideally, with no
> source files change (besides macro definitions, of course).
>
> Best regards,
>
> Michal Vodicka
> STMicroelectronics Design and Application s.r.o.
> [michal.vodicka@st.com, http:://www.st.com]
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

I wanted something similar to print an IP Address in dotted notation.
If I used a macro the WPP used to choke saying not enough parameters.

How do I print a IP address which is in network byte order?. Right now I
have to do this every time I want to print an IP.

DbgPrint((“LocalIp = %d.%d.%d.%d LocalPort = 0x%x RemoteIp =
%d.%d.%d.%d RemotePort =0x%x\n”,
*((PUCHAR)&NboLocalIp), *((PUCHAR)&NboLocalIp + 1),
*((PUCHAR)&NboLocalIp + 2), *((PUCHAR)&NboLocalIp + 3),
NTOHS(NboLocalPort), *((PUCHAR)&NboRemoteIp),
*((PUCHAR)&NboRemoteIp + 1), *((PUCHAR)&NboRemoteIp + 2),
*((PUCHAR)&NboRemoteIp + 3), NTOHS(NboRemotePort)));

Similar to %!STATUS! Can I define and implement my own types?

-Srin.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Henry
Gabryjelski
Sent: Wednesday, February 04, 2004 9:29 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] ETW?

So many questions, so little time. :slight_smile: Here’s a few quick answers.

  1. From tools\WppConfig\rev1\defaultwpp.ini:

DEFINE_FLAVOR(STATUS, UINT, ItemNTSTATUS, “s”);

This means you can convert to the ETW-only form “%!STATUS!”
where you previously dumped the hex code, and you’ll get a
pretty-printed string. (I don’t understand the problem with %08x?)

  1. It’s not much work to write, makes driver writing easier,
    and is fully in the templates ETW uses. This is just icing
    if they do it. :slight_smile: The hard part will be testing all the
    configurations.

  2. Good feedback. I’ll let the doc writers know this is what
    you really wanted to see when trying to enable debugging.

.

-----Original Message-----
From: Rob Green [mailto:xxxxx@cdp.com]
Sent: Tuesday, February 03, 2004 11:43 AM
Subject: RE: ETW?

See inline

Thanks,
Rob

> 2) I believe the format string %08x would work if you were passing a
> non-pointer. ETW is more exacting about matching types,
which I found

> to be a nice side benefit. It also will complain if you don’t have
> enough arguments for the given format string, which caught me a few
> times.

Yes I meant only when displaying pointers.

Another problem with this regard is displaying NTSTATUS
codes… I am currently using %08x which will work for 32
bit, but not 64 bit. Is there a handy % for it?

I also have found bugs where there was not enough args, which
is handy (and contributed to at least one bsod when running
debug on a customer machine).

>
> (what is “%-*.*s” supposed to do?)
>

It is used to display a length specified string (such as a
Unicode string that isn’t formatted as Unicode (otherwise use
%wZ). For example IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
has a field where they specify the length of the string and
then the buffer. It should only display what is there and it
is not null terminated. So instead of copying into a
separate buffer and initing a unicode string, I do this:

Debug(DEBUG_DEVCON,
(“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
Link->UseOnlyIfThereAreNoOtherLinks,
Link->NameLength,
Link->NameLength/2,
Link->NameLength/2,
Link->Name));

I currently have it commented out since converting to ETW.
You should be able to look up format specs in the VC help.

> 5) This is great feedback. I personally didn’t realize the
problem of
> *requiring* the WXP method of enabling tracing. I can imagine a
> method to work around this, I’ll see if I can convince the
trace guys
> that its worthwhile. As an added bonus, it won’t require new
kernel/os changes.

As I said, it didn’t really affect me as a new binary was
needed anyway.
I just needed to get the WXP way working for ia32 first, then
I got the
W2k working, then 64bit, and specify in the SOURCES which one I want
built for each platform. I wouldn’t spend much time on this though as
why support the w2k way on a brand new platform?

> 6) logman.exe, which uses different syntax than tracelog,
is shipped
> in XP and higher. It’s also available for download, IIRC.
I haven’t
> dealt with auto-enabling traces in the app/driver, but I’ll
pass along

> that more docs are required for this.
>

The hardest part was figuring out how to fill in the event trace
properties structure. All the docs had info on how to enable existing
OS tracing (such as net, disk, kernel, etc…) and not how to enable
your own event provider.

Looking at the docs for logman I don’t see how it is much
different from
tracelog. What I mean is that both of them are complicated
and seem to
provide the same functionality. For my purposes, I just say “Enable
debug”
and then have the customer replicate the problem, then say “Disable
debug”
and then have them email me the .ETL file.

I also don’t see how to enable logging for the next boot. I
don’t need
logging in my DriverEntry but do in my AddDevice and StartDevice
routines.

> 6b) I also do the same thing regarding having a compile-time switch
> for use DebugPrint. It’s more work in SOURCES and you need to wrap
> the init/unint/.TMH inclusion, but overall I’ve found it to be
workable.
>

Yes, I had to do all of that, but I found I like this
solution the best.
It is something I am comfortable with for every day debugging, and not
so much of pain for debugging customer issues.

> I’ll pass you comments to the tracing team, see if they’re able to
> make it better.

Also, all my files are .cpp which requires wrapping the .tmh
file around
and extern c like so

#ifdef RUN_WPP
extern “C” {
#include “devcon.tmh”
}
#endif


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

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

%!IPADDR! is that suitable?

But if that’s not the format u want it is possible to define a type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@NAI.com
Sent: Thursday, February 05, 2004 1:23 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

I wanted something similar to print an IP Address in dotted notation.
If I used a macro the WPP used to choke saying not enough parameters.

How do I print a IP address which is in network byte order?. Right now I
have to do this every time I want to print an IP.

DbgPrint((“LocalIp = %d.%d.%d.%d LocalPort = 0x%x RemoteIp =
%d.%d.%d.%d RemotePort =0x%x\n”,
*((PUCHAR)&NboLocalIp), *((PUCHAR)&NboLocalIp + 1),
*((PUCHAR)&NboLocalIp + 2), *((PUCHAR)&NboLocalIp + 3),
NTOHS(NboLocalPort), *((PUCHAR)&NboRemoteIp),
*((PUCHAR)&NboRemoteIp + 1), *((PUCHAR)&NboRemoteIp + 2),
*((PUCHAR)&NboRemoteIp + 3), NTOHS(NboRemotePort)));

Similar to %!STATUS! Can I define and implement my own types?

-Srin.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Henry
Gabryjelski
Sent: Wednesday, February 04, 2004 9:29 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] ETW?

So many questions, so little time. :slight_smile: Here’s a few quick answers.

  1. From tools\WppConfig\rev1\defaultwpp.ini:

DEFINE_FLAVOR(STATUS, UINT, ItemNTSTATUS, “s”);

This means you can convert to the ETW-only form “%!STATUS!”
where you previously dumped the hex code, and you’ll get a
pretty-printed string. (I don’t understand the problem with %08x?)

  1. It’s not much work to write, makes driver writing easier,
    and is fully in the templates ETW uses. This is just icing
    if they do it. :slight_smile: The hard part will be testing all the
    configurations.

  2. Good feedback. I’ll let the doc writers know this is what
    you really wanted to see when trying to enable debugging.

.

-----Original Message-----
From: Rob Green [mailto:xxxxx@cdp.com]
Sent: Tuesday, February 03, 2004 11:43 AM
Subject: RE: ETW?

See inline

Thanks,
Rob

> 2) I believe the format string %08x would work if you were passing a
> non-pointer. ETW is more exacting about matching types,
which I found

> to be a nice side benefit. It also will complain if you don’t have
> enough arguments for the given format string, which caught me a few
> times.

Yes I meant only when displaying pointers.

Another problem with this regard is displaying NTSTATUS
codes… I am currently using %08x which will work for 32
bit, but not 64 bit. Is there a handy % for it?

I also have found bugs where there was not enough args, which
is handy (and contributed to at least one bsod when running
debug on a customer machine).

>
> (what is “%-*.*s” supposed to do?)
>

It is used to display a length specified string (such as a
Unicode string that isn’t formatted as Unicode (otherwise use
%wZ). For example IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
has a field where they specify the length of the string and
then the buffer. It should only display what is there and it
is not null terminated. So instead of copying into a
separate buffer and initing a unicode string, I do this:

Debug(DEBUG_DEVCON,
(“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
Link->UseOnlyIfThereAreNoOtherLinks,
Link->NameLength,
Link->NameLength/2,
Link->NameLength/2,
Link->Name));

I currently have it commented out since converting to ETW.
You should be able to look up format specs in the VC help.

> 5) This is great feedback. I personally didn’t realize the
problem of
> *requiring* the WXP method of enabling tracing. I can imagine a
> method to work around this, I’ll see if I can convince the
trace guys
> that its worthwhile. As an added bonus, it won’t require new
kernel/os changes.

As I said, it didn’t really affect me as a new binary was
needed anyway.
I just needed to get the WXP way working for ia32 first, then
I got the
W2k working, then 64bit, and specify in the SOURCES which one I want
built for each platform. I wouldn’t spend much time on this though as
why support the w2k way on a brand new platform?

> 6) logman.exe, which uses different syntax than tracelog,
is shipped
> in XP and higher. It’s also available for download, IIRC.
I haven’t
> dealt with auto-enabling traces in the app/driver, but I’ll
pass along

> that more docs are required for this.
>

The hardest part was figuring out how to fill in the event trace
properties structure. All the docs had info on how to enable existing
OS tracing (such as net, disk, kernel, etc…) and not how to enable
your own event provider.

Looking at the docs for logman I don’t see how it is much
different from
tracelog. What I mean is that both of them are complicated
and seem to
provide the same functionality. For my purposes, I just say “Enable
debug”
and then have the customer replicate the problem, then say “Disable
debug”
and then have them email me the .ETL file.

I also don’t see how to enable logging for the next boot. I
don’t need
logging in my DriverEntry but do in my AddDevice and StartDevice
routines.

> 6b) I also do the same thing regarding having a compile-time switch
> for use DebugPrint. It’s more work in SOURCES and you need to wrap
> the init/unint/.TMH inclusion, but overall I’ve found it to be
workable.
>

Yes, I had to do all of that, but I found I like this
solution the best.
It is something I am comfortable with for every day debugging, and not
so much of pain for debugging customer issues.

> I’ll pass you comments to the tracing team, see if they’re able to
> make it better.

Also, all my files are .cpp which requires wrapping the .tmh
file around
and extern c like so

#ifdef RUN_WPP
extern “C” {
#include “devcon.tmh”
}
#endif


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

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


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

Yes, this is what I was looking for. Do you know which byte order it
expects the IPAddress to be.
In addition I would appreciate if you could tell me.

  1. How to define my own types. For Example if I want to define a type
    for printing IPADDR in a different byte order.
  2. If I can add support for these types to DbgPrint function. Using
    SOURCES file I enable and disable WPP without changing source code.

-Srin.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ian Service
Sent: Thursday, February 05, 2004 1:44 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

%!IPADDR! is that suitable?

But if that’s not the format u want it is possible to define a type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@NAI.com
Sent: Thursday, February 05, 2004 1:23 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

I wanted something similar to print an IP Address in dotted
notation. If I used a macro the WPP used to choke saying not
enough parameters.

How do I print a IP address which is in network byte order?.
Right now I have to do this every time I want to print an IP.

DbgPrint((“LocalIp = %d.%d.%d.%d LocalPort = 0x%x
RemoteIp = %d.%d.%d.%d RemotePort =0x%x\n”,
*((PUCHAR)&NboLocalIp), *((PUCHAR)&NboLocalIp + 1),
*((PUCHAR)&NboLocalIp + 2), *((PUCHAR)&NboLocalIp + 3),
NTOHS(NboLocalPort), *((PUCHAR)&NboRemoteIp),
*((PUCHAR)&NboRemoteIp + 1), *((PUCHAR)&NboRemoteIp + 2),
*((PUCHAR)&NboRemoteIp + 3), NTOHS(NboRemotePort)));

Similar to %!STATUS! Can I define and implement my own types?

-Srin.
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Henry
> Gabryjelski
> Sent: Wednesday, February 04, 2004 9:29 AM
> To: Windows System Software Devs Interest List
> Subject: RE:[ntdev] ETW?
>
>
> So many questions, so little time. :slight_smile: Here’s a few quick answers.
>
> 1) From tools\WppConfig\rev1\defaultwpp.ini:
>
> DEFINE_FLAVOR(STATUS, UINT, ItemNTSTATUS, “s”);
>
> This means you can convert to the ETW-only form “%!STATUS!”
> where you previously dumped the hex code, and you’ll get a
> pretty-printed string. (I don’t understand the problem with %08x?)
>
> 5) It’s not much work to write, makes driver writing easier,
> and is fully in the templates ETW uses. This is just icing
> if they do it. :slight_smile: The hard part will be testing all the
> configurations.
>
> 6) Good feedback. I’ll let the doc writers know this is what
> you really wanted to see when trying to enable debugging.
>
> .
>
>
> -----Original Message-----
> From: Rob Green [mailto:xxxxx@cdp.com]
> Sent: Tuesday, February 03, 2004 11:43 AM
> Subject: RE: ETW?
>
> See inline
>
> Thanks,
> Rob
>
>
> > 2) I believe the format string %08x would work if you
were passing a
> > non-pointer. ETW is more exacting about matching types,
> which I found
>
> > to be a nice side benefit. It also will complain if you
don’t have
> > enough arguments for the given format string, which
caught me a few
> > times.
>
> Yes I meant only when displaying pointers.
>
> Another problem with this regard is displaying NTSTATUS
> codes… I am currently using %08x which will work for 32
> bit, but not 64 bit. Is there a handy % for it?
>
> I also have found bugs where there was not enough args, which
> is handy (and contributed to at least one bsod when running
> debug on a customer machine).
>
> >
> > (what is “%-*.*s” supposed to do?)
> >
>
> It is used to display a length specified string (such as a
> Unicode string that isn’t formatted as Unicode (otherwise use
> %wZ). For example IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
> has a field where they specify the length of the string and
> then the buffer. It should only display what is there and it
> is not null terminated. So instead of copying into a
> separate buffer and initing a unicode string, I do this:
>
> Debug(DEBUG_DEVCON,
> (“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
> Link->UseOnlyIfThereAreNoOtherLinks,
> Link->NameLength,
> Link->NameLength/2,
> Link->NameLength/2,
> Link->Name));
>
> I currently have it commented out since converting to ETW.
> You should be able to look up format specs in the VC help.
>
> > 5) This is great feedback. I personally didn’t realize the
> problem of
> > *requiring* the WXP method of enabling tracing. I can imagine a
> > method to work around this, I’ll see if I can convince the
> trace guys
> > that its worthwhile. As an added bonus, it won’t require new
> kernel/os changes.
>
> As I said, it didn’t really affect me as a new binary was
> needed anyway.
> I just needed to get the WXP way working for ia32 first, then
> I got the
> W2k working, then 64bit, and specify in the SOURCES which one I want
> built for each platform. I wouldn’t spend much time on
this though as
> why support the w2k way on a brand new platform?
>
>
> > 6) logman.exe, which uses different syntax than tracelog,
> is shipped
> > in XP and higher. It’s also available for download, IIRC.
> I haven’t
> > dealt with auto-enabling traces in the app/driver, but I’ll
> pass along
>
> > that more docs are required for this.
> >
>
> The hardest part was figuring out how to fill in the event trace
> properties structure. All the docs had info on how to
enable existing
> OS tracing (such as net, disk, kernel, etc…) and not how
to enable
> your own event provider.
>
> Looking at the docs for logman I don’t see how it is much
> different from
> tracelog. What I mean is that both of them are complicated
> and seem to
> provide the same functionality. For my purposes, I just say “Enable
> debug”
> and then have the customer replicate the problem, then say “Disable
> debug”
> and then have them email me the .ETL file.
>
> I also don’t see how to enable logging for the next boot. I
> don’t need
> logging in my DriverEntry but do in my AddDevice and StartDevice
> routines.
>
> > 6b) I also do the same thing regarding having a
compile-time switch
> > for use DebugPrint. It’s more work in SOURCES and you
need to wrap
> > the init/unint/.TMH inclusion, but overall I’ve found it to be
> workable.
> >
>
> Yes, I had to do all of that, but I found I like this
> solution the best.
> It is something I am comfortable with for every day
debugging, and not
> so much of pain for debugging customer issues.
>
> > I’ll pass you comments to the tracing team, see if they’re able to
> > make it better.
>
>
> Also, all my files are .cpp which requires wrapping the .tmh
> file around
> and extern c like so
>
> #ifdef RUN_WPP
> extern “C” {
> #include “devcon.tmh”
> }
> #endif
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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


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


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

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

For the sources I do something similar to

!if “$(DEBUG_BUILD)” == “1”

no wpp on debug builds

!else

Enable WPP on release builds

RUN_WPP=$(SOURCES) \
-km -dll\
-gen:{km-w2k.tpl}*.tmh \
-func:Debug(LEVEL,(MSG,…))
!endif ## debug

and then I set “DEBUG_BUILD” environment before doing the debug build.

Thanks,
Rob

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-166363-
xxxxx@lists.osr.com] On Behalf Of xxxxx@NAI.com
Sent: Thursday, February 05, 2004 5:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

Yes, this is what I was looking for. Do you know which byte order it
expects the IPAddress to be.
In addition I would appreciate if you could tell me.

  1. How to define my own types. For Example if I want to define a type
    for printing IPADDR in a different byte order.
  2. If I can add support for these types to DbgPrint function. Using
    SOURCES file I enable and disable WPP without changing source code.

-Srin.

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Ian Service
> Sent: Thursday, February 05, 2004 1:44 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] ETW?
>
>
> %!IPADDR! is that suitable?
>
> But if that’s not the format u want it is possible to define a type.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@NAI.com
> Sent: Thursday, February 05, 2004 1:23 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] ETW?
>
> I wanted something similar to print an IP Address in dotted
> notation. If I used a macro the WPP used to choke saying not
> enough parameters.
>
> How do I print a IP address which is in network byte order?.
> Right now I have to do this every time I want to print an IP.
>
> DbgPrint((“LocalIp = %d.%d.%d.%d LocalPort = 0x%x
> RemoteIp = %d.%d.%d.%d RemotePort =0x%x\n”,
> *((PUCHAR)&NboLocalIp), *((PUCHAR)&NboLocalIp + 1),
> *((PUCHAR)&NboLocalIp + 2), *((PUCHAR)&NboLocalIp + 3),
> NTOHS(NboLocalPort), *((PUCHAR)&NboRemoteIp),
> *((PUCHAR)&NboRemoteIp + 1), *((PUCHAR)&NboRemoteIp + 2),
> *((PUCHAR)&NboRemoteIp + 3), NTOHS(NboRemotePort)));
>
> Similar to %!STATUS! Can I define and implement my own types?
>
> -Srin.
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Henry
> > Gabryjelski
> > Sent: Wednesday, February 04, 2004 9:29 AM
> > To: Windows System Software Devs Interest List
> > Subject: RE:[ntdev] ETW?
> >
> >
> > So many questions, so little time. :slight_smile: Here’s a few quick answers.
> >
> > 1) From tools\WppConfig\rev1\defaultwpp.ini:
> >
> > DEFINE_FLAVOR(STATUS, UINT, ItemNTSTATUS, “s”);
> >
> > This means you can convert to the ETW-only form “%!STATUS!”
> > where you previously dumped the hex code, and you’ll get a
> > pretty-printed string. (I don’t understand the problem with %08x?)
> >
> > 5) It’s not much work to write, makes driver writing easier,
> > and is fully in the templates ETW uses. This is just icing
> > if they do it. :slight_smile: The hard part will be testing all the
> > configurations.
> >
> > 6) Good feedback. I’ll let the doc writers know this is what
> > you really wanted to see when trying to enable debugging.
> >
> > .
> >
> >
> > -----Original Message-----
> > From: Rob Green [mailto:xxxxx@cdp.com]
> > Sent: Tuesday, February 03, 2004 11:43 AM
> > Subject: RE: ETW?
> >
> > See inline
> >
> > Thanks,
> > Rob
> >
> >
> > > 2) I believe the format string %08x would work if you
> were passing a
> > > non-pointer. ETW is more exacting about matching types,
> > which I found
> >
> > > to be a nice side benefit. It also will complain if you
> don’t have
> > > enough arguments for the given format string, which
> caught me a few
> > > times.
> >
> > Yes I meant only when displaying pointers.
> >
> > Another problem with this regard is displaying NTSTATUS
> > codes… I am currently using %08x which will work for 32
> > bit, but not 64 bit. Is there a handy % for it?
> >
> > I also have found bugs where there was not enough args, which
> > is handy (and contributed to at least one bsod when running
> > debug on a customer machine).
> >
> > >
> > > (what is “%-*.*s” supposed to do?)
> > >
> >
> > It is used to display a length specified string (such as a
> > Unicode string that isn’t formatted as Unicode (otherwise use
> > %wZ). For example IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
> > has a field where they specify the length of the string and
> > then the buffer. It should only display what is there and it
> > is not null terminated. So instead of copying into a
> > separate buffer and initing a unicode string, I do this:
> >
> > Debug(DEBUG_DEVCON,
> > (“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
> > Link->UseOnlyIfThereAreNoOtherLinks,
> > Link->NameLength,
> > Link->NameLength/2,
> > Link->NameLength/2,
> > Link->Name));
> >
> > I currently have it commented out since converting to ETW.
> > You should be able to look up format specs in the VC help.
> >
> > > 5) This is great feedback. I personally didn’t realize the
> > problem of
> > > *requiring* the WXP method of enabling tracing. I can imagine a
> > > method to work around this, I’ll see if I can convince the
> > trace guys
> > > that its worthwhile. As an added bonus, it won’t require new
> > kernel/os changes.
> >
> > As I said, it didn’t really affect me as a new binary was
> > needed anyway.
> > I just needed to get the WXP way working for ia32 first, then
> > I got the
> > W2k working, then 64bit, and specify in the SOURCES which one I want
> > built for each platform. I wouldn’t spend much time on
> this though as
> > why support the w2k way on a brand new platform?
> >
> >
> > > 6) logman.exe, which uses different syntax than tracelog,
> > is shipped
> > > in XP and higher. It’s also available for download, IIRC.
> > I haven’t
> > > dealt with auto-enabling traces in the app/driver, but I’ll
> > pass along
> >
> > > that more docs are required for this.
> > >
> >
> > The hardest part was figuring out how to fill in the event trace
> > properties structure. All the docs had info on how to
> enable existing
> > OS tracing (such as net, disk, kernel, etc…) and not how
> to enable
> > your own event provider.
> >
> > Looking at the docs for logman I don’t see how it is much
> > different from
> > tracelog. What I mean is that both of them are complicated
> > and seem to
> > provide the same functionality. For my purposes, I just say “Enable
> > debug”
> > and then have the customer replicate the problem, then say “Disable
> > debug”
> > and then have them email me the .ETL file.
> >
> > I also don’t see how to enable logging for the next boot. I
> > don’t need
> > logging in my DriverEntry but do in my AddDevice and StartDevice
> > routines.
> >
> > > 6b) I also do the same thing regarding having a
> compile-time switch
> > > for use DebugPrint. It’s more work in SOURCES and you
> need to wrap
> > > the init/unint/.TMH inclusion, but overall I’ve found it to be
> > workable.
> > >
> >
> > Yes, I had to do all of that, but I found I like this
> > solution the best.
> > It is something I am comfortable with for every day
> debugging, and not
> > so much of pain for debugging customer issues.
> >
> > > I’ll pass you comments to the tracing team, see if they’re able to
> > > make it better.
> >
> >
> > Also, all my files are .cpp which requires wrapping the .tmh
> > file around
> > and extern c like so
> >
> > #ifdef RUN_WPP
> > extern “C” {
> > #include “devcon.tmh”
> > }
> > #endif
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@nai.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> 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
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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


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

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

Srin,

good question. In user mode indentation is per thread. In kernel mode it is
global; one global counter which increments on enter and decrements on
leave. Not ideal always but yes, it works accross function calls on SMP
machine.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: xxxxx@NAI.com[SMTP:xxxxx@NAI.com]
Reply To: xxxxx@lists.osr.com
Sent: Thursday, February 05, 2004 10:13 PM
To: xxxxx@lists.osr.com
Subject: RE: [ntdev] ETW?

Michal,
Do these indentations work across function calls on multi processor
machines?

-Srin.

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
> Sent: Tuesday, February 03, 2004 12:18 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] ETW?
>
>
> > ----------
> > From:
> > xxxxx@windows.microsoft.com[SMTP:xxxxx@windows.microsoft.com]
> > Reply To: xxxxx@lists.osr.com
> > Sent: Tuesday, February 03, 2004 7:37 PM
> > To: xxxxx@lists.osr.com
> > Subject: RE:[ntdev] ETW?
> >
> >
> > “I just wondered if ETW can give me some advantages.”
> >
> > I will eventually post some of the “advanced” features.
> How about a
> > nice hexdump feature, something like “%!HEXDUMP!” resulting
> in a dump
> > of data similar to how the debugger shows data?
> >
> We have it, too, and don’t take is as advanced but standard
> feature :wink:
>
> Well, I should explain what I expect from traces and what we
> use. Captured example (without message prefixes to avoid wrapping):
>
> ==> SendServiceFrame(USB, 4, 12fb78, 11)
> ==> VerifyFrame(12facc, 1) > > size 11, SEQ 0>
> > SetParams frame, protocol version 1, flags 0, WTX timeout
> > 2100, MTU: 0.
> > <== (0.000) VerifyFrame() -> 0
> > Frame content:[len 13(0xd)], data follow
> > 04 00 08 01 00 34 08 00 00 00 00 6b 14 …4…k.
> > ==> LlUsbWriteFrame(12facc, 13)
> > ==> UsbWriteData(750, 12f264, 17, 3000)
> > ==> HandleAsyncIoResult(750, 12f208, 12f21c, 3000)
> > <== (0.000) HandleAsyncIoResult() -> 0 [17]
> > All 17 bytes successfully written to USB.
> > <== (0.000) UsbWriteData() -> 0 (0)
> > <== (0.000) LlUsbWriteFrame() -> 0.
> > <== (0.000) SendServiceFrame() -> 0
> >
> > Part of above is generated by following code:
> >
> > TTRACE_ENTER(LlPc, TDBG_DEBUG, (“SendServiceFrame(%s, %d, %x, %d)”,
> > Driver->Name, FrameType, Header, FrameSize));
> >
> > TTRACE(LlPc, TDBG_DEBUG, (“SetParams frame, protocol version
> > %d, flags %x, WTX timeout %d, MTU: %d.”,
> > SetParams->ProtocolVersion,
> > SetParams->Flags,
> > SetParams->WtxTimeout,
> > SetParams->MaxTransferSize));
> >
> > TDUMP_EX(LlPc, TDBG_LOUD, “Frame content”, Buffer, FrameSize
> > + sizeof(Crc));
> >
> > TTRACE_LEAVE((“SendServiceFrame() -> %d”, Result));
> >
> > ENTER/LEAVE are always used in pair and control proper trace
> > indentation to visualise nesting. Note LEAVE doesn’t have
> > area and level and uses settings from previous ENTER instead.
> > It also measures and displays the time spent in block.
> >
> > It is possible to achieve the same via ETW? Ideally, with no
> > source files change (besides macro definitions, of course).
> >
> > Best regards,
> >
> > Michal Vodicka
> > STMicroelectronics Design and Application s.r.o.
> > [michal.vodicka@st.com, http:://www.st.com]
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@nai.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: michal.vodicka@st.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

For Kernel mode code, if we just have on global counter for all
processors how would this work. Don’t we need to have a counter per CPU?
I believed indentation gets messed up if I have only one counter and it
is DUAL or a QUAD processor. Executing code in parallel…

-Srin.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Thursday, February 05, 2004 2:44 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

Srin,

good question. In user mode indentation is per thread. In
kernel mode it is global; one global counter which increments
on enter and decrements on leave. Not ideal always but yes,
it works accross function calls on SMP machine.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]

> ----------
> From: xxxxx@NAI.com[SMTP:xxxxx@NAI.com]
> Reply To: xxxxx@lists.osr.com
> Sent: Thursday, February 05, 2004 10:13 PM
> To: xxxxx@lists.osr.com
> Subject: RE: [ntdev] ETW?
>
> Michal,
> Do these indentations work across function calls on multi
> processor machines?
>
> -Srin.
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
Michal Vodicka
> > Sent: Tuesday, February 03, 2004 12:18 PM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] ETW?
> >
> >
> > > ----------
> > > From:
> > >
xxxxx@windows.microsoft.com[SMTP:xxxxx@windows.microsoft.com]
> > > Reply To: xxxxx@lists.osr.com
> > > Sent: Tuesday, February 03, 2004 7:37 PM
> > > To: xxxxx@lists.osr.com
> > > Subject: RE:[ntdev] ETW?
> > >
> > >
> > > “I just wondered if ETW can give me some advantages.”
> > >
> > > I will eventually post some of the “advanced” features.
> > How about a
> > > nice hexdump feature, something like “%!HEXDUMP!” resulting
> > in a dump
> > > of data similar to how the debugger shows data?
> > >
> > We have it, too, and don’t take is as advanced but standard
> > feature :wink:
> >
> > Well, I should explain what I expect from traces and what we
> > use. Captured example (without message prefixes to avoid
wrapping):
> >
> > ==> SendServiceFrame(USB, 4, 12fb78, 11)
> > ==> VerifyFrame(12facc, 1) > > > size 11, SEQ 0>
> > > SetParams frame, protocol version 1, flags 0, WTX timeout
> > > 2100, MTU: 0.
> > > <== (0.000) VerifyFrame() -> 0
> > > Frame content:[len 13(0xd)], data follow
> > > 04 00 08 01 00 34 08 00 00 00 00 6b 14 …4…k.
> > > ==> LlUsbWriteFrame(12facc, 13)
> > > ==> UsbWriteData(750, 12f264, 17, 3000)
> > > ==> HandleAsyncIoResult(750, 12f208, 12f21c, 3000)
> > > <== (0.000) HandleAsyncIoResult() -> 0 [17]
> > > All 17 bytes successfully written to USB.
> > > <== (0.000) UsbWriteData() -> 0 (0)
> > > <== (0.000) LlUsbWriteFrame() -> 0.
> > > <== (0.000) SendServiceFrame() -> 0
> > >
> > > Part of above is generated by following code:
> > >
> > > TTRACE_ENTER(LlPc, TDBG_DEBUG, (“SendServiceFrame(%s, %d,
> %x, %d)”,
> > > Driver->Name, FrameType, Header, FrameSize));
> > >
> > > TTRACE(LlPc, TDBG_DEBUG, (“SetParams frame, protocol version
> > > %d, flags %x, WTX timeout %d, MTU: %d.”,
> > > SetParams->ProtocolVersion,
> > > SetParams->Flags,
> > > SetParams->WtxTimeout,
> > > SetParams->MaxTransferSize));
> > >
> > > TDUMP_EX(LlPc, TDBG_LOUD, “Frame content”, Buffer, FrameSize
> > > + sizeof(Crc));
> > >
> > > TTRACE_LEAVE((“SendServiceFrame() -> %d”, Result));
> > >
> > > ENTER/LEAVE are always used in pair and control proper trace
> > > indentation to visualise nesting. Note LEAVE doesn’t have
> > > area and level and uses settings from previous ENTER instead.
> > > It also measures and displays the time spent in block.
> > >
> > > It is possible to achieve the same via ETW? Ideally, with no
> > > source files change (besides macro definitions, of course).
> > >
> > > Best regards,
> > >
> > > Michal Vodicka
> > > STMicroelectronics Design and Application s.r.o.
> > > [michal.vodicka@st.com, http:://www.st.com]
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@nai.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: michal.vodicka@st.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

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

Rob,
Thanks for your response. I already do this.
What I wanted to know is if I am using %!STATUS! Or %!IPADDR! types then
what would happen to them when I haven’t enabed WPP. Would these still
be recognized by DbgPrint?

-Srin.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Rob Green
Sent: Thursday, February 05, 2004 2:21 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] ETW?

For the sources I do something similar to

!if “$(DEBUG_BUILD)” == “1”

no wpp on debug builds

!else

Enable WPP on release builds

RUN_WPP=$(SOURCES) \
-km -dll\
-gen:{km-w2k.tpl}*.tmh \
-func:Debug(LEVEL,(MSG,…))
!endif ## debug

and then I set “DEBUG_BUILD” environment before doing the debug build.

Thanks,
Rob

> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:bounce-166363-
> xxxxx@lists.osr.com] On Behalf Of xxxxx@NAI.com
> Sent: Thursday, February 05, 2004 5:13 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] ETW?
>
> Yes, this is what I was looking for. Do you know which byte
order it
> expects the IPAddress to be. In addition I would appreciate if you
> could tell me. 1. How to define my own types. For Example
if I want to
> define a type for printing IPADDR in a different byte order.
> 2. If I can add support for these types to DbgPrint function. Using
> SOURCES file I enable and disable WPP without changing source code.
>
> -Srin.
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Ian Service
> > Sent: Thursday, February 05, 2004 1:44 PM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] ETW?
> >
> >
> > %!IPADDR! is that suitable?
> >
> > But if that’s not the format u want it is possible to
define a type.
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> > xxxxx@NAI.com
> > Sent: Thursday, February 05, 2004 1:23 PM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] ETW?
> >
> > I wanted something similar to print an IP Address in dotted
> > notation. If I used a macro the WPP used to choke saying
not enough
> > parameters.
> >
> > How do I print a IP address which is in network byte
order?. Right
> > now I have to do this every time I want to print an IP.
> >
> > DbgPrint((“LocalIp = %d.%d.%d.%d LocalPort = 0x%x
RemoteIp =
> > %d.%d.%d.%d RemotePort =0x%x\n”,
> > *((PUCHAR)&NboLocalIp), *((PUCHAR)&NboLocalIp + 1),
> > *((PUCHAR)&NboLocalIp + 2), *((PUCHAR)&NboLocalIp + 3),
> > NTOHS(NboLocalPort), *((PUCHAR)&NboRemoteIp),
> > *((PUCHAR)&NboRemoteIp + 1),
*((PUCHAR)&NboRemoteIp + 2),
> > *((PUCHAR)&NboRemoteIp + 3), NTOHS(NboRemotePort)));
> >
> > Similar to %!STATUS! Can I define and implement my own types?
> >
> > -Srin.
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] On Behalf Of Henry
> > > Gabryjelski
> > > Sent: Wednesday, February 04, 2004 9:29 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: RE:[ntdev] ETW?
> > >
> > >
> > > So many questions, so little time. :slight_smile: Here’s a few
quick answers.
> > >
> > > 1) From tools\WppConfig\rev1\defaultwpp.ini:
> > >
> > > DEFINE_FLAVOR(STATUS, UINT, ItemNTSTATUS, “s”);
> > >
> > > This means you can convert to the ETW-only form
“%!STATUS!” where
> > > you previously dumped the hex code, and you’ll get a
> > > pretty-printed string. (I don’t understand the problem
with %08x?)
> > >
> > > 5) It’s not much work to write, makes driver writing
easier, and
> > > is fully in the templates ETW uses. This is just icing
if they do
> > > it. :slight_smile: The hard part will be testing all the configurations.
> > >
> > > 6) Good feedback. I’ll let the doc writers know this
is what you
> > > really wanted to see when trying to enable debugging.
> > >
> > > .
> > >
> > >
> > > -----Original Message-----
> > > From: Rob Green [mailto:xxxxx@cdp.com]
> > > Sent: Tuesday, February 03, 2004 11:43 AM
> > > Subject: RE: ETW?
> > >
> > > See inline
> > >
> > > Thanks,
> > > Rob
> > >
> > >
> > > > 2) I believe the format string %08x would work if you
> > were passing a
> > > > non-pointer. ETW is more exacting about matching types,
> > > which I found
> > >
> > > > to be a nice side benefit. It also will complain if you
> > don’t have
> > > > enough arguments for the given format string, which
> > caught me a few
> > > > times.
> > >
> > > Yes I meant only when displaying pointers.
> > >
> > > Another problem with this regard is displaying NTSTATUS
codes… I
> > > am currently using %08x which will work for 32 bit, but not 64
> > > bit. Is there a handy % for it?
> > >
> > > I also have found bugs where there was not enough args,
which is
> > > handy (and contributed to at least one bsod when
running debug on
> > > a customer machine).
> > >
> > > >
> > > > (what is “%-*.*s” supposed to do?)
> > > >
> > >
> > > It is used to display a length specified string (such
as a Unicode
> > > string that isn’t formatted as Unicode (otherwise use
%wZ). For
> > > example IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
> > > has a field where they specify the length of the string
and then
> > > the buffer. It should only display what is there and it is not
> > > null terminated. So instead of copying into a separate
buffer and
> > > initing a unicode string, I do this:
> > >
> > > Debug(DEBUG_DEVCON,
> > > (“SuggestedLinkName: %d, %d: ‘%-*.*ws’\n”,
> > > Link->UseOnlyIfThereAreNoOtherLinks,
> > > Link->NameLength,
> > > Link->NameLength/2,
> > > Link->NameLength/2,
> > > Link->Name));
> > >
> > > I currently have it commented out since converting to ETW. You
> > > should be able to look up format specs in the VC help.
> > >
> > > > 5) This is great feedback. I personally didn’t realize the
> > > problem of
> > > > *requiring* the WXP method of enabling tracing. I
can imagine a
> > > > method to work around this, I’ll see if I can convince the
> > > trace guys
> > > > that its worthwhile. As an added bonus, it won’t require new
> > > kernel/os changes.
> > >
> > > As I said, it didn’t really affect me as a new binary
was needed
> > > anyway. I just needed to get the WXP way working for
ia32 first,
> > > then I got the
> > > W2k working, then 64bit, and specify in the SOURCES
which one I want
> > > built for each platform. I wouldn’t spend much time on
> > this though as
> > > why support the w2k way on a brand new platform?
> > >
> > >
> > > > 6) logman.exe, which uses different syntax than tracelog,
> > > is shipped
> > > > in XP and higher. It’s also available for download, IIRC.
> > > I haven’t
> > > > dealt with auto-enabling traces in the app/driver, but I’ll
> > > pass along
> > >
> > > > that more docs are required for this.
> > > >
> > >
> > > The hardest part was figuring out how to fill in the
event trace
> > > properties structure. All the docs had info on how to
> > enable existing
> > > OS tracing (such as net, disk, kernel, etc…) and not how
> > to enable
> > > your own event provider.
> > >
> > > Looking at the docs for logman I don’t see how it is much
> > > different from tracelog. What I mean is that both of them are
> > > complicated and seem to
> > > provide the same functionality. For my purposes, I
just say “Enable
> > > debug”
> > > and then have the customer replicate the problem, then
say “Disable
> > > debug”
> > > and then have them email me the .ETL file.
> > >
> > > I also don’t see how to enable logging for the next
boot. I don’t
> > > need logging in my DriverEntry but do in my AddDevice and
> > > StartDevice routines.
> > >
> > > > 6b) I also do the same thing regarding having a
> > compile-time switch
> > > > for use DebugPrint. It’s more work in SOURCES and you
> > need to wrap
> > > > the init/unint/.TMH inclusion, but overall I’ve found it to be
> > > workable.
> > > >
> > >
> > > Yes, I had to do all of that, but I found I like this
solution the
> > > best. It is something I am comfortable with for every day
> > debugging, and not
> > > so much of pain for debugging customer issues.
> > >
> > > > I’ll pass you comments to the tracing team, see if
they’re able
> > > > to make it better.
> > >
> > >
> > > Also, all my files are .cpp which requires wrapping the
.tmh file
> > > around and extern c like so
> > >
> > > #ifdef RUN_WPP
> > > extern “C” {
> > > #include “devcon.tmh”
> > > }
> > > #endif
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@nai.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > —
> > 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
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@nai.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@cdp.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


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

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

> ----------

From: xxxxx@NAI.com[SMTP:xxxxx@NAI.com]
Reply To: xxxxx@lists.osr.com
Sent: Friday, February 06, 2004 12:17 AM
To: xxxxx@lists.osr.com
Subject: RE: [ntdev] ETW?

For Kernel mode code, if we just have on global counter for all
processors how would this work. Don’t we need to have a counter per CPU?
I believed indentation gets messed up if I have only one counter and it
is DUAL or a QUAD processor. Executing code in parallel…

Yes, it is a problem. Surprisingly, very rare in my experience (on dual CPU
machine). One counter per CPU is another possibility but there can be
inverted problem: presume you send a request down the stack and it is
completed before return on another CPU. I prefer it is indented as nested to
emphasize completion before request returns.

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]