Callgrind Format Specification
•
version:
number
[Callgrind]
This is used to distinguish future profile data formats.
A major version of 0 or 1 is supposed to be upwards
compatible with Cachegrind’s format. It is optional; if not appearing, version 1 is supposed. Otherwise, this has
to be the first header line.
•
pid:
process id
[Callgrind]
This specifies the process ID of the supervised application for which this profile was generated.
•
cmd:
program name + args
[Cachegrind]
This specifies the full command line of the supervised application for which this profile was generated.
•
part:
number
[Callgrind]
This specifies a sequentially incremented number for each dump generated, starting at 1.
•
desc:
type:
value
[Cachegrind]
This specifies various information for this dump. For some types, the semantic is defined, but any description type
is allowed. Unknown types should be ignored.
There are the types "I1 cache", "D1 cache", "LL cache", which specify parameters used for the cache simulator.
These are the only types originally used by Cachegrind.
Additionally, Callgrind uses the following types:
"Timerange" gives a rough range of the basic block counter, for which the cost of this dump was collected. Type
"Trigger" states the reason of why this trace was generated. E.g. program termination or forced interactive dump.
•
positions:
[instr] [line]
[Callgrind]
For cost lines, this defines the semantic of the first numbers. Any combination of "instr", "bb" and "line" is allowed,
but has to be in this order which corresponds to position numbers at the start of the cost lines later in the file.
If "instr" is specified, the position is the address of an instruction whose execution raised the events given later on
the line. This address is relative to the offset of the binary/shared library file to not have to specify relocation info.
For "line", the position is the line number of a source file, which is responsible for the events raised. Note that the
mapping of "instr" and "line" positions are given by the debugging line information produced by the compiler.
This field is optional. If not specified, "line" is supposed only.
•
events:
event type abbreviations
[Cachegrind]
A list of short names of the event types logged in this file. The order is the same as in cost lines. The first event
type is the second or third number in a cost line, depending on the value of "positions".
Callgrind does not add
additional cost types. Specify exactly once.
Cost types from original Cachegrind are:
•
Ir
: Instruction read access
•
I1mr
: Instruction Level 1 read cache miss
•
ILmr
: Instruction last-level read cache miss
• ...
16