Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available


Download PDF here: http://insider.osr.com/2019/ntinsider_2019_01.pdf

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Debug output noise in release drivers

RourkeRourke Member Posts: 41
edited September 23 in NTDEV

Whenever I turn on Debug Print Filter UNKNOWN=8 to log KdPrint output and start windbg it surprises me that there is so much noise coming out of a clean install of windows totally cluttering the output window into uselessness. The amount now is more than ever before. I had always thought, perhaps incorrectly, that release compiled drivers should never have debug output. Putting my driver debug output from KdPrintEx into IHVDRIVER=4 (for debug builds only) where the docs seem to say it belongs here again the noise is incredibly high coming from other drivers from a clean install of the latest free build of windows. So 2 questions:

1: Is there a Debug Print Filter setting to see useful output from other drivers while debugging, but not too much noise?

2: Where is best place to put your own driver debug output so you can see it with minimal noise from other drivers?

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,103

    I haven't seen that much in IHVDRIVER. Is it possible you left DEFAULT set to a non-zero value?

    I tend to use IHVSTREAMING, but that's because most of my drivers are streaming drivers.

    Also, remember that you can change the in-memory values on the fly and observe the results.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • RourkeRourke Member Posts: 41

    @Tim_Roberts said:
    Is it possible you left DEFAULT set to a non-zero value?

    Unfortunately no. The noise in IHVDRIVER is different than DEFAULT. And when raising the level from DPFLTR_TRACE_LEVEL to DPFLTR_WARNING_LEVEL the IHVDRIVER noise all went away. I could just dump all my debug output into DPFLTR_WARNING_LEVEL as a solution but it seems against the spirit of the design to spit out trace level stuff into the warning level. But unless there are other ideas I'll just have to take the CB radio approach of trial and error switching around looking for quiet channels and adjusting the squelch.

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,310

    The 'spirit of the design' was abandoned decades ago with the shift to using ETW. So don't worry about that, just use a filter level for your driver that makes sense.

  • Martin_DrábMartin_Dráb Member - All Emails Posts: 66

    If I need to distinguish debug prints of my drivers from others, I usually use certain prefix in the prints, so the ooutput can be easily post-processed (and all noise filtered out).

    Martin Dráb

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,310

    To be clearer, what we generally do is use a level based wrapper around: DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL, ...). That results in very little noise from other kernel components, and very little noise from our components as our 'level based wrapper' limits our spew.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE