[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: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] RFC: Design Doc for a new trace format (to support variable number/size of args per event) simpletrace-v2 |
Date: |
Tue, 29 Nov 2011 12:56:03 +0000 |
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.
Stefan