[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4705735F.7000209@us.ibm.com>
Date: Thu, 04 Oct 2007 16:12:31 -0700
From: David Wilder <dwilder@...ibm.com>
To: Andi Kleen <andi@...stfloor.org>
CC: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
randy.dunlap@...cle.com, hch@...radead.org,
systemtap@...rces.redhat.com
Subject: Re: [patch 1/3] Trace code and documentation
Andi Kleen wrote:
> On Thu, Oct 04, 2007 at 12:19:35PM -0700, David Wilder wrote:
>> Andi Kleen wrote:
>>> "David J. Wilder" <dwilder@...ibm.com> writes:
>>>> @@ -0,0 +1,160 @@
>>>> +Trace Setup and Control
>>>> +=======================
>>>> +In the kernel, the trace interface provides a simple mechanism for
>>>> +starting and managing data channels (traces) to user space.
>>> Wasn't relayfs supposed to do that already? Why do you need another
>>> wrapper around it?
>> The code in trace is exactly what all the current users of relay do.
>> Therefor trace reduces the duplication of code.
>
> If everybody does this then the code should be just put into
> relayfs?
I disagree, I keeping the code separate (layering if you will) makes it
easer to use and maintain.
>
>>
>>> Is this also really still faster than a printk below log level
>>> (without console driver overhead). If not then why not just
>>> use printk?
>> Are you arguing against relayfs or trace? Trace just makes relayfs
>> easer to use. I think relayfs can stand up for it's self.
>
> I'm arguing against complicated trace mechanisms that are not fast.
What makes trace complicated? It is just, open ,start/stop, close. I
can't see how an trace API could be any simpler.
>
> At some point when I looked at relayfs it seemed to be reasonably
> fast (per cpu buffers; not much locking,
over head per call roughtly like putchar()),
> but that might have regressed.
No regression has occurred. According the relay documentation if you
use global bufferers you must use locking. If you don't want to use
locking use per-cpu bufferers.
>
> Your example module with its lock definitely looks very slow and I don't approve
> of it.
>
If you don't approve of the locking then use per-cpu bufferers. The
example will do ether.
>>
>> The example shows a way to create an ASCII data layer.
>
> ASCII layers don't make much sense imho -- these should just use printk.
>
So the only way I should pass ASCII to user space is using printk? I
don't understand that. Again nothing in trace limits you to ASCII data.
> Fast dedicated binary log channels make sense though; but you don't
> seem really to be very concentrated on that.
I impose no restriction on what type of data you can pass over trace's
fast dedicated channels.
>
>> 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,
>
> printk has selectable buffer sizes too.
>
>> "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."
>
> It's just that relayfs + another not simple layer are definitely not simple.
>
> For a simple logger I'm thinking more like something like SGI's old
> ktrace module (which undoubtedly many other people have recreated many
> times for specific debugging scenarios)
>
> But that all only makes sense if the overhead is really kept low
> and i don't see that in your approach.
Is your complaint with the overhead of setting up a trace channel or the
overhead of writing to a trace channel? For the later, trace adds
almost no overhead on top of relay.
>
>
>> 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.
>
> relayfs was supposed to be that data layer.
I am using the layer definitions described in trace.txt. In this
definition relay is a buffering layer.
>
>> 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.
>
> I'm all for that. I believe a simple fast efficient no frills logger
> would serve systemtap just fine too. But the approach here seems
> to be more to add all kinds of knobs and whizzles until you end
> up with something as slow with printk. And since we already have
> printk another one just doesn't seem to make much sense.
If by knobs you mean the trace controls. The only one that has any
effect on the "speed" of tracing is the control to start and stop
tracing. And that had been designed to impose the minimal impact
possible (one "if" in the tracing path).
>
> -Andi
>
-
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