public final class Stat extends ProcFile
/proc/[pid]/stat
Status information about the process. This is used by ps(1). It is defined in the kernel source file fs/proc/array.c.
The fields, in order, with their proper scanf(3) format specifiers, are:
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<Stat> |
CREATOR |
Modifier and Type | Method and Description |
---|---|
long |
arg_end()
(since Linux 3.5)
Address below program command-line arguments (argv) are placed.
|
long |
arg_start()
(since Linux 3.5)
Address above which program command-line arguments (argv) are placed.
|
long |
blocked()
The bitmap of blocked signals, displayed as a decimal number.
|
long |
cguest_time()
(since Linux 2.6.24)
Guest time of the process's children, measured in clock ticks (divide by
sysconf(_SC_CLK_TCK)).
|
long |
cmajflt()
The number of major faults that the process's waited-for children have made.
|
long |
cminflt()
The number of minor faults that the process's waited-for children have made.
|
long |
cnswap()
Cumulative nswap for child processes (not maintained).
|
long |
cstime()
Amount of time that this process's waited-for children have been scheduled in kernel mode,
measured in clock ticks (divide by sysconf(_SC_CLK_TCK)).
|
long |
cutime()
Amount of time that this process's waited-for children have been scheduled in user mode,
measured in clock ticks (divide by sysconf(_SC_CLK_TCK)).
|
long |
delayacct_blkio_ticks()
(since Linux 2.6.18)
Aggregated block I/O delays, measured in clock ticks (centiseconds).
|
int |
describeContents() |
long |
end_data()
(since Linux 3.3)
Address below which program initialized and uninitialized (BSS) data are placed.
|
long |
endcode()
The address below which program text can run.
|
long |
env_end()
(since Linux 3.5)
Address below which program environment is placed.
|
long |
env_start()
(since Linux 3.5)
Address above which program environment is placed.
|
int |
exit_code()
(since Linux 3.5)
The thread's exit status in the form reported by waitpid(2).
|
int |
exit_signal()
(since Linux 2.1.22)
Signal to be sent to parent when we die.
|
int |
flags()
The kernel flags word of the process.
|
static Stat |
get(int pid)
Read /proc/[pid]/stat.
|
java.lang.String |
getComm()
The filename of the executable, in parentheses.
|
int |
getPid()
The process ID.
|
long |
guest_time()
(since Linux 2.6.24)
Guest time of the process (time spent running a virtual CPU for a guest operating system),
measured in clock ticks (divide by sysconf(_SC_CLK_TCK)).
|
long |
itrealvalue()
The time in jiffies before the next SIGALRM is sent to the process due to an interval timer.
|
long |
kstkeip()
The current EIP (instruction pointer).
|
long |
kstkesp()
The current value of ESP (stack pointer), as found in the kernel stack page for the process.
|
long |
majflt()
The number of major faults the process has made which have required loading a memory page
from disk.
|
long |
minflt()
The number of minor faults the process has made which have not required loading a memory
page from disk.
|
int |
nice()
The nice value (see setpriority(2)), a value in the range 19 (low priority) to -20 (high
priority).
|
long |
nswap()
Number of pages swapped (not maintained).
|
long |
num_threads()
Number of threads in this process (since Linux 2.6).
|
int |
pgrp()
The process group ID of the process.
|
int |
policy()
(since Linux 2.5.19) Scheduling policy (see sched_setscheduler(2)).
|
int |
ppid()
The PID of the parent of this process.
|
long |
priority()
(Explanation for Linux 2.6) For processes running a real-time scheduling policy (policy
below; see sched_setscheduler(2)), this is the negated scheduling priority, minus one; that
is,
a number in the range -2 to -100, corresponding to real-time priorities 1 to 99.
|
int |
processor()
(since Linux 2.2.8)
CPU number last executed on.
|
long |
rss()
Resident Set Size: number of pages the process has in real memory.
|
long |
rsslim()
Current soft limit in bytes on the rss of the process; see the description of RLIMIT_RSS in
getrlimit(2).
|
int |
rt_priority()
(since Linux 2.5.19)
Real-time scheduling priority, a number in the range 1 to 99 for processes scheduled under a
real-time policy, or 0, for non-real-time processes (see sched_setscheduler(2)).
|
int |
session()
The session ID of the process.
|
long |
sigcatch()
The bitmap of caught signals, displayed as a decimal number.
|
long |
sigignore()
The bitmap of ignored signals, displayed as a decimal number.
|
long |
signal()
The bitmap of pending signals, displayed as a decimal number.
|
long |
start_brk()
(since Linux 3.3)
Address above which program heap can be expanded with brk(2).
|
long |
start_data()
(since Linux 3.3)
Address above which program initialized and uninitialized (BSS) data are placed.
|
long |
startcode()
The address above which program text can run.
|
long |
startstack()
The address of the start (i.e., bottom) of the stack.
|
long |
starttime()
The time the process started after system boot.
|
char |
state()
One of the following characters, indicating process state:
|
long |
stime()
Amount of time that this process has been scheduled in kernel mode, measured in clock ticks
(divide by sysconf(_SC_CLK_TCK)).
|
int |
tpgid()
The ID of the foreground process group of the controlling terminal of the process.
|
int |
tty_nr()
The controlling terminal of the process.
|
long |
utime()
Amount of time that this process has been scheduled in user mode, measured in clock ticks
(divide by sysconf(_SC_CLK_TCK)).
|
long |
vsize()
Virtual memory size in bytes.
|
long |
wchan()
This is the "channel" in which the process is waiting.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
public static final android.os.Parcelable.Creator<Stat> CREATOR
public static Stat get(int pid) throws java.io.IOException
pid
- the process id.Stat
java.io.IOException
- if the file does not exist or we don't have read permissions.public int getPid()
public java.lang.String getComm()
public char state()
One of the following characters, indicating process state:
public int ppid()
public int pgrp()
public int session()
public int tty_nr()
public int tpgid()
public int flags()
The kernel flags word of the process. For bit meanings, see the PF_* defines in the Linux kernel source file include/linux/sched.h. Details depend on the kernel version.
The format for this field was %lu before Linux 2.6.
public long minflt()
public long cminflt()
public long majflt()
public long cmajflt()
public long utime()
public long stime()
public long cutime()
public long cstime()
public long priority()
(Explanation for Linux 2.6) For processes running a real-time scheduling policy (policy below; see sched_setscheduler(2)), this is the negated scheduling priority, minus one; that is, a number in the range -2 to -100, corresponding to real-time priorities 1 to 99. For processes running under a non-real-time scheduling policy, this is the raw nice value (setpriority(2)) as represented in the kernel. The kernel stores nice values as numbers in the range 0 (high) to 39 (low), corresponding to the user-visible nice range of -20 to 19.
Before Linux 2.6, this was a scaled value based on the scheduler weighting given to this process.
public int nice()
public long num_threads()
public long itrealvalue()
public long starttime()
The time the process started after system boot. In kernels before Linux 2.6, this value was expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks (divide by sysconf(_SC_CLK_TCK)).
The format for this field was %lu before Linux 2.6.
public long vsize()
public long rss()
public long rsslim()
public long startcode()
public long endcode()
public long startstack()
public long kstkesp()
public long kstkeip()
public long signal()
public long blocked()
public long sigignore()
public long sigcatch()
public long wchan()
public long nswap()
public long cnswap()
public int exit_signal()
public int processor()
public int rt_priority()
public int policy()
(since Linux 2.5.19) Scheduling policy (see sched_setscheduler(2)). Decode using the SCHED_* constants in linux/sched.h.
The format for this field was %lu before Linux 2.6.22.
public long delayacct_blkio_ticks()
public long guest_time()
public long cguest_time()
public long start_data()
public long end_data()
public long start_brk()
public long arg_start()
public long arg_end()
public long env_start()
public long env_end()
public int exit_code()
public int describeContents()
describeContents
in interface android.os.Parcelable
describeContents
in class ProcFile
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
writeToParcel
in class ProcFile