As Doron said, it is cumbersome
Good idea, hideous implementation.
Both complicated to use and limited at once.
Few days before somebody compared developers and CPU time cost. Using
WPP takes a lot of developers’ time comparing to sprintf formatting.
Formatting is no issue in almost all cases with current CPUs even within
drivers. You’re right with other issues but there is a simple answer:
DbgPrint + DebugView. Sufficient is most cases. I don’t see almost any
real advantage of using WPP over DbgPrint which’d justify developer’s
time spent. Yes, user can’t examine WPP logs. And what? We normally send
end users a trace version of our software if there is a problem. They
can see our debug logs. Who cares? Actually, WPP is real disadvantage in
Windows case which decreases checked build usefullness because we don’t
have necessary TMF files. At least WDF messages are public, thanks for
it.
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com http:</http:>]
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alex Bendetov
Sent: Tuesday, September 08, 2009 9:02 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] RtlPrintf v/s sprintf variants
Deepak,
If you have specific questions/problems with WPP please let us
know and we can try to help out. In addition to sprintf cost mentioned
by Doran doing your own string formatting requires a buffer where final
formatted string will go which depending on the size of the data you
would like to trace can be quite large and can become a concern if you
choose to allocated it on the stack. And if you don’t use stack, you
have to deal with managing that buffer which can be quite painful -
something you don’t need to worry about if you use WPP for your debug
tracing.
Thanks,
Alex
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Tuesday, September 08, 2009 7:54 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] RtlPrintf v/s sprintf variants
Before giving up on wpp (and yes it is cumbersome), measure the
cost of a sprintf logger with a wpp logger. Processing the format string
for varargs can be quite costly, wpp addresses this its preprocessing.
The cost difference can be significant.
d
Sent from my phone with no t9, all spilling mistakes are not
intentional.
From: Deepak Gupta
Sent: Tuesday, September 08, 2009 7:43 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] RtlPrintf v/s sprintf variants
@Mark and James
Thanks for the input.
@MM
I have given up on WPP and was thinking of having own logging
functionality.
My logging func can be called at dispatch, So I was just
exploring all options that I can use while writing variable argument
logger function. I wanted to print the vars in my logging
buffers. I have plans to write these buffers to a log file through a
separate
thread as a flushing operation.
Doron’s blog –
http://blogs.msdn.com/doronh/archive/2006/03/03/543140.aspx
Regards
Deepak
On Tue, Sep 8, 2009 at 6:31 PM, Mark Roddy
wrote:
yes - paged_code is a nop in release builds.
However you should not violate explicitly documented IRQL
restrictions.
Even when those restrictions are wrong.
Unless you really have to.
Mark Roddy
On Tue, Sep 8, 2009 at 8:34 AM, Deepak
Gupta wrote:
> Thanks Mark for the input 
>
> Just to clarify,
>
> You mean to say even “RtlPrintf” ones are also not affected
with
> “paged_code” macros in release builds?
>
> @Adi
>
> I did the same you said.
> It works at dispatch.
>
> Regards
> Deepak
>
> And hence “RtlPrintf” can be safely used at DISPATCH if not
using wide char
> format specifiers?
>
> On Tue, Sep 8, 2009 at 5:27 PM, Mark Roddy
wrote:
>>
>> Don’t use wide char format specifiers. The C runtime stuff is
not, as
>> far as I know, afflicted with paged_code macros. Those
macros, by the
>> way, are only enabled in the checked build.
>>
>>
>> Mark Roddy
>>
>>
>>
>> On Tue, Sep 8, 2009 at 2:43 AM, Deepak
Gupta wrote:
>> > Are sprintf versions also IRQL specific like RtlPrintf’s
are?
>> >
>> > I read on Doron’s blog that Rtl one’s defined as PAGED_CODE
and hence
>> > can
>> > bugcheck even if we are calling it higher IRQL wiith no
format
>> > specifiers in
>> > the format string.
>> > Is that correct?
>> > If yes is that true for sprintf one’s also?
>> >
>> > Regards
>> > Deepak
>> > — NTDEV is sponsored by OSR For our schedule of WDF, WDM,
debugging
>> > and
>> > other seminars visit: http://www.osr.com/seminars To
unsubscribe, visit
>> > the
>> > List Server section of OSR Online at
>> > http://www.osronline.com/page.cfm?name=ListServer
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars
visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online
at
>> http://www.osronline.com/page.cfm?name=ListServer
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM,
debugging and
> other seminars visit: http://www.osr.com/seminars To
unsubscribe, visit the
> List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars
visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
— NTDEV is sponsored by OSR For our schedule of WDF, WDM,
debugging and other seminars visit: http://www.osr.com/seminars To
unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars
visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars
visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer