frysk.sys.proc
Class Stat

java.lang.Object
  extended by frysk.sys.proc.Stat

public class Stat
extends Object

The contents of /proc/PID/stat file.


Field Summary
 long blocked
          The bitmap of blocked signals.
 long cmajflt
          The number of major faluts of the children.
 long cminflt
          The number of minor faults of the children.
 long cnswap
          Number of pages swapped by children.
 String comm
          The filename of the executable.
 long cstime
          The number of kernel mode child jiffies.
 long cutime
          The number of user mode child jiffies.
 long endcode
          The address below which program text can run.
 int exitSignal
          Signal to be sent to parent.
 long flags
          The flags of the process.
 long irealvalue
          The number of jiffies to the next SIGALRM.
 long kstkeip
          The current instruction pointer.
 long kstkesp
          The current value of the stack pointer.
 long majflt
          The number of major faults.
 long minflt
          The number of minor faults.
 int nice
          The nice value.
 long nswap
          Number of pages swapped.
 int numThreads
          The number of threads (since 2.6).
 int pgrp
          The process group ID.
 ProcessIdentifier pid
          The thread id (== pid in main thread)
 ProcessIdentifier ppid
          The parent process id.
 long priority
          The nice value (plus fifteen).
 int processor
          CPU number last executed on.
 long rlim
          Current rss limit.
 long rss
          Resident Set Size.
 int session
          The session ID.
 long sigcatch
          The bitmap of catched signals.
 long sigignore
          The bitmap of ignored signals.
 long signal
          The bitmap of pending signals.
 long startcode
          The address above which program text can run.
 long startstack
          The address of the start of the stack.
 long starttime
          The number of jiffies, after system boot, that process started.
 char state
          The state represented by a character from "RSDZTW".
 long stime
          The number of kernel mode jiffies.
 int tpgid
          The process group ID of the process that owns the tty.
 int ttyNr
          The tty.
 long utime
          The number of user mode jiffies.
 long vsize
          Virtual memory size.
 long wchan
          The "channel" in which the process is waiting.
 
Constructor Summary
Stat()
          Create an unbounded Stat object.
 
Method Summary
 Stat rescan()
          Re-scan using the current pid.
 Stat scan(ProcessIdentifier pid)
          Refresh Stat from /proc/PID/stat, return true if the scan was successful.
 Stat scan(ProcessIdentifier pid, ProcessIdentifier tid)
          Refresh Stat from /proc/PID/task/TID/stat, return true if the scan was successful.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pid

public ProcessIdentifier pid
The thread id (== pid in main thread)


comm

public String comm
The filename of the executable.


state

public char state
The state represented by a character from "RSDZTW".


ppid

public ProcessIdentifier ppid
The parent process id.


pgrp

public int pgrp
The process group ID.


session

public int session
The session ID.


ttyNr

public int ttyNr
The tty.


tpgid

public int tpgid
The process group ID of the process that owns the tty.


flags

public long flags
The flags of the process.


minflt

public long minflt
The number of minor faults.


cminflt

public long cminflt
The number of minor faults of the children.


majflt

public long majflt
The number of major faults.


cmajflt

public long cmajflt
The number of major faluts of the children.


utime

public long utime
The number of user mode jiffies.


stime

public long stime
The number of kernel mode jiffies.


cutime

public long cutime
The number of user mode child jiffies.


cstime

public long cstime
The number of kernel mode child jiffies.


priority

public long priority
The nice value (plus fifteen).


nice

public int nice
The nice value.


numThreads

public int numThreads
The number of threads (since 2.6).


irealvalue

public long irealvalue
The number of jiffies to the next SIGALRM.


starttime

public long starttime
The number of jiffies, after system boot, that process started.


vsize

public long vsize
Virtual memory size.


rss

public long rss
Resident Set Size.


rlim

public long rlim
Current rss limit.


startcode

public long startcode
The address above which program text can run.


endcode

public long endcode
The address below which program text can run.


startstack

public long startstack
The address of the start of the stack.


kstkesp

public long kstkesp
The current value of the stack pointer.


kstkeip

public long kstkeip
The current instruction pointer.


signal

public long signal
The bitmap of pending signals.


blocked

public long blocked
The bitmap of blocked signals.


sigignore

public long sigignore
The bitmap of ignored signals.


sigcatch

public long sigcatch
The bitmap of catched signals.


wchan

public long wchan
The "channel" in which the process is waiting.


nswap

public long nswap
Number of pages swapped.


cnswap

public long cnswap
Number of pages swapped by children.


exitSignal

public int exitSignal
Signal to be sent to parent.


processor

public int processor
CPU number last executed on.

Constructor Detail

Stat

public Stat()
Create an unbounded Stat object.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

scan

public Stat scan(ProcessIdentifier pid)
Refresh Stat from /proc/PID/stat, return true if the scan was successful. Returns false when the file doesn't exist, or can't be read. Throws an error if there is some sort of scan problem.


rescan

public Stat rescan()
Re-scan using the current pid.


scan

public Stat scan(ProcessIdentifier pid,
                 ProcessIdentifier tid)
Refresh Stat from /proc/PID/task/TID/stat, return true if the scan was successful. Returns false when the file doesn't exist, or can't be read. Throws an error if there is some sort of scan problem.