From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXUqy-0003ki-L2 for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXUqw-0005k7-2l for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:51:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXUqv-0005k0-O6 for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:51:29 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 56F0683F3B for ; Wed, 10 Aug 2016 14:51:28 +0000 (UTC) Date: Wed, 10 Aug 2016 15:51:25 +0100 From: "Daniel P. Berrange" Message-ID: <20160810145125.GP13393@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87shucr8vo.fsf@fimbulvetr.bsc.es> 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: qemu-devel@nongnu.org, Stefan Hajnoczi On Wed, Aug 10, 2016 at 04:33:47PM +0200, Llu=C3=ADs Vilanova wrote: > Daniel P Berrange writes: >=20 > > Describe use of per-subdir trace events files and how it impacts > > code generation. >=20 > > Signed-off-by: Daniel P. Berrange > > --- > > docs/tracing.txt | 61 ++++++++++++++++++++++++++++++++++++++++++++++= +--------- > > 1 file changed, 52 insertions(+), 9 deletions(-) >=20 > > diff --git a/docs/tracing.txt b/docs/tracing.txt > > index 29f2f9a..b7ba179 100644 > > --- a/docs/tracing.txt > > +++ b/docs/tracing.txt > > @@ -27,18 +27,51 @@ for debugging, profiling, and observing execution= . > =20 > > =3D=3D Trace events =3D=3D > =20 > > +=3D=3D=3D Sub-directory setup =3D=3D=3D > > + > > Each directory in the source tree can declare a set of static trace = events > > -in a "trace-events" file. Each trace event declaration names the eve= nt, its > > -arguments, and the format string which can be used for pretty-printi= ng: > > +in a "trace-events" file. The first (non-comment) statement in the f= ile > > +must be "@id_offset(NN)" where NN is an integer that is unique among= all > > +"trace-events" files in the QEMU source tree. The IDs can be arbitra= rily > > +chosen, but extra fun the current "trace-events" files use values fr= om the > > +"powerful number" integer sequence :-) >=20 > Can we get rid of the "@id_offset(NN)"? If we're generating a trace-eve= nts-all > all the same, we can use that to generate all the per-directory file *a= nd* still > keep the simpler flat event ids. One thing that occurred to me is that we could take a hash of the group name. Since we have few enough sub-dirs / groups, and a large enough ID space, it ought to be possible to get a hash which is unique. The trace tool can double check that all groups get a unique hash > For example, first we concatenate /trace-events, /io/trace-events 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-directory tra= ce.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 restrict= ions > (like the "top-level vcpu" one). That means when any individual trace file is changed, we re-generate the world, which is exactly what this series is designed to avoid. 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 :|