LTTNG-ROTATE(1)

πŸŽ€ LTTNG-ROTATE πŸŽ€

okay bestie, welcome to the lttng-rotate page from the LTTng Manual πŸ’– sit down, grab a strawberry, and let's talk about archiving trace chunks. this is literally the moment your traces get their own little scrapbook era ✨


✨ NAME ✨

lttng-rotate β€” archive the current trace chunk of an LTTng recording session πŸ’…


🌸 SYNOPSIS 🌸

lttng [GENERAL OPTIONS] rotate [--no-wait] [SESSION]

πŸ’œ DESCRIPTION πŸ’œ

so, the lttng rotate command archives the current trace chunk of a recording session to the file system. which session, bestie? depends:

  • With the SESSION argument β€” it's the recording session named SESSION. you said the name, it does the thing 🫢
  • Without the SESSION argument β€” it's the current recording session (peep lttng-concepts(7) to learn more about the current recording session).

this whole operation is called a recording session rotation ⭐

also go read lttng-concepts(7) because it explains the recording session rotation and trace chunk concepts way better than I can in one breath, fr fr.

you can use the rotate command:

  • Any time the recording session is active πŸ”₯
  • A single time once the recording session becomes inactive

and yes, lttng-concepts(7) also covers what "activity of a recording session" even means πŸ‘‘

by default, the rotate command makes sure LTTng finished performing the recording session rotation before it prints the path of the archived trace chunk and exits. the printed path is:

  • absolute when the recording session was created in normal mode, and
  • relative to the base output directory of the relay daemon (see the --output option of lttng-relayd(8)) when it was created in network streaming mode (see lttng-create(1)).

want it to dip out immediately instead? use the --no-wait option. but bestie, heads up: in that case there's no easy way to know when the current trace chunk becomes archived, and the command does NOT print the path of the archived trace chunk. it's giving mystery πŸ•΅οΈ

here's the part that's actually kind of iconic: because LTTng flushes the current sub-buffers of the selected recording session when it performs a recording session rotation, archived trace chunks are never redundant β€” that is, they do not overlap over time the way snapshots can (see lttng-snapshot(1)). also, a rotation does NOT directly cause discarded event records or packets. we love a clean cut βœ‚οΈβœ¨

oh and p.s. a rotate-session trigger action can also rotate a recording session (see lttng-add-trigger(1)). multitasking queen.

scroll down to the "EXAMPLES" section for usage examples πŸ‘‡

Important πŸ’€ you may only use the rotate command when all of the following conditions are true: - The selected recording session was created in normal mode or in network streaming mode (see lttng-create(1)). - LTTng is not currently performing an immediate rotation (this command). both, bestie. not one. both. πŸ™ˆ

πŸ’… OPTIONS πŸ’…

see lttng(1) for GENERAL OPTIONS.

  • -n, --no-wait β€” do not ensure that the recording session rotation operation is completed before exiting. bye, no notes, no receipts πŸ¦‹

🌈 Program information 🌈

  • -h, --help β€” show help. this option attempts to launch /usr/bin/man to view this manual page. override the manual pager path with the LTTNG_MAN_BIN_PATH environment variable. iykyk πŸ“–
  • --list-options β€” list available command options and quit. that's it, that's the whole job ✨

πŸ“ EXIT STATUS πŸ“

  • 0 β€” success πŸŽ‰
  • 1 β€” command error 😭
  • 2 β€” undefined command πŸ€”
  • 3 β€” fatal error πŸ’€
  • 4 β€” command warning (something went wrong during the command) 😬

🧚 ENVIRONMENT 🧚

  • LTTNG_ABORT_ON_ERROR β€” set to 1 to abort the process after the first error is encountered. no second chances, periodt.
  • LTTNG_HOME β€” path to the LTTng home directory. defaults to $HOME. useful when the Unix user running the commands has a non-writable home directory. shoutout to the locked-down homedir girlies 🫢
  • LTTNG_LIST_LEGACY β€” set to 1 to use the legacy output format (LTTng 2.14 and earlier) for the lttng-list(1) command instead of the modern output format. note that the legacy output doesn't show anything related to features introduced after LTTng 2.14. it's giving vintage, not vintage-chic πŸ’€
  • LTTNG_MAN_BIN_PATH β€” absolute path to the manual pager to use to read the LTTng command-line help (with lttng-help(1) or with the --help option) instead of /usr/bin/man.
  • LTTNG_NO_UTF_8 β€” set to 1 to NOT emit multi-byte UTF-8 sequences, even if the locale claims to support it. beware, the emoji economy collapses 🌸
  • LTTNG_SESSION_CONFIG_XSD_PATH β€” path to the directory containing the session.xsd recording session configuration XML schema.
  • LTTNG_SESSIOND_PATH β€” absolute path to the LTTng session daemon binary (see lttng-sessiond(8)) to spawn from the lttng-create(1) command. the --sessiond-path general option overrides this environment variable. πŸ‘‘
  • LTTNG_TERM_COLOR β€” controls when to emit terminal SGR codes in the output. the NO_COLOR environment variable overrides this. one of:
    • auto (default) β€” only emit SGR codes when the standard output is connected to a color-capable terminal.
    • always β€” always emit SGR codes. rainbow mode, no cap 🌈
    • never β€” never emit SGR codes.
  • NO_COLOR β€” if set and not empty, then it's equivalent to setting LTTNG_TERM_COLOR to never. see NO_COLOR https://no-color.org/ to learn more.

πŸŽ€ FILES πŸŽ€

  • $LTTNG_HOME/.lttngrc β€” Unix user's LTTng runtime configuration. this is where LTTng stores the name of the Unix user's current recording session between executions of lttng(1). lttng-create(1) and lttng-set-session(1) set the current recording session. so basically it's the "who am i right now" file πŸ’…
  • $LTTNG_HOME/lttng-traces β€” default output directory of LTTng traces in local and snapshot modes. override this path with the --output option of the lttng-create(1) command.
  • $LTTNG_HOME/.lttng β€” Unix user's LTTng runtime and configuration directory.
  • $LTTNG_HOME/.lttng/sessions β€” default directory containing the Unix user's saved recording session configurations (see lttng-save(1) and lttng-load(1)).
  • /etc/lttng/sessions β€” directory containing the system-wide saved recording session configurations (see lttng-save(1) and lttng-load(1)).
Note ✨ $LTTNG_HOME defaults to the value of the HOME environment variable.

⭐ EXAMPLES ⭐

Example 1. Rotate the current recording session.

$ lttng rotate

Example 2. Rotate a specific recording session.

$ lttng rotate my-session

Example 3. Rotate the current recording session without waiting for completion.

see the --no-wait option.

$ lttng rotate --no-wait

πŸ¦‹ RESOURCES πŸ¦‹


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.


πŸ’– THANKS πŸ’–

special thanks to Michel Dagenais and the DORSAL laboratory http://www.dorsal.polymtl.ca/ at Γ‰cole Polytechnique de MontrΓ©al for the LTTng journey. absolute legends, no notes 🫢

also thanks to the Ericsson teams working on tracing which helped us greatly with detailed bug reports and unusual test cases. unusual test cases are the main character energy of QA, fr fr πŸ”₯


🌈 SEE ALSO 🌈

lttng(1), lttng-disable-rotation(1), lttng-enable-rotation(1), lttng-concepts(7)


okay that's the whole page, bestie πŸ’– this was LTTng 2.15.1, dated 14 June 2021 β€” go archive a trace chunk and slay βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from