[SCM] master: Restore removed super call.

cagney@sourceware.org cagney@sourceware.org
Fri Dec 28 17:55:00 GMT 2007


The branch, master has been updated
       via  538aac5c9ea9ce0bef2147a4088259a2b9d316ae (commit)
       via  a8989462e9b68576df8b34359c81e5d9bc37d84f (commit)
      from  4179fb79a3673f3bafc5d06cb4a5cc479377634f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 538aac5c9ea9ce0bef2147a4088259a2b9d316ae
Author: Andrew Cagney <cagney@redhat.com>
Date:   Fri Dec 28 12:55:28 2007 -0500

    Restore removed super call.
    
    frysk-core/frysk/proc/ChangeLog
    2007-12-28  Andrew Cagney  <cagney@redhat.com>
    
    	* TestTaskSyscallObserver.java (SyscallInterruptObserver): In
    	updateSyscallEnter call super.

commit a8989462e9b68576df8b34359c81e5d9bc37d84f
Author: Andrew Cagney <cagney@redhat.com>
Date:   Fri Dec 28 12:39:08 2007 -0500

    Rename frysk.proc.TaskObserver.Syscall to .Syscalls; add Syscall parameter.
    
    frysk-core/frysk/ftrace/ChangeLog
    2007-12-28  Andrew Cagney  <cagney@redhat.com>
    
    	frysk.proc.TaskObserver.Syscall reanmed to .Syscalls. Syscall
    	parameter added.
    	* Ftrace.java (MySyscallObserver): Update.
    	* MappingGuard.java (SyscallMappingGuard): Update.
    
    frysk-core/frysk/proc/ChangeLog
    2007-12-28  Andrew Cagney  <cagney@redhat.com>
    
    	* TaskObserver.java (Syscalls): Rename Syscall; add Syscall
    	parameter to updateSyscallEnter.
    	* TestTaskSyscallObserver.java: Update.
    	* TestSyscallSignal.java: Update.
    	* SyscallExaminer.java: Update.
    	* Task.java: Update.
    	* TestSyscallRunning.java: Update.
    
    frysk-gui/frysk/gui/monitor/ChangeLog
    2007-12-28  Andrew Cagney  <cagney@redhat.com>
    
    	frysk.proc.TaskObserver.Syscall renamed to .Syscalls.
    	* observers/TaskSyscallObserver.java: Update.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/ftrace/ChangeLog                  |    5 +
 frysk-core/frysk/ftrace/Ftrace.java                |   22 +--
 frysk-core/frysk/ftrace/MappingGuard.java          |   19 +-
 frysk-core/frysk/proc/ChangeLog                    |   11 +
 frysk-core/frysk/proc/SyscallExaminer.java         |   45 ++--
 frysk-core/frysk/proc/Task.java                    |   14 +-
 frysk-core/frysk/proc/TaskObserver.java            |    8 +-
 frysk-core/frysk/proc/TestSyscallRunning.java      |   20 +-
 frysk-core/frysk/proc/TestSyscallSignal.java       |   15 +-
 frysk-core/frysk/proc/TestTaskSyscallObserver.java |  216 +++++++++-----------
 frysk-gui/frysk/gui/monitor/ChangeLog              |    3 +
 .../gui/monitor/observers/TaskSyscallObserver.java |   47 +++--
 12 files changed, 203 insertions(+), 222 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/ftrace/ChangeLog b/frysk-core/frysk/ftrace/ChangeLog
index 238a4bc..06c163e 100644
--- a/frysk-core/frysk/ftrace/ChangeLog
+++ b/frysk-core/frysk/ftrace/ChangeLog
@@ -1,5 +1,10 @@
 2007-12-28  Andrew Cagney  <cagney@redhat.com>
 
+	frysk.proc.TaskObserver.Syscall reanmed to .Syscalls. Syscall
+	parameter added.
+	* Ftrace.java (MySyscallObserver): Update.
+	* MappingGuard.java (SyscallMappingGuard): Update.
+	
 	frysk.proc.Syscall moved to frysk.syscall.Syscall.
 	* Ftrace.java: Update.
 	* MappingGuard.java: Update.
diff --git a/frysk-core/frysk/ftrace/Ftrace.java b/frysk-core/frysk/ftrace/Ftrace.java
index 19b3ebe..621054e 100644
--- a/frysk-core/frysk/ftrace/Ftrace.java
+++ b/frysk-core/frysk/ftrace/Ftrace.java
@@ -49,7 +49,7 @@ import frysk.proc.ProcObserver;
 import frysk.proc.ProcTasksObserver;
 import frysk.proc.Task;
 import frysk.proc.TaskObserver;
-
+import frysk.syscall.Syscall;
 import frysk.sys.Signal;
 
 import inua.util.PrintWriter;
@@ -252,7 +252,7 @@ public class Ftrace
 	Proc proc = task.getProc();
 
 	if (traceSyscalls) {
-	    task.requestAddSyscallObserver(new MySyscallObserver(reporter));
+	    task.requestAddSyscallsObserver(new MySyscallObserver(reporter));
 	    observationRequested(task);
 	}
 
@@ -420,21 +420,15 @@ public class Ftrace
     /**
      * The syscallObserver added to the traced proc.
      */
-    class MySyscallObserver
-	implements TaskObserver.Syscall
-    {
-	Reporter reporter;
-	frysk.syscall.Syscall syscallCache = null;
+    private class MySyscallObserver implements TaskObserver.Syscalls {
+	private final Reporter reporter;
+	private Syscall syscallCache = null;
 
-	MySyscallObserver(Reporter reporter)
-	{
+	MySyscallObserver(Reporter reporter) {
 	    this.reporter = reporter;
 	}
 
-	public Action updateSyscallEnter(Task task)
-	{
-	    frysk.syscall.Syscall syscall
-		= task.getSyscallTable().getSyscall(task);
+	public Action updateSyscallEnter(Task task, Syscall syscall) {
 	    String name = syscall.getName();
 	    if (syscall.isNoReturn())
 		reporter.eventSingle(task, "syscall " + name,
@@ -455,7 +449,7 @@ public class Ftrace
 
 	public Action updateSyscallExit (Task task)
 	{
-	    frysk.syscall.Syscall syscall = syscallCache;
+	    Syscall syscall = syscallCache;
 	    String name = syscall.getName();
 
 	    reporter.eventLeave(task, syscall,
diff --git a/frysk-core/frysk/ftrace/MappingGuard.java b/frysk-core/frysk/ftrace/MappingGuard.java
index ee32785..5b14999 100644
--- a/frysk-core/frysk/ftrace/MappingGuard.java
+++ b/frysk-core/frysk/ftrace/MappingGuard.java
@@ -45,7 +45,7 @@ import java.util.Map;
 import java.util.List;
 import java.util.logging.*;
 import java.io.File;
-
+import frysk.syscall.Syscall;
 import frysk.proc.Action;
 import frysk.proc.Task;
 import frysk.proc.TaskObserver;
@@ -278,27 +278,24 @@ class MappingGuard
 	}
     }
 
-    private static class SyscallMappingGuard
-	extends MappingGuardB
-	implements TaskObserver.Syscall
+    private static class SyscallMappingGuard extends MappingGuardB
+	implements TaskObserver.Syscalls
     {
-	private frysk.syscall.Syscall syscallCache = null;
+	private Syscall syscallCache = null;
 
 	public SyscallMappingGuard(Task task) {
 	    super(task);
-	    task.requestAddSyscallObserver(this);
+	    task.requestAddSyscallsObserver(this);
 	}
 
-	public Action updateSyscallEnter(Task task) {
-	    frysk.syscall.Syscall syscall
-		= task.getSyscallTable().getSyscall(task);
+	public Action updateSyscallEnter(Task task, Syscall syscall) {
 	    syscallCache = syscall;
 	    return Action.CONTINUE;
 	}
 
 	public Action updateSyscallExit (Task task)
 	{
-	    frysk.syscall.Syscall syscall = syscallCache;
+	    Syscall syscall = syscallCache;
 	    syscallCache = null;
 
 	    if (syscall != null) {
@@ -315,7 +312,7 @@ class MappingGuard
 	}
 
 	public void remove() {
-	    task.requestDeleteSyscallObserver(this);
+	    task.requestDeleteSyscallsObserver(this);
 	}
     }
 
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index 5f3f5eb..cd9abdc 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,5 +1,16 @@
 2007-12-28  Andrew Cagney  <cagney@redhat.com>
 
+	* TestTaskSyscallObserver.java (SyscallInterruptObserver): In
+	updateSyscallEnter call super.
+	
+	* TaskObserver.java (Syscalls): Rename Syscall; add Syscall
+	parameter to updateSyscallEnter.
+	* TestTaskSyscallObserver.java: Update.
+	* TestSyscallSignal.java: Update.
+	* SyscallExaminer.java: Update.
+	* Task.java: Update.
+	* TestSyscallRunning.java: Update.
+
 	* Syscall.java: Move to frysk.syscall.
 	* SyscallTable.java: Move to frysk.syscall.
 	* SyscallTableFactory.java: Move to frysk.syscall.
diff --git a/frysk-core/frysk/proc/SyscallExaminer.java b/frysk-core/frysk/proc/SyscallExaminer.java
index a4dd838..4b3a631 100644
--- a/frysk-core/frysk/proc/SyscallExaminer.java
+++ b/frysk-core/frysk/proc/SyscallExaminer.java
@@ -44,6 +44,7 @@ import java.util.Observable;
 import java.util.logging.Level;
 import frysk.testbed.TestLib;
 import frysk.testbed.TaskObserverBase;
+import frysk.syscall.Syscall;
 
 /**
  * Superclass for tests that examine process state at a system call.
@@ -66,31 +67,29 @@ public class SyscallExaminer
     volatile boolean exited;
     volatile int exitedTaskEventStatus;
 	
-    // Need to add task observers to the process the moment it is
-    // created, otherwize the creation of the very first task is
-    // missed (giving a mismatch of task created and deleted
-    // notifications.)
-	
-    class TaskEventObserver
-      extends TaskObserverBase
-      implements TaskObserver.Syscall, TaskObserver.Signaled
-    {
-      public Action updateSyscallEnter (Task task)
-      {
-	syscallState = 1;
-	return Action.CONTINUE;
-      }
-      public Action updateSyscallExit (Task task)
+      /**
+       * Need to add task observers to the process the moment it is
+       * created, otherwize the creation of the very first task is
+       * missed (giving a mismatch of task created and deleted
+       * notifications.)
+       */	
+      class TaskEventObserver
+	  extends TaskObserverBase
+	  implements TaskObserver.Syscalls, TaskObserver.Signaled
       {
-	syscallState = 0;
-	return Action.CONTINUE;
+	  public Action updateSyscallEnter (Task task, Syscall syscall) {
+	      syscallState = 1;
+	      return Action.CONTINUE;
+	  }
+	  public Action updateSyscallExit (Task task) {
+	      syscallState = 0;
+	      return Action.CONTINUE;
+	  }
+	  public Action updateSignaled (Task task, int sig) {
+	      stoppedTaskEventCount++;
+	      return Action.CONTINUE;
+	  }
       }
-      public Action updateSignaled (Task task, int sig)
-      {
-	stoppedTaskEventCount++;
-	return Action.CONTINUE;
-      }
-    }
 	
     class ProcDestroyedObserver
       implements Observer
diff --git a/frysk-core/frysk/proc/Task.java b/frysk-core/frysk/proc/Task.java
index df769e3..9acc59e 100644
--- a/frysk-core/frysk/proc/Task.java
+++ b/frysk-core/frysk/proc/Task.java
@@ -39,6 +39,7 @@
 
 package frysk.proc;
 
+import frysk.syscall.Syscall;
 import frysk.syscall.SyscallTable;
 import frysk.syscall.SyscallTableFactory;
 import java.util.LinkedList;
@@ -745,9 +746,9 @@ public abstract class Task
   public TaskObservable syscallObservers = new TaskObservable(this);
 
   /**
-   * Add TaskObserver.Syscall to the TaskObserver pool.
+   * Add TaskObserver.Syscalls to the TaskObserver pool.
    */
-  public void requestAddSyscallObserver (TaskObserver.Syscall o)
+  public void requestAddSyscallsObserver (TaskObserver.Syscalls o)
   {
     logger.log(Level.FINE, "{0} requestAddSyscallObserver\n", this);
     proc.requestAddSyscallObserver(this, syscallObservers, o);
@@ -756,7 +757,7 @@ public abstract class Task
   /**
    * Delete TaskObserver.Syscall.
    */
-  public void requestDeleteSyscallObserver (TaskObserver.Syscall o)
+  public void requestDeleteSyscallsObserver (TaskObserver.Syscalls o)
   {
     proc.requestDeleteSyscallObserver(this, syscallObservers, o);
     logger.log(Level.FINE, "{0} requestDeleteSyscallObserver\n", this);
@@ -771,9 +772,10 @@ public abstract class Task
     public int notifySyscallEnter () {
 	logger.log(Level.FINE,
 		   "{0} notifySyscallEnter\n", this);
+	Syscall syscall = getSyscallTable().getSyscall(this);
 	for (Iterator i = syscallObservers.iterator(); i.hasNext();) {
-	    TaskObserver.Syscall observer = (TaskObserver.Syscall) i.next();
-	    if (observer.updateSyscallEnter(this) == Action.BLOCK)
+	    TaskObserver.Syscalls observer = (TaskObserver.Syscalls) i.next();
+	    if (observer.updateSyscallEnter(this, syscall) == Action.BLOCK)
 		blockers.add(observer);
 	}
 	return blockers.size();
@@ -789,7 +791,7 @@ public abstract class Task
 	logger.log(Level.FINE,
 		   "{0} notifySyscallExit {1}\n", this);
 	for (Iterator i = syscallObservers.iterator(); i.hasNext();) {
-	    TaskObserver.Syscall observer = (TaskObserver.Syscall) i.next();
+	    TaskObserver.Syscalls observer = (TaskObserver.Syscalls) i.next();
 	    if (observer.updateSyscallExit(this) == Action.BLOCK)
 		blockers.add(observer);
 	}
diff --git a/frysk-core/frysk/proc/TaskObserver.java b/frysk-core/frysk/proc/TaskObserver.java
index f958722..f475979 100644
--- a/frysk-core/frysk/proc/TaskObserver.java
+++ b/frysk-core/frysk/proc/TaskObserver.java
@@ -39,6 +39,8 @@
 
 package frysk.proc;
 
+import frysk.syscall.Syscall;
+
 /**
  * Observable events generated by a Task.
  */
@@ -160,14 +162,12 @@ public interface TaskObserver
      * Interface used to notify of a Task either entering, or exiting
      * a system call.
      */
-    public interface Syscall
-	extends TaskObserver
-    {
+    public interface Syscalls extends TaskObserver {
 	/**
 	 * The Task is entering a system call.  Return Action.BLOCK to
 	 * block the task's further execution.
 	 */
-	Action updateSyscallEnter (Task task);
+	Action updateSyscallEnter (Task task, Syscall syscall);
 	/**
 	 * The task is exiting a system call.  Return Action.BLOCK to
 	 * block the task's further execution.
diff --git a/frysk-core/frysk/proc/TestSyscallRunning.java b/frysk-core/frysk/proc/TestSyscallRunning.java
index 017dd3b..1e73ad7 100644
--- a/frysk-core/frysk/proc/TestSyscallRunning.java
+++ b/frysk-core/frysk/proc/TestSyscallRunning.java
@@ -39,6 +39,7 @@
 
 package frysk.proc;
 
+import frysk.syscall.Syscall;
 import java.io.InputStreamReader;
 import java.io.BufferedReader;
 import java.io.DataOutputStream;
@@ -113,7 +114,7 @@ public class TestSyscallRunning
     final Task procTask = proc.getMainTask();
 
     final SyscallObserver syso = new SyscallObserver("accept", procTask, false);
-    procTask.requestAddSyscallObserver(syso);
+    procTask.requestAddSyscallsObserver(syso);
 
     // Make sure the observer is properly installed.
     while (! syso.isAdded())
@@ -135,7 +136,7 @@ public class TestSyscallRunning
 		// Continue running (inside syscall), while attaching
 		// another syscall observer
 		procTask.requestUnblock(syso);
-		procTask.requestAddSyscallObserver(syso2);
+		procTask.requestAddSyscallsObserver(syso2);
 	    }
 	});
 
@@ -165,24 +166,23 @@ public class TestSyscallRunning
      * Observer that looks for open and close syscalls.
      * After a given number of calls it will BLOCK from the syscall enter.
      */
-    class SyscallObserver implements TaskObserver.Syscall {
+    private final class SyscallObserver implements TaskObserver.Syscalls {
 	private boolean entered;
 	private boolean exited;
 	private boolean added;
 	private boolean removed;
 
-	private final frysk.syscall.Syscall syscall;
+	private final Syscall expected;
 
 	SyscallObserver(String call, Task task, boolean entered) {
 	    SyscallTable syscallTable
 		= SyscallTableFactory.getSyscallTable(task.getISA());
-	    syscall = syscallTable.getSyscall(call);
+	    this.expected = syscallTable.getSyscall(call);
 	    this.entered = entered;
 	}
 
-	public Action updateSyscallEnter(Task task) {
-	    SyscallTable syscallTable = getSyscallTable(task);
-	    if (syscallTable.getSyscall(task).equals(syscall)) {
+	public Action updateSyscallEnter(Task task, Syscall syscall) {
+	    if (syscall.equals(expected)) {
 		entered = true;
 		Manager.eventLoop.requestStop();
 		return Action.BLOCK;
@@ -230,9 +230,5 @@ public class TestSyscallRunning
 	public boolean isRemoved() {
 	    return removed;
 	}
-
-	private SyscallTable getSyscallTable(Task task) {
-	    return task.getSyscallTable();
-	}
     }
 }
diff --git a/frysk-core/frysk/proc/TestSyscallSignal.java b/frysk-core/frysk/proc/TestSyscallSignal.java
index 72850d9..6170eff 100644
--- a/frysk-core/frysk/proc/TestSyscallSignal.java
+++ b/frysk-core/frysk/proc/TestSyscallSignal.java
@@ -46,6 +46,7 @@ import java.io.InputStreamReader;
 import frysk.sys.Signal;
 import frysk.sys.DaemonPipePair;
 import frysk.testbed.TestLib;
+import frysk.syscall.Syscall;
 import frysk.syscall.SyscallTable;
 import frysk.syscall.SyscallTableFactory;
 import frysk.testbed.TearDownProcess;
@@ -116,7 +117,7 @@ public class TestSyscallSignal
     final SignalObserver sigo = new SignalObserver(Signal.HUP);
     task.requestAddSignaledObserver(sigo);
     final SyscallObserver syso = new SyscallObserver(42, task);
-    task.requestAddSyscallObserver(syso);
+    task.requestAddSyscallsObserver(syso);
 
     // Make sure the observers are properly installed.
     while (! sigo.isAdded() || ! syso.isAdded())
@@ -241,7 +242,7 @@ public class TestSyscallSignal
      * Observer that looks for open and close syscalls.
      * After a given number of calls it will BLOCK from the syscall enter.
      */
-    class SyscallObserver implements TaskObserver.Syscall {
+    private class SyscallObserver implements TaskObserver.Syscalls {
 	private final int stophits;
 
 	private int entered;
@@ -249,8 +250,8 @@ public class TestSyscallSignal
 	private boolean added;
 	private boolean removed;
 
-	private final frysk.syscall.Syscall opensys;
-	private final frysk.syscall.Syscall closesys;
+	private final Syscall opensys;
+	private final Syscall closesys;
 
 	SyscallObserver(int stophits, Task task) {
 	    SyscallTable syscallTable
@@ -260,9 +261,7 @@ public class TestSyscallSignal
 	    this.closesys = syscallTable.getSyscall("close");
 	}
 
-	public Action updateSyscallEnter(Task task) {
-	    SyscallTable syscallTable = getSyscallTable(task);
-	    frysk.syscall.Syscall syscall = syscallTable.getSyscall(task);
+	public Action updateSyscallEnter(Task task, Syscall syscall) {
 	    if (opensys.equals(syscall) || closesys.equals(syscall)) {
 		entered++;
 		if (entered == stophits) {
@@ -275,7 +274,7 @@ public class TestSyscallSignal
 
 	public Action updateSyscallExit(Task task) {
 	    SyscallTable syscallTable = getSyscallTable(task);
-	    frysk.syscall.Syscall syscall = syscallTable.getSyscall(task);
+	    Syscall syscall = syscallTable.getSyscall(task);
 	    if (opensys.equals(syscall) || closesys.equals(syscall)) {
 		exited++;
 	    }
diff --git a/frysk-core/frysk/proc/TestTaskSyscallObserver.java b/frysk-core/frysk/proc/TestTaskSyscallObserver.java
index c72b05a..bb73dd3 100644
--- a/frysk-core/frysk/proc/TestTaskSyscallObserver.java
+++ b/frysk-core/frysk/proc/TestTaskSyscallObserver.java
@@ -40,6 +40,7 @@
 
 package frysk.proc;
 
+import frysk.syscall.Syscall;
 import frysk.syscall.SyscallTable;
 import frysk.syscall.SyscallTableFactory;
 import frysk.Config;
@@ -66,8 +67,9 @@ import frysk.testbed.DaemonBlockedAtEntry;
 public class TestTaskSyscallObserver
     extends TestLib
 {
-    class SyscallObserver extends TaskObserverBase
-	implements TaskObserver.Syscall {
+    private static class SyscallObserver extends TaskObserverBase
+	implements TaskObserver.Syscalls
+    {
 	int enter = 0;
 
 	int exit = 0;
@@ -77,11 +79,9 @@ public class TestTaskSyscallObserver
 
 	boolean caughtExec = false;
 
-	final frysk.syscall.Syscall execvesys;
-
-	final frysk.syscall.Syscall opensys;
-
-	final frysk.syscall.Syscall readsys;
+	private final Syscall execvesys;
+	final Syscall opensys;
+	final Syscall readsys;
 
 	SyscallObserver (Task task) {
 	    SyscallTable syscallTable
@@ -96,14 +96,11 @@ public class TestTaskSyscallObserver
 	    Manager.eventLoop.requestStop();
 	}
 
-	public Action updateSyscallEnter (Task task) {
+	public Action updateSyscallEnter (Task task, Syscall syscall) {
 	    assertFalse("inSyscall", inSyscall);
 	    inSyscall = true;
 	    enter++;
 
-	    SyscallTable syscallTable = getSyscallTable(task);
-	    frysk.syscall.Syscall syscall = syscallTable.getSyscall(task);
-
 	    if (execvesys.equals(syscall)) {
 		caughtExec = true;
 	    }
@@ -133,7 +130,7 @@ public class TestTaskSyscallObserver
     // called indicating that the attach succeeded.
     Task task = child.findTaskUsingRefresh(true);
     SyscallObserver syscallObserver = new SyscallObserver(task);
-    task.requestAddSyscallObserver(syscallObserver);
+    task.requestAddSyscallsObserver(syscallObserver);
     assertRunUntilStop("adding exec observer causing attach");
 
     // Do the exec; this call keeps the event loop running until
@@ -158,7 +155,7 @@ public class TestTaskSyscallObserver
     // called indicating that the attach succeeded.
     Task task = child.findTaskUsingRefresh(true);
     SyscallObserver syscallObserver = new SyscallObserver(task);
-    task.requestAddSyscallObserver(syscallObserver);


hooks/post-receive
--
frysk system monitor/debugger



More information about the Frysk-cvs mailing list