F.1 Profiling file format
Every mpatrol profiling output file contains the following components.
- 4 bytes containing the characters `M', `P', `T' and `L'.
- 1 unsigned integer representing the value `1'. This is used by
mprof to determine the endianness of the processor that produced the
profiling output file so that it can decide whether to perform byte-swapping on
the input data.
- 1 unsigned integer containing the version number of the mpatrol library which
produced the profiling output file.
- 3 unsigned integers containing the small, medium and large allocation bounds.
- 1 unsigned integer containing the allocation bin size. If the allocation bin
size is greater than zero then it is followed by the allocation bins, the large
allocation totals, the deallocation bins and the large deallocation totals,
where the bins are arrays of unsigned integers with dimensions of the allocation
bin size and the totals are unsigned integers.
- 1 unsigned integer containing the number of profiling data structures. If the
number of profiling data structures is greater than zero then it is followed by
the profiling data structures themselves, which are of the following structure.
- 1 unsigned integer representing the index of this profiling data.
- 4 unsigned integers representing the small, medium, large and extra large
allocation counts for this profiling data.
- 4 unsigned integers representing the small, medium, large and extra large
allocation totals for this profiling data.
- 4 unsigned integers representing the small, medium, large and extra large
deallocation counts for this profiling data.
- 4 unsigned integers representing the small, medium, large and extra large
deallocation totals for this profiling data.
- 1 unsigned integer containing the number of call sites. If the number of call
sites is greater than zero then it is followed by the call sites themselves,
which are of the following structure.
- 1 unsigned integer representing the index of this call site.
- 1 unsigned integer representing the index of the parent call site.
- 1 generic pointer representing the code address of this call site.
- 1 unsigned integer representing the index of an associated symbol.
- 1 unsigned integer representing the offset of the symbol name.
- 1 unsigned integer representing the index of any associated profiling data.
- 1 unsigned integer containing the number of symbol addresses. If the number
of symbol addresses is greater than zero then it is followed by the symbol
addresses themselves, which are generic pointers.
- 1 unsigned integer containing the size of the symbol name string table. This
is followed by the symbol name string table, which is an array of characters
containing the nul-terminated symbol names.
- 4 bytes containing the characters `M', `P', `T' and `L'.