/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/debugging/profiling/valgrind.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Memory Debugger:
 
2
    valgrind <application>              
 
3
        --track-origins=yes             Track uninitialized values
 
4
        --leak-check=full
 
5
 
 
6
Othertools:
 
7
    cachegrind:                         Cache simmulator
 
8
    callgrind:                          Tree profiler
 
9
    helgrind:                           Pthread debugger (race conditions,...)
 
10
    massiv:                             Heap profiller
 
11
    memcheck:                           Memory debugger
 
12
 
 
13
    iogrind:                            Third party, IO profiller (prealpha)
 
14
    
 
15
    
 
16
 
 
17
Other tools:
 
18
    --collect-jumps=yes                         - callgrind
 
19
    --simulate-cache=yes                        - callgrind, cache behaviour simulation
 
20
    --simulate-hwpref=yes                       - callgrind, prefetch simulation
 
21
    --cache-sim=yes                             - Cachegrind
 
22
    --branch-sim=yes                            - Cachegrind
 
23
    --heap=yes                                  - Massif
 
24
    --stacks=yes                                - Massif
 
25
    --track-lockorders=yes                      - Helgrind
 
26
    --show-conflicts=yes                        - Helgrind
 
27
    --enable-sg-checks=yes                      - Memcheck
 
28
 
 
29
Selecting tool
 
30
    valgrind --tool=<tool_name> <tool_options> app
 
31
 
 
32
 
 
33
Callgrind profilling
 
34
--------------------
 
35
 valgrind --tool=callgrind <application>
 
36
    create callgrind.out.* in working directory
 
37
 
 
38
    callgrind_annotate                          - information
 
39
    callgrind_annotate --tree=both              - in tree form
 
40
        
 
41
    callgrind_control                           - controlling callgrind process
 
42
                                    we may start and stop instrumentation, etc.