This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC Patch, Aarch64] : Macros for profile code generation to enable gprof support


On 03/08/13 19:01, Venkataramanan Kumar wrote:


2013-08-02  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>

          * config/aarch64/aarch64.h (MCOUNT_NAME): Define.
            (NO_PROFILE_COUNTERS): Likewise.
            (PROFILE_HOOK): Likewise.
            (FUNCTION_PROFILER): Likewise.
         *  config/aarch64/aarch64.c (aarch64_function_profiler): Remove.
            .

regards,
Venkat.


Hi Venkat,

Looking at the various other ports it looks that the majority choose to use FUNCTION_PROFILER_HOOK rather than PROFILE_HOOK.

Using PROFILE_HOOK to inject a regular call to to _mcount() means that all arguments passed in registers in every function will be spilled and reloaded because the _mcount call will kill the caller save registers.

Using the FUNCTION_PROFILER_HOOK and taking care not to kill the caller save registers would be less invasive. The LR argument to _mcount would need to be passed in a temporary register, say x9 and _mcount would also need to ensure caller save registers are saved and restored.

The latter seems to be a better option to me, is there compelling reason to choose PROFILE_HOOK over FUNCTION_PROFILER_HOOK ??

Cheers
/Marcus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]