|Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications|
by J. Seward, N. Nethercote, J. Weidendorfer and the Valgrind Development Team
Paperback (6"x9"), 164 pages
RRP £12.95 ($19.95)
7.4.4 Data collection options
These options specify when events are to be aggregated into event counts. Also see 7.3.2.
--instr-atstart=<yes|no> [default: yes]Specify if you want Callgrind to start simulation and profiling from the beginning of the program. When set to ‘no’, Callgrind will not be able to collect any information, including calls, but it will have at most a slowdown of around 4, which is the minimum Valgrind overhead. Instrumentation can be interactively switched on via ‘callgrind_control -i on’. Note that the resulting call graph will most probably not contain ‘main’, but will contain all the functions executed after instrumentation was switched on. Instrumentation can also programatically switched on/off. See the Callgrind include file ‘<callgrind.h>’ for the macro you have to use in your source code. For cache simulation, results will be less accurate when switching on instrumentation later in the program run, as the simulator starts with an empty cache at that moment. Switch on event collection later to cope with this error.
--collect-atstart=<yes|no> [default: yes]Specify whether event collection is switched on at beginning of the profile run. To only look at parts of your program, you have two possibilities:
- Zero event counters before entering the program part you want to profile, and dump the event counters to a file after leaving that program part.
- Switch on/off collection state as needed to only see event counters happening while inside of the program part you want to profile.
--toggle-collect. If you use this flag, collection state should be switched off at the beginning. Note that the specification of ‘--toggle-collect’ implicitly sets ‘--collect-state=no’. Collection state can be toggled also by using a Valgrind Client Request in your application. For this, include ‘valgrind/callgrind.h’ and specify the macro ‘CALLGRIND_TOGGLE_COLLECT’ at the needed positions. This only will have any effect if run under supervision of the Callgrind tool.
--toggle-collect=<function>Toggle collection on entry/exit of <function>.
--collect-jumps=<no|yes> [default: no]This specifies whether information for (conditional) jumps should be collected. As above, callgrind_annotate currently is not able to show you the data. You have to use KCachegrind to get jump arrows in the annotated code.
|ISBN 0954612051||Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications||See the print edition|