babeltrace2-plugin-text - Linux


Overview

babeltrace2-plugin-text converts Babeltrace events into textual summaries or full traces. It’s a powerful tool for capturing and analyzing trace data and is often used in debugging, profiling, and performance analysis.

Syntax

babeltrace2-plugin-text [options] <input_file>

Options/Flags

| Option | Description | Default |
| ———————– | ———————————————————————————————————- | ——– |
| -a, --all | Print all events, including those normally filtered out | false |
| -f, --format | Output format: summary (default), full, json, csv, dot, callgraph | summary |
| -s, --start-time | Start time in nanoseconds (relative to trace start) | 0 |
| -e, --end-time | End time in nanoseconds (relative to trace start) | -1 |
| -w, --context-width | Width of surrounding context in full mode | 0 |
| -E, --experimental | Activate experimental formats and features | false |
| -h, --help | Display this help message and exit | |
| -V, --version | Display version information and exit | |
| -j, --json-format | Format when --format is json (defaults to pretty JSON, use --json-format=csv for CSV) | pretty |
| -c, --color | Enable ANSI colors for output (disabled by default) | false |
| -T, --timestamp-format | Timestamp format: absolute (default), relative, utc | absolute |
| -P, --plugins | Load additional plugins from the specified directory | |
| -l, --log-level | Default log level for plugins | info |

Examples

Print only sched events:

babeltrace2-plugin-text /path/to/trace.lttng | grep sched

Generate a full trace from a specific time range:

babeltrace2-plugin-text -f full -s 123456789 -e 987654321 /path/to/trace.lttng

Export all events to CSV format:

babeltrace2-plugin-text -f csv /path/to/trace.lttng > trace.csv

Generate a callgraph for function profiling:

babeltrace2-plugin-text -f callgraph /path/to/trace.lttng > callgraph.dot

Common Issues

Empty output:

  • Ensure the input trace file contains events.
  • Check if the provided time range is valid.

Unrecognized format:

  • Specify a valid format using the --format option. Refer to the Options section for available formats.

Integration

Combine with other commands:

  • Use grep to filter specific events from the output.
  • Pipe the output to dot to generate a graphical representation of callgraphs.

Related Commands