From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 19 17:00:00 2012 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC3BB499 for ; Mon, 19 Nov 2012 17:00:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 765BA8FC17 for ; Mon, 19 Nov 2012 17:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJH0093033573 for ; Mon, 19 Nov 2012 17:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qAJH00UK033572; Mon, 19 Nov 2012 17:00:00 GMT (envelope-from gnats) Resent-Date: Mon, 19 Nov 2012 17:00:00 GMT Resent-Message-Id: <201211191700.qAJH00UK033572@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Baldwin Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 829861BA for ; Mon, 19 Nov 2012 16:50:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 69CE08FC08 for ; Mon, 19 Nov 2012 16:50:45 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJGojix019261 for ; Mon, 19 Nov 2012 16:50:45 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id qAJGojuv019260; Mon, 19 Nov 2012 16:50:45 GMT (envelope-from nobody) Message-Id: <201211191650.qAJGojuv019260@red.freebsd.org> Date: Mon, 19 Nov 2012 16:50:45 GMT From: John Baldwin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/173723: Add file descriptor information to process core dumps X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 17:00:00 -0000 >Number: 173723 >Category: kern >Synopsis: Add file descriptor information to process core dumps >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Nov 19 17:00:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: John Baldwin >Release: >Organization: >Environment: >Description: ELF core files already include metadata about processes including notes with the context of each running thread. Occasionally I have wanted to examine the open fd's associated with a process while debugging. With the advent of 'procstat -f' we now have a useful structure that holds file descriptor info in a somewhat abstract manner. It seems possible that we could add a new set of notes to a core dump listing the various file descriptors associated with the process at the time of exit storing 'kinfo_file' objects in the relevant notes. It is probably worth including additional notes for other "files" such as the working directory, etc. as show in 'procstat -f' output of a running process. Once this is present there should be ways to extract the information from a core. One would be to teach libprocstat how to look for data from a core file (and thus procstat). Another useful thing to do would be to add a new custom command to gdb to dump this table from within gdb. Said command could use libprocstat to work against both coredumps and running processes. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: