lttng-load(1): add usage examples
[lttng-tools.git] / doc / man / lttng-load.1.txt
index 691437dd743811fe6f8a7606deb4c295c5e37531..bebe1230607d362216f2a95534e5605135dc380b 100644 (file)
@@ -1,6 +1,6 @@
 lttng-load(1)
 =============
 lttng-load(1)
 =============
-:revdate: 28 November 2016
+:revdate: 17 May 2021
 
 
 NAME
 
 
 NAME
@@ -12,7 +12,7 @@ SYNOPSIS
 --------
 [verse]
 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *load* [option:--force] [option:--input-path='PATH']
 --------
 [verse]
 *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *load* [option:--force] [option:--input-path='PATH']
-      [option:--override-url='URL'] ['SESSION' [option:--override-name='NAME']]
+      [option:--override-url='URL'] [option:--all | 'SESSION' [option:--override-name='NAME']]
 
 
 DESCRIPTION
 
 
 DESCRIPTION
@@ -20,54 +20,65 @@ DESCRIPTION
 The `lttng load` command loads the configurations of one or more
 tracing sessions from files.
 
 The `lttng load` command loads the configurations of one or more
 tracing sessions from files.
 
-The `lttng load` command is used in conjunction with the
-man:lttng-save(1) command to save and restore the complete
-configurations of tracing sessions. This includes the enabled channels
-and event rules, the context added to channels, the tracing activity,
-and more.
+See man:lttng-concepts(7) to learn more about tracing sessions.
 
 
-Once one or more tracing session configurations are loaded, they appear
+Use the `load` command in conjunction with the man:lttng-save(1) command
+to save and restore the complete configurations of tracing sessions. A
+tracing session configuration includes the enabled channels and
+recording event rules, the context fields to be recorded, the tracing
+activity, and more.
+
+Once LTTng loads one or more tracing session configurations, they appear
 exactly as they were saved from the user's point of view.
 
 exactly as they were saved from the user's point of view.
 
-The following directories are searched, non-recursively, in this order
-for configuration files:
+LTTng searches the following directories, non-recursively, in this order
+for tracing session configuration files:
 
 . `$LTTNG_HOME/.lttng/sessions` (`$LTTNG_HOME` defaults to `$HOME`)
 . +{system_sessions_dir}+
 
 
 . `$LTTNG_HOME/.lttng/sessions` (`$LTTNG_HOME` defaults to `$HOME`)
 . +{system_sessions_dir}+
 
-The input path can be overridden with the option:--input-path option.
-When this option is specified, the default directories are :not:
-searched for configuration files. When it's not specified, _both_
-default directories are searched for configuration files.
+Override the input path with the option:--input-path='PATH' option. With
+this option, LTTng does :not: search the default directories above.
+'PATH' can be the path of one of:
+
+A directory::
+    With the 'SESSION' argument:::
+        LTTng searches for the tracing session configuration named
+        'SESSION' in all the files of the directory 'PATH' and loads it
+        if found.
 
 
-If the input path is a *directory*, then:
+    Without the 'SESSION' argument:::
+        The option:--all option is implicit: LTTng loads all the tracing
+        session configurations found in all the files in the directory
+        'PATH'.
 
 
-* If 'SESSION' is specified, the tracing session configuration named
-  'SESSION' is searched for in all the files of this directory and
-  loaded if found.
-* If 'SESSION' is not specified, the option:--all option is implicit:
-  all the tracing session configurations found in all the files in this
-  directory are loaded.
+A file::
+    With the 'SESSION' argument:::
+        LTTng searches for the tracing session configuration named
+        'SESSION' in the file 'PATH' and loads it if found.
 
 
-If the input path is a *file*, then:
+    Without the 'SESSION' argument:::
+        The option:--all option is implicit: LTTng loads all the tracing
+        session configurations found in the file 'PATH'.
 
 
-* If 'SESSION' is specified, the tracing session configuration named
-  'SESSION' is searched for in this file and loaded if found.
-* If 'SESSION' is not specified, the option:--all option is implicit:
-  all the tracing session configurations found in this file are loaded.
+Override the output URL of the loaded tracing session configurations
+with the option:--override-url option.
 
 
-Aspects of the loaded configurations can be overridden at load time
-using the option:--override-url and option:--override-name options.
+With the 'SESSION' argument, override the name of the loaded tracing
+session configuration with the option:--override-name option.
 
 
-By default, existing tracing sessions are not overwritten when loading:
-the command fails. The option:--force option can be used to allow this.
+By default, the `load` command does :not: overwrite existing tracing
+sessions: the command fails. Allow the `load` command to overwrite
+existing tracing sessions with the option:--force option.
 
 
+See the <<examples,EXAMPLES>> section below for usage examples.
 
 
-include::common-cmd-options-head.txt[]
+
+include::common-lttng-cmd-options-head.txt[]
 
 
 option:-a, option:--all::
 
 
 option:-a, option:--all::
-    Load all tracing session configurations (default).
+    Load all the tracing session configurations (default).
 
 option:-f, option:--force::
     Overwrite existing tracing sessions when loading.
 
 option:-f, option:--force::
     Overwrite existing tracing sessions when loading.
@@ -80,12 +91,9 @@ option:-i 'PATH', option:--input-path='PATH'::
 option:--override-name='NAME'::
     Override the name of the loaded tracing session configuration,
     'SESSION', with 'NAME'.
 option:--override-name='NAME'::
     Override the name of the loaded tracing session configuration,
     'SESSION', with 'NAME'.
-+
-You must specify a tracing session name to load ('SESSION') and :not:
-use the option:--all option when using this option.
 
 option:--override-url='URL'::
 
 option:--override-url='URL'::
-    Override the URL of the loaded tracing session configurations
+    Override the output URL of the loaded tracing session configurations
     with 'URL'.
 +
 This is the equivalent of the nloption:--set-url option of
     with 'URL'.
 +
 This is the equivalent of the nloption:--set-url option of
@@ -94,13 +102,68 @@ type of tracing session configurations to load. This option applies to
 _all_ the loaded tracing session configurations.
 
 
 _all_ the loaded tracing session configurations.
 
 
-include::common-cmd-help-options.txt[]
+include::common-lttng-cmd-help-options.txt[]
+
+
+include::common-lttng-cmd-after-options.txt[]
+
+
+[[examples]]
+EXAMPLES
+--------
+.Load all the tracing session configurations from the default search directories.
+====
+[role="term"]
+----
+$ lttng load
+----
+====
+
+.Load all the tracing session configurations from a specific directory.
+====
+See the option:--input-path option.
+
+[role="term"]
+----
+$ lttng load --input-path=/path/to/sessions
+----
+====
+
+.Load a specific tracing session configuration from the default search directories.
+====
+[role="term"]
+----
+$ lttng load my-session
+----
+====
+
+.Allow LTTng to overwrite existing tracing sessions when loading.
+====
+See the option:--force option.
+
+[role="term"]
+----
+$ lttng load --force
+----
+====
+
+.Load a specific tracing session configuration from a specific file, overriding its name.
+====
+See the option:--input-path and option:--override-name options.
+
+[role="term"]
+----
+$ lttng load my-session --input-path=/path/to/sessions.lttng \
+             --override-name=new-test
+----
+====
 
 
 
 
-include::common-cmd-footer.txt[]
+include::common-footer.txt[]
 
 
 SEE ALSO
 --------
 
 
 SEE ALSO
 --------
+man:lttng(1),
 man:lttng-save(1),
 man:lttng-save(1),
-man:lttng(1)
+man:lttng-concepts(7)
This page took 0.030045 seconds and 4 git commands to generate.