Re: Flight recorder mode

Mathieu Desnoyers <[email protected]> Wed, 20 Feb 2008 09:44:54 -0500
Newsgroups gmane.linux.kernel.tracing
Message-ID <20080220144454.GA31057@Krystal>
* Jan Kiszka ([email protected]) wrote:
> Mathieu Desnoyers wrote:
> > * Jan Kiszka ([email protected]) wrote:
> >> Jan Kiszka wrote:
> >>> Mathieu Desnoyers wrote:
> >>>> * Jan Kiszka ([email protected]) wrote:
> >>>>> Mathieu Desnoyers wrote:
> >>>>>> * Jan Kiszka ([email protected]) wrote:
> >>>>>>> Hi,
> >>>>>>>
> >>>>>>> I'm trying to understand the flight recorder mode (including the hybrid
> >>>>>>> one) of LTTng. I originally expected that this mode means:
> >>>>>>>
> >>>>>>>  1. Fixed set of buffers, older data will be overwritten on wrap-around
> >>>>>>>  2. Limited size of trace files
> >>>>>>>
> >>>>>>> While 1. seems to be true, 2. is neither what I observe in the output
> >>>>>>> directory (flight-cpu_* get larger and larger) nor what I can find in
> >>>>>>> lttd's code. Intentionally?
> >>>>>>>
> >>>>>> Yep, see the other lttctl options and the quickstart guide to see how to
> >>>>>> spawn one lttd for the "normal" channels and a different one for the
> >>>>>> flight recorder channels (should be done after you stop tracing).
> >>>>> Sorry, /me is too blind: The quickstart guide is not mentioning flight
> >>>>> recorder or hybrid mode, and also lttctl --help gives me no hint what
> >>>>> pattern to apply for achieving limited trace file sizes.
> >>>>>
> >>>> Hrm, or do I recall doing documentaion I haven't done, let's see :)
> >>>>
> >>>> Ah, it's in a mailing list, not in the documentation yet :
> >>>>
> >>>> http://osdir.com/ml/linux.kernel.tracing/2006-09/msg00015.html
> >>>>
> >>>> It explains how to use the hybrid mode.  I'll cut'n'paste it at the end
> >>>> of the quickstart guide.
> >>>>
> >>>> There is not trace file size limit you can give to lttctl nor lttd. You
> >>>> can only specify the buffer size. The idea is that you can decide at
> >>>> which moment you want to take you flight recorder "snapshot" by running
> >>>> lttctl -f at the correct moment.
> >>> OK, -EBRAINSUSPENDED, you just woke it up again:
> >>>
> >>> lttctl -b -n mytrace -m flight -l <debugfs>/ltt
> >>> <run application>
> >>> <when something happened:>
> >>> lttctl -f -n mytrace -t <trace-out> -l <debugfs>/ltt
> >> Hmm, in fact this won't fly yet. It looks like I need the hybrid mode,
> >> because flight recorder traces generated like above are lacking some
> >> basic information (stuff under /control I guess) to make lttv happy.
> >>
> >> That leaves me with a (for now) acceptable tracing procedure via hybrid
> >> traces. But I'm still lacking some howto for pure flight recorder
> >> traces. Any hints still appreciated... :)
> >>
> > 
> > Hrm, LTTV should be able to cope with the missing control information.
> > The only tracefiles that needs to be complete are the facilities
> > tracefiles.
> > 
> > What do you get when you start lttv on a flight recorder trace ?
> 
> What I did:
> 1. armall
> 2. lttctl -n mytrace -l /sys/kernel/debug/ltt -b -m flight

Ah, I see.. try to change -b for -d : it will spawn an lttd daemon which
will read the "normal" channels (in this case, only the facilities
tracefiles). (also add -l /sys/kernel/debug/ltt -t /tmp/trace)

It should then start working better.

Mathieu

> 3. run some load
> 4. lttctl -n mytrace -l /sys/kernel/debug/ltt -f -m flight -t /tmp/trace
> 5. lttv -mtextDump -t /tmp/trace
> 
> What I get:
> ** ERROR **: Trace /tmp/trace has no facility tracefile
> 
> Which is true as "ls /tmp/trace/control" shows. Simply copying those
> files from some full-fledge trace works around it, but only when the
> facilities are in fact the same, I guess...
> 
> Jan
> 
> -- 
> Siemens AG, Corporate Technology, CT SE 2
> Corporate Competence Center Embedded Linux
> 

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68