[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080925103821.GA15720@elte.hu>
Date: Thu, 25 Sep 2008 12:38:21 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
prasad@...ux.vnet.ibm.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mathieu Desnoyers <compudj@...stal.dyndns.org>,
"Frank Ch. Eigler" <fche@...hat.com>,
David Wilder <dwilder@...ibm.com>, hch@....de,
Martin Bligh <mbligh@...gle.com>,
Tom Zanussi <zanussi@...cast.net>,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [RFC PATCH 1/3] Unified trace buffer
* Steven Rostedt <rostedt@...dmis.org> wrote:
> > > Or if we already have the data together:
> > >
> > > ring_buffer_write(buffer, event_id, length, data);
> >
> > Don't like the event_id, just stick to plain binary data, and leave
> > interpretation open to whoemever uses it.
>
> This is up to debate. I know you don't like this extra event layer,
> but seriously, all my uses with ring buffers has had some kind of
> event. But then I'm sure you can argue that if you are using a single
> type you can can the event.
>
> I'm open to doing this, but I would like a consensus on this.
>
> Martin, Thomas, Ingo, Linus?
i'd prefer Peter's simplification and not pass event_id along. Since
static types are lost anyway (which is the biggest cost and risk of any
such abstraction), we have to convert between types early on. Whether
event_id is visible in the API is no big difference.
(It might be cheaper to not pass it along even if everyone ends up using
it - as it has no semantic meaning anyway.)
pretty much the only generic tracing information is time and payload
size. ( but even a time key is debatable - there are various resolutions
needed by different usecases. Some usecases are even fine without any
timestamps at all - they just want to know the ordering of events and
that's it.)
i'd like to see some automatic type protection though, as an
off-by-default debug option: encode the record type on storing and
double-check it on extraction. So it should be possible to reliably
store/restore a typed trace buffer and notice corruption early in
testing.
because there's one thing that is far more important tracer feature than
sheer performance: robustness.
Automated type checking in debug mode would also mean we could go for
RLE encoding much more agressively. Most of the risks of a more complex,
more compressed and pointer-laden data format come from type mismatches
and the loss of compiler protection against human errors/stupidity.
(running off the end of the page, misinterpreting a pointer, a record,
etc.)
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists