babeltrace2-sink.text.pretty - Linux


Overview

babeltrace2-sink.text.pretty is a command-line tool used to output formatted trace events to the standard output in a human-readable format. This command streamlines the process of inspecting and analyzing trace events captured using the Babeltrace framework.

Syntax

babeltrace2-sink.text.pretty [options]

Options/Flags

  • -c, –comma-separated: Format the output as comma-separated values (CSV).
  • -d, –differences: Print diffs between two traces.
  • -e, –event-filter: Filter events based on a specified expression.
  • -f, –field-filter: Filter fields based on a specified expression.
  • -h, –help: Display help information.
  • -i, –interactive: Enter interactive mode, which allows filtering and sorting of events.
  • -n, –num-events: Limit the number of events to print.
  • -o, –output-file: Specify an output file for trace events.
  • -s, –sort: Sort the events based on a specified field.
  • -t, –timestamp-format: Specify the format of the timestamp output. Available formats: "dec", "hex", "datetime", "relative".
  • -v, –verbose: Display additional information about the events.

Examples

Simple output:

babeltrace2-sink.text.pretty -n 100 /tmp/trace.bt

Comma-separated output:

babeltrace2-sink.text.pretty -c /tmp/trace.bt

Filter events by name:

babeltrace2-sink.text.pretty -e name='my_event' /tmp/trace.bt

Sort events by timestamp:

babeltrace2-sink.text.pretty -s ts /tmp/trace.bt

Compare two traces:

babeltrace2-sink.text.pretty -d /tmp/trace1.bt /tmp/trace2.bt

Common Issues

Incorrect trace format:

If the trace file is not a valid Babeltrace trace, the command will fail with an error message. Ensure that the trace file has the correct format and was generated using the Babeltrace framework.

Integration

Combining with other tools:

babelpy: The Python library for Babeltrace allows for integration with Python scripts and advanced data processing capabilities.

Related Commands

  • babeltrace2: Main Babeltrace command for analyzing traces.
  • babeltrace2-sink.json: Output trace events as JSON.
  • babeltrace2-sink.lttng: Convert trace events to LTTng format.