public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] AArch64 - Add parameter to __mount routine
@ 2013-09-15 12:45 Venkataramanan Kumar
  2013-09-16 11:31 ` Marcus Shawcroft
  2013-09-24 12:19 ` Marcus Shawcroft
  0 siblings, 2 replies; 5+ messages in thread
From: Venkataramanan Kumar @ 2013-09-15 12:45 UTC (permalink / raw)
  To: libc-ports; +Cc: Marcus Shawcroft, Patch Tracking, Marcus Shawcroft

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

Hi Maintainers,

Attached is a small patch which adds a parameter to __mcount routine.

We would like to make the compiler pass the "frompc" address from the function
that calls __mcount during profiling.

ref: http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01556.html

This patch is cross tested in ARMV8 foundation model. No new regressions found.

If it is ok, someone please commit on my behalf.

2013-09-15  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>

        * sysdeps/aarch64/machine-gmon.h (__mcount): Accept parameter and
          pass it to mcount_internal.

regards,
Venkat.

[-- Attachment #2: glibc.gprof.diff --]
[-- Type: application/octet-stream, Size: 1341 bytes --]

diff --git a/ports/sysdeps/aarch64/machine-gmon.h b/ports/sysdeps/aarch64/machine-gmon.h
index 4425965..5cc2941 100644
--- a/ports/sysdeps/aarch64/machine-gmon.h
+++ b/ports/sysdeps/aarch64/machine-gmon.h
@@ -16,10 +16,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* GCC version 2 gives us a perfect magical function to get
-   just the information we need:
-     void *__builtin_return_address (unsigned int N)
-   returns the return address of the frame N frames up.  */
+/* Accept 'frompc' address as argument from the function that calls
+   __mcount for profiling.  Use  __builtin_return_address (0)
+   for the 'selfpc' address.  */
 
 #include <sysdep.h>
 
@@ -28,8 +27,8 @@ static void mcount_internal (u_long frompc, u_long selfpc);
 #define _MCOUNT_DECL(frompc, selfpc) \
 static inline void mcount_internal (u_long frompc, u_long selfpc)
 
-#define MCOUNT \
-void __mcount (void)							      \
-{									      \
-  mcount_internal ((u_long) RETURN_ADDRESS (1), (u_long) RETURN_ADDRESS (0)); \
+#define MCOUNT                                                    \
+void __mcount (void *frompc)                                      \
+{                                                                 \
+  mcount_internal ((u_long) frompc, (u_long) RETURN_ADDRESS (0)); \
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-24 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-15 12:45 [PATCH] AArch64 - Add parameter to __mount routine Venkataramanan Kumar
2013-09-16 11:31 ` Marcus Shawcroft
2013-09-16 13:35   ` Venkataramanan Kumar
2013-09-24 12:19 ` Marcus Shawcroft
2013-09-24 16:03   ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).