babeltrace2-source.ctf.fs - Linux


Overview

babeltrace2-source.ctf.fs is a command-line tool for generating a CTF (Common Trace Format) trace source from a Linux ftrace trace directory. It is primarily used for analyzing kernel-level events and system behavior.

Syntax

babeltrace2-source.ctf.fs [options] <trace-directory> <ctf-file>

Options/Flags

  • -a, –annotate
    Annotate the trace with extra information, including kernel text markers and user-provided annotations.

  • -d, –debug
    Enable debug log messages.

  • -f, –filter
    Use a filter expression to select specific events to include in the trace.

  • -g, –group
    Generate a CTF trace for each event group.

  • -h, –help
    Print the help message and exit.

  • -l, –limit
    Maximum number of events to include in the trace.

  • -s, –split
    Split the trace into multiple CTF files.

  • -t, –timestamp
    Timestamp format (default: "relative")

  • -v, –verbose
    Increase the verbosity level.

Examples

Example 1: Generate a simple CTF trace from a trace directory

babeltrace2-source.ctf.fs /sys/kernel/debug/tracing /tmp/trace.ctf

Example 2: Generate a CTF trace with annotations

babeltrace2-source.ctf.fs -a /sys/kernel/debug/tracing /tmp/annotated-trace.ctf

Example 3: Filter the trace by event group

babeltrace2-source.ctf.fs -g -f sched /sys/kernel/debug/tracing /tmp/sched-trace.ctf

Common Issues

  • Permission denied: Ensure that you have sufficient permissions to access the trace directory.

  • No events found: Check if the trace directory contains valid trace data.

  • CTF file is corrupted: Verify the integrity of the generated CTF file using a tool like ctftool.

Integration

babeltrace2-source.ctf.fs can be integrated with other tools for advanced analysis. For example:

  • ctfload to load the trace into a database for querying and visualization.
  • babeltrace to analyze and visualize the trace using a graphical interface.

Related Commands

  • babeltrace – A command-line tool for analyzing kernel traces.
  • trace-cmd – A command-line tool for recording and analyzing traces.
  • ctftool – A command-line tool for manipulating CTF traces.
  • Linux Trace Toolkit (LTTng) – A trace event framework for Linux.