From: Eric Blake <eblake@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-arm@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-trivial@nongnu.org, Jason Wang <jasowang@redhat.com>,
Alistair Francis <alistair@alistair23.me>,
qemu-devel@nongnu.org, Ramon Fried <rfried.dev@gmail.com>
Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH v2] net: cadence_gem: fix compilation error when debug is on
Date: Wed, 12 Jun 2019 14:28:21 -0500 [thread overview]
Message-ID: <9b51858e-a876-aff8-15f7-228f659d0d20@redhat.com> (raw)
In-Reply-To: <87o932el61.fsf@zen.linaroharston>
[-- Attachment #1.1: Type: text/plain, Size: 1048 bytes --]
On 6/12/19 1:03 PM, Alex Bennée wrote:
>
> Ramon Fried <rfried.dev@gmail.com> writes:
>
>> defining CADENCE_GEM_ERR_DEBUG causes compilation
>> errors, fix that.
>
> It would be worth doing something like:
>
> #ifdef CADENCE_GEM_ERR_DEBUG
> #define CADENCE_GEM_GATE 1
> #else
> #define CADENCE_GEM_GATE 0
> #endif
>
> #define DB_PRINT(...) do { \
> if (CADENCE_GEM_GATE) { \
> fprintf(stderr, ": %s: ", __func__); \
> fprintf(stderr, ## __VA_ARGS__); \
> } \
> } while (0)
>
> So these format strings don't go stale in and only get detected on
> --debug builds.
>
> While your at it I suspect the fprintf debug would be better of as:
>
> qemu_log("%s: " fmt, __func__, ## args);
Indeed, or even see if it is worth converting to full-on trace points
for dynamic control of whether to catch these things without having to
recompile debug on or off.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2019-06-12 19:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-11 14:55 [Qemu-devel] [PATCH v2] net: cadence_gem: fix compilation error when debug is on Ramon Fried
2019-06-11 16:21 ` Laurent Vivier
2019-06-12 4:27 ` Ramon Fried
2019-06-12 7:40 ` Laurent Vivier
2019-06-15 5:10 ` Ramon Fried
2019-06-12 8:59 ` Philippe Mathieu-Daudé
2019-06-12 18:03 ` [Qemu-devel] [Qemu-arm] " Alex Bennée
2019-06-12 19:28 ` Eric Blake [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9b51858e-a876-aff8-15f7-228f659d0d20@redhat.com \
--to=eblake@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=alistair@alistair23.me \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rfried.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).