[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] RFC: Design Doc for a new trace format (to support vari

From: Harsh Bora
Subject: Re: [Qemu-devel] RFC: Design Doc for a new trace format (to support variable number/size of args per event) simpletrace-v2
Date: Wed, 30 Nov 2011 11:37:02 +0530
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5

On 11/29/2011 06:26 PM, Stefan Hajnoczi wrote:
On Tue, Nov 29, 2011 at 12:35 PM, Markus Armbruster<address@hidden>  wrote:
Stefan Hajnoczi<address@hidden>  writes:

So forget I said "self-describing" :).  I 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 {
     uint32_t length; /* in bytes */
     uint32_t reserved; /* unused */
     uint64_t event;
     uint64_t timestamp_ns;
     uint8_t arguments[];
} TraceRecord;

3. Strings are serialized like this:

uint16_t length;
char chars[length];

16 bit length?  Sure 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.

Makes sense to store size info only for strings as long as we rely on trace-events file to identify other meta-data about trace-events.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]