[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH] simpletrace: Thread-safe tracing
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] Re: [PATCH] simpletrace: Thread-safe tracing |
Date: |
Sun, 27 Feb 2011 17:02:06 +0000 |
On Sun, Feb 27, 2011 at 3:13 PM, Paolo Bonzini <address@hidden> wrote:
> On 02/27/2011 03:58 PM, Stefan Hajnoczi wrote:
>>
>> + * Trace records are written out by a dedicated thread. The thread waits
>> for
>> + * records to become available, writes them out, and then waits again.
>> + */
>> +static pthread_mutex_t trace_lock = PTHREAD_MUTEX_INITIALIZER;
>> +static pthread_cond_t trace_available_cond = PTHREAD_COND_INITIALIZER;
>> +static pthread_cond_t trace_empty_cond = PTHREAD_COND_INITIALIZER;
>> +static bool trace_available;
>> +static bool trace_writeout_enabled;
>
> Please use QemuThread.
The tracing code itself should use avoid core QEMU code. Otherwise we
can't trace QemuThread - we'd have an infinite loop.
Stefan