Loading and saving recordings

When suitably licensed, UDB can load and save LiveRecorder recordings.

Loading recordings

Load a recording using the uload command in UDB, or by specifying the filename on the UDB command line. This loads the execution history of the program loaded from the recording file, including any debug symbols, so that it is ready to be replayed. This also loads bookmarks created by the same user when previously replaying the recording.

Loading a recording from the command line

You can specify a LiveRecorder recording when starting UDB. When a recording is passed as the final command-line argument to udb it is automatically loaded. For example:

$ udb recording.undo

The debugged program is at the beginning of recorded history. Start debugging
from here or, to proceed towards the end, use:
    continue - to replay from the beginning
    ugo end  - to jump straight to the end of history

No more reverse-execution history.
start 1> continue
Continuing.

Program received signal SIGABRT, Aborted.
Have reached end of recorded history.

The recorded program has exited.
You can use UDB reverse commands to go backwards; see "help udb" for details.

__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
end 221,440> backtrace
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f173294e535 in __GI_abort () at abort.c:79
#2  0x000055d5f88d237a in main () at cache.c:85

Going to the end of execution history after loading

By default, UDB starts replaying the recording from the beginning of execution history, but when investigating a crash it is often more convenient to start at the end.

Use the udb --load-goto-end command-line option to start debugging the loaded recording from the end of execution history. This is significantly faster than loading the recording and issuing the ugo end command as separate steps. For example:

$ udb --load-goto-end recording.undo

No more reverse-execution history.
0x000055d5f88d2080 in _start ()

Performing "ugo end" to jump to the end of the recording. Press ^C to
interrupt this and go back to the start.

Have reached end of recorded history.
end 221,440> backtrace
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f173294e535 in __GI_abort () at abort.c:79
#2  0x000055d5f88d237a in main () at cache.c:85

This can be configured for all UDB sessions by setting UNDO_load_goto_end=true in the environment.

uload [-e|-goto-end] filename

Load a LiveRecorder recording.

The filename argument names the recording file.

For example:

$ udb
not running> uload recording.undo

The debugged program is at the beginning of recorded history. Start debugging
from here or, to proceed towards the end, use:
    continue - to replay from the beginning
    ugo end  - to jump straight to the end of history

No more reverse-execution history.
0x000055d5f88d2080 in _start ()
start 1 start> continue
Continuing.

Program received signal SIGABRT, Aborted.
Have reached end of recorded history.

The recorded program has exited.
You can use UDB reverse commands to go backwards; see "help udb" for details.

__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
-e, -goto-end

Jump to the end of execution history immediately after loading. This has the same effect as the ugo end command, but can be substantially faster.

$ udb
not running> uload -e recording.undo

No more reverse-execution history.
0x000055d5f88d2080 in _start ()

Imported 2 bookmarks from the previous session. Use "info bookmarks" to list
them.


Performing "ugo end" to jump to the end of the recording. Press ^C to
interrupt this and go back to the start.

Have reached end of recorded history.

info recording-version

The Undo version used to create the loaded LiveRecorder recording.

For example:

end 221,440 end> info recording-version
6.5.0-dev.925873450c35

Saving recordings

usave filename

Save execution history as a LiveRecorder recording.

The filename argument names the recording file.

The recording can be loaded into UDB using the uload command.

Replaying on a different CPU

Replaying a recording that was created on a different CPU requires that the replay CPU supports all the instructions used by the program when it was recorded. UDB refuses to load a recording if these requirements cannot be satisfied, although a warning may be shown instead when loading recordings made with older versions of LiveRecorder. The info replayability command shows the CPU features required to replay the loaded recording.

info replayability

The CPU features required to replay the loaded LiveRecorder recording.

The features are reported in the same style as they appear in the flags fields of /proc/cpuinfo. A feature is listed if the program executed an instruction requiring that feature when it was originally recorded. Any hardware which supports all of the listed features can be used to replay this recording.

For example:

end 221,440 end> info replayability
The CPU features required to replay 'recording.undo' are: avx avx2 bmi1 lm sse
sse2 xsave.

Recording File Locking

Recordings are locked while they are being written to file in order to prevent other Undo processes from accessing them before they are completed.

Attempts to save a recording to a file path that is already being saved to will fail:

$ live-record -o recording.undo true
live-record: Maximum event log size is 1G
live-record: Saving to 'recording.undo'...
live-record: Failed to save recording recording.undo: Recording is being written in another process.
live-record: Detaching...

Attempts to load a recording that is being saved to will also fail:

$ udb recording.undo
ERROR: Failed to load LiveRecorder recording
       because: Recording is being written in another process.

New in version 6.5.