[3/3] Use code cache in aarch64 prologue analyzer

Message ID 1481036629-21542-4-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi Dec. 6, 2016, 3:03 p.m. UTC
  This patch change aarch prologue analyzer using code cache, in order
to improve the performance of remote debugging.

gdb.perf/skip-prologue.exp (measured by wall-time) is improved when
the program is compiled without debug information.

			Original	Patched		Original	Patched
			without dbg	without dbg	with dbg	with dbg

/			11.1635239124	9.99472999573	9.65339517593	9.66648793221
-fstack-protector-all	11.2560930252	9.338118	9.63896489143	9.59474396706

gdb:

2016-12-06  Yao Qi  <yao.qi@linaro.org>

	* aarch64-tdep.c (instruction_reader::read): Call
	read_code_unsigned_integer instead of
	read_memory_unsigned_integer.
---
 gdb/aarch64-tdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Luis Machado Dec. 7, 2016, 6:26 p.m. UTC | #1
On 12/06/2016 09:03 AM, Yao Qi wrote:
> This patch change aarch prologue analyzer using code cache, in order
> to improve the performance of remote debugging.
>
> gdb.perf/skip-prologue.exp (measured by wall-time) is improved when
> the program is compiled without debug information.
>
> 			Original	Patched		Original	Patched
> 			without dbg	without dbg	with dbg	with dbg
>
> /			11.1635239124	9.99472999573	9.65339517593	9.66648793221
> -fstack-protector-all	11.2560930252	9.338118	9.63896489143	9.59474396706
>
> gdb:
>
> 2016-12-06  Yao Qi  <yao.qi@linaro.org>
>
> 	* aarch64-tdep.c (instruction_reader::read): Call
> 	read_code_unsigned_integer instead of
> 	read_memory_unsigned_integer.
> ---
>  gdb/aarch64-tdep.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
> index 590dcf6..0175630 100644
> --- a/gdb/aarch64-tdep.c
> +++ b/gdb/aarch64-tdep.c
> @@ -213,7 +213,7 @@ class instruction_reader : public abstract_instruction_reader
>   public:
>    ULONGEST read (CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
>    {
> -    return read_memory_unsigned_integer (memaddr, len, byte_order);
> +    return read_code_unsigned_integer (memaddr, len, byte_order);
>    }
>  };
>
>

The series LGTM except for the nit in 1/3. FTR, we have a similar local 
patch for ARM and also PowerPC to get the performance numbers up a bit. 
It helps with remote debugging as well, since we can read from cache 
instead of fetching it over and over again from the target.
  
Yao Qi Dec. 9, 2016, 9:39 a.m. UTC | #2
On 16-12-07 12:26:38, Luis Machado wrote:
> >
> >
> 
> The series LGTM except for the nit in 1/3. FTR, we have a similar
> local patch for ARM and also PowerPC to get the performance numbers
> up a bit. It helps with remote debugging as well, since we can read
> from cache instead of fetching it over and over again from the
> target.

Yes, I still have some patches for ARM to use cache in arm-tdep.c.
I plan to send them out after I measured the performance improvement,
but I need to fix PR 20939 before 7.12.1 (released on Jan 2017), so
I won't post my ARM patches recently.  If you already get your local
patches in shape, free feel to post them.
  

Patch

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 590dcf6..0175630 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -213,7 +213,7 @@  class instruction_reader : public abstract_instruction_reader
  public:
   ULONGEST read (CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
   {
-    return read_memory_unsigned_integer (memaddr, len, byte_order);
+    return read_code_unsigned_integer (memaddr, len, byte_order);
   }
 };