lkml.org 
[lkml]   [2008]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/3] Unified trace buffer

On Wed, 24 Sep 2008, Martin Bligh wrote:

>
> How about we just steal 5 bits from the timestamp to indicate event
> lengths up to 32 bytes, and if it's 0, that means there's a length
> field following? Also that'd mean you could use a longer length field
> and get beyond 256 bytes to 4096, without impacting most events.
>
> struct {
> u32 length:5, time_delta:27;
> u16 length;
> u8 buf[];
> };
>
> struct {
> u32 length:5, time_delta:27; /* where length == 0 */
> u8 buf[];
> };

BTW, if we declare the ring buffer to have fixed length entries, do we
still want to record the length?

Hmm, probably should. It would make the code easier. If it is fixed length
under 256 bytes, we still need to record the timestamp, and the length is
only 5 bits. It could probably store something else, but we can leave that
for version two ;-)

Heck, for now, I'll remove the work I did to add the fix length option,
and just use this default. If you have fixed length entries, it will
just make it easier to code the above layers.

-- Steve



\
 
 \ /
  Last update: 2008-09-24 23:55    [W:0.112 / U:1.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site