LTTNG-ROTATE(1) | LTTng Manual | LTTNG-ROTATE(1) |
lttng-rotate - Archive a tracing session's current trace chunk
lttng [GENERAL OPTIONS] rotate [--no-wait] [SESSION]
The lttng rotate command archives the current trace chunk of the current tracing session, or of the tracing session named SESSION if provided, to the file system. This action is called a tracing session rotation.
Once LTTng archives a trace chunk, it does not manage it anymore: you can read it, modify it, move it, or remove it.
An archived trace chunk is a collection of metadata and data stream files which form a self-contained LTTng trace.
The current trace chunk of a given tracing session includes:
You can use lttng rotate:
By default, the lttng rotate command ensures that LTTng finished performing the tracing session rotation before it prints the archived trace chunk’s path and exits. The printed path is absolute when the tracing session was created in normal mode and relative to the relay daemon’s output directory (see the --output option in lttng-relayd(8)) when it was created in network streaming mode (see lttng-create(1)).
With the --no-wait option, the command finishes immediately, so that LTTng might not have completed the rotation when the command exits. In this case, there is no easy way to know when the current trace chunk becomes archived, and the command does not print the archived trace chunk’s path.
Because when LTTng performs a tracing session rotation, it flushes the tracing session’s current sub-buffers, archived trace chunks are never redundant, that is, they do not overlap over time like snapshots can (see lttng-snapshot(1)). Also, a rotation does not directly cause discarded event records or packets.
See LIMITATIONS for important limitations regarding this command.
A trace chunk archive is a subdirectory of the archives subdirectory within a tracing session’s output directory (see the --output option in lttng-create(1) and lttng-relayd(8)).
A trace chunk archive contains, through tracing domain and possibly UID/PID subdirectories, metadata and data stream files.
A trace chunk archive is, at the same time:
In other words, an LTTng trace reader can read both the tracing session output directory (all the trace chunk archives), or a single trace chunk archive.
When LTTng performs a tracing session rotation, it names the resulting trace chunk archive as such, relative to the tracing session’s output directory:
archives/BEGIN-END-ID
BEGIN
Example: 20171119T152407-0500
END
Example: 20180118T152407+0930
ID
Trace chunk archive name example:
archives/20171119T152407-0500-20171119T151422-0500-3
General options are described in lttng(1).
-n, --no-wait
-h, --help
This option, like lttng-help(1), attempts to launch /usr/bin/man to view the command’s man page. The path to the man pager can be overridden by the LTTNG_MAN_BIN_PATH environment variable.
--list-options
The lttng rotate command only works when:
LTTNG_ABORT_ON_ERROR
LTTNG_HOME
LTTNG_MAN_BIN_PATH
LTTNG_SESSION_CONFIG_XSD_PATH
LTTNG_SESSIOND_PATH
The --sessiond-path option has precedence over this environment variable.
Note that the lttng-create(1) command can spawn an LTTng session daemon automatically if none is running. See lttng-sessiond(8) for the environment variables influencing the execution of the session daemon.
$LTTNG_HOME/.lttngrc
This is where the per-user current tracing session is stored between executions of lttng(1). The current tracing session can be set with lttng-set-session(1). See lttng-create(1) for more information about tracing sessions.
$LTTNG_HOME/lttng-traces
$LTTNG_HOME/.lttng
$LTTNG_HOME/.lttng/sessions
/etc/lttng/sessions
$LTTNG_HOME defaults to $HOME when not explicitly set.
0
1
2
3
4
If you encounter any issue or usability problem, please report it on the LTTng bug tracker <https://bugs.lttng.org/projects/lttng-tools>.
This program is part of the LTTng-tools project.
LTTng-tools is distributed under the GNU General Public License version 2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>. See the LICENSE <https://github.com/lttng/lttng-tools/blob/master/LICENSE> file for details.
Special thanks to Michel Dagenais and the DORSAL laboratory <http://www.dorsal.polymtl.ca/> at École Polytechnique de Montréal for the LTTng journey.
Also thanks to the Ericsson teams working on tracing which helped us greatly with detailed bug reports and unusual test cases.
lttng-enable-rotation(1), lttng-disable-rotation(1), lttng(1)
18 October 2019 | LTTng 2.12.3 |