Hi Marcus,

Please find in that attachment two separate patches.

One for getting return address from frame, and second one conating
macros for profile code generation.

I have incorporated your review comments.


> +    # We support profiling for AArch64 linux target.
> +    if { [istarget aarch64*-linux-*]
> + && ($test_what == "-p" || $test_what == "-pg") } {
> + return 1
>      }
>
> Can't this clause be removed completely now ?

We are not supporting profiling in "newlib". So it is still disabled
for aarch64-none-elf targets which uses newlib.


Patch1
---------

gcc/ChangeLog
---------------------

2013-05-12  Venkataramanan Kumar  <venkataramanan.ku...@linaro.org>

       *  config/aarch64/aarch64.c (aarch64_return_addr): Handle returning
          address from a frame.

Patch2
----------
2013-05-12  Venkataramanan Kumar  <venkataramanan.ku...@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.
          (aarch64_frame_pointer_required): Enable frame pointer when profiling.

gcc/testsuite/ChangeLog
-----------------------------------
2013-05-12  Venkataramanan Kumar  <venkataramanan.ku...@linaro.org>
        * lib/target-supports.exp (check_profiling_available): Enable
          aarch64*-linux-*

regards,
Venkat.

On 9 May 2013 15:02, Marcus Shawcroft <marcus.shawcr...@gmail.com> wrote:
> On 9 May 2013 07:48, Venkataramanan Kumar
> <venkataramanan.ku...@linaro.org> wrote:
>> Hi Maintainers,
>>
>> The attach patch contains the following for aarch64 backend to enable
>> gprof support.
>>
>> 1. Changes to "aarch64_return_addr" to get return address from a stack frame.
>> 2. Defines macros associated with generating code for profiling.
>
> Hi Venkat,
> Can we split this into separate patches for 1) and 2) please.
>
> General comment, GNU coding style places two space after each period,
> please update each of the comments that don't conform.
>
> +
> +/* All the work done in PROFILE_HOOK, but still required. */
> +#define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
> +
>
> Please don't move the location of FUNCTION_PROFILER, just change its 
> definition.
>
>
> +/* Implement RETURN_ADDR_RTX.  As per Aarch64 ABI return address
> +   is stored at an offset 8 from the frame pointer of a function. */
>
> Aarch64 -> AArch64
>
> Comma after ABI ?
>
> Specify 'bytes' after the 8.
>
> +  if(count != 0)
> +    {
>
> GNU coding style places a space before the '('.
>
> + mem_lr =  gen_frame_mem (DImode,
>
> Double space after "=" -> single space.
>
> -    # We don't yet support profiling for AArch64.
> -    if { [istarget aarch64*-*-*]
> - && ([lindex $test_what 1] == "-p"
> -     || [lindex $test_what 1] == "-pg") } {
> - return 0
> +    # We support profiling for AArch64 linux target.
> +    if { [istarget aarch64*-linux-*]
> + && ($test_what == "-p" || $test_what == "-pg") } {
> + return 1
>      }
>
> Can't this clause be removed completely now ?
>
> Cheers
> /Marcus

Attachment: gcc.return_addr_from_frame.diff
Description: Binary data

Attachment: gcc.profile.diff
Description: Binary data

Reply via email to