On Tue, Nov 29, 2011 at 12:35 PM, Markus Armbruster <arm...@redhat.com> wrote:
> Stefan Hajnoczi <stefa...@gmail.com> 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

Reply via email to