Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750977AbWBXKlU (ORCPT ); Fri, 24 Feb 2006 05:41:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750979AbWBXKlU (ORCPT ); Fri, 24 Feb 2006 05:41:20 -0500 Received: from mouth.voxel.net ([69.9.180.118]:43718 "EHLO mail.squishy.cc") by vger.kernel.org with ESMTP id S1750964AbWBXKlT (ORCPT ); Fri, 24 Feb 2006 05:41:19 -0500 Subject: [PATCH] x86_64 stack trace cleanup From: Andres Salomon To: linux-kernel@vger.kernel.org Cc: Andi Kleen Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-33iowLIuJoBW6/JL9fZ5" Date: Fri, 24 Feb 2006 05:41:19 -0500 Message-Id: <1140777679.5073.17.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.5.91 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7958 Lines: 159 --=-33iowLIuJoBW6/JL9fZ5 Content-Type: multipart/mixed; boundary="=-nlZU2b0gpDrJfAdtPS5x" --=-nlZU2b0gpDrJfAdtPS5x Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, This patch cleans up the clutter of x86_64 stack traces, making the output closer to what i386 and sparc64 stack traces look like. It uses print_symbol instead of resolving the symbols manually, and prints one frame per line instead of displaying multiple frames per line. I left the other stuff in the stack dump alone; this affects only the frame list. I know this has been brought up before (http://www.uwsg.iu.edu/hypermail/linux/kernel/0602.0/2238.html, although I noticed a slight problem w/ that patch, as __print_symbol returns void); however, for people that don't spend all their time looking at x86_64 backtraces, I think this consistency shouldn't be scoffed at. When you switch back and forth between different archs, x86_64's backtrace is cluttered and confusing in comparison. With this patch, traces end up looking as follows: getty S ffff81001e7d1db8 0 3812 1 3814 3811 (NOTLB) ffff81001e7d1db8 0000000000000008 ffffffff80240323 0000000000001d93 ffff81001f82a2d8 ffff81001f82a0c0 ffff81001f68b0c0 0000000000000000 ffff81001fa841fc ffff81001e7d0000 Call Trace: [] do_con_write+0x1853/0x1890 [] __pagevec_free+0x2a/0x40 [] schedule_timeout+0x25/0xd0 [] release_console_sem+0x1a8/0x220 [] add_wait_queue+0x1c/0x60 [] read_chan+0x48f/0x6e2 [] default_wake_function+0x0/0x10 [] tty_read+0xa2/0x110 [] vfs_read+0xdf/0x1a0 [] sys_read+0x53/0x90 [] system_call+0x7e/0x83 The old-style trace: pdflush D ffff810037a417a0 0 4293 11 4294 4292 (L-TLB) ffff810031fb3d68 0000000000000046 ffff8100107b1d78 0000000000000f60 0000000000000160 ffff810037a419b8 ffff810037a417a0 f fff810037a40300 ffff810001707d80 ffffffff80146b79 Call Trace:{lock_timer_base+41} {__mod_timer+189} {keventd_create_kthread+0} {schedule_timeout+154} {process_timeout+0} {__sched_text_start+49} {blk_congestion_wait+153} {autoremove_wake_function+0} {writeback_inodes+177} {background_writeout+165} {pdflush+0} {pdflush+341} Signed-off-by: Andres Salomon --=-nlZU2b0gpDrJfAdtPS5x Content-Disposition: attachment; filename=x86_64-stack-trace.patch Content-Type: text/x-patch; name=x86_64-stack-trace.patch; charset=UTF-8 Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2FyY2gveDg2XzY0L2tlcm5lbC90cmFwcy5jIGIvYXJjaC94ODZfNjQva2Vy bmVsL3RyYXBzLmMNCmluZGV4IDI4ZDUwZGMuLjc1OTgxMDcgMTAwNjQ0DQotLS0gYS9hcmNoL3g4 Nl82NC9rZXJuZWwvdHJhcHMuYw0KKysrIGIvYXJjaC94ODZfNjQva2VybmVsL3RyYXBzLmMNCkBA IC0xNyw2ICsxNyw3IEBADQogI2luY2x1ZGUgPGxpbnV4L2NvbmZpZy5oPg0KICNpbmNsdWRlIDxs aW51eC9zY2hlZC5oPg0KICNpbmNsdWRlIDxsaW51eC9rZXJuZWwuaD4NCisjaW5jbHVkZSA8bGlu dXgva2FsbHN5bXMuaD4gDQogI2lu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mNsdWRl L2FzbS14ODZfNjQva2RlYnVnLmgNCmluZGV4IGI5ZWQ0YzAuLjcyZjUyNjEgMTAwNjQ0DQotLS0g YS9pbmNsdWRlL2FzbS14ODZfNjQva2RlYnVnLmgNCisrKyBiL2luY2x1ZGUvYXNtLXg4Nl82NC9r ZGVidWcuaA0KQEAgLTQ4LDcgKzQ4LDcgQEAgc3RhdGljIGlubGluZSBpbnQgbm90aWZ5X2RpZShl bnVtIGRpZV92YQ0KIAlyZXR1cm4gbm90aWZpZXJfY2FsbF9jaGFpbigmZGllX2NoYWluLCB2YWws ICZhcmdzKTsgDQogfSANCiANCi1leHRlcm4gaW50IHByaW50a19hZGRyZXNzKHVuc2lnbmVkIGxv bmcgYWRkcmVzcyk7DQorZXh0ZXJuIHZvaWQgcHJpbnRrX2FkZHJlc3ModW5zaWduZWQgbG9uZyBh ZGRyZXNzKTsNCiBleHRlcm4gdm9pZCBkaWUoY29uc3QgY2hhciAqLHN0cnVjdCBwdF9yZWdzICos bG9uZyk7DQogZXh0ZXJuIHZvaWQgX19kaWUoY29uc3QgY2hhciAqLHN0cnVjdCBwdF9yZWdzICos bG9uZyk7DQogZXh0ZXJuIHZvaWQgc2hvd19yZWdpc3RlcnMoc3RydWN0IHB0X3JlZ3MgKnJlZ3Mp Ow0K --=-nlZU2b0gpDrJfAdtPS5x-- --=-33iowLIuJoBW6/JL9fZ5 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (GNU/Linux) iD8DBQBD/uLOOmXwGc/ULyYRAjy3AJoDhxbvAUaFbNOxGi/1q82wjBhrgACfQ2X3 igzz6q0yMyPAKiJZ1AADYbc= =T1WK -----END PGP SIGNATURE----- --=-33iowLIuJoBW6/JL9fZ5-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/