From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbB39-00008d-MB for qemu-devel@nongnu.org; Wed, 21 Nov 2012 09:13:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbB35-000873-KD for qemu-devel@nongnu.org; Wed, 21 Nov 2012 09:13:11 -0500 Received: from cantor2.suse.de ([195.135.220.15]:56121 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbB35-00086i-Dr for qemu-devel@nongnu.org; Wed, 21 Nov 2012 09:13:07 -0500 Message-ID: <50ACE16D.8020905@suse.de> Date: Wed, 21 Nov 2012 15:13:01 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1353080159-10536-1-git-send-email-fred.konrad@greensocs.com> <1353080159-10536-2-git-send-email-fred.konrad@greensocs.com> <50ACD157.6010100@suse.de> <50ACDFA8.4040504@greensocs.com> In-Reply-To: <50ACDFA8.4040504@greensocs.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 1/3] virtio-bus : Introduce VirtioBus. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?KONRAD_Fr=E9d=E9ric?= Cc: Peter Maydell , Stefan Hajnoczi , Evgeny Voevodin , mark.burton@greensocs.com, qemu-devel@nongnu.org, Anthony Liguori , Cornelia Huck Am 21.11.2012 15:05, schrieb KONRAD Fr=E9d=E9ric: > On 21/11/2012 14:04, Andreas F=E4rber wrote: >> Am 16.11.2012 16:35, schrieb fred.konrad@greensocs.com: >>> +#define DEBUG_VIRTIO_BUS >>> + >>> +#ifdef DEBUG_VIRTIO_BUS >>> + >>> +#define DPRINTF(fmt, ...) \ >>> +do { printf("virtio_bus: " fmt , ## __VA_ARGS__); } while (0) >>> +#else >>> +#define DPRINTF(fmt, ...) do {} while (0) >>> +#endif >> We recently had a discussion about bitrotting DPRINTF() statements whe= re >> I suggested to use if (0) instead of a no-op macro like this that >> doesn't reference fmt and the varargs. > I don't understand what you suggested, can you point me to an example ? I don't have a link at hand, maybe Evgeny does. It was along the lines of= : #define DEBUG_VIRTIO_BUS 0 #define DPRINTF(fmt, ...) if (DEBUG_VIRTIO_BUS) { \ printf("virtio_bus: " fmt , ## __VA_ARGS__); \ } The officially preferred alternative is to use tracepoints. ;) Cheers, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg