Class PsInfo
java.lang.Object
oshi.driver.common.unix.solaris.PsInfo
Shared utility to parse the pure-Java parts of Solaris
/proc/<pid>/psinfo,
/proc/<pid>/lwp/<tid>/lwpsinfo, and /proc/<pid>/usage.
The argument/environment reads differ between implementations and live in the JNA
(oshi.driver.unix.solaris.PsInfoJNA, via pread on /proc/<pid>/as) and FFM
(oshi.driver.unix.solaris.PsInfoFFM, via pargs) drivers respectively.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbytesToString(byte[] bytes) Trims a NUL-terminated byte array to a UTF-8 String.static SolarisLwpsInfoqueryLwpsInfo(int pid, int tid) Reads/proc/<pid>/lwp/<tid>/lwpsinfo.static SolarisPrUsagequeryPrUsage(int pid) Reads/proc/<pid>/usage.static SolarisPrUsagequeryPrUsage(int pid, int tid) Reads/proc/<pid>/lwp/<tid>/usage.static SolarisPsInfoqueryPsInfo(int pid) Reads/proc/<pid>/psinfo.
-
Method Details
-
queryPsInfo
Reads/proc/<pid>/psinfo.- Parameters:
pid- the process ID- Returns:
- populated
SolarisPsInfo, ornullif the file isn't readable
-
queryLwpsInfo
Reads/proc/<pid>/lwp/<tid>/lwpsinfo.- Parameters:
pid- the process IDtid- the thread ID (lwpid)- Returns:
- populated
SolarisLwpsInfo, ornullif not readable
-
queryPrUsage
Reads/proc/<pid>/usage.- Parameters:
pid- the process ID- Returns:
- populated
SolarisPrUsage, ornullif not readable
-
queryPrUsage
Reads/proc/<pid>/lwp/<tid>/usage.- Parameters:
pid- the process IDtid- the thread ID- Returns:
- populated
SolarisPrUsage, ornullif not readable
-
bytesToString
Trims a NUL-terminated byte array to a UTF-8 String.- Parameters:
bytes- the buffer- Returns:
- the trimmed String
-