From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
Prerna Saxena <prerna@linux.vnet.ibm.com>
Subject: [Qemu-devel] Re: [PATCH] simpletrace: Thread-safe tracing
Date: Sun, 27 Feb 2011 19:16:34 +0100 [thread overview]
Message-ID: <4D6A9502.1030100@redhat.com> (raw)
In-Reply-To: <AANLkTikN=xtOPURYhXMW4uUZabNB0_sfWRZhJ+ic+9DR@mail.gmail.com>
On 02/27/2011 06:02 PM, Stefan Hajnoczi wrote:
> On Sun, Feb 27, 2011 at 3:13 PM, Paolo Bonzini<pbonzini@redhat.com> 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.
Hmm, right... they'll use stdio to trace Win32 then... :) I was
actually thinking more of the code duplication.
But do you really need tracing at such a low level? I'd expect tracing
wrappers like qemu_lock_mutex_iothread, not mutexes in general.
Paolo
next prev parent reply other threads:[~2011-02-27 18:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-27 14:58 [Qemu-devel] [PATCH] simpletrace: Thread-safe tracing Stefan Hajnoczi
2011-02-27 15:13 ` [Qemu-devel] " Paolo Bonzini
2011-02-27 17:02 ` Stefan Hajnoczi
2011-02-27 18:16 ` Paolo Bonzini [this message]
2011-02-28 9:35 ` Stefan Hajnoczi
2011-02-27 16:14 ` [Qemu-devel] " Avi Kivity
2011-02-27 17:06 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D6A9502.1030100@redhat.com \
--to=pbonzini@redhat.com \
--cc=kwolf@redhat.com \
--cc=prerna@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).