[-- 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)); \ }
On 15 September 2013 13:45, Venkataramanan Kumar <venkataramanan.kumar@linaro.org> wrote: > 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. This is an ABI change, however, given that there is no functioning profiling solution using the existing interface I don't think that such a change is a problem. Does anyone object? > 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. No regressions is a good start. How did you test the the combined gcc/glibc patches for profiling are working correctly? /Marcus
Hi marcus,
On 16 September 2013 17:01, Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:
> On 15 September 2013 13:45, Venkataramanan Kumar
> <venkataramanan.kumar@linaro.org> wrote:
>> 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.
>
> This is an ABI change, however, given that there is no functioning
> profiling solution using the existing interface I don't think that
> such a change is a problem. Does anyone object?
>
>> 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.
>
> No regressions is a good start. How did you test the the combined
> gcc/glibc patches for profiling are working correctly?
I am cross compiling some simple tests cases and running them under in
ARMV8 model by invoking the runtime linker.
"/work/builds/gcc-fsf-trunk-patch/sysroot-aarch64-unknown-linux-gnu/lib/ld-linux-aarch64.so.1
--library-path /work/builds/gcc-fsf-trunk-patch/sysroot-aarch64-unknown-linux-gnu/lib64
test.out"
Basically do functional testing for these test cases by checking the
available gprof options.
regards,
Venkat,
On 15 September 2013 13:45, Venkataramanan Kumar
<venkataramanan.kumar@linaro.org> wrote:
> 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.
Venkat, I've committed your patch.
Thanks /Marcus
On Tue, 24 Sep 2013, Marcus Shawcroft wrote:
> Venkat, I've committed your patch.
Please remember when committing patches for someone else to use git commit
--author="Name <email>" so the patch's author is correctly recorded in the
git logs.
--
Joseph S. Myers
joseph@codesourcery.com