Valgrind is an excellent open source instrumentation framework for building dynamic analysis tools.
The Valgrind distribution includes the debugging and profiling tools like Memcheck, Cachegrind, Callgrind, Massif, Helgrind, DRD and Other Tools
All combined these offer great tools for a memory management & error detection, thread error detectors, a cache and branch-prediction profiler, a call-graph generating cache and branch-prediction profiler, and a heap profiler.
However Valgrind valgrind-3.6.1 was not compatible with Linux kernel versions.(3.0.0-+) . Trying to install valgrind-3.6.1 on Linux 3 + gave the follwoing error message: Look at the following location for compatible patches for Linux kernel versions.(3.0.0-+)
configure: error: Valgrind works on kernels 2.4, 2.6.
Come valgrind-3.7.0.tar.bz2 and you have a linux 3.0 + compatible valgrind.
To configure & install valgrind-3.7.0.tar.bz2 on Linux kernel 3.0.follow the steps below:
1 Download valgrind-3.7.0.tar.bz2 (using curl or wget)
curl -O http://valgrind.org/downloads/valgrind-3.7.0.tar.bz2
2 use md5sum to make sure it matches the one on the site
3 Unpack it.
tar -xjvf valgrind-3.7.0.tar.bz2
4 change directory into the newly created directory
5 configure it
6 make it
7 install it (need root)
sudo make install
Congratualtions, you are now empowered to use the best dynamic analysis tool for debugging your code.