public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
To: libc-ports@sourceware.org
Cc: Marcus Shawcroft <marcus.shawcroft@gmail.com>,
	Patch Tracking <patch@linaro.org>,
		Marcus Shawcroft <marcus.shawcroft@arm.com>
Subject: [PATCH] AArch64 - Add parameter to __mount routine
Date: Sun, 15 Sep 2013 12:45:00 -0000	[thread overview]
Message-ID: <CAJK_mQ2OQPP7_RFcMJc2NP7Wz7hX2AHQ9aVb8-uKi+MZN4UFsA@mail.gmail.com> (raw)

[-- 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)); \
 }

             reply	other threads:[~2013-09-15 12:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-15 12:45 Venkataramanan Kumar [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJK_mQ2OQPP7_RFcMJc2NP7Wz7hX2AHQ9aVb8-uKi+MZN4UFsA@mail.gmail.com \
    --to=venkataramanan.kumar@linaro.org \
    --cc=libc-ports@sourceware.org \
    --cc=marcus.shawcroft@arm.com \
    --cc=marcus.shawcroft@gmail.com \
    --cc=patch@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).