Home

Awesome

License Build Status codecov Total alerts Coverity Scan

What's this?

Valgrind-preload (AKA Pregrind) is a simple LD_PRELOAD-able library which will cause all spawned processes to be started under Valgrind.

It's functionality is similar to Valgrind's standard --trace-children=yes but fixes few disadvantages:

The tool seems to be pretty stable now, e.g. I was able to instrument complete Debian package builds and even found several new errors.

Usage

To use, just preload libpregrind.so to your app:

$ LD_PRELOAD=path/to/libpregrind.so app arg1 ...

You can also use a simple wrapper script:

$ path/to/pregrind app arg1 ...

Finally, if you want to instrument whole system, preload libpregrind.so globally:

$ echo path/to/libpregrind.so >> /etc/ld.so.preload

Note that in this mode libpregrind.so will be preloaded to all newly started processes so any malfunction may permanently break your system. It's thus highly recommended to only do this in a chroot or VM.

Library can be customized through environment variables:

Build

To build the tool, simply run make from top directory.

Trophies

Known issues

Various TODO and FIXME are scattered all over the codebase but tool should be quite robust. Ping me if you need more features.