This is the mail archive of the 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]

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

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.

 #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)); \

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  <>

         * 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.


Attachment: gcc.gprof.diff
Description: Binary data

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