Re: Debugging

Hi,
I am also working on sending some debug output to a file on disk. I am
using same ZwCreateFile() &
ZwWriteFile() kernel calls to do it. But I get a page fault on the call
to ZwCreateFile(). I am checking in code that I do this only if IRQL <=
DISPATCH_LEVEL.
Any ideas why page fault would occur?
I am using following code: maybe I am using some wrong flags or what??

InitializeObjectAttributes (&objectAttributes,

(PUNICODE_STRING)&fileName,

OBJ_CASE_INSENSITIVE,
NULL,
NULL );

status = ZwCreateFile(&FileHandle,
FILE_APPEND_DATA,
&objectAttributes,
&IoStatus,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0 );

Sanjay

-----Original Message-----
From: Shaun [mailto:xxxxx@sdlabs.net]
Sent: Monday, May 26, 2003 6:42 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Debugging

You can write to files using the ZwCreateFile() &
ZwWriteFile() kernel calls. If you want to just capture trace,
simply use DbgPrint and either use a debugger (such as the DDK
WinDbg or Numega SoftIce) or use a utility called DebugView
from SysInternals (http://www.sysinternals.com/ntw2k/utilities.shtml)
that will capture the DbgPrint and allow you to view/save it.

Shaun

Monday, May 26, 2003, 2:29:17 PM, you wrote:

TS> Hello,

TS> I am moving some dll code to driver side in 2K. ( Using deviceio
TS> calls) Is there any facility of printing messages to file
in driver
TS> code. ( For Debudding)

TS> As i Couldn’t get any status (tracking) of the driver
function, i am
TS> interested in
TS> getting track of the code.

TS> Any help ?
TS> Thanks in advance,
TS> Tushar

TS> —
TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
TS> unsubscribe send a blank email to xxxxx@lists.osr.com


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

RTFM.

“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”

P.S. debug logging to a file directly from kernel mode is generally a
useless idea.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
Sent: Tuesday, August 05, 2003 1:34 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Hi,
I am also working on sending some debug output to a file on disk. I am using
same ZwCreateFile() &
ZwWriteFile() kernel calls to do it. But I get a page fault on the call to
ZwCreateFile(). I am checking in code that I do this only if IRQL <=
DISPATCH_LEVEL. Any ideas why page fault would occur? I am using following
code: maybe I am using some wrong flags or what??

InitializeObjectAttributes (&objectAttributes,

(PUNICODE_STRING)&fileName,

OBJ_CASE_INSENSITIVE,
NULL,
NULL );

status = ZwCreateFile(&FileHandle,
FILE_APPEND_DATA,
&objectAttributes,
&IoStatus,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0 );

Sanjay

-----Original Message-----
From: Shaun [mailto:xxxxx@sdlabs.net]
Sent: Monday, May 26, 2003 6:42 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Debugging

You can write to files using the ZwCreateFile() &
ZwWriteFile() kernel calls. If you want to just capture trace,
simply use DbgPrint and either use a debugger (such as the DDK
WinDbg or Numega SoftIce) or use a utility called DebugView
from SysInternals (http://www.sysinternals.com/ntw2k/utilities.shtml)
that will capture the DbgPrint and allow you to view/save it.

Shaun

Monday, May 26, 2003, 2:29:17 PM, you wrote:

TS> Hello,

TS> I am moving some dll code to driver side in 2K. ( Using deviceio
TS> calls) Is there any facility of printing messages to file
in driver
TS> code. ( For Debudding)

TS> As i Couldn’t get any status (tracking) of the driver
function, i am
TS> interested in
TS> getting track of the code.

TS> Any help ?
TS> Thanks in advance,
TS> Tushar

TS> —
TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
TS> unsubscribe send a blank email to xxxxx@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@neoteris.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@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

IRQL must be PASSIVE_LEVEL, not <= DISPATCH_LEVEL.

Sanjay Chadda wrote:

Hi,
I am also working on sending some debug output to a file on disk. I am
using same ZwCreateFile() &
ZwWriteFile() kernel calls to do it. But I get a page fault on the call
to ZwCreateFile(). I am checking in code that I do this only if IRQL <=
DISPATCH_LEVEL.
Any ideas why page fault would occur?
I am using following code: maybe I am using some wrong flags or what??

InitializeObjectAttributes (&objectAttributes,

(PUNICODE_STRING)&fileName,

OBJ_CASE_INSENSITIVE,
NULL,
NULL );

status = ZwCreateFile(&FileHandle,
FILE_APPEND_DATA,
&objectAttributes,
&IoStatus,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0 );

Sanjay

>-----Original Message-----
>From: Shaun [mailto:xxxxx@sdlabs.net]
>Sent: Monday, May 26, 2003 6:42 AM
>To: NT Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>You can write to files using the ZwCreateFile() &
>ZwWriteFile() kernel calls. If you want to just capture trace,
>simply use DbgPrint and either use a debugger (such as the DDK
>WinDbg or Numega SoftIce) or use a utility called DebugView

>from SysInternals (http://www.sysinternals.com/ntw2k/utilities.shtml)

>that will capture the DbgPrint and allow you to view/save it.
>
>Shaun
>
>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>
>TS> Hello,
>
>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>TS> calls) Is there any facility of printing messages to file
>in driver
>TS> code. ( For Debudding)
>
>TS> As i Couldn’t get any status (tracking) of the driver
>function, i am
>TS> interested in
>TS> getting track of the code.
>
>TS> Any help ?
>TS> Thanks in advance,
>TS> Tushar
>
>
>
>TS> —
>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>TS> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@neoteris.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@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

  • Nick Ryan (MVP for DDK)

Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.

P.S. debug logging to a file directly from kernel mode is
generally a useless idea.

Why do you say this? Because of performance reasons?
Or maybe we can get the debug messages in the driver thru an IOCTL in
user mode app. The user mode
App could then write to a file.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Tuesday, August 05, 2003 10:44 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

RTFM.

“Callers of ZwCreateFile must be running at IRQL =
PASSIVE_LEVEL.” “Callers of ZwWriteFile must be running at
IRQL = PASSIVE_LEVEL.”

P.S. debug logging to a file directly from kernel mode is
generally a useless idea.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
Sent: Tuesday, August 05, 2003 1:34 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Hi,
I am also working on sending some debug output to a file on
disk. I am using same ZwCreateFile() &
ZwWriteFile() kernel calls to do it. But I get a page fault on
the call to ZwCreateFile(). I am checking in code that I do
this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
would occur? I am using following
code: maybe I am using some wrong flags or what??

InitializeObjectAttributes (&objectAttributes,

(PUNICODE_STRING)&fileName,

OBJ_CASE_INSENSITIVE,
NULL,
NULL );

status = ZwCreateFile(&FileHandle,
FILE_APPEND_DATA,
&objectAttributes,
&IoStatus,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0 );

Sanjay
>-----Original Message-----
>From: Shaun [mailto:xxxxx@sdlabs.net]
>Sent: Monday, May 26, 2003 6:42 AM
>To: NT Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>You can write to files using the ZwCreateFile() &
>ZwWriteFile() kernel calls. If you want to just capture trace,
>simply use DbgPrint and either use a debugger (such as the DDK
>WinDbg or Numega SoftIce) or use a utility called DebugView
>from SysInternals (http://www.sysinternals.com/ntw2k/utilities.shtml)
>that will capture the DbgPrint and allow you to view/save it.
>
>Shaun
>
>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>
>TS> Hello,
>
>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>TS> calls) Is there any facility of printing messages to file
>in driver
>TS> code. ( For Debudding)
>
>TS> As i Couldn’t get any status (tracking) of the driver
>function, i am
>TS> interested in
>TS> getting track of the code.
>
>TS> Any help ?
>TS> Thanks in advance,
>TS> Tushar
>
>
>
>TS> —
>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>TS> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@neoteris.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@stratus.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@neoteris.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

I would just go with the kernel debugger idea someone else here mentioned or
WPP tracing/tracelog and not roll my own if possible.

Maybe a “what are you trying to accomplish” question is valid here.


Bill McKenzie
Compuware Corporation
Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
http://frontline.compuware.com/nashua/patches/utility.htm

“Sanjay Chadda” wrote in message news:xxxxx@ntdev…

Hi,
I am also working on sending some debug output to a file on disk. I am
using same ZwCreateFile() &
ZwWriteFile() kernel calls to do it. But I get a page fault on the call
to ZwCreateFile(). I am checking in code that I do this only if IRQL <=
DISPATCH_LEVEL.
Any ideas why page fault would occur?
I am using following code: maybe I am using some wrong flags or what??

InitializeObjectAttributes (&objectAttributes,

(PUNICODE_STRING)&fileName,

OBJ_CASE_INSENSITIVE,
NULL,
NULL );

status = ZwCreateFile(&FileHandle,
FILE_APPEND_DATA,
&objectAttributes,
&IoStatus,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0 );

Sanjay
>-----Original Message-----
>From: Shaun [mailto:xxxxx@sdlabs.net]
>Sent: Monday, May 26, 2003 6:42 AM
>To: NT Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>You can write to files using the ZwCreateFile() &
>ZwWriteFile() kernel calls. If you want to just capture trace,
>simply use DbgPrint and either use a debugger (such as the DDK
>WinDbg or Numega SoftIce) or use a utility called DebugView
>from SysInternals (http://www.sysinternals.com/ntw2k/utilities.shtml)
>that will capture the DbgPrint and allow you to view/save it.
>
>Shaun
>
>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>
>TS> Hello,
>
>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>TS> calls) Is there any facility of printing messages to file
>in driver
>TS> code. ( For Debudding)
>
>TS> As i Couldn’t get any status (tracking) of the driver
>function, i am
>TS> interested in
>TS> getting track of the code.
>
>TS> Any help ?
>TS> Thanks in advance,
>TS> Tushar
>
>
>
>TS> —
>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>TS> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@neoteris.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Well lets see:

  1. its too complicated and invasive - debug tracing has to be light-weight
    or the tracing so alters program behavior that it invalidates its own
    usefulness.

  2. equivalent, well designed functionality, already exists as WPP tracing,
    so you are re-inventing the wheel, and your wheel isn’t even a superior
    design.

  3. you need to build a front end spooler to handle log messages at IRQL >
    PASSIVE_LEVEL, so what appears to be a simple idea becomes complicated
    rather quickly, see (1) above.

  4. windbg will spool console output to a file. Perhaps that is all you
    really need?

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
Sent: Tuesday, August 05, 2003 6:25 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.

P.S. debug logging to a file directly from kernel mode is
generally a useless idea.

Why do you say this? Because of performance reasons?
Or maybe we can get the debug messages in the driver thru an IOCTL in user
mode app. The user mode App could then write to a file.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Tuesday, August 05, 2003 10:44 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

RTFM.

“Callers of ZwCreateFile must be running at IRQL =
PASSIVE_LEVEL.” “Callers of ZwWriteFile must be running at
IRQL = PASSIVE_LEVEL.”

P.S. debug logging to a file directly from kernel mode is
generally a useless idea.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
Sent: Tuesday, August 05, 2003 1:34 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Hi,
I am also working on sending some debug output to a file on
disk. I am using same ZwCreateFile() &
ZwWriteFile() kernel calls to do it. But I get a page fault on
the call to ZwCreateFile(). I am checking in code that I do
this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
would occur? I am using following
code: maybe I am using some wrong flags or what??

InitializeObjectAttributes (&objectAttributes,

(PUNICODE_STRING)&fileName,

OBJ_CASE_INSENSITIVE,
NULL,
NULL );

status = ZwCreateFile(&FileHandle,
FILE_APPEND_DATA,
&objectAttributes,
&IoStatus,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0 );

Sanjay
>-----Original Message-----
>From: Shaun [mailto:xxxxx@sdlabs.net]
>Sent: Monday, May 26, 2003 6:42 AM
>To: NT Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>You can write to files using the ZwCreateFile() &
>ZwWriteFile() kernel calls. If you want to just capture trace, simply
>use DbgPrint and either use a debugger (such as the DDK WinDbg or
>Numega SoftIce) or use a utility called DebugView from SysInternals
>(http://www.sysinternals.com/ntw2k/utilities.shtml)
>that will capture the DbgPrint and allow you to view/save it.
>
>Shaun
>
>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>
>TS> Hello,
>
>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>TS> calls) Is there any facility of printing messages to file
>in driver
>TS> code. ( For Debudding)
>
>TS> As i Couldn’t get any status (tracking) of the driver
>function, i am
>TS> interested in
>TS> getting track of the code.
>
>TS> Any help ?
>TS> Thanks in advance,
>TS> Tushar
>
>
>
>TS> —
>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>TS> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@neoteris.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@stratus.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@neoteris.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@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Here is what I am looking for to implement:

We have a driver packaged into a product. It gets installed on
customer’s machine and sometimes things are
Not working. It could be due to some failure case in driver, but we will
never know that unless we log those debug messages coming out of the
driver. So, I need to log those DbgPrint messages somewhere which the
customer could pass on to us and we can take a look at them. That’s why
I thought of implementing a scheme where we can put those debug messages
to a file.

Also, I tried WPP tracing and its too cumbersome. To get the errors in
human readable form, one needs to run tools from DDK like - tracelog,
tracefmt, traceview, etc…

Now, for an end user customer deploying this product, we don’t expect
that he will be running these tools from DDK (which means he needs to
have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
convince customers to have these tools installed on their machine.

What I am looking for is, when somehting fails, the customer sends us a
log file (which has all debug messages logged from the driver) and then
I look up in source code to figure out what went wrong.

Sanjay

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, August 06, 2003 6:28 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Well lets see:

  1. its too complicated and invasive - debug tracing has to be
    light-weight or the tracing so alters program behavior that it
    invalidates its own usefulness.

  2. equivalent, well designed functionality, already exists as
    WPP tracing, so you are re-inventing the wheel, and your wheel
    isn’t even a superior design.

  3. you need to build a front end spooler to handle log
    messages at IRQL > PASSIVE_LEVEL, so what appears to be a
    simple idea becomes complicated rather quickly, see (1) above.

  4. windbg will spool console output to a file. Perhaps that is
    all you really need?

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
Sent: Tuesday, August 05, 2003 6:25 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.

>P.S. debug logging to a file directly from kernel mode is generally a
>useless idea.

Why do you say this? Because of performance reasons?
Or maybe we can get the debug messages in the driver thru an
IOCTL in user mode app. The user mode App could then write to a file.

>-----Original Message-----
>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>Sent: Tuesday, August 05, 2003 10:44 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>
>RTFM.
>
>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
>
>P.S. debug logging to a file directly from kernel mode is generally a
>useless idea.
>
>
>=====================
>Mark Roddy
>Hollis Technology Solutions
>www.hollistech.com
>xxxxx@hollistech.com
>
>
>-----Original Message-----
>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>Sent: Tuesday, August 05, 2003 1:34 PM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Hi,
>I am also working on sending some debug output to a file on
disk. I am
>using same ZwCreateFile() &
>ZwWriteFile() kernel calls to do it. But I get a page fault on
>the call to ZwCreateFile(). I am checking in code that I do
>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
>would occur? I am using following
>code: maybe I am using some wrong flags or what??
>
> InitializeObjectAttributes (&objectAttributes,
>
>(PUNICODE_STRING)&fileName,
>
>OBJ_CASE_INSENSITIVE,
> NULL,
> NULL );
>
> status = ZwCreateFile(&FileHandle,
> FILE_APPEND_DATA,
> &objectAttributes,
> &IoStatus,
> 0,
> FILE_ATTRIBUTE_NORMAL,
> FILE_SHARE_WRITE,
> FILE_OPEN_IF,
> FILE_SYNCHRONOUS_IO_NONALERT,
> NULL,
> 0 );
>
>Sanjay
>>-----Original Message-----
>>From: Shaun [mailto:xxxxx@sdlabs.net]
>>Sent: Monday, May 26, 2003 6:42 AM
>>To: NT Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>You can write to files using the ZwCreateFile() &
>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
>>Numega SoftIce) or use a utility called DebugView from SysInternals
>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
>>that will capture the DbgPrint and allow you to view/save it.
>>
>>Shaun
>>
>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>>
>>TS> Hello,
>>
>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>>TS> calls) Is there any facility of printing messages to file
>>in driver
>>TS> code. ( For Debudding)
>>
>>TS> As i Couldn’t get any status (tracking) of the driver
>>function, i am
>>TS> interested in
>>TS> getting track of the code.
>>
>>TS> Any help ?
>>TS> Thanks in advance,
>>TS> Tushar
>>
>>
>>
>>TS> —
>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>>TS> unsubscribe send a blank email to
xxxxx@lists.osr.com
>>
>>
>>
>>—
>>You are currently subscribed to ntdev as: xxxxx@neoteris.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@stratus.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@neoteris.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@stratus.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@neoteris.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

This raises an interesting issue or maybe it doesn’t:

My first reaction was to say to you, just ship the necessary tools to the
customer, like tracelog with a script or something to make WPP tracing easy
to use for your customer. However, sending tracelog to anyone would
obviously violate the DDK license agreement that each of us agreed to when
installing the DDK. So, the whole WPP tracing setup seems useless in
regards to what it was designed for in this and probably many other cases.
Or did I miss a special prevision in the DDK license agreement?


Bill McKenzie
Compuware Corporation
Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
http://frontline.compuware.com/nashua/patches/utility.htm

“Sanjay Chadda” wrote in message news:xxxxx@ntdev…

Here is what I am looking for to implement:

We have a driver packaged into a product. It gets installed on
customer’s machine and sometimes things are
Not working. It could be due to some failure case in driver, but we will
never know that unless we log those debug messages coming out of the
driver. So, I need to log those DbgPrint messages somewhere which the
customer could pass on to us and we can take a look at them. That’s why
I thought of implementing a scheme where we can put those debug messages
to a file.

Also, I tried WPP tracing and its too cumbersome. To get the errors in
human readable form, one needs to run tools from DDK like - tracelog,
tracefmt, traceview, etc…

Now, for an end user customer deploying this product, we don’t expect
that he will be running these tools from DDK (which means he needs to
have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
convince customers to have these tools installed on their machine.

What I am looking for is, when somehting fails, the customer sends us a
log file (which has all debug messages logged from the driver) and then
I look up in source code to figure out what went wrong.

Sanjay

>-----Original Message-----
>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>Sent: Wednesday, August 06, 2003 6:28 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Well lets see:
>
>1) its too complicated and invasive - debug tracing has to be
>light-weight or the tracing so alters program behavior that it
>invalidates its own usefulness.
>
>2) equivalent, well designed functionality, already exists as
>WPP tracing, so you are re-inventing the wheel, and your wheel
>isn’t even a superior design.
>
>3) you need to build a front end spooler to handle log
>messages at IRQL > PASSIVE_LEVEL, so what appears to be a
>simple idea becomes complicated rather quickly, see (1) above.
>
>4) windbg will spool console output to a file. Perhaps that is
>all you really need?
>
>
>
>=====================
>Mark Roddy
>Hollis Technology Solutions
>www.hollistech.com
>xxxxx@hollistech.com
>
>
>-----Original Message-----
>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>Sent: Tuesday, August 05, 2003 6:25 PM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>
>Why do you say this? Because of performance reasons?
>Or maybe we can get the debug messages in the driver thru an
>IOCTL in user mode app. The user mode App could then write to a file.
>
>
>>-----Original Message-----
>>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>>Sent: Tuesday, August 05, 2003 10:44 AM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>
>>RTFM.
>>
>>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
>>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
>>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>>
>>
>>=====================
>>Mark Roddy
>>Hollis Technology Solutions
>>www.hollistech.com
>>xxxxx@hollistech.com
>>
>>
>>-----Original Message-----
>>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>>Sent: Tuesday, August 05, 2003 1:34 PM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>Hi,
>>I am also working on sending some debug output to a file on
>disk. I am
>>using same ZwCreateFile() &
>>ZwWriteFile() kernel calls to do it. But I get a page fault on
>>the call to ZwCreateFile(). I am checking in code that I do
>>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
>>would occur? I am using following
>>code: maybe I am using some wrong flags or what??
>>
>> InitializeObjectAttributes (&objectAttributes,
>>
>>(PUNICODE_STRING)&fileName,
>>
>>OBJ_CASE_INSENSITIVE,
>> NULL,
>> NULL );
>>
>> status = ZwCreateFile(&FileHandle,
>> FILE_APPEND_DATA,
>> &objectAttributes,
>> &IoStatus,
>> 0,
>> FILE_ATTRIBUTE_NORMAL,
>> FILE_SHARE_WRITE,
>> FILE_OPEN_IF,
>> FILE_SYNCHRONOUS_IO_NONALERT,
>> NULL,
>> 0 );
>>
>>Sanjay
>>>-----Original Message-----
>>>From: Shaun [mailto:xxxxx@sdlabs.net]
>>>Sent: Monday, May 26, 2003 6:42 AM
>>>To: NT Developers Interest List
>>>Subject: [ntdev] Re: Debugging
>>>
>>>
>>>You can write to files using the ZwCreateFile() &
>>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
>>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
>>>Numega SoftIce) or use a utility called DebugView from SysInternals
>>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
>>>that will capture the DbgPrint and allow you to view/save it.
>>>
>>>Shaun
>>>
>>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>>>
>>>TS> Hello,
>>>
>>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>>>TS> calls) Is there any facility of printing messages to file
>>>in driver
>>>TS> code. ( For Debudding)
>>>
>>>TS> As i Couldn’t get any status (tracking) of the driver
>>>function, i am
>>>TS> interested in
>>>TS> getting track of the code.
>>>
>>>TS> Any help ?
>>>TS> Thanks in advance,
>>>TS> Tushar
>>>
>>>
>>>
>>>TS> —
>>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>>>TS> unsubscribe send a blank email to
>xxxxx@lists.osr.com
>>>
>>>
>>>
>>>—
>>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
>>
>>You are currently
>>subscribed to ntdev as:
>>xxxxx@stratus.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=&gt;256
>>
>>You are currently
>>subscribed to ntdev as:
>>xxxxx@neoteris.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@stratus.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=&gt;256
>
>You are currently
>subscribed to ntdev as:
>xxxxx@neoteris.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>

You can pawn off log strings to a worker thread or a user mode app to
write out to a file. Not too difficult, just a lot of coding. You aren’t
guaranteed to see the last N strings (where N is some arbitrary number)
in the case of BSOD, of course. If the customer is BSODing and he’s able
to give you the crash dump, consider placing log strings in a circular
memory buffer you can examine post-mortem.

Sanjay Chadda wrote:

Here is what I am looking for to implement:

We have a driver packaged into a product. It gets installed on
customer’s machine and sometimes things are
Not working. It could be due to some failure case in driver, but we will
never know that unless we log those debug messages coming out of the
driver. So, I need to log those DbgPrint messages somewhere which the
customer could pass on to us and we can take a look at them. That’s why
I thought of implementing a scheme where we can put those debug messages
to a file.

Also, I tried WPP tracing and its too cumbersome. To get the errors in
human readable form, one needs to run tools from DDK like - tracelog,
tracefmt, traceview, etc…

Now, for an end user customer deploying this product, we don’t expect
that he will be running these tools from DDK (which means he needs to
have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
convince customers to have these tools installed on their machine.

What I am looking for is, when somehting fails, the customer sends us a
log file (which has all debug messages logged from the driver) and then
I look up in source code to figure out what went wrong.

Sanjay

>-----Original Message-----
>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>Sent: Wednesday, August 06, 2003 6:28 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Well lets see:
>
>1) its too complicated and invasive - debug tracing has to be
>light-weight or the tracing so alters program behavior that it
>invalidates its own usefulness.
>
>2) equivalent, well designed functionality, already exists as
>WPP tracing, so you are re-inventing the wheel, and your wheel
>isn’t even a superior design.
>
>3) you need to build a front end spooler to handle log
>messages at IRQL > PASSIVE_LEVEL, so what appears to be a
>simple idea becomes complicated rather quickly, see (1) above.
>
>4) windbg will spool console output to a file. Perhaps that is
>all you really need?
>
>
>
>=====================
>Mark Roddy
>Hollis Technology Solutions
>www.hollistech.com
>xxxxx@hollistech.com
>
>
>-----Original Message-----
>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>Sent: Tuesday, August 05, 2003 6:25 PM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
>
>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>
>Why do you say this? Because of performance reasons?
>Or maybe we can get the debug messages in the driver thru an
>IOCTL in user mode app. The user mode App could then write to a file.
>
>
>
>>-----Original Message-----
>>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>>Sent: Tuesday, August 05, 2003 10:44 AM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>
>>RTFM.
>>
>>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
>>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
>>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>>
>>
>>=====================
>>Mark Roddy
>>Hollis Technology Solutions
>>www.hollistech.com
>>xxxxx@hollistech.com
>>
>>
>>-----Original Message-----
>>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>>Sent: Tuesday, August 05, 2003 1:34 PM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>Hi,
>>I am also working on sending some debug output to a file on
>
>disk. I am
>
>>using same ZwCreateFile() &
>>ZwWriteFile() kernel calls to do it. But I get a page fault on
>>the call to ZwCreateFile(). I am checking in code that I do
>>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
>>would occur? I am using following
>>code: maybe I am using some wrong flags or what??
>>
>> InitializeObjectAttributes (&objectAttributes,
>>
>>(PUNICODE_STRING)&fileName,
>>
>>OBJ_CASE_INSENSITIVE,
>> NULL,
>> NULL );
>>
>> status = ZwCreateFile(&FileHandle,
>> FILE_APPEND_DATA,
>> &objectAttributes,
>> &IoStatus,
>> 0,
>> FILE_ATTRIBUTE_NORMAL,
>> FILE_SHARE_WRITE,
>> FILE_OPEN_IF,
>> FILE_SYNCHRONOUS_IO_NONALERT,
>> NULL,
>> 0 );
>>
>>Sanjay
>>
>>>-----Original Message-----
>>>From: Shaun [mailto:xxxxx@sdlabs.net]
>>>Sent: Monday, May 26, 2003 6:42 AM
>>>To: NT Developers Interest List
>>>Subject: [ntdev] Re: Debugging
>>>
>>>
>>>You can write to files using the ZwCreateFile() &
>>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
>>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
>>>Numega SoftIce) or use a utility called DebugView from SysInternals
>>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
>>>that will capture the DbgPrint and allow you to view/save it.
>>>
>>>Shaun
>>>
>>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>>>
>>>TS> Hello,
>>>
>>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>>>TS> calls) Is there any facility of printing messages to file
>>>in driver
>>>TS> code. ( For Debudding)
>>>
>>>TS> As i Couldn’t get any status (tracking) of the driver
>>>function, i am
>>>TS> interested in
>>>TS> getting track of the code.
>>>
>>>TS> Any help ?
>>>TS> Thanks in advance,
>>>TS> Tushar
>>>
>>>
>>>
>>>TS> —
>>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>>>TS> unsubscribe send a blank email to
>
>xxxxx@lists.osr.com
>
>>>
>>>
>>>—
>>>You are currently subscribed to ntdev as: xxxxx@neoteris.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@stratus.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@neoteris.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@stratus.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@neoteris.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@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

  • Nick Ryan (MVP for DDK)

That’s the point of WPP tracing. Your customer *doesn’t* have to have all
that stuff. You send your customer a very limited toolset, your customer
sends you binary trace that is essentially unreadable, and *you* process it
to get the debug info you need. Please look at WPP tracing again.
Especially, look at the OSR articles:
http://www.osronline.com/article.cfm?id=200
http://www.osronline.com/article.cfm?id=213

Phil

Philip D. Barila Windows DDK MVP
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

“Sanjay Chadda” wrote in message news:xxxxx@ntdev…

Here is what I am looking for to implement:

We have a driver packaged into a product. It gets installed on
customer’s machine and sometimes things are
Not working. It could be due to some failure case in driver, but we will
never know that unless we log those debug messages coming out of the
driver. So, I need to log those DbgPrint messages somewhere which the
customer could pass on to us and we can take a look at them. That’s why
I thought of implementing a scheme where we can put those debug messages
to a file.

Also, I tried WPP tracing and its too cumbersome. To get the errors in
human readable form, one needs to run tools from DDK like - tracelog,
tracefmt, traceview, etc…

Now, for an end user customer deploying this product, we don’t expect
that he will be running these tools from DDK (which means he needs to
have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
convince customers to have these tools installed on their machine.

What I am looking for is, when somehting fails, the customer sends us a
log file (which has all debug messages logged from the driver) and then
I look up in source code to figure out what went wrong.

Sanjay

>-----Original Message-----
>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>Sent: Wednesday, August 06, 2003 6:28 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Well lets see:
>
>1) its too complicated and invasive - debug tracing has to be
>light-weight or the tracing so alters program behavior that it
>invalidates its own usefulness.
>
>2) equivalent, well designed functionality, already exists as
>WPP tracing, so you are re-inventing the wheel, and your wheel
>isn’t even a superior design.
>
>3) you need to build a front end spooler to handle log
>messages at IRQL > PASSIVE_LEVEL, so what appears to be a
>simple idea becomes complicated rather quickly, see (1) above.
>
>4) windbg will spool console output to a file. Perhaps that is
>all you really need?
>
>
>
>=====================
>Mark Roddy
>Hollis Technology Solutions
>www.hollistech.com
>xxxxx@hollistech.com
>
>
>-----Original Message-----
>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>Sent: Tuesday, August 05, 2003 6:25 PM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>
>Why do you say this? Because of performance reasons?
>Or maybe we can get the debug messages in the driver thru an
>IOCTL in user mode app. The user mode App could then write to a file.
>
>
>>-----Original Message-----
>>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>>Sent: Tuesday, August 05, 2003 10:44 AM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>
>>RTFM.
>>
>>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
>>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
>>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>>
>>
>>=====================
>>Mark Roddy
>>Hollis Technology Solutions
>>www.hollistech.com
>>xxxxx@hollistech.com
>>
>>
>>-----Original Message-----
>>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>>Sent: Tuesday, August 05, 2003 1:34 PM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>Hi,
>>I am also working on sending some debug output to a file on
>disk. I am
>>using same ZwCreateFile() &
>>ZwWriteFile() kernel calls to do it. But I get a page fault on
>>the call to ZwCreateFile(). I am checking in code that I do
>>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
>>would occur? I am using following
>>code: maybe I am using some wrong flags or what??
>>
>> InitializeObjectAttributes (&objectAttributes,
>>
>>(PUNICODE_STRING)&fileName,
>>
>>OBJ_CASE_INSENSITIVE,
>> NULL,
>> NULL );
>>
>> status = ZwCreateFile(&FileHandle,
>> FILE_APPEND_DATA,
>> &objectAttributes,
>> &IoStatus,
>> 0,
>> FILE_ATTRIBUTE_NORMAL,
>> FILE_SHARE_WRITE,
>> FILE_OPEN_IF,
>> FILE_SYNCHRONOUS_IO_NONALERT,
>> NULL,
>> 0 );
>>
>>Sanjay
>>>-----Original Message-----
>>>From: Shaun [mailto:xxxxx@sdlabs.net]
>>>Sent: Monday, May 26, 2003 6:42 AM
>>>To: NT Developers Interest List
>>>Subject: [ntdev] Re: Debugging
>>>
>>>
>>>You can write to files using the ZwCreateFile() &
>>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
>>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
>>>Numega SoftIce) or use a utility called DebugView from SysInternals
>>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
>>>that will capture the DbgPrint and allow you to view/save it.
>>>
>>>Shaun
>>>
>>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>>>
>>>TS> Hello,
>>>
>>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>>>TS> calls) Is there any facility of printing messages to file
>>>in driver
>>>TS> code. ( For Debudding)
>>>
>>>TS> As i Couldn’t get any status (tracking) of the driver
>>>function, i am
>>>TS> interested in
>>>TS> getting track of the code.
>>>
>>>TS> Any help ?
>>>TS> Thanks in advance,
>>>TS> Tushar
>>>
>>>
>>>
>>>TS> —
>>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>>>TS> unsubscribe send a blank email to
>xxxxx@lists.osr.com
>>>
>>>
>>>
>>>—
>>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
>>
>>You are currently
>>subscribed to ntdev as:
>>xxxxx@stratus.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=&gt;256
>>
>>You are currently
>>subscribed to ntdev as:
>>xxxxx@neoteris.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@stratus.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=&gt;256
>
>You are currently
>subscribed to ntdev as:
>xxxxx@neoteris.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Tell your customer to install this:

DebugMon (http://www.osronline.com/article.cfm?id=99)

Then ask him to save the output and send you the file.

Mat

-----Original Message-----
From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
Sent: Wednesday, August 06, 2003 12:58 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Here is what I am looking for to implement:

We have a driver packaged into a product. It gets installed on
customer’s machine and sometimes things are
Not working. It could be due to some failure case in driver, but we will
never know that unless we log those debug messages coming out of the
driver. So, I need to log those DbgPrint messages somewhere which the
customer could pass on to us and we can take a look at them. That’s why
I thought of implementing a scheme where we can put those debug messages
to a file.

Also, I tried WPP tracing and its too cumbersome. To get the errors in
human readable form, one needs to run tools from DDK like - tracelog,
tracefmt, traceview, etc…

Now, for an end user customer deploying this product, we don’t expect
that he will be running these tools from DDK (which means he needs to
have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
convince customers to have these tools installed on their machine.

What I am looking for is, when somehting fails, the customer sends us a
log file (which has all debug messages logged from the driver) and then
I look up in source code to figure out what went wrong.

Sanjay

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, August 06, 2003 6:28 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Well lets see:

  1. its too complicated and invasive - debug tracing has to be
    light-weight or the tracing so alters program behavior that it
    invalidates its own usefulness.

  2. equivalent, well designed functionality, already exists as
    WPP tracing, so you are re-inventing the wheel, and your wheel
    isn’t even a superior design.

  3. you need to build a front end spooler to handle log
    messages at IRQL > PASSIVE_LEVEL, so what appears to be a
    simple idea becomes complicated rather quickly, see (1) above.

  4. windbg will spool console output to a file. Perhaps that is
    all you really need?

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
Sent: Tuesday, August 05, 2003 6:25 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.

>P.S. debug logging to a file directly from kernel mode is generally a
>useless idea.

Why do you say this? Because of performance reasons?
Or maybe we can get the debug messages in the driver thru an
IOCTL in user mode app. The user mode App could then write to a file.

>-----Original Message-----
>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>Sent: Tuesday, August 05, 2003 10:44 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>
>RTFM.
>
>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
>
>P.S. debug logging to a file directly from kernel mode is generally a
>useless idea.
>
>
>=====================
>Mark Roddy
>Hollis Technology Solutions
>www.hollistech.com
>xxxxx@hollistech.com
>
>
>-----Original Message-----
>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>Sent: Tuesday, August 05, 2003 1:34 PM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Hi,
>I am also working on sending some debug output to a file on
disk. I am
>using same ZwCreateFile() &
>ZwWriteFile() kernel calls to do it. But I get a page fault on
>the call to ZwCreateFile(). I am checking in code that I do
>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
>would occur? I am using following
>code: maybe I am using some wrong flags or what??
>
> InitializeObjectAttributes (&objectAttributes,
>
>(PUNICODE_STRING)&fileName,
>
>OBJ_CASE_INSENSITIVE,
> NULL,
> NULL );
>
> status = ZwCreateFile(&FileHandle,
> FILE_APPEND_DATA,
> &objectAttributes,
> &IoStatus,
> 0,
> FILE_ATTRIBUTE_NORMAL,
> FILE_SHARE_WRITE,
> FILE_OPEN_IF,
> FILE_SYNCHRONOUS_IO_NONALERT,
> NULL,
> 0 );
>
>Sanjay
>>-----Original Message-----
>>From: Shaun [mailto:xxxxx@sdlabs.net]
>>Sent: Monday, May 26, 2003 6:42 AM
>>To: NT Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>You can write to files using the ZwCreateFile() &
>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
>>Numega SoftIce) or use a utility called DebugView from SysInternals
>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
>>that will capture the DbgPrint and allow you to view/save it.
>>
>>Shaun
>>
>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>>
>>TS> Hello,
>>
>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>>TS> calls) Is there any facility of printing messages to file
>>in driver
>>TS> code. ( For Debudding)
>>
>>TS> As i Couldn’t get any status (tracking) of the driver
>>function, i am
>>TS> interested in
>>TS> getting track of the code.
>>
>>TS> Any help ?
>>TS> Thanks in advance,
>>TS> Tushar
>>
>>
>>
>>TS> —
>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>>TS> unsubscribe send a blank email to
xxxxx@lists.osr.com
>>
>>
>>
>>—
>>You are currently subscribed to ntdev as: xxxxx@neoteris.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@stratus.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@neoteris.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@stratus.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@neoteris.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@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Well since tracelog is freely available on the Microsoft site
http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=55e5
1b3b-6c26-4ca0-abf1-0e51d92b8298 and the sources are in the SDK one can get
around you supposed problem.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: “Bill McKenzie”
Newsgroups: ntdev
To: “Windows System Software Developers Interest List”
Sent: Wednesday, August 06, 2003 1:27 PM
Subject: [ntdev] Re: Debugging

>
> This raises an interesting issue or maybe it doesn’t:
>
> My first reaction was to say to you, just ship the necessary tools to the
> customer, like tracelog with a script or something to make WPP tracing
easy
> to use for your customer. However, sending tracelog to anyone would
> obviously violate the DDK license agreement that each of us agreed to when
> installing the DDK. So, the whole WPP tracing setup seems useless in
> regards to what it was designed for in this and probably many other cases.
> Or did I miss a special prevision in the DDK license agreement?
>
> –
> Bill McKenzie
> Compuware Corporation
> Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
> http://frontline.compuware.com/nashua/patches/utility.htm
>
>
>
> “Sanjay Chadda” wrote in message
news:xxxxx@ntdev…
>
> Here is what I am looking for to implement:
>
> We have a driver packaged into a product. It gets installed on
> customer’s machine and sometimes things are
> Not working. It could be due to some failure case in driver, but we will
> never know that unless we log those debug messages coming out of the
> driver. So, I need to log those DbgPrint messages somewhere which the
> customer could pass on to us and we can take a look at them. That’s why
> I thought of implementing a scheme where we can put those debug messages
> to a file.
>
> Also, I tried WPP tracing and its too cumbersome. To get the errors in
> human readable form, one needs to run tools from DDK like - tracelog,
> tracefmt, traceview, etc…
>
> Now, for an end user customer deploying this product, we don’t expect
> that he will be running these tools from DDK (which means he needs to
> have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
> convince customers to have these tools installed on their machine.
>
> What I am looking for is, when somehting fails, the customer sends us a
> log file (which has all debug messages logged from the driver) and then
> I look up in source code to figure out what went wrong.
>
> Sanjay
>
> >-----Original Message-----
> >From: Roddy, Mark [mailto:xxxxx@stratus.com]
> >Sent: Wednesday, August 06, 2003 6:28 AM
> >To: Windows System Software Developers Interest List
> >Subject: [ntdev] Re: Debugging
> >
> >
> >Well lets see:
> >
> >1) its too complicated and invasive - debug tracing has to be
> >light-weight or the tracing so alters program behavior that it
> >invalidates its own usefulness.
> >
> >2) equivalent, well designed functionality, already exists as
> >WPP tracing, so you are re-inventing the wheel, and your wheel
> >isn’t even a superior design.
> >
> >3) you need to build a front end spooler to handle log
> >messages at IRQL > PASSIVE_LEVEL, so what appears to be a
> >simple idea becomes complicated rather quickly, see (1) above.
> >
> >4) windbg will spool console output to a file. Perhaps that is
> >all you really need?
> >
> >
> >
> >=====================
> >Mark Roddy
> >Hollis Technology Solutions
> >www.hollistech.com
> >xxxxx@hollistech.com
> >
> >
> >-----Original Message-----
> >From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> >Sent: Tuesday, August 05, 2003 6:25 PM
> >To: Windows System Software Developers Interest List
> >Subject: [ntdev] Re: Debugging
> >
> >
> >Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
> >
> >>P.S. debug logging to a file directly from kernel mode is generally a
> >>useless idea.
> >
> >Why do you say this? Because of performance reasons?
> >Or maybe we can get the debug messages in the driver thru an
> >IOCTL in user mode app. The user mode App could then write to a file.
> >
> >
> >>-----Original Message-----
> >>From: Roddy, Mark [mailto:xxxxx@stratus.com]
> >>Sent: Tuesday, August 05, 2003 10:44 AM
> >>To: Windows System Software Developers Interest List
> >>Subject: [ntdev] Re: Debugging
> >>
> >>
> >>
> >>RTFM.
> >>
> >>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
> >>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
> >>
> >>P.S. debug logging to a file directly from kernel mode is generally a
> >>useless idea.
> >>
> >>
> >>=====================
> >>Mark Roddy
> >>Hollis Technology Solutions
> >>www.hollistech.com
> >>xxxxx@hollistech.com
> >>
> >>
> >>-----Original Message-----
> >>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> >>Sent: Tuesday, August 05, 2003 1:34 PM
> >>To: Windows System Software Developers Interest List
> >>Subject: [ntdev] Re: Debugging
> >>
> >>
> >>Hi,
> >>I am also working on sending some debug output to a file on
> >disk. I am
> >>using same ZwCreateFile() &
> >>ZwWriteFile() kernel calls to do it. But I get a page fault on
> >>the call to ZwCreateFile(). I am checking in code that I do
> >>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
> >>would occur? I am using following
> >>code: maybe I am using some wrong flags or what??
> >>
> >> InitializeObjectAttributes (&objectAttributes,
> >>
> >>(PUNICODE_STRING)&fileName,
> >>
> >>OBJ_CASE_INSENSITIVE,
> >> NULL,
> >> NULL );
> >>
> >> status = ZwCreateFile(&FileHandle,
> >> FILE_APPEND_DATA,
> >> &objectAttributes,
> >> &IoStatus,
> >> 0,
> >> FILE_ATTRIBUTE_NORMAL,
> >> FILE_SHARE_WRITE,
> >> FILE_OPEN_IF,
> >> FILE_SYNCHRONOUS_IO_NONALERT,
> >> NULL,
> >> 0 );
> >>
> >>Sanjay
> >>>-----Original Message-----
> >>>From: Shaun [mailto:xxxxx@sdlabs.net]
> >>>Sent: Monday, May 26, 2003 6:42 AM
> >>>To: NT Developers Interest List
> >>>Subject: [ntdev] Re: Debugging
> >>>
> >>>
> >>>You can write to files using the ZwCreateFile() &
> >>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
> >>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
> >>>Numega SoftIce) or use a utility called DebugView from SysInternals
> >>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
> >>>that will capture the DbgPrint and allow you to view/save it.
> >>>
> >>>Shaun
> >>>
> >>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
> >>>
> >>>TS> Hello,
> >>>
> >>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
> >>>TS> calls) Is there any facility of printing messages to file
> >>>in driver
> >>>TS> code. ( For Debudding)
> >>>
> >>>TS> As i Couldn’t get any status (tracking) of the driver
> >>>function, i am
> >>>TS> interested in
> >>>TS> getting track of the code.
> >>>
> >>>TS> Any help ?
> >>>TS> Thanks in advance,
> >>>TS> Tushar
> >>>
> >>>
> >>>
> >>>TS> —
> >>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
> >>>TS> unsubscribe send a blank email to
> >xxxxx@lists.osr.com
> >>>
> >>>
> >>>
> >>>—
> >>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
> >>
> >>You are currently
> >>subscribed to ntdev as:
> >>xxxxx@stratus.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=&gt;256
> >>
> >>You are currently
> >>subscribed to ntdev as:
> >>xxxxx@neoteris.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@stratus.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=&gt;256
> >
> >You are currently
> >subscribed to ntdev as:
> >xxxxx@neoteris.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@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Good point. Maybe there is some ‘redistributables’ exemption in the DDK?

Anyhow, ignoring WPP, logging to a file from kernel mode still has issues,
like it is a 500lb gorilla of a tool to foist on a customer. If you just
want trace execution history, consider a lightweight version of WPP that
uses a ringbuffer to store thread id and function entry/exit information
encoded in some minimal format, and provide a tool to fetch the ringbuffer
from the kernel and save it to disk on a regular basis. You can then layer
your own tool on top of that to analyze the saved ringbuffer information
back into human friendly format.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Bill McKenzie [mailto:xxxxx@compuware.com]
Sent: Wednesday, August 06, 2003 1:27 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Debugging

This raises an interesting issue or maybe it doesn’t:

My first reaction was to say to you, just ship the necessary tools to the
customer, like tracelog with a script or something to make WPP tracing easy
to use for your customer. However, sending tracelog to anyone would
obviously violate the DDK license agreement that each of us agreed to when
installing the DDK. So, the whole WPP tracing setup seems useless in
regards to what it was designed for in this and probably many other cases.
Or did I miss a special prevision in the DDK license agreement?


Bill McKenzie
Compuware Corporation
Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
http://frontline.compuware.com/nashua/patches/utility.htm

“Sanjay Chadda” wrote in message news:xxxxx@ntdev…

Here is what I am looking for to implement:

We have a driver packaged into a product. It gets installed on customer’s
machine and sometimes things are Not working. It could be due to some
failure case in driver, but we will never know that unless we log those
debug messages coming out of the driver. So, I need to log those DbgPrint
messages somewhere which the customer could pass on to us and we can take a
look at them. That’s why I thought of implementing a scheme where we can put
those debug messages to a file.

Also, I tried WPP tracing and its too cumbersome. To get the errors in human
readable form, one needs to run tools from DDK like - tracelog, tracefmt,
traceview, etc…

Now, for an end user customer deploying this product, we don’t expect that
he will be running these tools from DDK (which means he needs to have DDK
installed) or WINDBG also (as pointed in case 4). Its hard to convince
customers to have these tools installed on their machine.

What I am looking for is, when somehting fails, the customer sends us a log
file (which has all debug messages logged from the driver) and then I look
up in source code to figure out what went wrong.

Sanjay

>-----Original Message-----
>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>Sent: Wednesday, August 06, 2003 6:28 AM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Well lets see:
>
>1) its too complicated and invasive - debug tracing has to be
>light-weight or the tracing so alters program behavior that it
>invalidates its own usefulness.
>
>2) equivalent, well designed functionality, already exists as WPP
>tracing, so you are re-inventing the wheel, and your wheel isn’t even a
>superior design.
>
>3) you need to build a front end spooler to handle log messages at IRQL
>> PASSIVE_LEVEL, so what appears to be a simple idea becomes
>complicated rather quickly, see (1) above.
>
>4) windbg will spool console output to a file. Perhaps that is all you
>really need?
>
>
>
>=====================
>Mark Roddy
>Hollis Technology Solutions
>www.hollistech.com
>xxxxx@hollistech.com
>
>
>-----Original Message-----
>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>Sent: Tuesday, August 05, 2003 6:25 PM
>To: Windows System Software Developers Interest List
>Subject: [ntdev] Re: Debugging
>
>
>Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>
>Why do you say this? Because of performance reasons?
>Or maybe we can get the debug messages in the driver thru an IOCTL in
>user mode app. The user mode App could then write to a file.
>
>
>>-----Original Message-----
>>From: Roddy, Mark [mailto:xxxxx@stratus.com]
>>Sent: Tuesday, August 05, 2003 10:44 AM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>
>>RTFM.
>>
>>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
>>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
>>
>>P.S. debug logging to a file directly from kernel mode is generally a
>>useless idea.
>>
>>
>>=====================
>>Mark Roddy
>>Hollis Technology Solutions
>>www.hollistech.com
>>xxxxx@hollistech.com
>>
>>
>>-----Original Message-----
>>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
>>Sent: Tuesday, August 05, 2003 1:34 PM
>>To: Windows System Software Developers Interest List
>>Subject: [ntdev] Re: Debugging
>>
>>
>>Hi,
>>I am also working on sending some debug output to a file on
>disk. I am
>>using same ZwCreateFile() &
>>ZwWriteFile() kernel calls to do it. But I get a page fault on the
>>call to ZwCreateFile(). I am checking in code that I do this only if
>>IRQL <= DISPATCH_LEVEL. Any ideas why page fault would occur? I am
>>using following
>>code: maybe I am using some wrong flags or what??
>>
>> InitializeObjectAttributes (&objectAttributes,
>>
>>(PUNICODE_STRING)&fileName,
>>
>>OBJ_CASE_INSENSITIVE,
>> NULL,
>> NULL );
>>
>> status = ZwCreateFile(&FileHandle,
>> FILE_APPEND_DATA,
>> &objectAttributes,
>> &IoStatus,
>> 0,
>> FILE_ATTRIBUTE_NORMAL,
>> FILE_SHARE_WRITE,
>> FILE_OPEN_IF,
>> FILE_SYNCHRONOUS_IO_NONALERT,
>> NULL,
>> 0 );
>>
>>Sanjay
>>>-----Original Message-----
>>>From: Shaun [mailto:xxxxx@sdlabs.net]
>>>Sent: Monday, May 26, 2003 6:42 AM
>>>To: NT Developers Interest List
>>>Subject: [ntdev] Re: Debugging
>>>
>>>
>>>You can write to files using the ZwCreateFile() &
>>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
>>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
>>>Numega SoftIce) or use a utility called DebugView from SysInternals
>>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
>>>that will capture the DbgPrint and allow you to view/save it.
>>>
>>>Shaun
>>>
>>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
>>>
>>>TS> Hello,
>>>
>>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
>>>TS> calls) Is there any facility of printing messages to file
>>>in driver
>>>TS> code. ( For Debudding)
>>>
>>>TS> As i Couldn’t get any status (tracking) of the driver
>>>function, i am
>>>TS> interested in
>>>TS> getting track of the code.
>>>
>>>TS> Any help ?
>>>TS> Thanks in advance,
>>>TS> Tushar
>>>
>>>
>>>
>>>TS> —
>>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
>>>TS> unsubscribe send a blank email to
>xxxxx@lists.osr.com
>>>
>>>
>>>
>>>—
>>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
>>
>>You are currently
>>subscribed to ntdev as:
>>xxxxx@stratus.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=&gt;256
>>
>>You are currently
>>subscribed to ntdev as:
>>xxxxx@neoteris.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@stratus.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=&gt;256
>
>You are currently
>subscribed to ntdev as:
>xxxxx@neoteris.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@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

> Please look at WPP tracing again.

Especially, look at the OSR articles:
http://www.osronline.com/article.cfm?id=200
http://www.osronline.com/article.cfm?id=213

If you think you have read any documentation related to WPP tracing more
often, or more thoroughly than I have, think again.

That’s the point of WPP tracing. Your customer *doesn’t* have to have all
that stuff. You send your customer a very limited toolset, your customer
sends you binary trace that is essentially unreadable, and *you* process
it
to get the debug info you need.

You skipped right over my point. The “very limited toolset” you mentioned
was exactly what I was talking about. However, I just did a quick perusal
of the resource kit, and those tools, such as tracelog, appear to ship with
it as well, and it is a free download as well here:

http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/tracelog
-o.asp

I should have checked that first.


Bill McKenzie
Compuware Corporation
Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
http://frontline.compuware.com/nashua/patches/utility.htm

“Phil Barila” wrote in message
news:xxxxx@ntdev…
>
> That’s the point of WPP tracing. Your customer doesn’t have to have all
> that stuff. You send your customer a very limited toolset, your customer
> sends you binary trace that is essentially unreadable, and you process
it
> to get the debug info you need. Please look at WPP tracing again.
> Especially, look at the OSR articles:
> http://www.osronline.com/article.cfm?id=200
> http://www.osronline.com/article.cfm?id=213
>
> Phil
> –
> Philip D. Barila Windows DDK MVP
> Seagate Technology, LLC
> (720) 684-1842
> As if I need to say it: Not speaking for Seagate.
>
> “Sanjay Chadda” wrote in message
news:xxxxx@ntdev…
>
> Here is what I am looking for to implement:
>
> We have a driver packaged into a product. It gets installed on
> customer’s machine and sometimes things are
> Not working. It could be due to some failure case in driver, but we will
> never know that unless we log those debug messages coming out of the
> driver. So, I need to log those DbgPrint messages somewhere which the
> customer could pass on to us and we can take a look at them. That’s why
> I thought of implementing a scheme where we can put those debug messages
> to a file.
>
> Also, I tried WPP tracing and its too cumbersome. To get the errors in
> human readable form, one needs to run tools from DDK like - tracelog,
> tracefmt, traceview, etc…
>
> Now, for an end user customer deploying this product, we don’t expect
> that he will be running these tools from DDK (which means he needs to
> have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
> convince customers to have these tools installed on their machine.
>
> What I am looking for is, when somehting fails, the customer sends us a
> log file (which has all debug messages logged from the driver) and then
> I look up in source code to figure out what went wrong.
>
> Sanjay
>
> >-----Original Message-----
> >From: Roddy, Mark [mailto:xxxxx@stratus.com]
> >Sent: Wednesday, August 06, 2003 6:28 AM
> >To: Windows System Software Developers Interest List
> >Subject: [ntdev] Re: Debugging
> >
> >
> >Well lets see:
> >
> >1) its too complicated and invasive - debug tracing has to be
> >light-weight or the tracing so alters program behavior that it
> >invalidates its own usefulness.
> >
> >2) equivalent, well designed functionality, already exists as
> >WPP tracing, so you are re-inventing the wheel, and your wheel
> >isn’t even a superior design.
> >
> >3) you need to build a front end spooler to handle log
> >messages at IRQL > PASSIVE_LEVEL, so what appears to be a
> >simple idea becomes complicated rather quickly, see (1) above.
> >
> >4) windbg will spool console output to a file. Perhaps that is
> >all you really need?
> >
> >
> >
> >=====================
> >Mark Roddy
> >Hollis Technology Solutions
> >www.hollistech.com
> >xxxxx@hollistech.com
> >
> >
> >-----Original Message-----
> >From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> >Sent: Tuesday, August 05, 2003 6:25 PM
> >To: Windows System Software Developers Interest List
> >Subject: [ntdev] Re: Debugging
> >
> >
> >Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
> >
> >>P.S. debug logging to a file directly from kernel mode is generally a
> >>useless idea.
> >
> >Why do you say this? Because of performance reasons?
> >Or maybe we can get the debug messages in the driver thru an
> >IOCTL in user mode app. The user mode App could then write to a file.
> >
> >
> >>-----Original Message-----
> >>From: Roddy, Mark [mailto:xxxxx@stratus.com]
> >>Sent: Tuesday, August 05, 2003 10:44 AM
> >>To: Windows System Software Developers Interest List
> >>Subject: [ntdev] Re: Debugging
> >>
> >>
> >>
> >>RTFM.
> >>
> >>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
> >>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
> >>
> >>P.S. debug logging to a file directly from kernel mode is generally a
> >>useless idea.
> >>
> >>
> >>=====================
> >>Mark Roddy
> >>Hollis Technology Solutions
> >>www.hollistech.com
> >>xxxxx@hollistech.com
> >>
> >>
> >>-----Original Message-----
> >>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> >>Sent: Tuesday, August 05, 2003 1:34 PM
> >>To: Windows System Software Developers Interest List
> >>Subject: [ntdev] Re: Debugging
> >>
> >>
> >>Hi,
> >>I am also working on sending some debug output to a file on
> >disk. I am
> >>using same ZwCreateFile() &
> >>ZwWriteFile() kernel calls to do it. But I get a page fault on
> >>the call to ZwCreateFile(). I am checking in code that I do
> >>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
> >>would occur? I am using following
> >>code: maybe I am using some wrong flags or what??
> >>
> >> InitializeObjectAttributes (&objectAttributes,
> >>
> >>(PUNICODE_STRING)&fileName,
> >>
> >>OBJ_CASE_INSENSITIVE,
> >> NULL,
> >> NULL );
> >>
> >> status = ZwCreateFile(&FileHandle,
> >> FILE_APPEND_DATA,
> >> &objectAttributes,
> >> &IoStatus,
> >> 0,
> >> FILE_ATTRIBUTE_NORMAL,
> >> FILE_SHARE_WRITE,
> >> FILE_OPEN_IF,
> >> FILE_SYNCHRONOUS_IO_NONALERT,
> >> NULL,
> >> 0 );
> >>
> >>Sanjay
> >>>-----Original Message-----
> >>>From: Shaun [mailto:xxxxx@sdlabs.net]
> >>>Sent: Monday, May 26, 2003 6:42 AM
> >>>To: NT Developers Interest List
> >>>Subject: [ntdev] Re: Debugging
> >>>
> >>>
> >>>You can write to files using the ZwCreateFile() &
> >>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
> >>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
> >>>Numega SoftIce) or use a utility called DebugView from SysInternals
> >>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
> >>>that will capture the DbgPrint and allow you to view/save it.
> >>>
> >>>Shaun
> >>>
> >>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
> >>>
> >>>TS> Hello,
> >>>
> >>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
> >>>TS> calls) Is there any facility of printing messages to file
> >>>in driver
> >>>TS> code. ( For Debudding)
> >>>
> >>>TS> As i Couldn’t get any status (tracking) of the driver
> >>>function, i am
> >>>TS> interested in
> >>>TS> getting track of the code.
> >>>
> >>>TS> Any help ?
> >>>TS> Thanks in advance,
> >>>TS> Tushar
> >>>
> >>>
> >>>
> >>>TS> —
> >>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
> >>>TS> unsubscribe send a blank email to
> >xxxxx@lists.osr.com
> >>>
> >>>
> >>>
> >>>—
> >>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
> >>
> >>You are currently
> >>subscribed to ntdev as:
> >>xxxxx@stratus.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=&gt;256
> >>
> >>You are currently
> >>subscribed to ntdev as:
> >>xxxxx@neoteris.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@stratus.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=&gt;256
> >
> >You are currently
> >subscribed to ntdev as:
> >xxxxx@neoteris.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>
>
>
>

PLEASE DON’T! If you have ever had to try to debug a driver on a system
where some helpful person left the debug print in a production driver or
service you know of the pain that can result. The question was how to build
in logging for diagnostics on production code, WPP is the best way to go,
the tools are in the system resource kit, and freely downloadable.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: “Mathieu Routhier”
To: “Windows System Software Developers Interest List”
Sent: Wednesday, August 06, 2003 1:33 PM
Subject: [ntdev] Re: Debugging

> Tell your customer to install this:
>
> DebugMon (http://www.osronline.com/article.cfm?id=99)
>
> Then ask him to save the output and send you the file.
>
> Mat
>

Oops, sorry Phil, I thought you had posted a reply to me (my newreader put
your post directly under mine). Didn’t mean to get attitude there.


Bill McKenzie
Compuware Corporation
Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
http://frontline.compuware.com/nashua/patches/utility.htm

“Bill McKenzie” wrote in message
news:xxxxx@ntdev…
>
> > Please look at WPP tracing again.
> > Especially, look at the OSR articles:
> > http://www.osronline.com/article.cfm?id=200
> > http://www.osronline.com/article.cfm?id=213
> >
>
> If you think you have read any documentation related to WPP tracing more
> often, or more thoroughly than I have, think again.
>
> > That’s the point of WPP tracing. Your customer doesn’t have to have
all
> > that stuff. You send your customer a very limited toolset, your
customer
> > sends you binary trace that is essentially unreadable, and you process
> it
> > to get the debug info you need.
>
> You skipped right over my point. The “very limited toolset” you mentioned
> was exactly what I was talking about. However, I just did a quick perusal
> of the resource kit, and those tools, such as tracelog, appear to ship
with
> it as well, and it is a free download as well here:
>
>
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/tracelog
> -o.asp
>
> I should have checked that first.
>
> –
> Bill McKenzie
> Compuware Corporation
> Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
> http://frontline.compuware.com/nashua/patches/utility.htm
>
>
> “Phil Barila” wrote in message
> news:xxxxx@ntdev…
> >
> > That’s the point of WPP tracing. Your customer doesn’t have to have
all
> > that stuff. You send your customer a very limited toolset, your
customer
> > sends you binary trace that is essentially unreadable, and you process
> it
> > to get the debug info you need. Please look at WPP tracing again.
> > Especially, look at the OSR articles:
> > http://www.osronline.com/article.cfm?id=200
> > http://www.osronline.com/article.cfm?id=213
> >
> > Phil
> > –
> > Philip D. Barila Windows DDK MVP
> > Seagate Technology, LLC
> > (720) 684-1842
> > As if I need to say it: Not speaking for Seagate.
> >
> > “Sanjay Chadda” wrote in message
> news:xxxxx@ntdev…
> >
> > Here is what I am looking for to implement:
> >
> > We have a driver packaged into a product. It gets installed on
> > customer’s machine and sometimes things are
> > Not working. It could be due to some failure case in driver, but we will
> > never know that unless we log those debug messages coming out of the
> > driver. So, I need to log those DbgPrint messages somewhere which the
> > customer could pass on to us and we can take a look at them. That’s why
> > I thought of implementing a scheme where we can put those debug messages
> > to a file.
> >
> > Also, I tried WPP tracing and its too cumbersome. To get the errors in
> > human readable form, one needs to run tools from DDK like - tracelog,
> > tracefmt, traceview, etc…
> >
> > Now, for an end user customer deploying this product, we don’t expect
> > that he will be running these tools from DDK (which means he needs to
> > have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
> > convince customers to have these tools installed on their machine.
> >
> > What I am looking for is, when somehting fails, the customer sends us a
> > log file (which has all debug messages logged from the driver) and then
> > I look up in source code to figure out what went wrong.
> >
> > Sanjay
> >
> > >-----Original Message-----
> > >From: Roddy, Mark [mailto:xxxxx@stratus.com]
> > >Sent: Wednesday, August 06, 2003 6:28 AM
> > >To: Windows System Software Developers Interest List
> > >Subject: [ntdev] Re: Debugging
> > >
> > >
> > >Well lets see:
> > >
> > >1) its too complicated and invasive - debug tracing has to be
> > >light-weight or the tracing so alters program behavior that it
> > >invalidates its own usefulness.
> > >
> > >2) equivalent, well designed functionality, already exists as
> > >WPP tracing, so you are re-inventing the wheel, and your wheel
> > >isn’t even a superior design.
> > >
> > >3) you need to build a front end spooler to handle log
> > >messages at IRQL > PASSIVE_LEVEL, so what appears to be a
> > >simple idea becomes complicated rather quickly, see (1) above.
> > >
> > >4) windbg will spool console output to a file. Perhaps that is
> > >all you really need?
> > >
> > >
> > >
> > >=====================
> > >Mark Roddy
> > >Hollis Technology Solutions
> > >www.hollistech.com
> > >xxxxx@hollistech.com
> > >
> > >
> > >-----Original Message-----
> > >From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> > >Sent: Tuesday, August 05, 2003 6:25 PM
> > >To: Windows System Software Developers Interest List
> > >Subject: [ntdev] Re: Debugging
> > >
> > >
> > >Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
> > >
> > >>P.S. debug logging to a file directly from kernel mode is generally a
> > >>useless idea.
> > >
> > >Why do you say this? Because of performance reasons?
> > >Or maybe we can get the debug messages in the driver thru an
> > >IOCTL in user mode app. The user mode App could then write to a file.
> > >
> > >
> > >>-----Original Message-----
> > >>From: Roddy, Mark [mailto:xxxxx@stratus.com]
> > >>Sent: Tuesday, August 05, 2003 10:44 AM
> > >>To: Windows System Software Developers Interest List
> > >>Subject: [ntdev] Re: Debugging
> > >>
> > >>
> > >>
> > >>RTFM.
> > >>
> > >>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
> > >>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
> > >>
> > >>P.S. debug logging to a file directly from kernel mode is generally a
> > >>useless idea.
> > >>
> > >>
> > >>=====================
> > >>Mark Roddy
> > >>Hollis Technology Solutions
> > >>www.hollistech.com
> > >>xxxxx@hollistech.com
> > >>
> > >>
> > >>-----Original Message-----
> > >>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> > >>Sent: Tuesday, August 05, 2003 1:34 PM
> > >>To: Windows System Software Developers Interest List
> > >>Subject: [ntdev] Re: Debugging
> > >>
> > >>
> > >>Hi,
> > >>I am also working on sending some debug output to a file on
> > >disk. I am
> > >>using same ZwCreateFile() &
> > >>ZwWriteFile() kernel calls to do it. But I get a page fault on
> > >>the call to ZwCreateFile(). I am checking in code that I do
> > >>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
> > >>would occur? I am using following
> > >>code: maybe I am using some wrong flags or what??
> > >>
> > >> InitializeObjectAttributes (&objectAttributes,
> > >>
> > >>(PUNICODE_STRING)&fileName,
> > >>
> > >>OBJ_CASE_INSENSITIVE,
> > >> NULL,
> > >> NULL );
> > >>
> > >> status = ZwCreateFile(&FileHandle,
> > >> FILE_APPEND_DATA,
> > >> &objectAttributes,
> > >> &IoStatus,
> > >> 0,
> > >> FILE_ATTRIBUTE_NORMAL,
> > >> FILE_SHARE_WRITE,
> > >> FILE_OPEN_IF,
> > >> FILE_SYNCHRONOUS_IO_NONALERT,
> > >> NULL,
> > >> 0 );
> > >>
> > >>Sanjay
> > >>>-----Original Message-----
> > >>>From: Shaun [mailto:xxxxx@sdlabs.net]
> > >>>Sent: Monday, May 26, 2003 6:42 AM
> > >>>To: NT Developers Interest List
> > >>>Subject: [ntdev] Re: Debugging
> > >>>
> > >>>
> > >>>You can write to files using the ZwCreateFile() &
> > >>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
> > >>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
> > >>>Numega SoftIce) or use a utility called DebugView from SysInternals
> > >>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
> > >>>that will capture the DbgPrint and allow you to view/save it.
> > >>>
> > >>>Shaun
> > >>>
> > >>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
> > >>>
> > >>>TS> Hello,
> > >>>
> > >>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
> > >>>TS> calls) Is there any facility of printing messages to file
> > >>>in driver
> > >>>TS> code. ( For Debudding)
> > >>>
> > >>>TS> As i Couldn’t get any status (tracking) of the driver
> > >>>function, i am
> > >>>TS> interested in
> > >>>TS> getting track of the code.
> > >>>
> > >>>TS> Any help ?
> > >>>TS> Thanks in advance,
> > >>>TS> Tushar
> > >>>
> > >>>
> > >>>
> > >>>TS> —
> > >>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
> > >>>TS> unsubscribe send a blank email to
> > >xxxxx@lists.osr.com
> > >>>
> > >>>
> > >>>
> > >>>—
> > >>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
> > >>
> > >>You are currently
> > >>subscribed to ntdev as:
> > >>xxxxx@stratus.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=&gt;256
> > >>
> > >>You are currently
> > >>subscribed to ntdev as:
> > >>xxxxx@neoteris.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@stratus.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=&gt;256
> > >
> > >You are currently
> > >subscribed to ntdev as:
> > >xxxxx@neoteris.com
> > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
> >
> >
> >
> >
> >
>
>
>
>

Absolutely no sweat. As you correctly surmised, I was responding to the OP,
who was, it appears, erroneously thinking that the trace facility carries
more baggage than his roll-your-own approach. I hadn’t considered the
redistributable issue, but that appears to have been resolved, as well.

And yes, I figured you to have looked at those articles long and hard. :slight_smile:

Thanks for the hearty laugh, though. :slight_smile:

Phil

Philip D. Barila Windows DDK MVP
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

“Bill McKenzie” wrote in message
news:xxxxx@ntdev…
>
> Oops, sorry Phil, I thought you had posted a reply to me (my newreader put
> your post directly under mine). Didn’t mean to get attitude there.
>
> –
> Bill McKenzie
> Compuware Corporation
> Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
> http://frontline.compuware.com/nashua/patches/utility.htm
>
>
> “Bill McKenzie” wrote in message
> news:xxxxx@ntdev…
> >
> > > Please look at WPP tracing again.
> > > Especially, look at the OSR articles:
> > > http://www.osronline.com/article.cfm?id=200
> > > http://www.osronline.com/article.cfm?id=213
> > >
> >
> > If you think you have read any documentation related to WPP tracing more
> > often, or more thoroughly than I have, think again.
> >
> > > That’s the point of WPP tracing. Your customer doesn’t have to have
> all
> > > that stuff. You send your customer a very limited toolset, your
> customer
> > > sends you binary trace that is essentially unreadable, and you
process
> > it
> > > to get the debug info you need.
> >
> > You skipped right over my point. The “very limited toolset” you
mentioned
> > was exactly what I was talking about. However, I just did a quick
perusal
> > of the resource kit, and those tools, such as tracelog, appear to ship
> with
> > it as well, and it is a free download as well here:
> >
> >
>
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/tracelog
> > -o.asp
> >
> > I should have checked that first.
> >
> > –
> > Bill McKenzie
> > Compuware Corporation
> > Watch your IRPs/IRBs/URBs/SRBs/NDIS pkts with our free WDMSniffer tool:
> > http://frontline.compuware.com/nashua/patches/utility.htm
> >
> >
> > “Phil Barila” wrote in message
> > news:xxxxx@ntdev…
> > >
> > > That’s the point of WPP tracing. Your customer doesn’t have to have
> all
> > > that stuff. You send your customer a very limited toolset, your
> customer
> > > sends you binary trace that is essentially unreadable, and you
process
> > it
> > > to get the debug info you need. Please look at WPP tracing again.
> > > Especially, look at the OSR articles:
> > > http://www.osronline.com/article.cfm?id=200
> > > http://www.osronline.com/article.cfm?id=213
> > >
> > > Phil
> > > –
> > > Philip D. Barila Windows DDK MVP
> > > Seagate Technology, LLC
> > > (720) 684-1842
> > > As if I need to say it: Not speaking for Seagate.
> > >
> > > “Sanjay Chadda” wrote in message
> > news:xxxxx@ntdev…
> > >
> > > Here is what I am looking for to implement:
> > >
> > > We have a driver packaged into a product. It gets installed on
> > > customer’s machine and sometimes things are
> > > Not working. It could be due to some failure case in driver, but we
will
> > > never know that unless we log those debug messages coming out of the
> > > driver. So, I need to log those DbgPrint messages somewhere which the
> > > customer could pass on to us and we can take a look at them. That’s
why
> > > I thought of implementing a scheme where we can put those debug
messages
> > > to a file.
> > >
> > > Also, I tried WPP tracing and its too cumbersome. To get the errors in
> > > human readable form, one needs to run tools from DDK like - tracelog,
> > > tracefmt, traceview, etc…
> > >
> > > Now, for an end user customer deploying this product, we don’t expect
> > > that he will be running these tools from DDK (which means he needs to
> > > have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
> > > convince customers to have these tools installed on their machine.
> > >
> > > What I am looking for is, when somehting fails, the customer sends us
a
> > > log file (which has all debug messages logged from the driver) and
then
> > > I look up in source code to figure out what went wrong.
> > >
> > > Sanjay
> > >
> > > >-----Original Message-----
> > > >From: Roddy, Mark [mailto:xxxxx@stratus.com]
> > > >Sent: Wednesday, August 06, 2003 6:28 AM
> > > >To: Windows System Software Developers Interest List
> > > >Subject: [ntdev] Re: Debugging
> > > >
> > > >
> > > >Well lets see:
> > > >
> > > >1) its too complicated and invasive - debug tracing has to be
> > > >light-weight or the tracing so alters program behavior that it
> > > >invalidates its own usefulness.
> > > >
> > > >2) equivalent, well designed functionality, already exists as
> > > >WPP tracing, so you are re-inventing the wheel, and your wheel
> > > >isn’t even a superior design.
> > > >
> > > >3) you need to build a front end spooler to handle log
> > > >messages at IRQL > PASSIVE_LEVEL, so what appears to be a
> > > >simple idea becomes complicated rather quickly, see (1) above.
> > > >
> > > >4) windbg will spool console output to a file. Perhaps that is
> > > >all you really need?
> > > >
> > > >
> > > >
> > > >=====================
> > > >Mark Roddy
> > > >Hollis Technology Solutions
> > > >www.hollistech.com
> > > >xxxxx@hollistech.com
> > > >
> > > >
> > > >-----Original Message-----
> > > >From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> > > >Sent: Tuesday, August 05, 2003 6:25 PM
> > > >To: Windows System Software Developers Interest List
> > > >Subject: [ntdev] Re: Debugging
> > > >
> > > >
> > > >Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
> > > >
> > > >>P.S. debug logging to a file directly from kernel mode is generally
a
> > > >>useless idea.
> > > >
> > > >Why do you say this? Because of performance reasons?
> > > >Or maybe we can get the debug messages in the driver thru an
> > > >IOCTL in user mode app. The user mode App could then write to a file.
> > > >
> > > >
> > > >>-----Original Message-----
> > > >>From: Roddy, Mark [mailto:xxxxx@stratus.com]
> > > >>Sent: Tuesday, August 05, 2003 10:44 AM
> > > >>To: Windows System Software Developers Interest List
> > > >>Subject: [ntdev] Re: Debugging
> > > >>
> > > >>
> > > >>
> > > >>RTFM.
> > > >>
> > > >>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
> > > >>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
> > > >>
> > > >>P.S. debug logging to a file directly from kernel mode is generally
a
> > > >>useless idea.
> > > >>
> > > >>
> > > >>=====================
> > > >>Mark Roddy
> > > >>Hollis Technology Solutions
> > > >>www.hollistech.com
> > > >>xxxxx@hollistech.com
> > > >>
> > > >>
> > > >>-----Original Message-----
> > > >>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> > > >>Sent: Tuesday, August 05, 2003 1:34 PM
> > > >>To: Windows System Software Developers Interest List
> > > >>Subject: [ntdev] Re: Debugging
> > > >>
> > > >>
> > > >>Hi,
> > > >>I am also working on sending some debug output to a file on
> > > >disk. I am
> > > >>using same ZwCreateFile() &
> > > >>ZwWriteFile() kernel calls to do it. But I get a page fault on
> > > >>the call to ZwCreateFile(). I am checking in code that I do
> > > >>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
> > > >>would occur? I am using following
> > > >>code: maybe I am using some wrong flags or what??
> > > >>
> > > >> InitializeObjectAttributes (&objectAttributes,
> > > >>
> > > >>(PUNICODE_STRING)&fileName,
> > > >>
> > > >>OBJ_CASE_INSENSITIVE,
> > > >> NULL,
> > > >> NULL );
> > > >>
> > > >> status = ZwCreateFile(&FileHandle,
> > > >> FILE_APPEND_DATA,
> > > >> &objectAttributes,
> > > >> &IoStatus,
> > > >> 0,
> > > >> FILE_ATTRIBUTE_NORMAL,
> > > >> FILE_SHARE_WRITE,
> > > >> FILE_OPEN_IF,
> > > >> FILE_SYNCHRONOUS_IO_NONALERT,
> > > >> NULL,
> > > >> 0 );
> > > >>
> > > >>Sanjay
> > > >>>-----Original Message-----
> > > >>>From: Shaun [mailto:xxxxx@sdlabs.net]
> > > >>>Sent: Monday, May 26, 2003 6:42 AM
> > > >>>To: NT Developers Interest List
> > > >>>Subject: [ntdev] Re: Debugging
> > > >>>
> > > >>>
> > > >>>You can write to files using the ZwCreateFile() &
> > > >>>ZwWriteFile() kernel calls. If you want to just capture trace,
simply
> > > >>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
> > > >>>Numega SoftIce) or use a utility called DebugView from SysInternals
> > > >>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
> > > >>>that will capture the DbgPrint and allow you to view/save it.
> > > >>>
> > > >>>Shaun
> > > >>>
> > > >>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
> > > >>>
> > > >>>TS> Hello,
> > > >>>
> > > >>>TS> I am moving some dll code to driver side in 2K. ( Using
deviceio
> > > >>>TS> calls) Is there any facility of printing messages to file
> > > >>>in driver
> > > >>>TS> code. ( For Debudding)
> > > >>>
> > > >>>TS> As i Couldn’t get any status (tracking) of the driver
> > > >>>function, i am
> > > >>>TS> interested in
> > > >>>TS> getting track of the code.
> > > >>>
> > > >>>TS> Any help ?
> > > >>>TS> Thanks in advance,
> > > >>>TS> Tushar
> > > >>>
> > > >>>
> > > >>>
> > > >>>TS> —
> > > >>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
> > > >>>TS> unsubscribe send a blank email to
> > > >xxxxx@lists.osr.com
> > > >>>
> > > >>>
> > > >>>
> > > >>>—
> > > >>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
> > > >>
> > > >>You are currently
> > > >>subscribed to ntdev as:
> > > >>xxxxx@stratus.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=&gt;256
> > > >>
> > > >>You are currently
> > > >>subscribed to ntdev as:
> > > >>xxxxx@neoteris.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@stratus.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=&gt;256
> > > >
> > > >You are currently
> > > >subscribed to ntdev as:
> > > >xxxxx@neoteris.com
> > > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
>

If the driver is causing a blue screen the most important last two or three
messages may be lost.

“Mathieu Routhier” wrote in message
news:xxxxx@ntdev…
>
> Tell your customer to install this:
>
> DebugMon (http://www.osronline.com/article.cfm?id=99)
>
> Then ask him to save the output and send you the file.
>
> Mat
>
> -----Original Message-----
> From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> Sent: Wednesday, August 06, 2003 12:58 PM
> To: Windows System Software Developers Interest List
> Subject: [ntdev] Re: Debugging
>
> Here is what I am looking for to implement:
>
> We have a driver packaged into a product. It gets installed on
> customer’s machine and sometimes things are
> Not working. It could be due to some failure case in driver, but we will
> never know that unless we log those debug messages coming out of the
> driver. So, I need to log those DbgPrint messages somewhere which the
> customer could pass on to us and we can take a look at them. That’s why
> I thought of implementing a scheme where we can put those debug messages
> to a file.
>
> Also, I tried WPP tracing and its too cumbersome. To get the errors in
> human readable form, one needs to run tools from DDK like - tracelog,
> tracefmt, traceview, etc…
>
> Now, for an end user customer deploying this product, we don’t expect
> that he will be running these tools from DDK (which means he needs to
> have DDK installed) or WINDBG also (as pointed in case 4). Its hard to
> convince customers to have these tools installed on their machine.
>
> What I am looking for is, when somehting fails, the customer sends us a
> log file (which has all debug messages logged from the driver) and then
> I look up in source code to figure out what went wrong.
>
> Sanjay
>
> >-----Original Message-----
> >From: Roddy, Mark [mailto:xxxxx@stratus.com]
> >Sent: Wednesday, August 06, 2003 6:28 AM
> >To: Windows System Software Developers Interest List
> >Subject: [ntdev] Re: Debugging
> >
> >
> >Well lets see:
> >
> >1) its too complicated and invasive - debug tracing has to be
> >light-weight or the tracing so alters program behavior that it
> >invalidates its own usefulness.
> >
> >2) equivalent, well designed functionality, already exists as
> >WPP tracing, so you are re-inventing the wheel, and your wheel
> >isn’t even a superior design.
> >
> >3) you need to build a front end spooler to handle log
> >messages at IRQL > PASSIVE_LEVEL, so what appears to be a
> >simple idea becomes complicated rather quickly, see (1) above.
> >
> >4) windbg will spool console output to a file. Perhaps that is
> >all you really need?
> >
> >
> >
> >=====================
> >Mark Roddy
> >Hollis Technology Solutions
> >www.hollistech.com
> >xxxxx@hollistech.com
> >
> >
> >-----Original Message-----
> >From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> >Sent: Tuesday, August 05, 2003 6:25 PM
> >To: Windows System Software Developers Interest List
> >Subject: [ntdev] Re: Debugging
> >
> >
> >Yes, I agree. It shd be IRQL = PASSIVE_LEVEL.
> >
> >>P.S. debug logging to a file directly from kernel mode is generally a
> >>useless idea.
> >
> >Why do you say this? Because of performance reasons?
> >Or maybe we can get the debug messages in the driver thru an
> >IOCTL in user mode app. The user mode App could then write to a file.
> >
> >
> >>-----Original Message-----
> >>From: Roddy, Mark [mailto:xxxxx@stratus.com]
> >>Sent: Tuesday, August 05, 2003 10:44 AM
> >>To: Windows System Software Developers Interest List
> >>Subject: [ntdev] Re: Debugging
> >>
> >>
> >>
> >>RTFM.
> >>
> >>“Callers of ZwCreateFile must be running at IRQL = PASSIVE_LEVEL.”
> >>“Callers of ZwWriteFile must be running at IRQL = PASSIVE_LEVEL.”
> >>
> >>P.S. debug logging to a file directly from kernel mode is generally a
> >>useless idea.
> >>
> >>
> >>=====================
> >>Mark Roddy
> >>Hollis Technology Solutions
> >>www.hollistech.com
> >>xxxxx@hollistech.com
> >>
> >>
> >>-----Original Message-----
> >>From: Sanjay Chadda [mailto:xxxxx@neoteris.com]
> >>Sent: Tuesday, August 05, 2003 1:34 PM
> >>To: Windows System Software Developers Interest List
> >>Subject: [ntdev] Re: Debugging
> >>
> >>
> >>Hi,
> >>I am also working on sending some debug output to a file on
> >disk. I am
> >>using same ZwCreateFile() &
> >>ZwWriteFile() kernel calls to do it. But I get a page fault on
> >>the call to ZwCreateFile(). I am checking in code that I do
> >>this only if IRQL <= DISPATCH_LEVEL. Any ideas why page fault
> >>would occur? I am using following
> >>code: maybe I am using some wrong flags or what??
> >>
> >> InitializeObjectAttributes (&objectAttributes,
> >>
> >>(PUNICODE_STRING)&fileName,
> >>
> >>OBJ_CASE_INSENSITIVE,
> >> NULL,
> >> NULL );
> >>
> >> status = ZwCreateFile(&FileHandle,
> >> FILE_APPEND_DATA,
> >> &objectAttributes,
> >> &IoStatus,
> >> 0,
> >> FILE_ATTRIBUTE_NORMAL,
> >> FILE_SHARE_WRITE,
> >> FILE_OPEN_IF,
> >> FILE_SYNCHRONOUS_IO_NONALERT,
> >> NULL,
> >> 0 );
> >>
> >>Sanjay
> >>>-----Original Message-----
> >>>From: Shaun [mailto:xxxxx@sdlabs.net]
> >>>Sent: Monday, May 26, 2003 6:42 AM
> >>>To: NT Developers Interest List
> >>>Subject: [ntdev] Re: Debugging
> >>>
> >>>
> >>>You can write to files using the ZwCreateFile() &
> >>>ZwWriteFile() kernel calls. If you want to just capture trace, simply
> >>>use DbgPrint and either use a debugger (such as the DDK WinDbg or
> >>>Numega SoftIce) or use a utility called DebugView from SysInternals
> >>>(http://www.sysinternals.com/ntw2k/utilities.shtml)
> >>>that will capture the DbgPrint and allow you to view/save it.
> >>>
> >>>Shaun
> >>>
> >>>Monday, May 26, 2003, 2:29:17 PM, you wrote:
> >>>
> >>>TS> Hello,
> >>>
> >>>TS> I am moving some dll code to driver side in 2K. ( Using deviceio
> >>>TS> calls) Is there any facility of printing messages to file
> >>>in driver
> >>>TS> code. ( For Debudding)
> >>>
> >>>TS> As i Couldn’t get any status (tracking) of the driver
> >>>function, i am
> >>>TS> interested in
> >>>TS> getting track of the code.
> >>>
> >>>TS> Any help ?
> >>>TS> Thanks in advance,
> >>>TS> Tushar
> >>>
> >>>
> >>>
> >>>TS> —
> >>>TS> You are currently subscribed to ntdev as: xxxxx@sdlabs.net To
> >>>TS> unsubscribe send a blank email to
> >xxxxx@lists.osr.com
> >>>
> >>>
> >>>
> >>>—
> >>>You are currently subscribed to ntdev as: xxxxx@neoteris.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=&gt;256
> >>
> >>You are currently
> >>subscribed to ntdev as:
> >>xxxxx@stratus.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=&gt;256
> >>
> >>You are currently
> >>subscribed to ntdev as:
> >>xxxxx@neoteris.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@stratus.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=&gt;256
> >
> >You are currently
> >subscribed to ntdev as:
> >xxxxx@neoteris.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@guillemot.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>

>We have a driver packaged into a product. It gets installed on

customer’s machine and sometimes things are
Not working. It could be due to some failure case in driver, but we will
never know that unless we log those debug messages coming out of the
driver. So, I need to log those DbgPrint messages somewhere which the
customer could pass on to us and we can take a look at them. That’s why
I thought of implementing a scheme where we can put those debug messages
to a file.

Get DbgView from SysInternals. Or OSR has something similar. If things
don’t work, just have you customer start dbgview, which will capture the
dbgprints, then they can save the text to a file and send it to you.

Works for me!

Loren

I should add that it is helpful to either also ship a debug version of the
driver, or have a way to enable debugging so that it isn’t always there in
the standard driver. Slows your driver down and annoys the heck out of
anyone trying to debug some other problem on the system.

Loren

----- Original Message -----
From: “Loren Wilton”
To: “Windows System Software Developers Interest List”
Sent: Wednesday, August 06, 2003 10:05 PM
Subject: [ntdev] Re: Debugging

> >We have a driver packaged into a product. It gets installed on
> >customer’s machine and sometimes things are
> >Not working. It could be due to some failure case in driver, but we will
> >never know that unless we log those debug messages coming out of the
> >driver. So, I need to log those DbgPrint messages somewhere which the
> >customer could pass on to us and we can take a look at them. That’s why
> >I thought of implementing a scheme where we can put those debug messages
> >to a file.
>
> Get DbgView from SysInternals. Or OSR has something similar. If things
> don’t work, just have you customer start dbgview, which will capture the
> dbgprints, then they can save the text to a file and send it to you.