This extension provides new functionality to the pstat() system call that enables various system management and
measurement tools to eliminate their dependency on the /dev/kmem pseudo-driver.
Today, many system management and measurement tools read kernel
data structures through unsupported interfaces, such as the /dev/kmem pseudo-driver, to get information about open files,
resource usage, process activity, and so on. Because kernel data
structures change from release to release, this access method is
fragile, incurring a high maintenance cost. To insulate these applications
from the release-to-release variability in private kernel data structures,
HP-UX 11i provides the enhanced pstat system call and a new set of wrappers.
The pstat interface is designed to allow future expansion
of the interface, while preserving source and binary compatibility
of programs written using pstat wrappers. The pstat interface is
available in both 64-bit and 32-bit versions. Replacing the /dev/kmem access with calls to pstat wrappers will eliminate the need to re-release applications
with each new HP-UX release.
Currently, the pstat() system call provides information about various system
contexts, such as static, dynamic, virtual memory, process, open
files, etc. HP-UX provides a number of libc wrappers (pstat_get()*) and corresponding structures (struct pst_()*) to get information from the kernel using pstat(). As part of this enhancement, new pstat() wrappers and corresponding structures are added and some
existing ones are extended.
Compatibility is significantly improved by introducing a well
documented interface that guarantees binary compatibility for kernel
intrusive applications between releases. There is no impact to legacy
behavior of current pstat() services.
There is no impact to application performance as compared
to obtaining the data from /dev/kmem. No impact to system performance is expected from these pstat extensions.
New Data Structures |
 |
The following are new data structures being added to the PSTAT
module:
| pst_fileinfo2 | Describes per-file information. For the specified
process, there is one instance of this context for each open file
descriptor. |
| pst_fid | Used to efficiently re-access the opened files.
This value is returned by pstat_getfile2(), pstat_getproc(), and pstat_getprocvm() calls. This ID is then passed to subsequent PSTAT
calls such as pstat_getsocket() to efficiently re-access the opened files. |
| pst_filedetails | This data structure contains detailed information
specific to a particular open file. For a specified file, there
is only one instance of this structure. This information includes stat equivalent information. |
| pst_socket | The PSTAT socket structure contains detailed
information pertaining to an opened socket, such as type, state,
protocol, address family, and options of the socket. For a specified socket,
there is only one instance of this structure. |
| pst_stream | The PSTAT stream structure contains detailed
information pertaining to a stream entity. This includes information
about the head, names of modules pushed, and the driver of the stream. |
| pst_mpathnode | This structure is returned by pstat_getmpathname() routine that provides a copy of the DNLC entries
for a given file system. The information contained in this structure includes
id of the current file or directory, parent of the current entry,
and the name of the current entry. By traversing the DNLC entries
in the reverse order, one can obtain the pathname for an opened
file to the mount point. |
In addition to the above data structures, several existing
PSTAT data structures have been extended. These include: pst_dynamic, pst_vminfo, pst_vm_status, pst_status, pst_static, and pstun.
Documentation Changes |
 |
The existing pstat(2) manpage has been extended
to reflect the added functionality.