qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] trace: Provide a per-event status define for conditional	compilation
Date: Wed, 21 Sep 2011 10:59:30 -0700	[thread overview]
Message-ID: <4E7A2602.5000709@twiddle.net> (raw)
In-Reply-To: <20110921155051.10212.14972.stgit@ginnungagap.bsc.es>

On 09/21/2011 08:50 AM, Lluís Vilanova wrote:
> +        void *complex = NULL;
> +        if (!size && !allow_zero_malloc()) {
> +            abort();
> +        }
> +        ptr = oom_check(malloc(size ? size : 1));
> +    #if trace_qemu_malloc_enabled
> +        /* some complex computations to produce the 'complex' value */
> +    #endif
> +        trace_qemu_malloc(size, ptr, complex);  /* <-- trace event */

That's just ugly.  Surely something like

    if (trace_qemu_malloc_enabled) {
        void *complex;
        /* some complex computations to produce the 'complex' value */
        trace_qemu_malloc(size, ptr, complex);
    }

be a better example to set.


r~

  reply	other threads:[~2011-09-21 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 15:50 [Qemu-devel] [PATCH] trace: Provide a per-event status define for conditional compilation Lluís Vilanova
2011-09-21 17:59 ` Richard Henderson [this message]
2011-09-21 18:35   ` Lluís Vilanova
  -- strict thread matches above, loose matches on Subject: below --
2011-09-21 18:38 Lluís Vilanova
2011-09-24  7:51 ` Blue Swirl
2011-09-25 17:39   ` Lluís Vilanova
2011-09-25 20:03     ` Blue Swirl
2011-09-25 22:10       ` Lluís Vilanova

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=4E7A2602.5000709@twiddle.net \
    --to=rth@twiddle.net \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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).