From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk9Oy-0001bU-Rz for qemu-devel@nongnu.org; Wed, 14 Sep 2016 08:35:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bk9Ou-0002rP-KN for qemu-devel@nongnu.org; Wed, 14 Sep 2016 08:34:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk9Ou-0002rH-Bd for qemu-devel@nongnu.org; Wed, 14 Sep 2016 08:34:52 -0400 Date: Wed, 14 Sep 2016 13:34:47 +0100 From: "Daniel P. Berrange" Message-ID: <20160914123447.GO28399@redhat.com> Reply-To: "Daniel P. Berrange" References: <1470756748-18933-1-git-send-email-berrange@redhat.com> <1470756748-18933-61-git-send-email-berrange@redhat.com> <87shucr8vo.fsf@fimbulvetr.bsc.es> <20160810145125.GP13393@redhat.com> <87eg5wppsj.fsf@fimbulvetr.bsc.es> <20160811081317.GA27458@redhat.com> <87ziojlio5.fsf@fimbulvetr.bsc.es> <20160902212404.GH21771@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160902212404.GH21771@stefanha-x1.localdomain> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-2.8 v1 60/60] trace: update docs to reflect new code generation approach List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On Fri, Sep 02, 2016 at 05:24:04PM -0400, Stefan Hajnoczi wrote: > On Thu, Aug 11, 2016 at 12:11:06PM +0200, Llu=C3=ADs Vilanova wrote: > > Daniel P Berrange writes: > >=20 > > > On Wed, Aug 10, 2016 at 06:11:24PM +0200, Llu=C3=ADs Vilanova wrote= : > > >> Daniel P Berrange writes: > > >>=20 > > >> > On Wed, Aug 10, 2016 at 04:33:47PM +0200, Llu=C3=ADs Vilanova wr= ote: > > >> >> Daniel P Berrange writes: > > [...] > > >> >> For example, first we concatenate /trace-events, /io/trace-even= ts and > > >> >> /hw/usb/trace-events into /trace-events-all to produce: > > >> >>=20 > > >> >> @group core > > >> >> @dir / > > >> >> # contents of /trace-events > > >> >> @group io > > >> >> @dir /io > > >> >> # contents of /io/trace-events > > >> >> @group hw_usb > > >> >> @dir /hw/usb > > >> >> # contents of /hw/usb/trace-events > > >> >>=20 > > >> >> Then we can use /trace-events-all to generate all the per-direc= tory trace.h > > >> >> files while ensuring a perfectly flat event identifier space (a= single > > >> >> generated-events.c is used). > > >> >>=20 > > >> >> This should minimize changes to tracing code and avoid further = restrictions > > >> >> (like the "top-level vcpu" one). > > >>=20 > > >> > That means when any individual trace file is changed, we re-gene= rate the > > >> > world, which is exactly what this series is designed to avoid. > > >>=20 > > >> Nope. We re-generate /trace-events-all, but each individual file g= enerated > > >> afterwards (taken from the "@dir" directive) will change only if i= ts new > > >> contents do (the Makefile uses cmp to check if files need updating= from their > > >> corresponding timestamp file). > >=20 > > > The contents will still need to change too if we have a global numb= ering > > > space as your suggestion requires. The event groups are the only wa= y to > > > avoid that. > >=20 > > Aha, that's true. I didn't think of that, sorry. >=20 > Nevertheless, I agree that @id_offset() should be eliminated to avoid > collisions and manual effort when trace-events files are added. I think I have a workable solution to eliminate this. During build I'll create a file 'trace-event-file-list' which contains a list of paths to 'trace-event' files in the tree. We'll then use the line number in this file as the id offset for events. The generated $SUBDIR/trace.h file will depend on trace-event-file-list. So we'll have fully automatic numbering for each trace-event file and will only get a full rebuild if someone adds a completely new trace-event file, which is acceptable. 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 :|