From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752567AbbBMJ64 (ORCPT ); Fri, 13 Feb 2015 04:58:56 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:59415 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912AbbBMJ6z (ORCPT ); Fri, 13 Feb 2015 04:58:55 -0500 Date: Fri, 13 Feb 2015 10:58:50 +0100 From: Markus Pargmann To: Joe Perches Cc: nbd-general@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/9] nbd: Restructure debugging prints Message-ID: <20150213095850.GA10654@pengutronix.de> References: <1423774657-12748-1-git-send-email-mpa@pengutronix.de> <1423774657-12748-7-git-send-email-mpa@pengutronix.de> <1423775328.15343.38.camel@perches.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: <1423775328.15343.38.camel@perches.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:45:35 up 22 days, 23:52, 74 users, load average: 0.74, 0.51, 0.61 User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 12, 2015 at 01:08:48PM -0800, Joe Perches wrote: > On Thu, 2015-02-12 at 21:57 +0100, Markus Pargmann wrote: > > dprintk has some name collisions with other frameworks and drivers. It > > is also not necessary to have these custom debug print filters. Dynamic > > debug offers the same amount of filtered debugging. > >=20 > > This patch replaces all dprintks with dev_dbg(). It also removes the > > ioctl dprintk which prints the ingoing ioctls which should be > > replaceable by strace or similar stuff. >=20 > Perhaps add >=20 > #define nbd_dbg(nbd, fmt, ...) \ > dev_dbg(disk_to_dev((nbd)->disk), "%s: " fmt, \ > nbd->disk->disk_name, ##__VA_ARGS__) I am not really happy with those custom debug print macros. What do you think about an inline function 'nbd_to_dev' instead? >=20 > (or function with %pV) >=20 > > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c > [] > > +static void nbd_end_request(struct nbd_device *nbd, struct request *re= q) > > { > > int error =3D req->errors ? -EIO : 0; > > struct request_queue *q =3D req->q; > > unsigned long flags; > > =20 > > - dprintk(DBG_BLKDEV, "%s: request %p: %s\n", req->rq_disk->disk_name, > > - req, error ? "failed" : "done"); > > + dev_dbg(disk_to_dev(nbd->disk), "%s: request %p: %s\n", > > + req->rq_disk->disk_name, req, error ? "failed" : "done"); >=20 > so this becomes >=20 > nbd_dbg(nbd, "request %p: %s\n", > req, error ? "failed" : "done"); so this would be: nbd_dbg(nbd_to_dev(nbd), "request %p: %s\n", req, error ? "failed" : "done"); Best regards, Markus --=20 Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --mP3DRpeJDSE+ciuQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJU3crZAAoJEEpcgKtcEGQQEX8P/2pdS3zVkXcLjVUjMzItRxM7 x1fsGODY5wclUzB7qSYQejD2wlsPnq8gBNyDQj9Co7WlCdeWscr9gZAM8W6rLUIF JtroEBULiMFk5oeQkVQzBzZ5DH8LEzEtLmy52k5rjTh9dCxCeH6WtHdDr62AKa8a 5o/AO4QTFUmWMBrQO3jB+HkO142HSMjlt+f43THKv+6LYwq2CCLUFzglZu8mxeZt NreQRpFqJMKa5aFFJvRijUVtt06cgJ2PyXGFdXrXF98oEm0+7UO3BYwc2eJTi70w rgvLlCmPYBTp1rZcP/lsvXb80O7Ir6Uy4/mx7F++RIrRQN2QUqUjK2G3Y3/RAQ3v gUoEJdX5SGojsuMS9WRtbRogSv+HEF0QMGVbFHS+kLLAkKkage7cAGLcm2bpFU0o DtqgomryzFoq3qwWqoPt7wBqd8FZ6ERyduNv8l6Oij/z6NTBPIEORy6NpMGv4ODv rS4FJipFel6AkljeysEYOqmvJ+eSvjfYd3ZIKHim+3CNTtyHjU7doIyb5Xq2Lgd0 MEnnVzfcZUwANqFn8CRwp9MFOn8iBA/iHXvd0uib00yY9XutAzgs//QCSR6Qta3V AOJ+A+CAIUGO5xgiaTFumjU30BLl1+zSfyUW/JGYtKms6ixJAnDNrbSPas5WswLT yNfkZ3HXZ4TQi7ZUS0jB =3b5X -----END PGP SIGNATURE----- --mP3DRpeJDSE+ciuQ--