This is the mail archive of the
frysk@sourceware.org
mailing list for the frysk project.
Re: proc based observers
Do you have some examples of code that does that in frysk at the moment?
There are a couple of instances in the gui. Here is an example from
Ftrace.java:
ProcObserver.ProcTasks tasksObserver = new ProcObserver.ProcTasks()
{
public void existingTask (Task task)
{
handleTask(task);
}
public void taskAdded (Task task)
{
handleTask(task);
}
public void taskRemoved (Task arg0)
{
}
public void addedTo (Object arg0)
{
}
public void addFailed (Object arg0, Throwable arg1)
{
}
public void deletedFrom (Object arg0)
{
}
};
Then handle task does this:
synchronized void handleTask (Task task)
{
task.requestAddSyscallObserver(syscallObserver);
task.requestAddForkedObserver(forkedObserver);
Proc proc = task.getProc();
....
The history behind this is interesting:
We used to have some proc observers, but we wanted fine grain control so
everything was moved down to tasks. then we wanted a safe way of getting
a procs tasks, so we created ProcTasksObserver. And now the common case
(at least outside of monitor) is to add observers to all tasks.