Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 14 Jun 2002 17:33:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 14 Jun 2002 17:33:51 -0400 Received: from fmr03.intel.com ([143.183.121.5]:18400 "EHLO hermes.sc.intel.com") by vger.kernel.org with ESMTP id ; Fri, 14 Jun 2002 17:33:43 -0400 Message-Id: <200206142133.g5ELXYP22784@unix-os.sc.intel.com> From: mgross Reply-To: mgross@unix-os.sc.intel.com Organization: SSG Intel To: Linux Kernel Mailing List Subject: [PATCH] Multi-threaded core dumps for 2.4.18 non-O(1) kernels. Date: Fri, 14 Jun 2002 14:40:40 -0400 X-Mailer: KMail [version 1.3.1] Cc: Marcelo , Linus Torvalds , mark.gross@intel.com MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_S7LP2WIFG3VT3OYB7E55" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --------------Boundary-00=_S7LP2WIFG3VT3OYB7E55 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 8bit The following patch is a back port of the 2.5.18 tcore patch I posted last week. It applies cleanly to the 2.4.18 base tree. It has some warnings and one simple regection when applied to the 2.4.18-ia64 tree due to a patch collision with the ia64 patch. I have a ia64 version of this patch available, upon request, which will apply cleanly to the ia64 kernel. This patch has been tested on SMP and UP i386 architectures and works very well. The ia64 SMP version has also been tested and works very well. To use this patch you will need to strip the objects from the libpthread module loaded by GDB at post mortem debug time. ('strip /lib/libpthread-0.9.so for my system', YMMV) I would like to see this feature added to the linux kernel. Support for multi-threaded core dumps has been in Solaris for a LONG time now, and its silly for it to not exist in Linux. ISV's need this type of support from the kernel. Please apply this patch. Its a good thing. --mgross --------------Boundary-00=_S7LP2WIFG3VT3OYB7E55 Content-Type: text/x-diff; charset="iso-8859-15"; name="tcore-i386-2418.pat" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tcore-i386-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7LP2WIFG3VT3OYB7E55-- - 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/