Received: from eggs.gnu.org ([2001:4830:134:3::10]:57616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXUZt-0007IS-62 for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:33:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXUZq-0008Lh-Dk for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:33:53 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:43895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXUZq-0008L8-2G for qemu-devel@nongnu.org; Wed, 10 Aug 2016 10:33:50 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1470756748-18933-1-git-send-email-berrange@redhat.com> <1470756748-18933-61-git-send-email-berrange@redhat.com> Date: Wed, 10 Aug 2016 16:33:47 +0200 In-Reply-To: <1470756748-18933-61-git-send-email-berrange@redhat.com> (Daniel P. Berrange's message of "Tue, 9 Aug 2016 16:32:28 +0100") Message-ID: <87shucr8vo.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain 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: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Daniel P Berrange writes: > Describe use of per-subdir trace events files and how it impacts > code generation. > Signed-off-by: Daniel P. Berrange > --- > docs/tracing.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 52 insertions(+), 9 deletions(-) > 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. > == Trace events == > +=== Sub-directory setup === > + > 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 event, its > -arguments, and the format string which can be used for pretty-printing: > +in a "trace-events" file. The first (non-comment) statement in the file > +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 arbitrarily > +chosen, but extra fun the current "trace-events" files use values from the > +"powerful number" integer sequence :-) Can we get rid of the "@id_offset(NN)"? If we're generating a trace-events-all all the same, we can use that to generate all the per-directory file *and* still keep the simpler flat event ids. For example, first we concatenate /trace-events, /io/trace-events and /hw/usb/trace-events into /trace-events-all to produce: @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 Then we can use /trace-events-all to generate all the per-directory trace.h files while ensuring a perfectly flat event identifier space (a single generated-events.c is used). This should minimize changes to tracing code and avoid further restrictions (like the "top-level vcpu" one). Cheers, Lluis