]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/ctf: add scoped_time_it in elfctf_build_psymtabs
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 28 Feb 2026 03:51:53 +0000 (22:51 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 9 Mar 2026 19:00:04 +0000 (15:00 -0400)
This will be useful to determine the impact on the startup time getting
rid of partial symtabs has.

I use it like so:

    $ ./gdb -q -nx --data-directory=data-directory -iex "maint set per-command time on" /home/simark/src/linux/vmlinux.unstripped -batch
    ...
    Time for "elfctf_build_psymtabs": wall 0.381, user 0.357, sys 0.015, user+sys 0.372, 97.6 % CPU

Change-Id: I021319212f27eee0bf0f6c230f4e7cdd9c3602c1
Approved-By: Tom Tromey <tom@tromey.com>
gdb/ctfread.c

index ed4a7383427d04fd1a19e68a53e1a2be8c0ccdb1..251b1c7f1fce5c9bd8633a2da29753378ec64bb1 100644 (file)
@@ -79,6 +79,7 @@
 #include "complaints.h"
 #include "block.h"
 #include "ctfread.h"
+#include "maint.h"
 #include "psymtab.h"
 #include "cli/cli-cmds.h"
 
@@ -1576,6 +1577,8 @@ elfctf_build_psymtabs (objfile *objfile)
   bfd *abfd = objfile->obfd.get ();
   int err;
 
+  scoped_time_it time_it (__func__);
+
   CTF_SCOPED_DEBUG_START_END ("building psymtabs for %s",
                              bfd_get_filename (abfd));