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

2013-08-02  Venkataramanan Kumar  <venkataramanan.ku...@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

Reply via email to