2010/04/04

profiler

-- 2008/05/20 bbs backup --

http://vast.uccs.edu/~tboult/CS330/NOTES/profilers.ppt

#for timing



gprof

    ex.
    compile with -pg parameter
    run program once,   gmon.out is generated
    gprof ,    it shows info the same format as in the slide


#for memory

valgrind

                                                                              
http://www.lrz-muenchen.de/services/software/programmierung/valgrind/
http://www.network-theory.co.uk/docs/valgrind/

    - memcheck: memory leakage checking
        ex.
        valgrind --tool=memcheck --leak-check=yes
    - callgrind/cachegrind: simulating instruction usage/cache hit, miss
        ex.
        valgrind --tool=callgrind
        callgrind_annotate to transform to readable format
    - massif: analyze stack and heap usage, simple memory profiler
        ex.
        valgrind --tool=massif
        see the ps file

沒有留言:

張貼留言