From owner-freebsd-scsi@freebsd.org Fri Dec 4 17:27:12 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 8FD4DA41A73 for ; Fri, 4 Dec 2015 17:27:12 +0000 (UTC) (envelope-from imp@bsdimp.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 624F5198D for ; Fri, 4 Dec 2015 17:27:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by mailman.ysv.freebsd.org (Postfix) id 6172BA41A72; Fri, 4 Dec 2015 17:27:12 +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 61121A41A71 for ; Fri, 4 Dec 2015 17:27:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-oi0-x22b.google.com (mail-oi0-x22b.google.com [IPv6:2607:f8b0:4003:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19744198C for ; Fri, 4 Dec 2015 17:27:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by oige206 with SMTP id e206so70651029oig.2 for ; Fri, 04 Dec 2015 09:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to; bh=ow9007m6X/AbJrU13ZUfgfmYZ99/P1jcFdCc9MAH/9U=; b=piIWfJs6TdDYtAi+EI/hC1LcBCVZdO6XedwdUzcj2qhyBcRoRqlWepHJObxEnpOuWb Agxy5GOgzrsG4SZjBbzrwkDbIHjSYuRp+HpWYJpJVAK9x/EzTVygzvMlTh6ySlN7XgJ8 PWS5vFyOLg9rzohY0VgEUOVg7fZgb3aqTmehhA8uVlX2VylSEJ9oO4F+a5ts9xxf2rcL VdDTfJCv5elHxWa1q2/Ehxjh+gih8Wv1RTgUo3WMHmjahdEEEfaWTviY35on+Wiccfaf bedEcOcWRpstKRnbbkCNMuPWRzztQ0Gu4eNNm2cE4yAOXfozWieo1Rty+8LTjqCngPvC Bxjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=ow9007m6X/AbJrU13ZUfgfmYZ99/P1jcFdCc9MAH/9U=; b=I3u/uM1LOXgc7pf6K2XRGeJkCs3bKmULY9BExqBaps4JvEz7fePJ91diGDp33e7Z9e XNb/oCVn95JgFzNENDyM7zsnZEAvKx1NBDhok9MGciFT6PHa5lFvdZcH3SwsoIL/20VO 8L/F5nJwOXBD9r1IeVCttRzibIeR+kEERGQ7ozadqrzBlbhsYAv1/cTXknDLBijbghsV WqvBdIR/IQdXW3m9MtEz5+j+GdFxpoV8vxQTcsDRDVjgLHAgNWRC7ii1wB9QDo6lFV21 FS6wZTYVqQYgZ9zxCqfFCTq8Px7PedeQNGWhrJ7vh8uFDjLFo5RS2Yz5gPKwwEKsCZSK KVrQ== X-Gm-Message-State: ALoCoQlC78RFpFMLFXeRxYvwHP5GP33VzHINPihVPtmlKYVsRgNjTjAZs0cLR2heRiLtU1+ANBQr X-Received: by 10.202.71.132 with SMTP id u126mr13078549oia.113.1449250031185; Fri, 04 Dec 2015 09:27:11 -0800 (PST) Received: from ?IPv6:2601:280:4900:3700:4939:59c6:c70c:980e? ([2601:280:4900:3700:4939:59c6:c70c:980e]) by smtp.gmail.com with ESMTPSA id y9sm6180292obg.4.2015.12.04.09.27.10 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Dec 2015 09:27:10 -0800 (PST) Sender: Warner Losh Subject: Re: Minor improvement in debugging Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: multipart/signed; boundary="Apple-Mail=_67E0377A-C2C0-4D03-90FB-1AE81E999176"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5.2 From: Warner Losh In-Reply-To: <5661CAC5.9080603@interlog.com> Date: Fri, 4 Dec 2015 10:27:09 -0700 Cc: scsi@freebsd.org Message-Id: <7AEAED43-1EC8-42C0-9AAD-BE31AEE258CA@bsdimp.com> References: <5661CAC5.9080603@interlog.com> To: dgilbert@interlog.com X-Mailer: Apple Mail (2.2104) 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:27:12 -0000 --Apple-Mail=_67E0377A-C2C0-4D03-90FB-1AE81E999176 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 4, 2015, at 10:17 AM, Douglas Gilbert = wrote: >=20 > On 15-12-04 12:03 PM, Warner Losh wrote: >> While writing the NVMe CAM attachment, I noticed that the = xpt_action() >> routine=E2=80=99s 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=E2=80=99t. >>=20 >> This review fixes that. https://reviews.freebsd.org/D4382 >=20 > 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__ ); >=20 > That is a little less reabable but more robust, for example if someone > later renames the containing function. >=20 > This assumes compliance with C99 (when __func__ was introduced) or = later. The CAM debug doesn=E2=80=99t do that anywhere, so I=E2=80=99m not going = to introduce it piecemeal. But it is a great general suggestion. Warner --Apple-Mail=_67E0377A-C2C0-4D03-90FB-1AE81E999176 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----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----- --Apple-Mail=_67E0377A-C2C0-4D03-90FB-1AE81E999176--