Minor improvement in debugging

Douglas Gilbert dgilbert at interlog.com
Fri Dec 4 17:26:58 UTC 2015


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.

Doug Gilbert




More information about the freebsd-scsi mailing list