Project

General

Profile

Bug #3294

pfiles postmortem support

Added by Garrett D'Amore about 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Category:
kernel
Start date:
2012-10-23
Due date:
% Done:

100%

Estimated time:
Difficulty:
Hard
Tags:
Gerrit CR:

Description

pfiles should support postmortem debugging -- i.e. it would be nice if pfiles could operate on a core file. This would facilitate certain kinds of post mortem debugging, since the map of files opened is generally not available via the traditional userland debuggers. (E.g. dbx has no way to know what file is associated with a given numbered file descriptor.)

Enabling this requires adding a new .note section to the core file (which is just an ELF object) containing per file descriptor information, including details like the path to the file, the various flags, stat structure.

There are two places that generate core dumps -- one in userland (via gcore) in libproc, and another in the kernel elfexec module.

Processing of the core file will require additional support to be added to libproc, and changes to the pfiles command.

This work was suggested by Adam Leventhal at the October 2012 illumos hackathon. I've implemented the work, and hope to integrate it shortly (code review needed first, of course.)

#1

Updated by Rich Lowe about 8 years ago

Note that adding the new .note involves adding support to elfdump to print it out, as well. (see corenote.c, struct_layout_*)

#2

Updated by Garrett D'Amore about 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 90 to 100

Fixed. It took a little longer because I added support for elfdump to dump the new prfdinfo_t (NT_FDINFO) sections.

Committed here:

commit 34bdffbf3e3c188027e767e631f717b10159316d
Author: Garrett D'Amore <>
Date: Fri Nov 2 09:48:42 2012 -0700

3294 pfiles postmortem support
Reviewed by: Robert Mustacchi &lt;&gt;
Reviewed by: Richard Lowe &lt;&gt;
Approved by: Eric Schrock &lt;&gt;

Also available in: Atom PDF