These macros will help you generate code for profiling.
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
mcounteven the target does not support profiling.
mcountsubroutine 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
mcountroutine provided by the GNU C Library finds the address of the routine that called the routine that called
mcountby looking in the immediate caller's stack frame. If the immediate caller has no frame pointer, this lookup will fail.
By default, GCC assumes that the target does allow profiling when the
frame pointer is omitted. This macro should be defined to a C
expression that evaluates to
false if the target does not allow
profiling when the frame pointer is omitted.