Event log¶
The event log stores information about each non-deterministic event that affects the execution of the program. These events include:
Reads from shared memory.
Asynchronous signal delivery.
Thread switches and thread interactions.
Non-deterministic machine instructions.
Event log rotation¶
In the default (circular) mode, the Undo Engine discards events from the beginning of the event log in order to make space for new events. This means that the program can continue to run without allocating extra space for the event log.
Note
When an event is discarded from the event log, the execution history prior to the event can no longer be replayed.
Note
When UDB is loading a recording, this setting is ignored and the complete event log is loaded.
Configuring event log size¶
Memory is allocated dynamically for the event log as required, and by default is
limited to 1GB on x64 and 256MB on other platforms. To query the event log size,
use the info event-log-size command. The maximum size can be configured
when starting UDB, either using the --max-event-log-size
command-line option, for example:
$ udb --max-event-log-size 2G
or using the UNDO_event_log_max
environment variable:
$ UNDO_event_log_max=2G udb
In either case specify the maximum size as a number followed by an optional
multiplier (K
for kilobytes, M
for megabytes, or G
for gigabytes),
or as 0 to choose a suitable size.
Note
It’s recommended to set the event log size to a value that is substantially smaller than the available system memory, otherwise UDB risks being killed by the Linux out-of-memory (OOM) killer.
Note
When UDB is loading a recording, this setting is ignored and the complete event log is loaded.
info event-log-size¶
Report the current size of the event log.
For example:
recording 11,469> info event-log-size The event log size is 67108864 bytes (64.00M).
set max-event-log-size size[K|M|G]¶
Set the maximum size to which the event log may grow.
For example:
recording 11,469> set max-event-log-size 1 Maximum event log size rounded up to 67108864 bytes (64.00M). recording 11,469> set max-event-log-size 512M Maximum event log size set to 536870912 bytes (512.00M). recording 11,469> set max-event-log-size 1G Maximum event log size set to 1073741824 bytes (1.00G).
show max-event-log-size¶
The maximum size of the event log.
For example:
recording 11,469> show max-event-log-size Maximum event log size is 1073741824 bytes (1.00G).
Using a straight event log¶
If you prefer the event log not be rotated, you can switch to the “straight” event log mode. In this mode, when the event log is full, UDB stops the program and emits this message:
ERROR: The Undo Engine's event log is full, so no more history can be recorded.
You may still use UDB commands to go backwards, or alternatively: Use "set
max-event-log-size <size>[K|M|G]" to increase the event log size, or use "set
event-log-mode circular" to use a circular event log. The current event log
size is 67108864 bytes (64.00M).
At this point you can increase the maximum event log size using the set max-event-log-size, or switch to a circular event log using the set event-log-mode command.
Configure the event log when starting UDB, either using the
--event-log-mode
command-line option, for
example:
$ udb --event-log-mode straight
or using the UNDO_event_log_mode
environment variable:
$ UNDO_event_log_mode=straight udb
set event-log-mode circular|straight¶
Set the event log mode.
For example:
recording 11,469> set event-log-mode straightThe default (circular) event log mode can be restored using:
recording 11,469> set event-log-mode circular
show event-log-mode¶
The event log mode (circular or straight).
For example:
recording 11,469> show event-log-mode The event log mode is circular.