Software engineering tools based on syscall instrumentation – Cédric Vincent

ptrace is the ultimate syscall, that allows to instrument all system calls. It works on any 2.6 kernel. There are a few tools that use this syscall to do useful stuff.

  • proot rewrites paths. This is like fakechroot, but a bit more powerful because it can change subpaths, e.g. map /usr/include to ~/mydir/include (you don’t need a full root). In that sense it’s more like mount –bind. proot is ideal for cross-building.
  • proot also makes it possible to fake a lot of syscalls that didn’t exist in older kernels, by giving ‘-k 2.6.32’ it will emulate the 2.6.32 syscalls when it is run on an older kernel.
  • proot can use qemu or another emulator to run binaries – similar to binformat but completely in userspace.
  • proot can be extended to do other kind of syscall modifications.
  • CARE is a proot-based tool that detects which parts of the environment are used when running something, and then archives all this stuff into a self-extracting archive. With this archive, you can reproduce exactly the same environment on a different computer (currently it doesn’t record and replay time, but it could). It also contains a script that performs the steps needed to reproduce. It cannot reproduce race conditions of course.
  • fakeid0 is fakeroot using ptrace.
  • depstracker is like CARE but builds a dependency graph. Can be used to debug failing parallel builds.
  • pstrace is like strace but with more eye-candy.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s