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