From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXUn1-0007mW-AK for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:47:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXUmy-0004pc-TL for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:47:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXUmy-0004pA-Kt for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:47:24 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 838CB80096 for ; Wed, 10 Aug 2016 14:47:23 +0000 (UTC) Date: Wed, 10 Aug 2016 15:47:20 +0100 From: "Daniel P. Berrange" Message-ID: <20160810144720.GN13393@redhat.com> Reply-To: "Daniel P. Berrange" References: <1470756748-18933-1-git-send-email-berrange@redhat.com> <1470756748-18933-11-git-send-email-berrange@redhat.com> <87inv8u3ke.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87inv8u3ke.fsf@fimbulvetr.bsc.es> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.8 v1 10/60] trace: remove fixed global event state arrays List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Stefan Hajnoczi On Wed, Aug 10, 2016 at 04:00:17PM +0200, Llu=C3=ADs Vilanova wrote: > Daniel P Berrange writes: > [...] > > diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool= /format/events_c.py > > index 9203377..bab6404 100644 > > --- a/scripts/tracetool/format/events_c.py > > +++ b/scripts/tracetool/format/events_c.py > > @@ -25,7 +25,10 @@ def generate(events, backend): > > '#include "trace/control.h"', > > '') > =20 > > - out('TraceEvent trace_events[TRACE_EVENT_COUNT] =3D {') > > + out('uint16_t dstate[TRACE_EVENT_COUNT];') > > + out('bool dstate_init[TRACE_EVENT_COUNT];') > > + > > + out('static TraceEvent trace_events[TRACE_EVENT_COUNT] =3D {') > =20 > > for e in events: > > if "vcpu" in e.properties: >=20 > I'd rather keep them as 'trace_events_dstate' and 'trace_events_dstate_= init' if > most references are auto-generated. Or maybe I just missed something. Later patches rename this again, giving it a custom prefix for each group > Also, maybe we should just try to get rid of the dstate_init structure.= Only > vcpu events need late initialization, which could be something like: >=20 > trace_events_enabled_count--; > dstate[ev->id]--; > trace_event_set_state_dynamic(dstate, ev, true); >=20 > Non-vcpu events shouldn't need late initialization. I'd rather not try to refactor that logic at the same time - it could be done as a later patch, or if you want to submit a patch to fix that I can rebase on top of it. > [...] > > diff --git a/stubs/trace-control.c b/stubs/trace-control.c > > index fe59836..31566c2 100644 > > --- a/stubs/trace-control.c > > +++ b/stubs/trace-control.c > > @@ -11,16 +11,12 @@ > > #include "trace/control.h" > =20 > =20 > > -void trace_event_set_state_dynamic(TraceEvent *ev, bool state) > > +void trace_event_set_state_dynamic(uint16_t *dstate, TraceEvent *ev,= bool state) > > { > > - TraceEventID id; > > assert(trace_event_get_state_static(ev)); > > - id =3D trace_event_get_id(ev); > > - trace_events_enabled_count +=3D state - trace_events_dstate[id]; > > - trace_events_dstate[id] =3D state; > > } >=20 > Should not be empty (here, stub means it's not target code). Oh hmm, for qemu-img & friends, i geuss Regards, Daniel --=20 |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| |: http://libvirt.org -o- http://virt-manager.or= g :| |: http://autobuild.org -o- http://search.cpan.org/~danberr= / :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vn= c :|