NAMEDESCRIPTIONINITIALIZATION PARAMETERSPORTSSEE ALSO

babeltrace2-sink.ctf.fs(7)

NAME

babeltrace2-sink.ctf.fs — Babeltrace 2's file system CTF sink component class

DESCRIPTION

A Babeltrace 2 sink.ctf.fs component writes the messages it consumes to one or more CTF 1.8 traces on the file system.

            +-------------+
            | sink.ctf.fs |
            |             +--> CTF trace(s) on
Messages -->@ in          |    the file system
            +-------------+

See babeltrace2-intro(7) to learn more about the Babeltrace 2 project and its core concepts.

A sink.ctf.fs component does not merge traces: it writes the messages of different input traces to different output traces.

Special trace IR to CTF translations

A sink.ctf.fs component makes a best effort to write CTF traces that are semantically equivalent to the input traces. As of this version, the component writes CTF 1.8 traces, so the following field class translations can occur:

In all the cases above, the component adds a comment in the metadata stream, above the field class, to indicate that a special translation occurred.

Input message constraints

Because of limitations in CTF 1.8 regarding how discarded events and packets are encoded:

The messages which a source.ctf.fs component creates satisfy all the requirements above.

If a discarded events or packets message has no events/packets count, the sink.ctf.fs component adds 1 to the corresponding CTF stream’s counter.

Alignment and byte order

A sink.ctf.fs component always aligns data fields as such:

Integer fields with a size which is not a multiple of 8

1-bit.

All other scalar fields (integer, enumeration, real, string)

8-bit.

The component writes fields using the machine’s native byte order. As of this version, there’s no way to force a custom byte order.

Output path

The path of a CTF trace is the directory which directly contains the metadata and data stream files.

The current strategy to build a path in which to write the streams of a given input trace is, in this order:

  1. If the assume-single-trace parameter is true, then the output trace path to use for the single input trace is the directory specified by the path parameter.

  2. If the component recognizes the input trace as an LTTng (2.11 or greater) trace, then it checks specific trace environment values to build a trace path relative to the directory specified by the path parameter:

    Linux kernel domain
    HOST/SNAME-STIME/kernel
    User space domain, per-UID buffering
    HOST/SNAME-STIME/ust/uid/UID/ARCHW-bit
    User space domain, per-PID buffering
    HOST/SNAME-STIME/ust/pid/PNAME-PID-PTIME

    With:

    HOST

    Target’s hostname.

    SNAME

    Tracing session name.

    STIME

    Tracing session creation date/time.

    UID

    User ID.

    ARCHW

    Architecture’s width (32 or 64).

    PNAME

    Process name.

    PID

    Process ID.

    PTIME

    Process’s date/time.

  3. If the input trace has a name, then the component sanitizes this name and uses it as a relative path to the directory specified by the path parameter.

    The trace name sanitization operation:

    • Replaces . subdirectories with _.

    • Replaces .. subdirectories with __.

    • Removes any trailing / character.

  4. The component uses the subdirectory trace relative to the directory specified by the path parameter.

In all the cases above, if the effective output trace path already exists on the file system, the component appends a numeric suffix to the name of the last subdirectory. The suffix starts at 0 and increments until the path does not exist.

INITIALIZATION PARAMETERS

assume-single-trace=VAL [optional boolean]

If VAL is true, then assume that the component only receives messages related to a single input trace.

This parameter affects how the component builds the output trace path (see Output path).

Default: false.

ignore-discarded-events=VAL [optional boolean]

If VAL is true, then ignore discarded events messages.

Default: false.

ignore-discarded-packets=VAL [optional boolean]

If VAL is true, then ignore discarded packets messages.

Default: false.

path=PATH [string]

Base output path.

See Output path to learn how the component uses this parameter to build the output path for a given input trace.

quiet=VAL [optional boolean]

If VAL is true, then do not write anything to the standard output.

Default: false.

PORTS

+-------------+
| sink.ctf.fs |
|             |
@ in          |
+-------------+

Input

in

Single input port.

SEE ALSO

babeltrace2-intro(7), babeltrace2-plugin-ctf(7)