[lttng-dev] LTTng snapshot howto

Bernd Hufmann bernd.hufmann at ericsson.com
Tue Aug 20 09:55:12 EDT 2013


Hello

I've tried the snapshot feature as described below by Mathieu. I noticed 
that the commands "lttng list" and "lttng list <session>" don't print 
anything for the trace path. I understand that command "lttng snapshot 
list-output" would provide detailed information about all added output 
locations. I'm wondering if it would be useful to print the default 
output location (which is created by lttng create --snapshot) in the 
trace path when using "lttng list" or "lttng list <session>" for 
snapshot sessions? Any plans to add that?

Best Regards
Bernd

---------- Forwarded message ----------
From: *Mathieu Desnoyers* <mathieu.desnoyers at efficios.com 
<mailto:mathieu.desnoyers at efficios.com>>
Date: Sun, Jul 21, 2013 at 2:27 PM
Subject: [lttng-dev] LTTng snapshot howto
To: lttng-dev at lists.lttng.org <mailto:lttng-dev at lists.lttng.org>


Hi,

I just pushed a LTTng snapshot howto (new feature of lttng 2.3-rc). I'm
posting it to lttng-dev, since it provides a quick insight on how to use
the snapshot feature. Comments are welcome!

Thanks,

Mathieu


LTTng Flight Recorder Snapshot HOWTO

Mathieu Desnoyers
July 21st, 2013

This document presents how to use the snapshot feature of LTTng.

Snapshots allow to grab the content of flight recorder tracing buffers
at the time the snapshot record command is invoked. Flight recorder
tracing gather trace data in memory, overwriting the oldest information,
without requiring any disk I/O. The snapshot record command exports the
snapshot to the destination specified by the user.

Basic usage:

Session daemon started as root for kernel tracing:

# lttng-sessiond -d

 From a user part of the tracing group (for kernel tracing):

$ lttng create --snapshot
$ lttng enable-event -k -a      # enable kernel tracing
$ lttng enable-event -u -a      # enable user-space tracing
$ lttng start

     [ do something, generate activity on the system ]

$ lttng snapshot record

     [ do more stuff... ]

$ lttng snapshot record

$ lttng stop
$ lttng destroy

Each "lttng snapshot" command records a snapshot of the current buffer
state. "lttng enable --snapshot" automatically setups the buffers in
overwrite mode for flight recording, and does not attach any output file
to the trace. The "lttng snapshot record" command can be performed
either while tracing is started or stopped.

As an example, this generates the following hierarchy under the
directory reported by the "create" command above:

.
├── snapshot-1-20130721-141838-0
│   ├── kernel
│   │   ├── channel0_0
│   │   ├── channel0_1
│   │   ├── channel0_2
│   │   ├── channel0_3
│   │   └── metadata
│   └── ust
│       └── uid
│           └── 1000
│               └── 64-bit
│                   ├── channel0_0
│                   ├── channel0_1
│                   ├── channel0_2
│                   ├── channel0_3
│                   └── metadata
└── snapshot-1-20130721-141842-1
     ├── kernel
     │   ├── channel0_0
     │   ├── channel0_1
     │   ├── channel0_2
     │   ├── channel0_3
     │   └── metadata
     └── ust
         └── uid
             └── 1000
                 └── 64-bit
                     ├── channel0_0
                     ├── channel0_1
                     ├── channel0_2
                     ├── channel0_3
                     └── metadata


Then, running babeltrace on, e.g.

babeltrace snapshot-1-20130721-141838-0

shows the content of the first snapshot.

Please refer to the lttng(1) manpage for details on the snapshot mode.

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
lttng-dev at lists.lttng.org <mailto:lttng-dev at lists.lttng.org>
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20130820/0810b154/attachment.html>


More information about the lttng-dev mailing list