Next: Tail Calls, Previous: Function Entry, Up: Stack and Calling
These macros will help you generate code for profiling.
A C statement or compound statement to output to file some assembler code to call the profiling subroutine
mcount
.The details of how
mcount
expects to be called are determined by your operating system environment, not by GCC. To figure them out, compile a small program for profiling using the system's installed C compiler and look at the assembler code that results.Older implementations of
mcount
expect the address of a counter variable to be loaded into some register. The name of this variable is `LP' followed by the number labelno, so you would generate the name using `LP%d' in afprintf
.
A C statement or compound statement to output to file some assembly code to call the profiling subroutine
mcount
even the target does not support profiling.