qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] trace: Provide a per-event status define for co


From: Lluís Vilanova
Subject: Re: [Qemu-devel] [PATCH] trace: Provide a per-event status define for conditional compilation
Date: Wed, 21 Sep 2011 20:35:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Richard Henderson writes:

> 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.

True XD

I'll send a new version, thanks.


Lluis

-- 
 "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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]