[nvmewin] DBG question

Freyensee, James P james.p.freyensee at intel.com
Thu Apr 26 09:05:19 PDT 2012


May I ask a fundamental question I see going on in the driver?

What is the rationale behind debug blocks like:

#if DBG
                DbgPrint("Complete CID 0x%x on 0x%x\n",
                         pNVMeCmd->CDW0.CID,
                         pSQI->SubQueueID);
#endif

I would have expected DbgPrint() to be already compiled out in 'release mode' , something like:

#if "Microsoft Debug Build"
#define DbgPrint(x...) do {  \
              fprintf(stderr, "Function: %s(), Line: %d-> ", __func__, __LINE__);  \
              fprintf(stderr, x);  \
              fprintf(stderr, "\n");  \
} while(0)
#else
#define DbgPrint(x...)
#endif


And not need the extra "DBG" #if around it in the actual code blocks.  Though the MSDN page for DbgPrint does not really say what happens if code is compiled in "debug" build vs "release" build.

Thanks,
Jay



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20120426/d71e6e7a/attachment.html>


More information about the nvmewin mailing list