3 :revdate: 18 October 2019
8 lttng-rotate - Archive a tracing session's current trace chunk
14 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *rotate* [option:--no-wait] ['SESSION']
19 The `lttng rotate` command archives the current trace chunk of the
20 current tracing session, or of the tracing session named 'SESSION' if
21 provided, to the file system. This action is called a tracing session
24 Once LTTng archives a trace chunk, it does not manage it anymore: you
25 can read it, modify it, move it, or remove it.
27 An _archived trace chunk_ is a collection of metadata and data stream
28 files which form a self-contained LTTng trace.
30 The _current trace chunk_ of a given tracing session includes:
32 * The stream files already written to the file system, and which are
33 not part of a previously archived trace chunk, since the most recent
35 ** The first time the tracing session was started with
37 ** The last rotation, either an immediate one with `lttng rotate`, or an
38 automatic one from a rotation schedule previously set with
39 man:lttng-enable-rotation(1).
40 * The content of all the non-flushed sub-buffers of the tracing
43 You can use `lttng rotate`:
45 * At any time when the tracing session is active (see
47 * A single time once the tracing session becomes inactive
48 (see man:lttng-stop(1)).
50 By default, the `lttng rotate` command ensures that LTTng finished
51 performing the tracing session rotation before it prints the archived
52 trace chunk's path and exits. The printed path is absolute when the
53 tracing session was created in normal mode and relative to the relay
54 daemon's output directory (see the nloption:--output option in
55 man:lttng-relayd(8)) when it was created in network streaming mode (see
58 With the option:--no-wait option, the command finishes immediately, so
59 that LTTng might not have completed the rotation when the command exits.
60 In this case, there is no easy way to know when the current trace chunk
61 becomes archived, and the command does not print the archived trace
64 Because when LTTng performs a tracing session rotation, it flushes the
65 tracing session's current sub-buffers, archived trace chunks are never
66 redundant, that is, they do not overlap over time like snapshots can
67 (see man:lttng-snapshot(1)). Also, a rotation does not directly cause
68 discarded event records or packets.
70 See <<limitations,LIMITATIONS>> for important limitations regarding
74 Trace chunk archive naming
75 ~~~~~~~~~~~~~~~~~~~~~~~~~~
76 A trace chunk archive is a subdirectory of the `archives` subdirectory
77 within a tracing session's output directory (see the nloption:--output
78 option in man:lttng-create(1) and man:lttng-relayd(8)).
80 A trace chunk archive contains, through tracing domain and possibly
81 UID/PID subdirectories, metadata and data stream files.
83 A trace chunk archive is, at the same time:
85 * A self-contained LTTng trace.
86 * A member of a set of trace chunk archives which form the complete
87 trace of a tracing session.
89 In other words, an LTTng trace reader can read both the tracing
90 session output directory (all the trace chunk archives), or a
91 single trace chunk archive.
93 When LTTng performs a tracing session rotation, it names the resulting
94 trace chunk archive as such, relative to the tracing session's output
98 archives/__BEGIN__-__END__-__ID__
101 Date and time of the beginning of the trace chunk archive with
102 the ISO{nbsp}8601-compatible `YYYYmmddTHHMMSS±HHMM` form, where
103 `YYYYmmdd` is the date and `HHMMSS±HHMM` is the time with the
104 time zone offset from UTC.
106 Example: `20171119T152407-0500`
109 Date and time of the end of the trace chunk archive with
110 the ISO{nbsp}8601-compatible `YYYYmmddTHHMMSS±HHMM` form, where
111 `YYYYmmdd` is the date and `HHMMSS±HHMM` is the time with the
112 time zone offset from UTC.
114 Example: `20180118T152407+0930`
117 Unique numeric identifier of the trace chunk within its tracing
120 Trace chunk archive name example:
123 archives/20171119T152407-0500-20171119T151422-0500-3
127 include::common-cmd-options-head.txt[]
130 option:-n, option:--no-wait::
131 Do not ensure that the rotation is done before returning to
135 include::common-cmd-help-options.txt[]
141 The `lttng rotate` command only works when:
143 * The tracing session is created in normal mode or in network streaming
144 mode (see man:lttng-create(1)).
146 * No channel was created with a configured trace file count or size
147 limit (see the nloption:--tracefile-size and
148 nloption:--tracefile-count options in man:lttng-enable-channel(1)).
150 * No immediate rotation (`lttng rotate`) is currently happening.
153 include::common-cmd-footer.txt[]
158 man:lttng-enable-rotation(1),
159 man:lttng-disable-rotation(1),