How To Use Profiling Tools New
How To Use Profiling Tools New
Memcheck tool:
1.Preparing your program -
Compile your program with -g to include debugging information so that
Memcheck's error messages include exact line numbers.
1.To gather heap profiling information about the program prog, type:
valgrind --tool=massif prog
2.Running ms_print -
To see the information gathered by Massif in an easy-to-read form, use
ms_print.
ms_print massif.out.12345
2. Run your program normally; that is, pretend you didn't do anything to it and do
what you would normally do (checking difficult, slow, or fast cases, of course).
3.Type gprof exec > out where exec is replaced by your executable's name and out by
some meaningful name for the profiling information.