Date: Fri, 4 Dec 2015 10:27:09 -0700 From: Warner Losh <imp@bsdimp.com> To: dgilbert@interlog.com Cc: scsi@freebsd.org Subject: Re: Minor improvement in debugging Message-ID: <7AEAED43-1EC8-42C0-9AAD-BE31AEE258CA@bsdimp.com> In-Reply-To: <5661CAC5.9080603@interlog.com> References: <DA1D0AF2-C967-47F7-8110-FA91B1E6281B@bsdimp.com> <5661CAC5.9080603@interlog.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] > On Dec 4, 2015, at 10:17 AM, Douglas Gilbert <dgilbert@interlog.com> wrote: > > On 15-12-04 12:03 PM, Warner Losh wrote: >> While writing the NVMe CAM attachment, I noticed that the xpt_action() >> routine’s logging would be a lot more useful if we logged the function >> code. In addition, it is useful to log calls to the SIM inside of >> xpt_action_default(). Some sims have debugs, others don’t. >> >> This review fixes that. https://reviews.freebsd.org/D4382 > > Hi, > Had a quick look at your patch. If you are naming the containing > function in a printf style call then you could do this: > printf("%s: <some debug info here>\n", __func__ ); > > That is a little less reabable but more robust, for example if someone > later renames the containing function. > > This assumes compliance with C99 (when __func__ was introduced) or later. The CAM debug doesn’t do that anywhere, so I’m not going to introduce it piecemeal. But it is a great general suggestion. Warner [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJWYczuAAoJEGwc0Sh9sBEAwAEP/03pM01AiCQRpH/Jnyxyk3rA DCjBNkJ6wnanPVsfU+efdgcUx+qkOrr4UhIrHr0FuTiQZObq6VRI3TMJhP3uLJlM YptN+cqCiDY1YaXgp6KOy3YXNJR2Lpg36TLsUyTtt1YZzP0BjOCFXX0h/OACUhPM VKuQ7UzDBx9SAqAruFCZj1b2oth+RpEu2jodCXZLsjobV5o3eDJDcvXuYMT2MKiJ Lh7VuZAW7b3GHeJDUsHAg8MpfPbFkQjXO3xL4W6iDVEnuK/62YBGU+XH2aumhmjd c/NygNVcC80rzf+W4p1mSNNBSB4l1aTEIArFKu9VXEkJe5YktYb/ORZj80ZVOYvt G1Hu60uidka3UdibcEkgdjjMjckuVsIkJO1/GjG8G2qMAbOS0ZODiLFZAGo+VxQ/ 5aGzYdr8WJMxCtprNUb31NcRArkYVENf0c1k3w9AWaoK/fG/h39if4aoA5/dBLio NuvlXEasg2mMeD31xk6fN2zP2QRFfipn7abFRnjgkrajUziz/fHXNIEDthI/8MDo f7RaX8fABmUmXrdNl3W0wYs1PSzrjjquchFuJstQZIcUGzfTFwcJY3p5Wkuomk2h mH0fRKs5UIa9ZNljdxVnfYKqMC1xDwrGUyKPhrSHhquLhXi4PF+YtvHH1n+nfkMF FNAwW5IclWlt56C0uN/5 =er4T -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7AEAED43-1EC8-42C0-9AAD-BE31AEE258CA>
