sreplay 0.2.9

sreplay is a tool that performs system call replay of strace logs on UNIX-like operating systems.

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
LGPL (GNU Lesser General Public License) 
Amos Waterland
ROOT \ Utilities
sreplay is a tool that performs system call replay of strace logs on UNIX-like operating systems. The project is written in assembly and C, and is free software licensed under the LGPL. It supports simple dynamically-linked application replay under i386 and ppc64 Linux at present.

sreplay can be thought of as a virtual application. It is a freestanding program that has just enough logic to get itself running and then parse and replay a trace of system calls. It understands the trace format produced by the standard strace utility. Note that it does not attempt to preserve any timing information or trap loads and stores; it just takes an strace log and executes the system calls recorded therein.

It is mostly useful for bringup of experimental operating systems. Since it is an entirely free-standing program (no libgcc or libc), the kernel can blast it into memory with the desired trace and leap at its entry point. In this way, a kernel designer can make sure his kernel properly supports the common code paths through a proprietary database management system (for example) by obtaining a trace thereof.

A freestanding program is one that does not rely on code provided by the compiler runtime library or the system C library. Operating system kernels, hypervisors and bootloaders are freestanding for obvious reasons, but sreplay is so because the code provided by libc makes system calls before handing control to main. Because our goal is to make sreplay execute only those system calls provided in a trace, it must be freestanding. For similar reasons, the trace is accepted as a literal command line argument, because opening a file would involve one or more system calls. The alternative is to embed the trace as a seperate ELF section in the sreplay binary, similar to Linux's zImage format, but we have chosen to pursue the simplicity of the argv approach for now.


In the following, we record and replay a simple dynamically-linked program:

$ 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: ?
$ sreplay $(cat hello.strace)
Hello, world!

What's New in This Release:

Support for the lstat64, readlink, gettimeofday, and stat system calls.

Last updated on June 25th, 2007

#system call replay #strace call #strace logs #sreplay #strace #logs #call

Add your review!