Re: [PATCH] rudimentary tracing for Classic RCU

From: Frédéric Weisbecker
Date: Thu Oct 09 2008 - 09:02:03 EST


2008/10/9 Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>:
> Well, one reason is that I didn't know about it. ;-)
>
> Does it allow the user to trigger a one-shot trace? Right now, what
> one does is:
>
> cat /debug/rcu/rcucb
>
> whenever one wants to see what RCU is up to. You really don't want to
> see every new value, as that would generate hundreds of trace records
> per second -- per CPU. What does the user do with the ring-buffer
> tracing enging?
>
> Thanx, Paul

With a tracer from the unified tracing buffer, you have often one
function, used somewhere in the kernel, which will add periodically
some specific entries. For example mmiotrace receives entries which
contain IO access.
When the user tries to read the entries, he has to read the pipe
/debug/tracing/trace_pipe. During this reading, the tracing engine
calls a read callback given by the tracer. This read callback is
nothing related to entries on the buffer: if the tracer has to print
something special, this is the ususal function.
Than if the read gave some content, the pipe reading returns. Else,
the tracing engine tells the tracer to format its entries from the
ring buffer. If there is no entries, the pipe reading sleeps and waits
for new entries.

So after some thought, I don't think the current tracing engine is
really adapted for what you want. It is a pipe system and it's not
adapted for your one-shot captures.

Sorry for the noise.

But it only requires few features to add for the unified tracing
engine to support such one-shot tracer.
--
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/