An object code expansion profiler equips a program for execution profiling by
preprocessing the object code files of the program so as to add profiling monitoring
code to the beginning of all or substantially all functions. The preprocessing
includes, for each function, the steps of grouping the function's instructions
into basic blocks, counting the number of cycles required to execute the instructions
of the basic block, and inserting special monitoring code with the basic block.
The special monitoring code is executed each time the basic block is executed,
and updates the profiling information to reflect the number of cycles required
to execute the basic block. Special handling is provided for profiling calls to
the Operating System (OS). The resultant profiling information is converted into
a call graph image most useful for human users. For each arc in the graph connecting
a calling-function/parent-node to a called-function/child node, the displayed arc
image has a width logarithmically proportional to the self+descendants time for
the called function.