/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 Analysis/debugger/malloc/valgrind.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2015-08-21 03:52:00 UTC
  • Revision ID: csa@suren.me-20150821035200-xu1zh22cqlk2omcq
Profiling

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Valgrind / callgrind
 
2
--------------------
 
3
 Open source memory leak detector and profiller. Very powerful, it is able
 
4
 to profile CPU and HEAP, simullate cache and branching behaviour. There is
 
5
 even alpha version of I/O profiller available. However, it's extremely
 
6
 slow.
 
7
 
 
8
Memory Debugger:
 
9
    valgrind <application>              
 
10
        --track-origins=yes             Track uninitialized values
 
11
        --leak-check=full
 
12
 
 
13
Othertools:
 
14
    cachegrind:                         Cache simmulator
 
15
    callgrind:                          Tree profiler
 
16
    helgrind:                           Pthread debugger (race conditions,...)
 
17
    massif:                             Heap profiller
 
18
    memcheck:                           Memory debugger
 
19
 
 
20
    iogrind:                            Third party, IO profiller (prealpha)
 
21
    
 
22
    
 
23
 
 
24
Other tools:
 
25
    --collect-jumps=yes                         - callgrind
 
26
    --simulate-cache=yes                        - callgrind, cache behaviour simulation
 
27
    --simulate-hwpref=yes                       - callgrind, prefetch simulation
 
28
    --cache-sim=yes                             - Cachegrind
 
29
    --branch-sim=yes                            - Cachegrind
 
30
    --heap=yes                                  - Massif
 
31
    --stacks=yes                                - Massif
 
32
    --track-lockorders=yes                      - Helgrind
 
33
    --show-conflicts=yes                        - Helgrind
 
34
    --enable-sg-checks=yes                      - Memcheck
 
35
 
 
36
Selecting tool
 
37
    valgrind --tool=<tool_name> <tool_options> app
 
38
 
 
39
 
 
40
Callgrind profilling
 
41
--------------------
 
42
 valgrind --tool=callgrind <application>
 
43
    create callgrind.out.* in working directory
 
44
 
 
45
    callgrind_annotate                          - information
 
46
    callgrind_annotate --tree=both              - in tree form
 
47
        
 
48
    callgrind_control                           - controlling callgrind process
 
49
                                    we may start and stop instrumentation, etc.
 
50
 
 
51
Heap Profilling
 
52
----------------
 
53
    ms_print                                    - readable
 
54
    
 
 
b'\\ No newline at end of file'