Class AixOSProcess
java.lang.Object
oshi.software.common.AbstractOSProcess
oshi.software.common.os.unix.AbstractProcOSProcess
oshi.software.common.os.unix.aix.AixOSProcess
- All Implemented Interfaces:
OSProcess
Abstract base for AIX OSProcess. The
/proc parsing, command-line/env memoization, thread enumeration, and
field assignment are shared (via AbstractProcOSProcess); concrete subclasses (JNA/FFM) provide the perfstat
lookup, the rlimit read, the affinity supplier, and the actual queryArgsEnv address-space read.-
Nested Class Summary
Nested classes/interfaces inherited from interface OSProcess
OSProcess.StateModifier and TypeInterfaceDescriptionstatic enumProcess and Thread Execution States -
Field Summary
Fields inherited from class AbstractProcOSProcess
commandLineBackup, group, groupID, privateResidentMemory, residentSetSize, user, userIDFields inherited from class AbstractOSProcess
bytesRead, bytesWritten, kernelTime, name, parentProcessID, path, priority, startTime, state, threadCount, upTime, userTime, virtualSizeModifier and TypeFieldDescriptionprotected longprotected longprotected longprotected Stringprotected intprotected Stringprotected intprotected longprotected OSProcess.Stateprotected intprotected longprotected longprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected OSThreadcreateThread(int lwpid) Creates a platform-specificOSThreadfor the given lwpid of this process.longGets the process affinity mask for this process.protected abstract longReturns the per-process CPU affinity mask (fromPerfstatCpu.queryCpuAffinityMask).queryArgsEnv(int pid, AixPsInfo psinfo) Performs the address-space read for command-line arguments and environment variables.Reads this process's argument list and environment.protected final voidsetState(OSProcess.State newState) Allows subclasses to set this process's state toOSProcess.State.INVALIDwhen their perfstat lookup can't find the process.protected booleanApplies the perfstat-derived CPU and memory quartet to this process.Methods inherited from class AbstractProcOSProcess
getArguments, getBitness, getCommandLine, getCurrentWorkingDirectory, getEnvironmentVariables, getGroup, getGroupID, getOpenFiles, getPrivateResidentMemory, getResidentMemory, getThreadDetails, getUser, getUserIDModifier and TypeMethodDescriptionMakes a best effort attempt to get a list of the the command-line arguments of the process.intAttempts to get the bitness (32 or 64) of the process.Gets the process command line used to start the process, including arguments if available to be determined.Makes a best effort attempt to obtain the current working directory for the process.Makes a best effort attempt to obtain the environment variables of the process.getGroup()Gets the group under which the process is executing.Gets the group id under which the process is executing.longGets the number of open file handles (or network connections) that belongs to the process.longReturns an estimate of the portion of physical memory (RAM) uniquely attributed to this process.longReturns the total amount of physical memory (RAM) currently mapped to the process's address space.Retrieves the threads of the process and their details.getUser()Gets the user name of the process owner.Gets the user id of the process owner.Methods inherited from class AbstractOSProcess
getBytesRead, getBytesWritten, getKernelTime, getName, getParentProcessID, getPath, getPriority, getProcessCpuLoadBetweenTicks, getProcessCpuLoadCumulative, getProcessID, getStartTime, getState, getThreadCount, getUpTime, getUserTime, getVirtualSize, toStringModifier and TypeMethodDescriptionlongGets the bytes read by the process.longGets the bytes written by the process.longGets kernel/system (privileged) time used by the process.getName()Gets the name of the process, often the executable program.intGets the process ID of this process's parent.getPath()Gets the full filesystem path of the executing process.intGets the priority of this process.doublegetProcessCpuLoadBetweenTicks(OSProcess priorSnapshot) Gets CPU usage of this process since a previous snapshot of the same process, provided as a parameter.doubleGets cumulative CPU usage of this process.intGets the process ID.longGets the process start time.getState()Gets the process state.intGets the number of threads being executed by this process.longGets up time / elapsed time since the process started.longGets user time used by the process.longGets the Virtual Memory Size (VSZ).toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OSProcess
getContextSwitches, getHardOpenFileLimit, getInvoluntaryContextSwitches, getMajorFaults, getMinorFaults, getSoftOpenFileLimit, getVoluntaryContextSwitches, updateAttributesModifier and TypeMethodDescriptiondefault longA snapshot of the context switches the process has done, equal to the sum ofOSProcess.getVoluntaryContextSwitches()andOSProcess.getInvoluntaryContextSwitches()on platforms that provide the split.longGets the hard limit for open file handles (or network connections) that belong to the given process.default longThe number of involuntary context switches the process has made.default longGets the number of major (hard) faults the process has made which have required loading a memory page from disk.default longGets the number of minor (soft) faults the process has made which have not required loading a memory page from disk.longGets the soft limit for open file handles (or network connections) of the given process.default longThe number of voluntary context switches the process has made.booleanAttempts to update process attributes.
-
Constructor Details
-
AixOSProcess
protected AixOSProcess(int pid)
-
-
Method Details
-
queryCommandlineEnvironment
Description copied from class:AbstractProcOSProcessReads this process's argument list and environment.- Specified by:
queryCommandlineEnvironmentin classAbstractProcOSProcess- Returns:
- a pair of (arg list, env map); either may be empty if it cannot be read
-
setState
Allows subclasses to set this process's state toOSProcess.State.INVALIDwhen their perfstat lookup can't find the process. Mirrors the original pre-splitAixOSProcess.updateAttributes()behavior so a staleperfstat_process_t[]array that briefly omits the pid leaves the OSProcess marked invalid rather than silently retaining whatever fields were last assigned.- Parameters:
newState- the new state
-
createThread
Description copied from class:AbstractProcOSProcessCreates a platform-specificOSThreadfor the given lwpid of this process.- Specified by:
createThreadin classAbstractProcOSProcess- Parameters:
lwpid- the thread (lwp) ID- Returns:
- a new OSThread
-
getAffinityMask
public long getAffinityMask()Description copied from interface:OSProcessGets the process affinity mask for this process.On Windows systems with more than 64 processors, if the threads of the calling process are in a single processor group, returns the process affinity mask for that group (which may be zero if the specified process is running in a different group). If the calling process contains threads in multiple groups, returns zero.
Because macOS does not export interfaces that identify processors or control thread placement, explicit thread to processor binding is not supported and this method will return a bitmask of all logical processors.
If the Operating System fails to retrieve an affinity mask (e.g., the process has terminated), returns zero.
- Returns:
- a bit vector in which each bit represents the processors that a process is allowed to run on.
-
updateAttributes
Applies the perfstat-derived CPU and memory quartet to this process. Concrete subclasses arrange aQuartet<ucpu_time(ms), scpu_time(ms), real_inuse(bytes), proc_real_mem_data+text(bytes)>from their data source and call this. Returns true on success; setsstate = INVALIDand returns false otherwise.- Parameters:
cpuMem- the quartet of (userTime, kernelTime, residentSetSize, privateResidentMemory)- Returns:
trueif attributes were updated
-
queryArgsEnv
Performs the address-space read for command-line arguments and environment variables.- Parameters:
pid- the process idpsinfo- a populatedAixPsInfo- Returns:
- (argv list, env map) — may be empty if the address-space cannot be read
-
getCpuAffinityMask
protected abstract long getCpuAffinityMask()Returns the per-process CPU affinity mask (fromPerfstatCpu.queryCpuAffinityMask).- Returns:
- affinity mask
-