[Top][All Lists]
[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: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] trace: Provide a per-event status define for conditional compilation |
Date: |
Wed, 21 Sep 2011 10:59:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
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~