Tracing Commands - HACKT PRSIM Manual
Description: HACKT PRSIM Manual

Next: Debug Commands, Previous: Modes Commands, Up: Commands

### 3.8 `tracing` Commands

Checkpointing is useful for saving the state of the simulator, which allows one to interrupt and resume long simulations, and also examine points of failure in detail.

— Command: save ckpt

> Saves the current state of the production rules and nodes into a checkpoint file ckpt. The checkpoint file can be loaded to resume or replay a simulation later.

— Command: load ckpt

> Loads a hacprsim checkpoint file into the simulator state. Loading a checkpoint will not overwrite the current status of the auto-save file, the previous autosave command will keep effect. Loading a checkpoint, however, will close any open tracing streams.

— Command: autosave [on|off [file]]

> Automatically save checkpoint upon end of simulation, regardless of exit status. The reset command will turn off auto-save; to re-enable it with the same file name, just `autosave on`. The -a command line option is another way of enabling and specifying the autosave checkpoint name.

The simulator supports trace file recording. Unlike checkpoints, trace files contain information for the entire history of execution, not just the state at one point in time.

— Command: trace file

> Record events to tracefile file. Overwrites file if it already exists. A trace stream is automatically closed when the initialize or reset commands are invoked. See the -r option for starting up the simulator with a newly opened trace stream.

— Command: trace-file

> Print the name of the currently opened trace file.

— Command: trace-close

> Finish writing the currently opened trace file by flushing out the last epoch and concatenating the header with the stream body. Trace is automatically closed when the simulator exits.

— Command: trace-flush-notify [0|1]

> Enable (1) or disable (0) notifications when trace epochs are flushed.

— Command: trace-flush-interval steps

> If steps is given, set the size of each epoch according to the number of events executed, otherwise report the current epoch size. This regulates the granularity of saving traces in a space-time tradeoff.

— Command: trace-dump file

> Produce textual dump of trace file contents in file.