From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmtO-000895-S8 for qemu-devel@nongnu.org; Wed, 05 Oct 2016 10:09:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brmtK-0001V8-98 for qemu-devel@nongnu.org; Wed, 05 Oct 2016 10:09:54 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brmtJ-0001Un-Ss for qemu-devel@nongnu.org; Wed, 05 Oct 2016 10:09:50 -0400 Received: by mail-wm0-x243.google.com with SMTP id p138so24774324wmb.0 for ; Wed, 05 Oct 2016 07:09:49 -0700 (PDT) Date: Wed, 5 Oct 2016 15:09:47 +0100 From: Stefan Hajnoczi Message-ID: <20161005140947.GJ863@stefanha-x1.localdomain> References: <1475588159-30598-1-git-send-email-berrange@redhat.com> <1475588159-30598-12-git-send-email-berrange@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YZVh52eu0Ophig4D" Content-Disposition: inline In-Reply-To: <1475588159-30598-12-git-send-email-berrange@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 11/20] trace: emit name <-> ID mapping in simpletrace header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, =?iso-8859-1?Q?Llu=EDs?= Vilanova , Stefan Hajnoczi --YZVh52eu0Ophig4D Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 04, 2016 at 02:35:50PM +0100, Daniel P. Berrange wrote: > Currently simpletrace assumes that events are given IDs > starting from 0, based on the order in which they appear > in the trace-events file, with no gaps. When the > trace-events file is split up, this assumption becomes > problematic. >=20 > To deal with this, extend the simpletrace format so that > it outputs a table of event name <-> ID mappings. That > will allow QEMU to assign arbitrary IDs to events without > breaking simpletrace parsing. >=20 > The v3 simple trace format was >=20 > FILE HEADER > EVENT TRACE RECORD 0 > EVENT TRACE RECORD 1 > ... > EVENT TRACE RECORD N >=20 > The v4 simple trace format is now >=20 > FILE HEADER > EVENT MAPPING RECORD 0 > EVENT MAPPING RECORD 1 > ... > EVENT MAPPING RECORD M > EVENT TRACE RECORD RECORD 0 > EVENT TRACE RECORD RECORD 1 > ... > EVENT TRACE RECORD N >=20 > Although this shows all the mapping records being emitted > upfront, this is not required by the format. While the main > simpletrace backend will emit all mappings at startup, > the systemtap simpletrace.stp script will emit the mappings > at first use. eg >=20 > FILE HEADER > ... > EVENT MAPPING RECORD 0 > EVENT TRACE RECORD RECORD 0 > EVENT TRACE RECORD RECORD 1 > EVENT MAPPING RECORD 1 > EVENT TRACE RECORD RECORD 2 > ... > EVENT TRACE RECORD N >=20 > This is more space efficient given that most trace records > only include a subset of events. >=20 > In modifying the systemtap simpletrace code, a 'begin' probe > was added to emit the trace event header, so you no longer > need to add '--no-header' when running simpletrace.py for > systemtap generated trace files. >=20 > Signed-off-by: Daniel P. Berrange > --- > scripts/simpletrace.py | 50 ++++++++++++++++++++--= ------ > scripts/tracetool/format/simpletrace_stap.py | 24 +++++++++++-- > trace/simple.c | 33 ++++++++++++++++-- > 3 files changed, 89 insertions(+), 18 deletions(-) Reviewed-by: Stefan Hajnoczi --YZVh52eu0Ophig4D Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJX9QmrAAoJEJykq7OBq3PIRZMH+wUCqA50xiOtZEm/RN3XAz70 d4WDil85OqlqiX4BUPBUoCHXx1mzGdCre3D7qN7sSOUDfd1n+I2OztLeo/qMwl9K 78OvEp5CEqWt8oGuHh+Ad1nSItdYxSDPtj+Hnoup2zH+p4gONTnvLBRLkbk2v5p3 Iwi5f7HcoJ0zmABUIX3eiG+5rztw1pwPPKWZa6fAay8t8tWhgsIPAWoc+bAPH0jt 2jmo9zzfA4FC0BxS95aRbp9n1kJLscGuBEwA7Te/6kChWL+Yj1rTSvmzanwseVVE T3jk9la7K0ZBsEHtJUpFrc6BPLqRBqBhbFlgP8C2JxFleNXB3HWMdHGDbQkz61U= =S3sh -----END PGP SIGNATURE----- --YZVh52eu0Ophig4D--