debian: update instructions
[lttng-docs.git] / contents / using-lttng / controlling-tracing / saving-loading-tracing-session.md
CommitLineData
5e0cbfb0
PP
1---
2id: saving-loading-tracing-session
3---
4
5Configuring a tracing session may be long: creating and enabling
6channels with specific parameters, enabling kernel and user space
ba3b1994
PP
7domain events with specific log levels and filters, and adding context
8to some channels are just a few of the many possible operations using
9the `lttng` command line tool. If you're going to use LTTng to solve real
5e0cbfb0
PP
10world problems, chances are you're going to have to record events using
11the same tracing session setup over and over, modifying a few variables
12each time in your instrumented program or environment. To avoid
13constant tracing session reconfiguration, the `lttng` tool is able to
14save and load tracing session configurations to/from XML files.
15
16To save a given tracing session configuration, do:
17
18<pre class="term">
19lttng save my-session
20</pre>
21
22where `my-session` is the name of the tracing session to save. Tracing
23session configurations are saved to `~/.lttng/sessions` by default;
24use the `--output-path` option to change this destination directory.
25
26All configuration parameters are saved:
27
28 * tracing session name
29 * trace data output path
30 * channels with their state and all their parameters
31 * context information added to channels
32 * events with their state, log level and filter
33 * tracing activity (started or stopped)
34
35To load a tracing session, simply do:
36
37<pre class="term">
38lttng load my-session
39</pre>
40
41or, if you used a custom path:
42
43<pre class="term">
44lttng load --input-path /path/to/my-session.lttng
45</pre>
46
47bfcb75 47Your saved tracing session is restored as if you just configured
5e0cbfb0 48it manually.
This page took 0.024227 seconds and 4 git commands to generate.