Callgrind: a call-graph generating cache and branch prediction profiler
--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 enabled 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 enabled. Instrumentation can also programatically enabled/disabled. 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 enabled at beginning of the profile run.
To only look at parts of your program, you have two possibilities:
1. 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.
2. Switch on/off collection state as needed to only see event counters happening while inside of the program part you
want to profile.
The second option can be used if the program part you want to profile is called many times. Option 1, i.e. creating a
lot of dumps is not practical here.
Collection state can be toggled at entry and exit of a given function with the option
--toggle-collect
. If you use
this option, collection state should be disabled at the beginning. Note that the specification of
--toggle-collect
implicitly sets
--collect-state=no
.
Collection state can be toggled also by inserting the client request
CALLGRIND_TOGGLE_COLLECT ;
at the
needed code positions.
--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.
--collect-systime=<no|yes> [default:
no]
This specifies whether information for system call times should be collected.
--collect-bus=<no|yes> [default:
no]
This specifies whether the number of global bus events executed should be collected. The event type "Ge" is used for
these events.
6.3.4. Cost entity separation options
These options specify how event counts should be attributed to execution contexts. For example, they specify whether
the recursion level or the call chain leading to a function should be taken into account, and whether the thread ID
should be considered. Also see
Avoiding cycles
.
100
Содержание BBV
Страница 176: ...Valgrind FAQ Release 3 8 0 10 August 2012 Copyright 2000 2012 Valgrind Developers Email valgrind valgrind org ...
Страница 177: ...Valgrind FAQ Table of Contents Valgrind Frequently Asked Questions 1 ii ...
Страница 302: ...README mips based on newer GCC versions if possible 95 ...
Страница 303: ...GNU Licenses ...
Страница 304: ...GNU Licenses Table of Contents 1 The GNU General Public License 1 2 The GNU Free Documentation License 8 ii ...