From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6R57-00066P-Ip for qemu-devel@nongnu.org; Wed, 21 Sep 2011 13:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6R56-0003dn-J0 for qemu-devel@nongnu.org; Wed, 21 Sep 2011 13:59:37 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:56170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6R56-0003dZ-Ed for qemu-devel@nongnu.org; Wed, 21 Sep 2011 13:59:36 -0400 Received: by wyh22 with SMTP id 22so2220120wyh.4 for ; Wed, 21 Sep 2011 10:59:35 -0700 (PDT) Sender: Richard Henderson Message-ID: <4E7A2602.5000709@twiddle.net> Date: Wed, 21 Sep 2011 10:59:30 -0700 From: Richard Henderson MIME-Version: 1.0 References: <20110921155051.10212.14972.stgit@ginnungagap.bsc.es> In-Reply-To: <20110921155051.10212.14972.stgit@ginnungagap.bsc.es> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] trace: Provide a per-event status define for conditional compilation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TGx1w61zIFZpbGFub3Zh?= Cc: qemu-devel@nongnu.org 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~