1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
|
lttng-enable-channel(1)
=======================
:revdate: 14 June 2021
NAME
----
lttng-enable-channel - Create or enable LTTng channels
SYNOPSIS
--------
Create a Linux kernel channel:
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-channel* option:--kernel
[option:--discard | option:--overwrite] [option:--output=(**mmap** | **splice**)]
[option:--subbuf-size='SIZE'] [option:--num-subbuf='COUNT']
[option:--switch-timer='PERIODUS'] [option:--read-timer='PERIODUS']
[option:--monitor-timer='PERIODUS'] [option:--buffers-global]
[option:--tracefile-size='SIZE' [option:--tracefile-count='COUNT']]
[option:--session='SESSION'] 'CHANNEL'
Create a user space channel:
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-channel* option:--userspace
[option:--overwrite | [option:--discard] option:--blocking-timeout='TIMEOUTUS']
[option:--output=**mmap**] [option:--buffers-uid | option:--buffers-pid]
[option:--subbuf-size='SIZE'] [option:--num-subbuf='COUNT']
[option:--switch-timer='PERIODUS'] [option:--read-timer='PERIODUS']
[option:--monitor-timer='PERIODUS']
[option:--tracefile-size='SIZE' [option:--tracefile-count='COUNT']]
[option:--session='SESSION'] 'CHANNEL'
Enable channel(s):
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-channel* (option:--userspace | option:--kernel)
[option:--session='SESSION'] 'CHANNEL'[,'CHANNEL']...
DESCRIPTION
-----------
The `lttng enable-channel` command does one of:
* Create a channel named 'CHANNEL'.
* Enable one or more disabled channels named 'CHANNEL'
(non-option argument, comma-separated).
See man:lttng-concepts(7) to learn more about channels.
The channel(s) to create or enable belong to:
With the option:--session='SESSION' option::
The recording session named 'SESSION'.
Without the option:--session option::
The current recording session (see man:lttng-concepts(7) to learn
more about the current recording session).
NOTE: The man:lttng-enable-event(1) command can automatically create a
default channel when no channel exists for the provided tracing domain.
See the ``<<examples,EXAMPLES>>'' section below for usage examples.
List the channels of a given recording session with the
man:lttng-list(1) and man:lttng-status(1) commands.
Disable an enabled channel with the man:lttng-disable-channel(1)
command.
[IMPORTANT]
====
As of LTTng{nbsp}{lttng_version}, you may :not: perform the following
operations with the `enable-channel` command:
* Change an attribute of an existing channel.
* Enable a disabled channel once its recording session has been active
(started; see man:lttng-start(1)) at least once.
* Create a channel once its recording session has been active at least
once.
* Create a user space channel with a given buffering scheme
(option:--buffers-uid or option:--buffers-pid options) and create a
second user space channel with a different buffering scheme in the
same recording session.
====
include::common-lttng-cmd-options-head.txt[]
Tracing domain
~~~~~~~~~~~~~~
One of:
option:-k, option:--kernel::
Create or enable channels in the Linux kernel domain.
option:-u, option:--userspace::
Create or enable channels in the user space domain.
Recording target
~~~~~~~~~~~~~~~~
option:-s 'SESSION', option:--session='SESSION'::
Create or enable channels in the recording session named 'SESSION'
instead of the current recording session.
Buffering scheme
~~~~~~~~~~~~~~~~
One of:
option:--buffers-global::
Allocate a single set of ring buffers for the whole system.
+
Only available with the option:--kernel option.
+
As of LTTng{nbsp}{lttng_version}, this is the default buffering scheme
for the Linux kernel tracing domain, but this may change in the future.
option:--buffers-pid::
Allocate one set of ring buffers (one per CPU) for each instrumented
process of:
+
--
If you connect to the root session daemon::
All Unix users.
+
See the ``Session daemon connection'' section of man:lttng(1) to learn
how a user application connects to a session daemon.
Otherwise::
Your Unix user.
--
+
Only available with the option:--userspace option.
option:--buffers-uid::
Allocate one set of ring buffers (one per CPU) shared by all the
instrumented processes of:
+
--
If you connect to the root session daemon::
Each Unix user.
+
See the ``Session daemon connection'' section of man:lttng(1) to learn
how a user application connects to a session daemon.
Otherwise::
Your Unix user.
--
+
Only available with the option:--userspace option.
+
As of LTTng{nbsp}{lttng_version}, this is the default buffering scheme
for the user space tracing domain, but this may change in the future.
Event record loss mode
~~~~~~~~~~~~~~~~~~~~~~
option:--blocking-timeout='TIMEOUTUS'::
Set the channel's blocking timeout value to __TIMEOUTUS__{nbsp}µs
for instrumented applications executed with a set
`LTTNG_UST_ALLOW_BLOCKING` environment variable.
+
'TIMEOUTUS' is one of:
+
--
`0` (default)::
Do not block (non-blocking mode).
`inf`::
Block forever until a sub-buffer is available to write the event
record.
__N__, a positive value::
Wait for at most __N__{nbsp}µs when trying to write to a sub-buffer.
After __N__{nbsp}µs, discard the event record.
--
+
This option is only available with both the option:--userspace and
option:--discard options.
One of:
option:--discard::
Discard event records when there's no available sub-buffer.
+
As of LTTng{nbsp}{lttng_version}, this is the default event record loss
mode, but this may change in the future.
option:--overwrite::
Overwrite the whole sub-buffer containing the oldest event records
when there's no available sub-buffer (flight recorder mode).
Sub-buffers
~~~~~~~~~~~
option:--num-subbuf='COUNT'::
Use 'COUNT' sub-buffers per ring buffer.
+
The effective value is 'COUNT' rounded up to the next power of two.
+
Default values:
+
option:--userspace and option:--buffers-uid options:::
+{default_ust_uid_channel_subbuf_num}+
option:--userspace and option:--buffers-pid options:::
+{default_ust_pid_channel_subbuf_num}+
option:--kernel and option:--buffers-global options:::
+{default_kernel_channel_subbuf_num}+
`metadata` channel:::
+{default_metadata_subbuf_num}+
option:--output='TYPE'::
Set channel's output type to 'TYPE'.
+
'TYPE' is one of:
+
--
`mmap`:::
Share ring buffers between the tracer and the consumer daemon with
the man:mmap(2) system call.
`splice`:::
Share ring buffers between the tracer and the consumer daemon
with the man:splice(2) system call.
+
Only available with the option:--kernel option.
--
+
Default values:
+
option:--userspace and option:--buffers-uid options:::
`mmap`
option:--userspace and option:--buffers-pid options:::
`mmap`
option:--kernel and option:--buffers-global options:::
`splice`
`metadata` channel:::
`mmap`
option:--subbuf-size='SIZE'::
Set the size of each sub-buffer to 'SIZE' bytes.
+
The effective value is 'SIZE' rounded up to the next power of two.
+
The `k`{nbsp}(KiB), `M`{nbsp}(MiB), and `G`{nbsp}(GiB) suffixes are
supported.
+
The minimum sub-buffer size, for each tracer, is the maximum value
between the default below and the system page size (see man:getconf(1)
with the `PAGE_SIZE` variable).
+
Default values:
+
option:--userspace and option:--buffers-uid options:::
+{default_ust_uid_channel_subbuf_size}+
option:--userspace and option:--buffers-pid options:::
+{default_ust_pid_channel_subbuf_size}+
option:--kernel and option:--buffers-global options:::
+{default_kernel_channel_subbuf_size}+
`metadata` channel:::
+{default_metadata_subbuf_size}+
Trace files
~~~~~~~~~~~
option:--tracefile-count='COUNT'::
Limit the number of trace files which LTTng writes for this channel
to 'COUNT'.
+
'COUNT' set to `0` means ``unlimited''.
+
Default: +{default_channel_tracefile_count}+.
+
You must also use the option:--tracefile-size option with this option.
option:--tracefile-size='SIZE'::
Set the maximum size of each trace file which LTTng writes for
this channel to __SIZE__{nbsp}bytes.
+
'SIZE' set to `0` means ``unlimited''.
+
Default: +{default_channel_tracefile_size}+.
+
NOTE: Data streams which LTTng writes for a channel configured with this
option may inaccurately report discarded event records as of
CTF{nbsp}1.8.
Timers
~~~~~~
option:--monitor-timer='PERIODUS'::
Set the period of the monitor timer of the channel to
__PERIODUS__{nbsp}µs.
+
Set 'PERIODUS' to `0` to disable the monitor timer.
+
Default values:
+
option:--userspace and option:--buffers-uid options:::
+{default_ust_uid_channel_monitor_timer}+
option:--userspace and option:--buffers-pid options:::
+{default_ust_pid_channel_monitor_timer}+
option:--kernel and option:--buffers-global options:::
+{default_kernel_channel_monitor_timer}+
option:--read-timer='PERIODUS'::
Set the period of the read timer of the channel to
__PERIODUS__{nbsp}µs.
+
Set 'PERIODUS' to `0` to disable the read timer.
+
Default values:
+
option:--userspace and option:--buffers-uid options:::
+{default_ust_uid_channel_read_timer}+
option:--userspace and option:--buffers-pid options:::
+{default_ust_pid_channel_read_timer}+
option:--kernel and option:--buffers-global options:::
+{default_kernel_channel_read_timer}+
`metadata` channel:::
+{default_metadata_read_timer}+
option:--switch-timer='PERIODUS'::
Set the period of the switch timer of the channel to
__PERIODUS__{nbsp}µs.
+
Set 'PERIODUS' to `0` to disable the switch timer.
+
Default values:
+
option:--userspace and option:--buffers-uid options:::
+{default_ust_uid_channel_switch_timer}+
option:--userspace and option:--buffers-pid options:::
+{default_ust_pid_channel_switch_timer}+
option:--kernel and option:--buffers-global options:::
+{default_kernel_channel_switch_timer}+
`metadata` channel:::
+{default_metadata_switch_timer}+
include::common-lttng-cmd-help-options.txt[]
include::common-lttng-cmd-after-options.txt[]
[[examples]]
EXAMPLES
--------
.Create a Linux kernel channel with default attributes in the current recording session.
====
The following command line only creates a new channel if `my-channel`
doesn't name an existing Linux kernel channel in the current recording
session.
[role="term"]
----
$ lttng enable-channel --kernel my-channel
----
====
.Create a user space channel with a per-process buffering scheme in a specific recording session.
====
See the option:--session and option:--buffers-pid options.
[role="term"]
----
$ lttng enable-channel --session=my-session --userspace \
--buffers-pid my-channel
----
====
.Create a Linux kernel channel in the current recording session with four 32-MiB sub-buffers per ring buffer.
====
See the option:--num-subbuf and option:--subbuf-size options.
[role="term"]
----
$ lttng enable-channel --kernel my-channel \
--num-subbuf=4 --subbuf-size=32M
----
====
.Create a user space channel in the current recording session with trace file rotation.
====
See the option:--tracefile-count and option:--tracefile-size options.
[role="term"]
----
$ lttng enable-channel --userspace my-channel \
--tracefile-count=16 --tracefile-size=8M
----
====
.Enable two user space channels of a specific recording session.
====
[role="term"]
----
$ lttng enable-channel --session=my-session --userspace \
canal-d,rds
----
====
include::common-footer.txt[]
SEE ALSO
--------
man:lttng(1),
man:lttng-disable-channel(1),
man:lttng-list(1),
man:lttng-concepts(7)
|