tracetools_trace.trace module

Entrypoint/script to setup and start an LTTng tracing session.

tracetools_trace.trace.cleanup(*, session_name: str) None

Clean up and remove tracing session if it exists.

Parameters:

session_name – the name of the session

tracetools_trace.trace.fini(*, session_name: str) None

Stop and finalize tracing.

Needs user interaction to stop tracing. Stops tracing automatically on SIGINT.

Parameters:

session_name – the name of the session

tracetools_trace.trace.init(*, session_name: str, base_path: str | None, append_trace: bool, ros_events: List[str], kernel_events: List[str], context_fields: List[str], display_list: bool, interactive: bool) bool

Init and start tracing.

Can be interactive by requiring user interaction to start tracing. If non-interactive, tracing starts right away.

Raises RuntimeError on failure, in which case the tracing session might still exist.

Parameters:
  • session_name – the name of the session

  • base_path – the path to the directory in which to create the tracing session directory, or None for default

  • append_trace – whether to append to the trace directory if it already exists, otherwise an error is reported

  • ros_events – list of ROS events to enable

  • kernel_events – list of kernel events to enable

  • context_fields – list of context fields to enable

  • display_list – whether to display list(s) of enabled events and context names

  • interactive – whether to require user interaction to start tracing

Returns:

True if successful, False otherwise

tracetools_trace.trace.main() int
tracetools_trace.trace.pause(args: Namespace) int

Pause tracing after starting or resuming.

On failure, the tracing session might still exist.

Parameters:

args – the arguments parsed using tracetools_trace.tools.args.add_arguments_session_name

Returns:

the return code (0 if successful, 1 otherwise)

tracetools_trace.trace.resume(args: Namespace) int

Resume tracing after pausing.

On failure, the tracing session might still exist.

Parameters:

args – the arguments parsed using tracetools_trace.tools.args.add_arguments_session_name

Returns:

the return code (0 if successful, 1 otherwise)

tracetools_trace.trace.start(args: Namespace) int

Configure tracing session and start tracing.

On failure, the tracing session will not exist.

Parameters:

args – the arguments parsed using tracetools_trace.tools.args.add_arguments_noninteractive

Returns:

the return code (0 if successful, 1 otherwise)

tracetools_trace.trace.stop(args: Namespace) int

Stop tracing.

On failure, the tracing session might still exist.

Parameters:

args – the arguments parsed using tracetools_trace.tools.args.add_arguments_session_name

Returns:

the return code (0 if successful, 1 otherwise)

tracetools_trace.trace.trace(args: Namespace) int

Trace.

Needs user interaction to start tracing and then stop tracing.

On failure, the tracing session will not exist.

Parameters:

args – the arguments parsed using tracetools_trace.tools.args.add_arguments

Returns:

the return code (0 if successful, 1 otherwise)