Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 2015 12:17:57 -0500
From:      Douglas Gilbert <dgilbert@interlog.com>
To:        Warner Losh <imp@bsdimp.com>, scsi@freebsd.org
Subject:   Re: Minor improvement in debugging
Message-ID:  <5661CAC5.9080603@interlog.com>
In-Reply-To: <DA1D0AF2-C967-47F7-8110-FA91B1E6281B@bsdimp.com>
References:  <DA1D0AF2-C967-47F7-8110-FA91B1E6281B@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5661CAC5.9080603>