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, Steven Rostedt wrote:
>
> Right now I have a list of pages that make up the ring buffer. Are you
> saying that the first entry in the page should be a timestamp?

I think the most straightforward model would be that the "head" of the
ring buffer (regardless of size in pages) would have that timestamp.
Making them per-page is an option, of course, I have no strong opinions
either way. The per-page one could have advantages (ie it would give a
nice upper limit for just how many entries you have to walk in order to
convert an entry into a full timestamp), but I certainly don't think
that's a big decision, more of a detail.

But if we start out with having the full TSC in each entry, that's easily
going to be painful to fix later. If we start out with a delta system,
changing the details of where the base is gotten is likely to be exactly
that - just a detail.

So I'd like the thing to have small headers, and be designed from the
start to have small headers.

> I will now have a ring_buffer API, which will do basic recording. It will
> have two modes when allocated. Fixed sized entry mode where you can just
> put whatever you want in (I'm still aligning everything by 8 bytes, just
> since memory is cheap). Or you can have variable length mode that will
> make the following event header:
>
> struct {
> unsigned char length;
> unsigned char buff[];
> };

So the only reason I'm not thrilled with this is that I really think that
timestamping should be inherent, and at the lowest level.

Without timestamping, what's the real point? EVERYBODY eventually wants a
timestamp. We added it even to the kernel printk()'s. People want them for
network packets to user space. X wants it for all its events. It's one of
those things that people never do from the beginning, but that everybody
eventually wants anyway.

So I certainly don't mind layering, but I *do* mind it if it then means
that some people will use a broken model and not have timestamps. So I
think the timestamping code should just be there - without it, a trace
buffer is pointless.

Linus


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