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


ping!

On 3 August 2013 23:31, Venkataramanan Kumar
<venkataramanan.kumar@linaro.org> wrote:
> Hi Maintainers,
>
> This patch adds macros to support gprof in Aarch64. The difference
> from the previous patch is that the compiler, while generating
> "mcount" routine for an instrumented function, also passes the return
> address as argument.
>
> The "mcount" routine in glibc will be modified as follows.
>
> (-----Snip-----)
>  #define MCOUNT \
> -void __mcount (void)                                                         \
> +void __mcount (void* frompc)
>                \
>  {                                                                            \
> -  mcount_internal ((u_long) RETURN_ADDRESS (1), (u_long) RETURN_ADDRESS (0)); \
> +  mcount_internal ((u_long) frompc, (u_long) RETURN_ADDRESS (0)); \
>  }
> (-----Snip-----)
>
> Also in Aarch64 cases__builtin_return_adderess(n) where n>0, still be
> returning 0 as it was doing before.
>
> If this is Ok I will send the patch to glibc as well.
>
> 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.


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