Received: from eggs.gnu.org ([140.186.70.92]:46641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6RfX-00042t-TT for qemu-devel@nongnu.org; Wed, 21 Sep 2011 14:37:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6RfW-0002e6-Oc for qemu-devel@nongnu.org; Wed, 21 Sep 2011 14:37:15 -0400 Received: from gw.ac.upc.edu ([147.83.30.3]:46008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6RfW-0002df-Hr for qemu-devel@nongnu.org; Wed, 21 Sep 2011 14:37:14 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20110921155051.10212.14972.stgit@ginnungagap.bsc.es> <4E7A2602.5000709@twiddle.net> Date: Wed, 21 Sep 2011 20:35:27 +0200 In-Reply-To: <4E7A2602.5000709@twiddle.net> (Richard Henderson's message of "Wed, 21 Sep 2011 10:59:30 -0700") Message-ID: <87r539vj4g.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Richard Henderson Cc: qemu-devel@nongnu.org Richard Henderson writes: > On 09/21/2011 08:50 AM, Llu=C3=ADs Vilanova wrote: >> + void *complex =3D NULL; >> + if (!size && !allow_zero_malloc()) { >> + abort(); >> + } >> + ptr =3D 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. True XD I'll send a new version, thanks. Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth