Re: [GDB 7.6/GCC 4.8.0] Slowdown in GDB macro processing for cores?

Paul Smith <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <1369248335.7209.151.camel@homebase>
On Fri, 2013-05-17 at 11:15 +0100, Pedro Alves wrote:
> > Against a core file it takes a second or longer per iteration of this
> > loop!  FWIW, the class this macro operates on is very large and contains
> > a lot of data per object.
> > 
> > Any ideas?  Is there a handy way to tell where the slowdown is happening
> > here?  
> 
> I'm really surprised.  If anything, I'd expect cores to be marginally faster.
> I suggest git bisecting gdb looking.  Maybe you'll find the culprit
> easily that way.

Sorry for the delay.  Getting a repro case was harder than it seemed
initially... just running "kill -9" on the process wasn't enough, or
didn't crash at the right spot, or something.  We had to induce a
failure through a particular assert().

However, now I have a core file and executable built with my local copy
of GDB 4.8.0.  If I run the macro using a locally-built copy of GDB
7.5.1, then I get this behavior:

  $ time gdb-7.5.1 -c core.30095 -x macros.gdb myprog \
      -ex "frame 4" -ex "ptracelog master->traceLog" -ex "q"
   ...prints 200 trace log lines...
  real    0m2.811s
  user    0m2.768s
  sys     0m0.028s

so that's good stuff.

Now I try it with GDB 7.6, compiled locally using the identical
configure/etc. commands, and I get this behavior:

  $ time gdb-7.6 -c core.30095 -x macros.gdb myprog \
      -ex "frame 4" -ex "ptracelog master->traceLog" -ex "q"
   ...prints 200 trace log lines...
  real    11m51.113s
  user    11m46.324s
  sys     0m2.168s

That's... not as good :-p.

I've just got this case working now, so I'll look into what's going on
here more.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.