From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dov Grobgeld Newsgroups: gmane.emacs.bugs Subject: bug#10580: 24.0.92; gdb initialization takes more than one minute at 100% CPU Date: Tue, 8 May 2012 14:59:36 +0300 Message-ID: References: <20253.9861.848886.122482@fencepost.gnu.org> <87aa1mj69x.fsf@gnu.org> <87havtvpeb.fsf@gnu.org> <874nrsem67.fsf@gnu.org> <874nrswme9.fsf@gnu.org> <87zk9kv75l.fsf@gnu.org> <87mx5j6pqs.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c71ee9092d04bf851ebb X-Trace: dough.gmane.org 1336478427 485 80.91.229.3 (8 May 2012 12:00:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 May 2012 12:00:27 +0000 (UTC) Cc: 10580@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 08 14:00:22 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SRj5V-0002gF-GD for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 May 2012 14:00:17 +0200 Original-Received: from localhost ([::1]:46770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRj5U-0003cr-Te for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 May 2012 08:00:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRj5K-0003TQ-RK for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 08:00:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRj5A-0003Ct-Rb for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 08:00:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRj5A-0003Cp-LN for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 07:59:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SRj7C-00056q-0R for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 08:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dov Grobgeld Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 May 2012 12:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10580 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10580-submit@debbugs.gnu.org id=B10580.133647851419627 (code B ref 10580); Tue, 08 May 2012 12:02:01 +0000 Original-Received: (at 10580) by debbugs.gnu.org; 8 May 2012 12:01:54 +0000 Original-Received: from localhost ([127.0.0.1]:40596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRj73-00056U-O5 for submit@debbugs.gnu.org; Tue, 08 May 2012 08:01:54 -0400 Original-Received: from mail-gg0-f172.google.com ([209.85.161.172]:44863) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRj70-00056H-N1 for 10580@debbugs.gnu.org; Tue, 08 May 2012 08:01:52 -0400 Original-Received: by ggmi1 with SMTP id i1so1387170ggm.3 for <10580@debbugs.gnu.org>; Tue, 08 May 2012 04:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zqSjIHt8jB8cmm79wyHFKCPoC9VCLI2lOac9FUILR64=; b=jejnC1/3ykSt//oVqeq8msfylA5fSLBQ+ky4Rk1ttozxIKAOVo/Iu6X2CxuQOrne9+ GVFGB+MMbV8QAXK8qvobd3AW+y7tJgKmVm4dcDADm5EXcdconhRHd+xbJBbGTyLLjbfM RTudnkHW6WOvOx6Wo6Zni63uIGiPfD1LYwk8wRwrPRX0M57svoPTK1m50om+4lHqELTS GT+MtEA0abo0B34eOiX1EPxDHOh8OAycbNg7oidu9oIZ29DZOIxqncZV6FytOSV9DYtG N10AA1KcRMD1u7pJ9yjeGbm8q4wfm4Y6+09COPEUWv+GHr66xHIQE5q+7v+ogndF1yjA buLQ== Original-Received: by 10.60.21.103 with SMTP id u7mr26437714oee.11.1336478376986; Tue, 08 May 2012 04:59:36 -0700 (PDT) Original-Received: by 10.182.60.137 with HTTP; Tue, 8 May 2012 04:59:36 -0700 (PDT) In-Reply-To: <87mx5j6pqs.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59859 Archived-At: --e89a8ff1c71ee9092d04bf851ebb Content-Type: text/plain; charset=UTF-8 Indeed, my result is much fatter. (safe-length gdb-debug-log) => 223 and the total length of the messages is about 800k. So it seems that the time spent is simply the parsing of this large chunk of data? What gdb command is run that outputs all the file="..." commands? Thanks, Dov On Tue, May 8, 2012 at 11:28 AM, Chong Yidong wrote: > Dov Grobgeld writes: > > > I added the above patch and the result is as follows: > > After the following two lines: > > > > nread = read_process_output (proc, channel); > > pp = XPROCESS(proc); > > > > nread==4095, pp->pid=1234 repeatedly. (Actually 1234 seems to be an > > arbitrary, but constant number between 1000 and 2000). > > > > Some more info that I found through strace that might help. > > Alltogether read_process_output() is called 214 times and thus a total > > of 870k of text is read through /dev/ptmx to read_process_output() . > > Could the amount of data possibly explain the slowness? > > Maybe, if this process IO is emitted non-stop. But this indicates that > the traffic is due to the main connection with the main gdb process > (which has a positive pid), not with the pty which gdb-mi uses for IO > (which has pid -2) like I guessed. > > Could you do > > M-: (setq gdb-enable-debug t) RET > > and show the value of the variable `gdb-debug-log'? > > For example, when I run M-x gdb on the Emacs binary itself, > `gdb-debug-log' gets 22 entries by the time I get to the (gdb) prompt; > this is the usual GDB-MI chatter. From the time I "run" the program > till the debugged program exits, it gains another 24 entries. Do you > see a lot more traffic with your program? > --e89a8ff1c71ee9092d04bf851ebb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Indeed, my resul= t is much fatter.

(safe-length gdb-debug-log) =3D> 223

and= the total length of the messages is about 800k. So it seems that the time = spent is simply the parsing of this large chunk of data? What gdb command i= s run that outputs all the file=3D"..." commands?

Thanks,
Dov

On Tue, May 8, = 2012 at 11:28 AM, Chong Yidong <cyd@gnu.org> wrote:
Dov Grobgeld <dov.grobgeld@gmail.com> writes:

> I added the above patch and the result is as follows:
> After the following two lines:
>
> =C2=A0=C2=A0=C2=A0 nread =3D read_process_output (proc, channel);
> =C2=A0=C2=A0=C2=A0 pp =3D XPROCESS(proc);
>
> nread=3D=3D4095, pp->pid=3D1234 repeatedly. (Actually 1234 seems to= be an
> arbitrary, but constant number between 1000 and 2000).
>
> Some more info that I found through strace tha= t might help.
> Alltogether read_process_output() is called 214 times and thus a total=
> of 870k of text is read through /dev/ptmx to read_process_output() . > Could the amount of data possibly explain the slowness?

Maybe, if this process IO is emitted non-stop. =C2=A0But this indicat= es that
the traffic is due to the main connection with the main gdb process
(which has a positive pid), not with the pty which gdb-mi uses for IO
(which has pid -2) like I guessed.

Could you do

M-: (setq gdb-enable-debug t) RET

and show the value of the variable `gdb-debug-log'?

For example, when I run M-x gdb on the Emacs binary itself,
`gdb-debug-log' gets 22 entries by the time I get to the (gdb) prompt;<= br> this is the usual GDB-MI chatter. =C2=A0From the time I "run" the= program
till the debugged program exits, it gains another 24 entries. =C2=A0Do you<= br> see a lot more traffic with your program?

--e89a8ff1c71ee9092d04bf851ebb--