Re: [RFC PATCH 1/3] Unified trace buffer

From: Steven Rostedt
Date: Wed Sep 24 2008 - 12:31:23 EST



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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/