Sreplay is a software tool for UNIX-like operating systems that can replay system calls from strace logs. It can help developers in debugging and analyzing system calls of their applications.
The project is written in assembly and C and can be thought of as a virtual application. It's a freestanding program that has just enough logic to parse and replay a trace of system calls. It understands the trace format produced by the standard strace utility and executes the system calls recorded in it.
Note that sreplay does not attempt to preserve any timing information or trap loads and stores. It supports simple dynamically-linked application replay under i386 and ppc64 Linux at present. It is mostly useful for bringup of experimental operating systems.
Sreplay is entirely freestanding as it does not rely on code provided by the compiler runtime library or system C library. A freestanding program is one that does not depend on external libraries or the operating system to function. The alternative to accepting the trace as a literal command-line argument is embedding the trace as a separate ELF section in the sreplay binary, similar to Linux's zImage format. However, the simplicity of the argv approach was chosen.
One can execute sreplay by passing the trace as an argument as shown in the example below:
$ strace /bin/echo 'Hello, world!' 2> hello.strace
Hello, world!
$ sreplay --dry-run $(cat hello.strace)
SYS: execve
ARG: /bin/echo
ARG: [/bin/echo
ARG: Hello,world!]
ARG: [/*40vars*/]
RET: 0
SYS: uname
ARG: {sys=Linux,node=cluster013,...}
RET: 0
...
SYS: exit_group
ARG: 0
RET: ?
The latest release of sreplay (with version number not mentioned) now supports the lstat64, readlink, gettimeofday, and stat system calls. As a whole, sreplay can be a useful tool for developers trying to achieve efficient experimental operating systems with complex functionalities.
Version 0.2.9: N/A