Class PsInfo

java.lang.Object
oshi.driver.common.unix.aix.PsInfo

@ThreadSafe public final class PsInfo extends Object
Shared utility to query the pure-Java parts of AIX /proc/<pid>/psinfo and /proc/<pid>/lwp/<tid>/lwpsinfo.

The address-space reads queryArgsEnv performs need libc open/pread and live in the JNA (PsInfoJNA) and FFM (PsInfoFFM) drivers respectively.

  • Method Details

    • queryPsInfo

      public static AixPsInfo queryPsInfo(int pid)
      Reads /proc/<pid>/psinfo and returns the parsed structure.
      Parameters:
      pid - the process ID
      Returns:
      a structure containing information for the requested process
    • queryLwpsInfo

      public static AixLwpsInfo queryLwpsInfo(int pid, int tid)
      Reads /proc/<pid>/lwp/<tid>/lwpsinfo and returns the parsed structure.
      Parameters:
      pid - the process ID
      tid - the thread ID (lwpid)
      Returns:
      a structure containing information for the requested thread
    • queryArgsEnvAddrs

      public static Triplet<Integer,Long,Long> queryArgsEnvAddrs(int pid, AixPsInfo psinfo)
      Reads the pr_argc, pr_argv, and pr_envp fields from a psinfo_t.
      Parameters:
      pid - the process ID (used for diagnostic logging only)
      psinfo - a populated AixPsInfo containing the offset pointers
      Returns:
      a triplet of (argc, argv, envp), or null if the psinfo is unusable