performance and DbgPrints

Does anybody know what happens with DbgPrints and performance when kernel is
not in debug mode? Have the DbgPrings any cost?

What happens if the kernel is in debug mode but there is no WinDbg
connected?

It seems to me that only there is a connected WinDbg there is a lost of
performance.

Thanks

Julian

No there is a perfomnace hit all the time, you just notice it the most when
the debugger is connected. sprintf which is the basis of the DbgPrint is
not a cheap piece of code, also there is buffer managment that occurs.
This is why there is DbgPrintEx so things can be controlled and disabled.

First used KdPrintEx since the rest of us don’t want your drivers spew in a
free build. You should consider putting in a check so by default the
KdPrintEx are disabled in your driver unless a registry setting or other
action since even with a checked build the spew from some drivers is
annoying.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

“Julián de Navascués” wrote in message
news:xxxxx@windbg…
> Does anybody know what happens with DbgPrints and performance when kernel
> is
> not in debug mode? Have the DbgPrings any cost?
>
> What happens if the kernel is in debug mode but there is no WinDbg
> connected?
>
> It seems to me that only there is a connected WinDbg there is a lost of
> performance.
>
> Thanks
>
> Julian
>

Thank you very much.

I understand the sprintf hit but I wonder if futhermore every DbgPrint
implies an I/O operation to send data to serial port.

I would like to use DbgPrintEx but it is not implemented in NT 4. So I use
some macro defs to make DbgPrints conditionally depending on global flag and
dont spit annoying messages to the world. I suppose there are better
solutions.

Julian

On Thu, Apr 24, 2008 at 2:10 PM, Don Burn wrote:

> No there is a perfomnace hit all the time, you just notice it the most when
> the debugger is connected. sprintf which is the basis of the DbgPrint is
> not a cheap piece of code, also there is buffer managment that occurs.
> This is why there is DbgPrintEx so things can be controlled and disabled.
>
> First used KdPrintEx since the rest of us don’t want your drivers spew in a
> free build. You should consider putting in a check so by default the
> KdPrintEx are disabled in your driver unless a registry setting or other
> action since even with a checked build the spew from some drivers is
> annoying.
>
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>
> “Juli?n de Navascu?s” wrote in message
> news:xxxxx@windbg…
> > Does anybody know what happens with DbgPrints and performance when kernel
> > is
> > not in debug mode? Have the DbgPrings any cost?
> >
> > What happens if the kernel is in debug mode but there is no WinDbg
> > connected?
> >
> > It seems to me that only there is a connected WinDbg there is a lost of
> > performance.
> >
> > Thanks
> >
> > Julian
> >
>
>
>
> —
> You are currently subscribed to windbg as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>