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, Mathieu Desnoyers wrote:
> /*
> * Perform an aligned write of the input data into the buffer.
> *
> * buffer : page pointer array
> * woffset : offset in the page pointer array where write starts from
> * data : input data
> * len : length of data to copy
> *
> * Note : if a NULL buffer is passed, no copy is performed, but the
> * alignment and offset calculation is done. Useful to calculate the
> * size to reserve.
> *
> * return : length written
> */
> size_t write(struct page **buffer, size_t woffset, void *data, size_t len);
>
> Therefore, we could have code which writes in the buffers, without extra
> copy, and without using vmap, in multiple writes for a single event,
> which would deal with data alignment, e.g. :
>
> size_t woffset, evsize = 0;
>
> evsize += write(NULL, evsize, &var1, sizeof(var1));
> evsize += write(NULL, evsize, &var2, sizeof(var2));
> evsize += write(NULL, evsize, &var3, sizeof(var3));
>
> woffset = reserve(..., evsize);
>
> woffset += write(buffer, woffset, &var1, sizeof(var1));
> woffset += write(buffer, woffset, &var2, sizeof(var2));
> woffset += write(buffer, woffset, &var3, sizeof(var3));
>
> commit(..., evsize);
>
> Does that make sense ?

Mathieu,

I'm starting to think that you are just too smart for your own good ;-)
No it does not make sense. Well, it does not after looking at it for 10
seconds.

Which brings up my point, the interface must be simple, and not cause
people to spend minutes trying to figure out what the trace is doing.

-- Steve



\
 
 \ /
  Last update: 2008-09-24 18:33    [from the cache]
©2003-2011 Jasper Spaans