Received: from eggs.gnu.org ([2001:4830:134:3::10]:56154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXW8Y-0006c3-HT for qemu-devel@nongnu.org; Wed, 10 Aug 2016 12:13:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXW8U-0003jy-8K for qemu-devel@nongnu.org; Wed, 10 Aug 2016 12:13:45 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:56249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXW8T-0003jY-Sl for qemu-devel@nongnu.org; Wed, 10 Aug 2016 12:13:42 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1470756748-18933-1-git-send-email-berrange@redhat.com> <1470756748-18933-11-git-send-email-berrange@redhat.com> <87inv8u3ke.fsf@fimbulvetr.bsc.es> <20160810144720.GN13393@redhat.com> Date: Wed, 10 Aug 2016 18:13:40 +0200 In-Reply-To: <20160810144720.GN13393@redhat.com> (Daniel P. Berrange's message of "Wed, 10 Aug 2016 15:47:20 +0100") Message-ID: <874m6sppor.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 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: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Daniel P Berrange writes: > 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_i= nit' 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 I saw them later, sorry. But I still think these too should be renamed, to = make it clear it's related to tracing. >> 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. I can do that. >> [...] >> > 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 Exactly. Cheers, Lluis