Re: [patch 1/3] Trace code and documentation

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andi Kleen <andi@...>
Cc: <linux-kernel@...>, <akpm@...>, <randy.dunlap@...>, <hch@...>, <systemtap@...>
Date: Thursday, October 4, 2007 - 3:19 pm

Andi Kleen wrote:

The code in trace is exactly what all the current users of relay do. 
Therefor trace reduces the duplication of code.



Are you arguing against relayfs or trace?  Trace just makes relayfs 
easer to use.  I think relayfs can stand up for it's self.



Each user of trace has its own requirements for passing data over 
relayfs channels. This is why the documentation describes separate 
control and data layers.  The trace API provides a control layer with 
this flexibility.

The example shows a way to create an ASCII data layer.  The format of 
the data (binary or ascii) is just a function of how the data layer 
formats it.

Locking is only required when using global bufferers. The option of 
selecting per-cpu vs global bufferers is available to the trace user. 
The example (and the documentation) shows how to use both methods (See: 
#define USE_GLOBAL_BUFFER in the example).

There is no impact of adding an extra layer. The primitives for trace 
adds code for trace setup and control, but trace is not doing anything 
that a relayfs user would not have to do anyway.  We mostly care about 
the impact of writing data to the trace channels and trace has no impact 
there.


True, to make trace "fast" you need a data layer that can handle the 
requirements of per-cpu buffers.  However there are still advantages of 
trace over printk even when using global bufferers: selectable bufferer 
sizes, separate data channels (not have to share data channels with 
every other subsystem in the kernel), trace control, non-overwrite mode 
and buffer management.

The next step is to provide data layer that can fully take advantage of 
per-cpu bufferers (systemtap shows us one example). Trace give us a 
place to build it.  As Christoph's said about trace:

    "Long term we probably want more complex tracing based on lttng,
     but I'm a big fan of starting out simple and doing incremental
     changes."

One advantage of the trace approach is separating control and data 
layers, therefor trace can support multiple data layers to fit multiple 
requirements.

I have my ideas on how to develop data layer, others may have their own 
ideas and I welcome the input.

-Dave

PS: Systemtap has been criticized for introducing out-of-tree kernel 
code.  A clear direction from the community is to move re-usable code 
in-tree where it can be maintained.  Trace is a move in that direction.

Dave

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/3] Trace code and documentation, David J. Wilder, (Tue Oct 2, 12:33 pm)
Re: [patch 1/3] Trace code and documentation, Andi Kleen, (Thu Oct 4, 5:24 am)
Re: [patch 1/3] Trace code and documentation, David Wilder, (Thu Oct 4, 3:19 pm)
Re: [patch 1/3] Trace code and documentation, Andi Kleen, (Thu Oct 4, 5:19 pm)
Re: [patch 1/3] Trace code and documentation, David Wilder, (Thu Oct 4, 7:12 pm)
Re: [patch 1/3] Trace code and documentation, Randy Dunlap, (Tue Oct 2, 1:05 pm)