valgrind

Ceci est une ancienne révision du document !


Valgrind

Valgrind is a flexible system for debugging and profiling Linux executables for x86_64 (and some other) architectures. The functionality of Valgrind covers :

  • Memcheck/Addrcheck: Detection of memory-management problems
  • Cachegrind: Cache profiler. Detailed simulation of the I1, D1 and L2 caches is provided to pinpoint the sources of cache misses.
  • Callgrind: adds call graph tracing to cachegrind. It can be used to get call counts and inclusive cost for each call happening in your program. In addition to cachegrind, callgrind can annotate threads separately, and every instruction of disassembler output of your program with the number of instructions executed and cache misses incurred.
  • Massif: Memory consumption profiling.
  • Helgrind: Identify data races in multithreaded programs

Check for available version :

$ module avail valgrind

Load the software, from login nodes (mesologin1, mesologin2) :

$ module load valgrind

Which will provide suitable environment settings for using Valgrind.

For most cases, Valgrind will run your program considerably slower than usual, and also may use more resources, so it is recommended to cut down on problem sizes for profiling.

$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./leak1.exe
$ valgrind --tool=massif --format=html --depth=5  ./heap1.exe
$ valgrind --tool=cachegrind  ./cache1.exe
$ valgrind --tool=callgrind  ./heap1.exe
  • valgrind.1424878091.txt.gz
  • Dernière modification : 2015/02/25 15:28
  • de admin