User: Password:
|
|
Subscribe / Log in / New account

Re: Unified tracing buffer

From:  Peter Zijlstra <a.p.zijlstra-AT-chello.nl>
To:  prasad-AT-linux.vnet.ibm.com
Subject:  Re: Unified tracing buffer
Date:  Mon, 22 Sep 2008 16:45:24 +0200
Message-ID:  <1222094724.16700.11.camel@lappy.programming.kicks-ass.net>
Cc:  Martin Bligh <mbligh-AT-google.com>, Linux Kernel Mailing List <linux-kernel-AT-vger.kernel.org>, Linus Torvalds <torvalds-AT-linux-foundation.org>, Thomas Gleixner <tglx-AT-linutronix.de>, Mathieu Desnoyers <compudj-AT-krystal.dyndns.org>, Steven Rostedt <rostedt-AT-goodmis.org>, od-AT-novell.com, "Frank Ch. Eigler" <fche-AT-redhat.com>, Andrew Morton <akpm-AT-linux-foundation.org>, hch-AT-lst.de, David Wilder <dwilder-AT-us.ibm.com>, zanussi-AT-comcast.net
Archive-link:  Article

On Mon, 2008-09-22 at 19:37 +0530, K.Prasad wrote:

> > > INPUT_FUNCTIONS
> > > ---------------
> > > 
> > > allocate_buffer (name, size)
> > >         return buffer_handle
> > > 
> > > register_event (buffer_handle, event_id, print_function)
> > >         You can pass in a requested event_id from a fixed set, and
> > > will be given it, or an error
> > >         0 means allocate me one dynamically
> > >         returns event_id     (or -E_ERROR)
> > > 
> > > record_event (buffer_handle, event_id, length, *buf)
> > 
> > I'd hoped for an interface like:
> > 
> > struct ringbuffer *ringbuffer_alloc(const char *name, size_t size);
> > void ringbuffer_free(struct ringbuffer *buffer);
> > int ringbuffer_write(struct ringbuffer *buffer, const char *buf, size_t size);
> > int ringbuffer_read(struct ringbuffer *buffer, int cpu, char *buf, size_t size);
> > 
> > On top of which you'd do the event thing, the register event with a
> > callback idea makes sense, except I'd split the consumption into two:
> >  - one method to pull the binary event out, which knows how long it
> > ought to be etc..
> >  - one method to convert the binary event to ASCII
> >
> In conjunction with the previous email on this thread
> (http://lkml.org/lkml/2008/9/22/160), may I suggest
> the equivalent interfaces in -mm tree (2.6.27-rc5-mm1) to be:
> 
> relay_printk(<some struct with default filenames/pathnames>, <string>,
> ....) ;
> relay_dump(<some struct with default filenames/pathnames>, <binary
> data>);
> and
> relay_cleanup_all(<the struct name>); - Single interface that cleans up
> all files/directories/output data created under a logical entity.

Dude, relayfs is such a bad performing mess that extending it seems like
a bad idea. Better to write something new and delete everything relayfs
related.

Also, it seems prudent to separate the ring-buffer implementation from
the event encoding/decoding facilities.





(Log in to post comments)


Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds