Received: from eggs.gnu.org ([208.118.235.92]:36665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCrkY-00047s-2Y for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:17:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCrU5-0006G6-Ab for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:01:57 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:39965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCrU4-0006F7-UH for qemu-devel@nongnu.org; Tue, 05 Mar 2013 08:00:45 -0500 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20130301152934.22476.82209.stgit@fimbulvetr.bsc.es> <20130304142214.GA3981@stefanha-thinkpad.redhat.com> <87d2ve6frc.fsf@fimbulvetr.bsc.es> <20130305103357.GD1938@stefanha-thinkpad.redhat.com> Date: Tue, 05 Mar 2013 14:00:42 +0100 In-Reply-To: <20130305103357.GD1938@stefanha-thinkpad.redhat.com> (Stefan Hajnoczi's message of "Tue, 5 Mar 2013 11:33:57 +0100") Message-ID: <8762160znp.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v11 0/7] trace: Generic event state description List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Blue Swirl , qemu-devel@nongnu.org Stefan Hajnoczi writes: > On Mon, Mar 04, 2013 at 10:01:43PM +0100, Llu=C3=ADs Vilanova wrote: >> Stefan Hajnoczi writes: >>=20 >> > On Fri, Mar 01, 2013 at 04:29:35PM +0100, Llu=C3=ADs Vilanova wrote: >> >> Provides a generic event state description structure (TraceEvent) and= a more >> >> detailed event control and query interface. >> >>=20 >> >> This is achieved by creating a new "non-public" tracing backend (i.e.= , not >> >> selectable by the user at configure time) that will generate the appr= opriate >> >> event description information. >> >>=20 >> >> Signed-off-by: Llu=C3=ADs Vilanova >> >> --- >> >>=20 >> >> Changes in v11: >> >>=20 >> >> * Rebase on a4bcea3 from master. >>=20 >> > Hi Llu=C3=ADs, >> > Thanks for rebasing. Unfortunately I still hit the hang on shutdown >> > with the simple trace backend. >>=20 >> > Steps to reproduce: >> > $ ./configure --target-list=3Dx86_64-softmmu --enable-trace-backend=3D= simple >> > $ make >> > $ cat my-events >> > bdrv_open_common >> > $ x86_64-softmmu/qemu-system-x86_64 \ >> > -enable-kvm -m 1024 \ >> > -trace events=3Dmy-events \ >> > -drive if=3Dvirtio,cache=3Dnone,file=3Dtest.img >> > Ctrl-Alt-2 >> > (qemu) quit >> > ...hang... >>=20 >> > Please let me know if you are able to reproduce it. qemu.git/master >> > does not behave this way. >>=20 >> I've been unable to reproduce it with v11, but was able to using v10 (al= though >> only a couple of times). > Found it! > The problem is that trace_record_start() is writing a 4-byte event field > instead of an 8-byte event field. TraceEventID used to be typedef > uint64_t. In your series TraceEventID becomes an enum and breaks > trace_record_start(). > Try this: > diff --git a/trace/simple.c b/trace/simple.c > index 5bb905c..1e3f691 100644 > --- a/trace/simple.c > +++ b/trace/simple.c > @@ -218,6 +218,7 @@ int trace_record_start(TraceBufferRecord *rec, TraceEv > { > unsigned int idx, rec_off, old_idx, new_idx; > uint32_t rec_len =3D sizeof(TraceRecord) + datasize; > + uint64_t event_u64 =3D event; > uint64_t timestamp_ns =3D get_clock(); =20 > do { > @@ -235,7 +236,7 @@ int trace_record_start(TraceBufferRecord *rec, TraceEv > idx =3D old_idx % TRACE_BUF_LEN; =20 > rec_off =3D idx; > - rec_off =3D write_to_buffer(rec_off, &event, sizeof(event)); > + rec_off =3D write_to_buffer(rec_off, &event_u64, sizeof(event_u64)); > rec_off =3D write_to_buffer(rec_off, ×tamp_ns, sizeof(timestamp= _ns > rec_off =3D write_to_buffer(rec_off, &rec_len, sizeof(rec_len)); Works for me, thx! I'll send v12 in a couple of minutes. 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