This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC Patch, Aarch64] : Macros for profile code generation to enable gprof support
- From: Venkataramanan Kumar <venkataramanan dot kumar at linaro dot org>
- To: gcc-patches at gcc dot gnu dot org, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Andrew Pinski <pinskia at gmail dot com>, Marcus Shawcroft <marcus dot shawcroft at gmail dot com>, Richard Earnshaw <rearnsha at arm dot com>
- Date: Fri, 9 Aug 2013 16:17:58 +0530
- Subject: Re: [RFC Patch, Aarch64] : Macros for profile code generation to enable gprof support
- References: <CAJK_mQ0JTvCFX+XBKQrWaH_prOkW_zCpG=g5noFvQp2rkFPnFA at mail dot gmail dot com>
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.