frysk.proc.live
Class LinuxWaitBuilder

java.lang.Object
  extended by frysk.proc.live.LinuxWaitBuilder
All Implemented Interfaces:
WaitBuilder

 class LinuxWaitBuilder
extends Object
implements WaitBuilder

Handles wait events generated by the wait builder.


Field Summary
private static Log fine
           
private  List fsckedOrderedKernelEvents
          Maintain a list of fscked up kernel waitpid events - where an event for a pid arrives before it has been created - so that they can be re-processed when there's a fork.
private  LinuxPtraceHost host
           
 
Constructor Summary
LinuxWaitBuilder(LinuxPtraceHost host)
           
 
Method Summary
private  void attemptDeliveringFsckedKernelEvents()
          Run through the list of fscked up kernel waitpid events attempting delivery of each in turn.
 void cloneEvent(ProcessIdentifier pid, ProcessIdentifier clonePid)
          The task PID got a clone event; CLONE is the new task's ID.
 void disappeared(ProcessIdentifier pid, Throwable w)
          The task PID disappeared.
 void execEvent(ProcessIdentifier pid)
          The task PID got an exec event; the process has already been overlayed.
 void exitEvent(ProcessIdentifier pid, Signal signal, int status, boolean coreDumped)
          The task PID got an exit event; if SIGNAL is non-NULL it contains the terminating signal and STATUS is the negated signal value, else STATUS contains the cardinal exit status.
 void forkEvent(ProcessIdentifier pid, ProcessIdentifier fork)
          The task PID got a fork event; CHILD is the new process ID.
private  LinuxPtraceTask get(ProcessIdentifier pid, String why)
           
private  void logMissing(String what, ProcessIdentifier pid)
           
private  void saveFsckedOrderedKernelStoppedEvent(ProcessIdentifier aPid, Signal aSignal)
          Append the fscked-up stop event (it arrived when the task didn't exist) to the fscked-up list.
 void stopped(ProcessIdentifier pid, Signal sig)
          The task PID stopped with SIGNAL pending (could be SIGNONE).
 void syscallEvent(ProcessIdentifier pid)
          XXX: It isn't currently possible to determine from the syscall event whether it is entry or exit.
 void terminated(ProcessIdentifier pid, Signal signal, int status, boolean coreDumped)
          The task PID terminated (either WIFEXITED or WIFSIGNALED); if SIGNAL is non-NULL then the termination is the specified signal and STATUS is the negated signal value; else STATUS is the cardinal exit status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fine

private static final Log fine

host

private final LinuxPtraceHost host

fsckedOrderedKernelEvents

private List fsckedOrderedKernelEvents
Maintain a list of fscked up kernel waitpid events - where an event for a pid arrives before it has been created - so that they can be re-processed when there's a fork.

Constructor Detail

LinuxWaitBuilder

LinuxWaitBuilder(LinuxPtraceHost host)
Method Detail

attemptDeliveringFsckedKernelEvents

private void attemptDeliveringFsckedKernelEvents()
Run through the list of fscked up kernel waitpid events attempting delivery of each in turn.


saveFsckedOrderedKernelStoppedEvent

private void saveFsckedOrderedKernelStoppedEvent(ProcessIdentifier aPid,
                                                 Signal aSignal)
Append the fscked-up stop event (it arrived when the task didn't exist) to the fscked-up list. Will get re-processed later.


get

private LinuxPtraceTask get(ProcessIdentifier pid,
                            String why)

logMissing

private void logMissing(String what,
                        ProcessIdentifier pid)

cloneEvent

public void cloneEvent(ProcessIdentifier pid,
                       ProcessIdentifier clonePid)
Description copied from interface: WaitBuilder
The task PID got a clone event; CLONE is the new task's ID.

Specified by:
cloneEvent in interface WaitBuilder

forkEvent

public void forkEvent(ProcessIdentifier pid,
                      ProcessIdentifier fork)
Description copied from interface: WaitBuilder
The task PID got a fork event; CHILD is the new process ID.

Specified by:
forkEvent in interface WaitBuilder

exitEvent

public void exitEvent(ProcessIdentifier pid,
                      Signal signal,
                      int status,
                      boolean coreDumped)
Description copied from interface: WaitBuilder
The task PID got an exit event; if SIGNAL is non-NULL it contains the terminating signal and STATUS is the negated signal value, else STATUS contains the cardinal exit status.

Specified by:
exitEvent in interface WaitBuilder

execEvent

public void execEvent(ProcessIdentifier pid)
Description copied from interface: WaitBuilder
The task PID got an exec event; the process has already been overlayed.

Specified by:
execEvent in interface WaitBuilder

disappeared

public void disappeared(ProcessIdentifier pid,
                        Throwable w)
Description copied from interface: WaitBuilder
The task PID disappeared. Received an event for PID but then that, by the time its status was checked, the process had vanished.

Specified by:
disappeared in interface WaitBuilder

syscallEvent

public void syscallEvent(ProcessIdentifier pid)
Description copied from interface: WaitBuilder
XXX: It isn't currently possible to determine from the syscall event whether it is entry or exit. We must do state transitioning in the upper-level and figure it out.

Specified by:
syscallEvent in interface WaitBuilder

stopped

public void stopped(ProcessIdentifier pid,
                    Signal sig)
Description copied from interface: WaitBuilder
The task PID stopped with SIGNAL pending (could be SIGNONE).

Specified by:
stopped in interface WaitBuilder

terminated

public void terminated(ProcessIdentifier pid,
                       Signal signal,
                       int status,
                       boolean coreDumped)
Description copied from interface: WaitBuilder
The task PID terminated (either WIFEXITED or WIFSIGNALED); if SIGNAL is non-NULL then the termination is the specified signal and STATUS is the negated signal value; else STATUS is the cardinal exit status.

Specified by:
terminated in interface WaitBuilder