From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mSw-0000Rz-Tc for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:19:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7mSv-00034F-Ma for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:19:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7mSv-00033h-FA for qemu-devel@nongnu.org; Wed, 24 Jun 2015 11:19:53 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 311618E3CA for ; Wed, 24 Jun 2015 15:19:53 +0000 (UTC) Date: Wed, 24 Jun 2015 16:19:51 +0100 From: Stefan Hajnoczi Message-ID: <20150624151951.GG7454@stefanha-thinkpad.redhat.com> References: <1435070633-20071-1-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OFj+1YLvsEfSXdCH" Content-Disposition: inline In-Reply-To: <1435070633-20071-1-git-send-email-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH] gdb command: qemu iohandlers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: Fam Zheng , qemu-devel@nongnu.org, quintela@redhat.com --OFj+1YLvsEfSXdCH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 23, 2015 at 03:43:53PM +0100, Dr. David Alan Gilbert (git) wrot= e: > From: "Dr. David Alan Gilbert" >=20 > Add a gdb command to print the current set of IOHandlers and > if one of them is a thread yielding for data print the backtrace. >=20 > Useful for debugging why an incoming migration has stalled, e.g. >=20 > ---- > {fd_read =3D 0x7fd4c8e40d00 , fd_write =3D 0x0, opa= que =3D > 0x7fd4b8bfeb00, next =3D {le_next =3D 0x7fd4cac81b00, le_prev =3D > 0x7fd4c93d2bd0 }, fd =3D 22, pollfds_idx =3D 0, deleted =3D > false} > #0 qemu_coroutine_switch (from_=3Dfrom_@entry=3D0x7fd4cbb33c00, > to_=3Dto_@entry=3D0x7fd4c8b13a90, > action=3Daction@entry=3DCOROUTINE_YIELD) at coroutine-ucontext.c:177 > #1 0x00007fd4c8e40507 in qemu_coroutine_yield () at > qemu-coroutine.c:145 > #2 0x00007fd4c8e40e75 in yield_until_fd_readable (fd=3D22) at > qemu-coroutine-io.c:90 > #3 0x00007fd4c8df347f in qemu_rdma_block_for_wrid > (rdma=3Drdma@entry=3D0x7fd4b8c7e010, > wrid_requested=3Dwrid_requested@entry=3D2000, > byte_len=3Dbyte_len@entry=3D0x0) at migration/rdma.c:1510 > #4 0x00007fd4c8df388f in qemu_rdma_post_send_control > (rdma=3Drdma@entry=3D0x7fd4b8c7e010, buf=3Dbuf@entry=3D0x0, > head=3Dhead@entry=3D0x7fd4b8bfed00) at migration/rdma.c:1608 > #5 0x00007fd4c8df4b8e in qemu_rdma_exchange_recv (rdma=3D0x7fd4b8c7e01= 0, > head=3D0x7fd4b8bfed50, expecting=3D3) > at migration/rdma.c:1814 > #6 0x00007fd4c8df5089 in qemu_rdma_get_buffer (opaque=3D0x7fd4cba34950, > buf=3D0x7fd4cc24fd20 "TR\022", > pos=3D, size=3D32768) at migration/rdma.c:2611 > #7 0x00007fd4c8df000d in qemu_fill_buffer (f=3Df@entry=3D0x7fd4cc24fcf= 0) at > migration/qemu-file.c:214 > #8 0x00007fd4c8df08d4 in qemu_peek_byte (f=3Df@entry=3D0x7fd4cc24fcf0, > offset=3Doffset@entry=3D0) > at migration/qemu-file.c:447 > #9 0x00007fd4c8c2cad1 in qemu_loadvm_state (f=3Df@entry=3D0x7fd4cc24fc= f0) > at /root/qemu-world3/migration/savevm.c:1128 > #10 0x00007fd4c8ded895 in process_incoming_migration_co > (opaque=3D0x7fd4cc24fcf0) at migration/migration.c:145 > #11 0x00007fd4c8e4112a in coroutine_trampoline (i0=3D, > i1=3D) at coroutine-ucontext.c:80 > #12 0x00007fd4c453e0f0 in ?? () from /lib64/libc.so.6 > #13 0x00007ffee263e870 in ?? () > #14 0x0000000000000000 in ?? () > ---- > {fd_read =3D 0x7fd4c8e3ace0 , fd_write =3D 0x0, opaque = =3D 0x5, > next =3D {le_next =3D 0x0, le_prev =3D 0x7fd4cb78a3d8}, fd =3D 5, pollf= ds_idx =3D > 1, deleted =3D false} >=20 > Signed-off-by: Dr. David Alan Gilbert > --- > scripts/qemu-gdb.py | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) >=20 > diff --git a/scripts/qemu-gdb.py b/scripts/qemu-gdb.py > index 6c7f4fb..2670625 100644 > --- a/scripts/qemu-gdb.py > +++ b/scripts/qemu-gdb.py > @@ -102,6 +102,30 @@ class CoroutineCommand(gdb.Command): > coroutine_pointer =3D gdb.parse_and_eval(argv[0]).cast(gdb.looku= p_type('CoroutineUContext').pointer()) > bt_jmpbuf(coroutine_pointer['env']['__jmpbuf']) > =20 > +class IOhandlersCommand(gdb.Command): > + '''Display a backtrace for io handlers''' > + def __init__(self): > + gdb.Command.__init__(self, 'qemu iohandlers', gdb.COMMAND_DATA, > + gdb.COMPLETE_NONE) > + > + def invoke(self, arg, from_tty): > + cur =3D gdb.parse_and_eval('io_handlers.lh_first') Fam is getting rid of io_handlers and replacing it with an AioContext. I have CCed him. --OFj+1YLvsEfSXdCH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVisqXAAoJEJykq7OBq3PIWoEH/A3Su+5smbyGoe2q1Zpsc35f GoxKF6uAoh/Rk98v5kByfs4FGYmcTPhNueMysWa2iSQj4Ax/njTV9ADxEURC4paK nlKgJPmjJkFFyUuCgNtUHZ+5Mf/Spuf6wWl15CRCrmtlhrNvQbU2pPjbS4T6fN4u t34gLMHKUWZxjKaBmJePW9fWelL+L4SQV8hR4z8s7j7Ypizii7HemKPsKAt1jGdC 6ylykKnGl8Oyf8N3U902TqfuHFLKcpxuZsL9eY+hm3qRMcCocwbiuDyz3hflCdm9 3ohDPAWpYKQZpPd+37ta7CXQr3FoyKO58a5eLLfGph+Q+zZU/b/Dobxk/kl8O1o= =PR1b -----END PGP SIGNATURE----- --OFj+1YLvsEfSXdCH--