babeltrace2-filter.utils.muxer - Linux


Overview

babeltrace2-filter.utils.muxer is a command-line utility that provides multiplexing capabilities for trace data, allowing you to combine multiple trace streams into a single output file. It is designed for use with the Babeltrace 2 tracing framework.

Syntax

babeltrace2-filter.utils.muxer [options] <input.bt> [<input2.bt> ...] -o <output.bt>

Options/Flags

Required

  • -o, –output: Specify the output file name.

Optional

  • -f, –filter: Apply a filter expression to the input trace streams. (e.g., "process.name == "my_app"")
  • -t, –tag: Assign a tag to the output file.
  • -r, –replace: Replace the existing output file if it exists.
  • -z, –compress: Compress the output file using LZ4.
  • -j, –threads: Set the number of threads to use for multiplexing. (Default: number of CPU cores)
  • –clock-sync: Synchronize the timestamps of the input trace streams based on their global.trace_id field.

Examples

Simple multiplexing:

babeltrace2-filter.utils.muxer -o output.bt input1.bt input2.bt

Multiplexing with filtering:

babeltrace2-filter.utils.muxer -o output.bt -f "process.name == \"my_app\"" input1.bt input2.bt

Replacing existing output:

babeltrace2-filter.utils.muxer -o output.bt -r input1.bt input2.bt

Common Issues

  • File Format Error: Ensure that the input trace files are in the correct Babeltrace 2 format.
  • Timestamp Misalignment: If the input trace streams have different start times or clocks, consider using --clock-sync to synchronize them.
  • Input File Conflicts: If multiple input files contain the same global trace id, the output file may contain duplicate data.

Integration

  • Use babeltrace2-filter.utils.demuxer to extract specific trace streams from the multiplexed file.
  • Combine with babeltrace2-filter.utils.merge to merge multiple trace files into a single stream before multiplexing.

Related Commands

  • babeltrace2-filter.utils.demuxer: Demultiplexes a Babeltrace 2 trace file.
  • babeltrace2-filter.utils.merge: Merges multiple Babeltrace 2 trace streams.
  • babeltrace2-viewer: Viewer for Babeltrace 2 trace files.
  • Official Babeltrace2 Documentation