Minor improvement in debugging

Warner Losh imp at bsdimp.com
Fri Dec 4 17:27:12 UTC 2015


> On Dec 4, 2015, at 10:17 AM, Douglas Gilbert <dgilbert at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-scsi/attachments/20151204/bd6b267f/attachment.bin>


More information about the freebsd-scsi mailing list