From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60718 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhHUp-0004ID-3b for qemu-devel@nongnu.org; Mon, 24 Jan 2011 03:09:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhHUn-0006MB-Tm for qemu-devel@nongnu.org; Mon, 24 Jan 2011 03:09:55 -0500 Received: from mail-iw0-f173.google.com ([209.85.214.173]:61400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhHUn-0006M6-Ma for qemu-devel@nongnu.org; Mon, 24 Jan 2011 03:09:53 -0500 Received: by iwn40 with SMTP id 40so3900619iwn.4 for ; Mon, 24 Jan 2011 00:09:52 -0800 (PST) MIME-Version: 1.0 From: Mike Frysinger Date: Mon, 24 Jan 2011 03:09:32 -0500 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] gdbstub chews cpu due to nonblocking socket mode List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org i'm not sure if someone has brought this up before (i cant find anything in the archives), but using the gdbstub with qemu seems to cause quite a bit of useless cpu chewing. in gdbstub.c:gdb_accept(), after the connection has been established, we see: fcntl(fd, F_SETFL, O_NONBLOCK); then, when the gdb connection is idle (the process is stopped, and gdb is waiting for input from the user), the main polling loop in gdb_handlesig() will call read() over and over again as fast as possible and thus eat a cpu. is there any need for this to be nonblocking ? ive commented out that one line and have yet to notice a problem during my development (using singlestep, breakpoints, continue, etc...). -mike