From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#10580: 24.0.92; gdb initialization takes more than one minute at 100% CPU Date: Tue, 08 May 2012 16:28:27 +0800 Message-ID: <87mx5j6pqs.fsf@gnu.org> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1336465755 955 80.91.229.3 (8 May 2012 08:29:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 May 2012 08:29:15 +0000 (UTC) Cc: 10580@debbugs.gnu.org To: Dov Grobgeld Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 08 10:29:14 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 1SRfnF-0002Xg-He for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 May 2012 10:29:13 +0200 Original-Received: from localhost ([::1]:38454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRfnE-0007F3-AX for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 May 2012 04:29:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRfn7-0007Es-B8 for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 04:29:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRfmz-0002cL-1A for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 04:29:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRfmy-0002bz-Ti for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 04:28:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SRfoz-0005QP-S7 for bug-gnu-emacs@gnu.org; Tue, 08 May 2012 04:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 May 2012 08:31: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.133646584520829 (code B ref 10580); Tue, 08 May 2012 08:31:01 +0000 Original-Received: (at 10580) by debbugs.gnu.org; 8 May 2012 08:30:45 +0000 Original-Received: from localhost ([127.0.0.1]:40397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRfoi-0005Pu-M6 for submit@debbugs.gnu.org; Tue, 08 May 2012 04:30:45 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:43053 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRfog-0005Pn-Uo for 10580@debbugs.gnu.org; Tue, 08 May 2012 04:30:43 -0400 Original-Received: from [155.69.17.96] (port=54955 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SRfmc-00011d-HC; Tue, 08 May 2012 04:28:35 -0400 In-Reply-To: (Dov Grobgeld's message of "Tue, 8 May 2012 10:56:21 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.96 (gnu/linux) 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:59858 Archived-At: Dov Grobgeld 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).=20 > > 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?