From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVNEN-0007QS-JB for qemu-devel@nongnu.org; Tue, 29 Nov 2011 07:56:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVNED-0000z4-9L for qemu-devel@nongnu.org; Tue, 29 Nov 2011 07:56:15 -0500 Received: from mail-fx0-f45.google.com ([209.85.161.45]:36959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVNED-0000ys-1W for qemu-devel@nongnu.org; Tue, 29 Nov 2011 07:56:05 -0500 Received: by fabs1 with SMTP id s1so832584fab.4 for ; Tue, 29 Nov 2011 04:56:04 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <4ED497CC.5040607@linux.vnet.ibm.com> Date: Tue, 29 Nov 2011 12:56:03 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] RFC: Design Doc for a new trace format (to support variable number/size of args per event) simpletrace-v2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Harsh Bora , qemu-devel@nongnu.org, "Aneesh Kumar K. V" On Tue, Nov 29, 2011 at 12:35 PM, Markus Armbruster wro= te: > Stefan Hajnoczi writes: > > [...] >> So forget I said "self-describing" :). =A0I think the only changes from >> the v1 format we need are: >> >> 1. New magic number to mark v2 format. >> >> 2. Trace records are no longer fixed-length, they include a size field: >> >> typedef struct { >> =A0 =A0 uint32_t length; /* in bytes */ >> =A0 =A0 uint32_t reserved; /* unused */ >> =A0 =A0 uint64_t event; >> =A0 =A0 uint64_t timestamp_ns; >> =A0 =A0 uint8_t arguments[]; >> } TraceRecord; >> >> 3. Strings are serialized like this: >> >> uint16_t length; >> char chars[length]; > > 16 bit length? =A0Sure you want that? You're right, it's more future-proof to use a larger type. Since I said uint32_t length in TraceRecord, uint32_t here would work well. Stefan