These macros will help you generate code for profiling.
FUNCTION_PROFILER (
file,
labelno)
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 a fprintf
.
PROFILE_HOOK
mcount
even the target does
not support profiling.
NO_PROFILE_COUNTERS
mcount
subroutine on your system does
not need a counter variable allocated for each function. This is true
for almost all modern implementations. If you define this macro, you
must not use the labelno argument to FUNCTION_PROFILER
.
PROFILE_BEFORE_PROLOGUE