From owner-freebsd-scsi@freebsd.org Fri Dec 4 17:26:58 2015 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CC9DA41A43 for ; Fri, 4 Dec 2015 17:26:58 +0000 (UTC) (envelope-from dgilbert@interlog.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 5398D1958 for ; Fri, 4 Dec 2015 17:26:58 +0000 (UTC) (envelope-from dgilbert@interlog.com) Received: by mailman.ysv.freebsd.org (Postfix) id 50D91A41A42; Fri, 4 Dec 2015 17:26:58 +0000 (UTC) Delivered-To: scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 506DEA41A41 for ; Fri, 4 Dec 2015 17:26:58 +0000 (UTC) (envelope-from dgilbert@interlog.com) Received: from smtp.infotech.no (smtp.infotech.no [82.134.31.41]) by mx1.freebsd.org (Postfix) with ESMTP id 11FA01957 for ; Fri, 4 Dec 2015 17:26:57 +0000 (UTC) (envelope-from dgilbert@interlog.com) Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id 372ED20418E; Fri, 4 Dec 2015 18:18:04 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f2Qnmo1jN9hF; Fri, 4 Dec 2015 18:18:02 +0100 (CET) Received: from [192.168.254.24] (unknown [50.107.164.250]) by smtp.infotech.no (Postfix) with ESMTPA id A19A720417C; Fri, 4 Dec 2015 18:18:01 +0100 (CET) Reply-To: dgilbert@interlog.com Subject: Re: Minor improvement in debugging References: To: Warner Losh , scsi@freebsd.org From: Douglas Gilbert Message-ID: <5661CAC5.9080603@interlog.com> Date: Fri, 4 Dec 2015 12:17:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 17:26:58 -0000 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: \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