valgrind

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
valgrind [2015/02/25 15:38] – [Examples] adminvalgrind [2015/02/27 13:28] (Version actuelle) – supprimée admin
Ligne 1: Ligne 1:
-====== 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 
- 
-===== Installed version ===== 
- 
-Check for available version : 
-<code bash>$ module avail valgrind</code> 
- 
-Load the software, from login nodes (mesologin1, mesologin2) : 
- 
-<code bash> 
-$ module load valgrind 
-</code> 
-Which will provide suitable environment settings for using Valgrind. 
- 
-<WRAP center round important 60%> 
- 
-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. 
-</WRAP> 
- 
- 
-===== Examples ===== 
- 
-A number of example programs are available {{:valgrind_examples.tar|}}, which illustrate the various usage possibilities.  The archive contains the following files 
- 
-  *A Makefile for building the examples. It also contains targets illustrating the call parameters you need to specify for each case 
-  *Examples for Memcheck functionality: Fortran programs (leak1.f90) with and (noleak1.f90) without memory leaks, respectively. 
-  *Example for memory profiling (heap1.f90) 
-  *Example for cache profiling (cache1.f90). This includes a dummy routine which prevents the compiler from optimizing away the loop. 
- 
-<WRAP center round info 60%> 
- 
-Source of examples and copyrights :  https://www.lrz.de/services/software/programmierung/valgrind/ 
-</WRAP> 
- 
- 
- 
-==== Memcheck tool ==== 
- 
-<code bash> 
-$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./leak1.exe 
- 
-</code> 
-==== Massif tool==== 
- 
-<code bash> 
-$ valgrind --tool=massif --format=html --depth=5  ./heap1.exe 
-</code> 
-==== Cachegrind tool ==== 
- 
-<code bash> 
-$ valgrind --tool=cachegrind  ./cache1.exe 
- 
-</code> 
- 
- 
-==== Callgrind tool ==== 
- 
-<code bash> 
- 
-$ valgrind --tool=callgrind  ./heap1.exe 
- 
-$ callgrind_annotate --tree=both --auto=yes callgrind.out* 
- 
- 
-</code> 
- 
-<WRAP center round tip 60%> 
-On can visualize the call graphs with [[http://kcachegrind.sourceforge.net/html/Home.html|Kcachedgrind]] 
-</WRAP> 
- 
- 
-===== Links ===== 
- 
-  * http://valgrind.org/ 
  • valgrind.1424878720.txt.gz
  • Dernière modification : 2015/02/25 15:38
  • de admin