LTTNG-CREATE(1) | LTTng Manual | LTTNG-CREATE(1) |
lttng-create - Create an LTTng tracing session
Local mode:
lttng [GENERAL OPTIONS] create [SESSION] [--shm-path=PATH]
[--no-output | --output=PATH | --set-url=file://PATH]
Network streaming mode:
lttng [GENERAL OPTIONS] create [SESSION] [--shm-path=PATH]
(--set-url=URL | --ctrl-url=URL --data-url=URL)
Snapshot mode:
lttng [GENERAL OPTIONS] create [SESSION] --snapshot
[--shm-path=PATH] [--set-url=URL | --ctrl-url=URL --data-url=URL]
Live mode:
lttng [GENERAL OPTIONS] create [SESSION] --live[=DELAYUS]
[--shm-path=PATH] [--set-url=URL | --ctrl-url=URL --data-url=URL]
The lttng create command creates a new tracing session.
A tracing session is a named container of channels, which in turn contain event rules. It is domain-agnostic, in that channels and event rules can be enabled for the user space tracer and/or the Linux kernel tracer.
On execution, an .lttngrc file is created, if it does not exist, in the user’s home directory. This file contains the name of the current tracing session. When creating a new tracing session with lttng create, the current tracing session is set to this new tracing session. The lttng-set-session(1) command can be used to set the current tracing session without manually editing the .lttngrc file.
If SESSION is omitted, a session name is automatically created having this form: auto-YYYYmmdd-HHMMSS. SESSION must not contain the character /.
The --shm-path option can be used to specify the path to the shared memory holding the ring buffers. Specifying a location on an NVRAM file system makes it possible to retrieve the latest recorded trace data when the system reboots after a crash. To view the events of ring buffer files after a system crash, use the lttng-crash(1) utility.
Tracing sessions are destroyed using the lttng-destroy(1) command.
There are four tracing session modes:
Local mode
If none of the options mentioned above are used, then the trace is written locally in the $LTTNG_HOME/lttng-traces directory ($LTTNG_HOME defaults to $HOME).
Network streaming mode
Snapshot mode
Live mode
The --set-url, --ctrl-url, and --data-url options' arguments are URLs.
The format of those URLs is one of:
file://TRACEPATH NETPROTO://(HOST | IPADDR)[:CTRLPORT[:DATAPORT]][/TRACEPATH]
The file:// protocol targets the local file system and can only be used as the --set-url option’s argument when the session is created in local or snapshot mode.
TRACEPATH
The other version is available when the session is created in network streaming, snapshot, or live mode.
NETPROTO
net
net6
tcp
tcp6
(HOST | IPADDR)
CTRLPORT
DATAPORT
TRACEPATH
General options are described in lttng(1).
--live[=DELAYUS]
The optional DELAYUS parameter, given in microseconds, is the maximum time the user can wait for the data to be flushed. This mode can be set with a network URL (options --set-url, or --ctrl-url and --data-url) and must have a relay daemon listening (see lttng-relayd(8)).
By default, DELAYUS is 1000000 and the network URL is set to net://127.0.0.1.
--snapshot
--no-output
-o PATH, --output=PATH
--shm-path=PATH
See the URL format section above for more information about the syntax of the following options' URL argument.
-C URL, --ctrl-url=URL
-D URL, --data-url=URL
-U URL, --set-url=URL
In local mode, URL must start with file:// followed by the destination path on the local file system.
-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
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.
18 January 2018 | LTTng 2.12.3 |