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: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- To: Venkataramanan Kumar <venkataramanan dot kumar at linaro dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 27 Aug 2013 08:35:23 +0100
- Subject: Re: [RFC Patch, Aarch64] : Macros for profile code generation to enable gprof support
- Authentication-results: sourceware.org; auth=none
- References: <CAJK_mQ0JTvCFX+XBKQrWaH_prOkW_zCpG=g5noFvQp2rkFPnFA at mail dot gmail dot com>
Hi Venkat,
On 3 August 2013 19:01, Venkataramanan Kumar
<venkataramanan.kumar@linaro.org> wrote:
> 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-----)
> 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.
+ emit_library_call (fun, LCT_NORMAL, VOIDmode, 1,lr,Pmode); \
+}
GNU coding style requires spaces after the commas, but otherwise I
have no further comments on this patch. Post the glibc patch please.
Thanks
/Marcus