Improved Debugging with pfiles Enhancement

Until Solaris 11.3 in order to get information on open file descriptors of a dump file you needed to use a debugger like mdb, gdb, dbx or whatsoever.
Unlike e.g. pstack, pflags, pargs or pmaps the pfiles command did not accept a core file name as an argument.

root@bama:~# gcore $$
gcore: core.1405 dumped
root@bama:~# pfiles core.1405
pfiles: cannot examine core.1405: no such process

Thanks to the Oracle Solaris team it is now possible to quickly check the process’ last open file descriptors in Oracle Solaris 11.4. This is awesome!

root@wacken:~# gcore $$
gcore: core.1636 dumped
root@wacken:~# pfiles core.1636
1636:   -bash
  Current rlimit: 256 file descriptors
   0: S_IFCHR mode:0620 dev:16380,0 ino:101157813 uid:100 gid:7 rdev:151,2
      O_RDWR|O_NOCTTY|O_LARGEFILE
      /dev/pts/2
   1: S_IFCHR mode:0620 dev:16380,0 ino:101157813 uid:100 gid:7 rdev:151,2
      O_RDWR|O_NOCTTY|O_LARGEFILE
      /dev/pts/2
   2: S_IFCHR mode:0620 dev:16380,0 ino:101157813 uid:100 gid:7 rdev:151,2
      O_RDWR|O_NOCTTY|O_LARGEFILE
      /dev/pts/2
   3: S_IFDOOR mode:0777 dev:16378,0 ino:0 uid:0 gid:0 size:0
      O_RDONLY|O_LARGEFILE FD_CLOEXEC  door to nscd[620]
   4: S_IFREG mode:0644 dev:16374,1 ino:50709184 uid:0 gid:0 size:524296 (512KB)
      O_RDONLY|O_LARGEFILE FD_CLOEXEC
      /system/volatile/audit_cache.bin
      offset:0
 255: S_IFCHR mode:0620 dev:16380,0 ino:101157813 uid:100 gid:7 rdev:151,2
      O_RDWR|O_NOCTTY|O_LARGEFILE FD_CLOEXEC
      /dev/pts/2

There is not much more to say about this other than that the fantastic proc-tools family is getting even better.

Leave a Reply

Your email address will not be published. Required fields are marked *