# Debugger: Trace Management

This service plugin manages the collection of open traces, and it is controlled primarily via the Threads window. It maintains a list of open traces, the active trace coordinates (trace, time, thread, frame), and permits saving, opening, and closing traces. To some extent, it also tracks which traces are being actively recorded.

## Actions

The plugin provides the following actions and toggles:

### Open Trace

This action is always available. It prompts for a trace in the current project and opens that trace in the tool.

### Save Trace

This action is available whenever at least one trace is open and active. It saves the current trace. If the current trace is not in any project, it saves it under "New Traces" of the current project.

### Close Trace

This action is available whenever at least one trace is open and active. It closes the current trace. WARNING: If the trace has not been saved, it will be lost, even when Save by Default is active.

### Close All Traces

This action is available whenever at least one trace is open. It closes all traces in this tool. WARNING: Any trace that has not been saved will be lost, even when Save by Default is active.

### Close Other Traces

This action is available whenever there is an open trace other than the active one. It closes all traces in this tool, except the active trace. WARNING: Any closed trace that has not been saved will be lost, even when Save by Default is active.

### Close Dead Traces

This action is available whenever at least one trace is open. It closes all dead traces in this tool. WARNING: Any closed trace that has not been saved will be lost, even when Save by Default is active.

### Save by Default

This toggle is always available. If the tool is closed with this toggle enabled, all open traces are immediately saved. Note that if Ghidra is abruptly terminated (a rare occurrence under normal use), traces may not be saved. When the tool is re-opened, the open traces are also restored.

### Close Traces on Termination

This toggle is always available. If a target terminates with this toggle enabled, and it was being recorded into a trace, that trace is automatically closed. If Save by Default is active, the trace is saved.