]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gprof: speed up line-by-line for MIPS/PowerPC/RISCV/SuperH
authorRichard Allen <rsaxvc@gmail.com>
Sun, 16 Feb 2025 22:50:02 +0000 (16:50 -0600)
committerAlan Modra <amodra@gmail.com>
Sat, 1 Mar 2025 00:47:13 +0000 (11:17 +1030)
Roughly halves the number of bfd_find_nearest_line() calls,
about 40% less time for a few different large ELF files.

Signed-off-by: Richard Allen <rsaxvc@gmail.com>
gprof/corefile.c

index bd8e60d4e68bf0c77afb6ce1d1fd94512166963e..6ecb55d62f4d6e7b5f2f4409671541a3c79bc98b 100644 (file)
@@ -255,6 +255,13 @@ core_init (const char * aout_name)
       offset_to_code = 2;
       break;
 
+    case bfd_arch_mips:/* and microMIPS */
+    case bfd_arch_powerpc:/* and VLE */
+    case bfd_arch_riscv:/* and RVC */
+    case bfd_arch_sh:
+      insn_boundary = 2;
+      break;
+
     case bfd_arch_alpha:
       insn_boundary = 4;
       break;