[ltt-dev] Is Lttng able to work as a printk-like function?

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue Jun 1 13:16:41 EDT 2010


* jerome zh (jeromezhr at gmail.com) wrote:
> 2010/6/2 Mathieu Desnoyers <compudj at krystal.dyndns.org>
> >
> > * jerome zh (jeromezhr at gmail.com) wrote:
> > > Hi all,
> > >
> > > In our projects, we used to call printk() in the ip stack to show some ip
> > > header information each time a packet comes in.
> > > But when the packet comes too frequently, the system becomes overload
> > > because of  too many printk().
> > > So we are wondering if we can do this by lttng, since its performance is
> > > quite high?
> >
> > LTTng achieve high throughput by _not_ pretty-printing all the
> > information to the console like printk() does. So you can output the
> > information at high volume using LTTng, but expect to use an output
> > different from the console.
> 
> I'm sorry but what do you mean by "_not_ pretty-printing"

By keeping data in binary format rather than text-based.

> and "output
> the information at high volume using LTTng, but expect to use an
> output different from the console."

Don't use a serial console to export loads of information, because the
serial console is usually pretty slow.

> Is lttng able to output the information immediately instead of saving
> to files and check it in lttv later?

You can activate a periodical timer to flush the information
periodically. You can possibly create your own buffer backend that
exports the data through a serial port at each event. But don't expect
to be much faster than printk() if you export every event through a
serial console, because this will be your bottleneck.

> 
> > If you want to save printk-like information to the trace (e.g.
> > format-string based calls), you should use the "trace_mark()" statements
> > (Markers).
> >
> 
> I have finished this feature. Will the buffer overflow if there are
> too many information to save?

Please do some reading of the lttng.org website papers. The
producer-consumer and flight recorder (overwrite) modes are thoroughly
explained.

Thanks,

Mathieu

> 
> --
> Regards,
> 
> Jerome
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list