public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM] master: More conversion to frysk.rsl.
@ 2008-02-28 19:08 cagney
0 siblings, 0 replies; only message in thread
From: cagney @ 2008-02-28 19:08 UTC (permalink / raw)
To: frysk-cvs
The branch, master has been updated
via 72543106fcd8c66bcbda2fac110ef2d792fd2c44 (commit)
from 84be88afd0541d23295051eb75029e84a0f3a0b2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 72543106fcd8c66bcbda2fac110ef2d792fd2c44
Author: Andrew Cagney <cagney@redhat.com>
Date: Thu Feb 28 14:06:41 2008 -0500
More conversion to frysk.rsl.
frysk-core/frysk/proc/ChangeLog
2008-02-28 Andrew Cagney <cagney@redhat.com>
* Proc.java: Use frysk.rsl.
* TestProcTasksObserver.java: Ditto.
* StressAttachDetachRapidlyForkingMainTask.java: Ditto.
* SyscallExaminer.java: Ditto.
* TestTaskObserverDetach.java: Ditto.
* TestFindProc.java: Ditto.
* ProcEvent.java: Ditto.
* TestTaskSyscallObserver.java: Ditto.
* Host.java: Ditto.
* Task.java: Ditto.
* ProcBlockAction.java: Ditto.
frysk-core/frysk/proc/dead/ChangeLog
2008-02-28 Andrew Cagney <cagney@redhat.com>
* DeadProc.java: Use frysk.rsl.
* DeadTask.java: Ditto.
frysk-sys/frysk/rsl/ChangeLog
2008-02-28 Andrew Cagney <cagney@redhat.com>
* Log.java: Add more loggers.
-----------------------------------------------------------------------
Summary of changes:
frysk-core/frysk/proc/ChangeLog | 14 +++++
frysk-core/frysk/proc/Host.java | 19 +++----
frysk-core/frysk/proc/Proc.java | 23 ++++----
frysk-core/frysk/proc/ProcBlockAction.java | 53 ++++++++----------
frysk-core/frysk/proc/ProcEvent.java | 17 +++----
.../StressAttachDetachRapidlyForkingMainTask.java | 58 ++++++++------------
frysk-core/frysk/proc/SyscallExaminer.java | 14 ++----
frysk-core/frysk/proc/Task.java | 9 ++--
frysk-core/frysk/proc/TestFindProc.java | 14 ++---
frysk-core/frysk/proc/TestProcTasksObserver.java | 24 ++++-----
frysk-core/frysk/proc/TestTaskObserverDetach.java | 10 ++--
frysk-core/frysk/proc/TestTaskSyscallObserver.java | 14 +++---
frysk-core/frysk/proc/dead/ChangeLog | 5 ++
frysk-core/frysk/proc/dead/DeadProc.java | 10 ++--
frysk-core/frysk/proc/dead/DeadTask.java | 12 +++--
frysk-sys/frysk/rsl/ChangeLog | 4 ++
frysk-sys/frysk/rsl/Log.java | 12 ++++
17 files changed, 158 insertions(+), 154 deletions(-)
First 500 lines of diff:
diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog
index 6ee5f3e..7ee212e 100644
--- a/frysk-core/frysk/proc/ChangeLog
+++ b/frysk-core/frysk/proc/ChangeLog
@@ -1,3 +1,17 @@
+2008-02-28 Andrew Cagney <cagney@redhat.com>
+
+ * Proc.java: Use frysk.rsl.
+ * TestProcTasksObserver.java: Ditto.
+ * StressAttachDetachRapidlyForkingMainTask.java: Ditto.
+ * SyscallExaminer.java: Ditto.
+ * TestTaskObserverDetach.java: Ditto.
+ * TestFindProc.java: Ditto.
+ * ProcEvent.java: Ditto.
+ * TestTaskSyscallObserver.java: Ditto.
+ * Host.java: Ditto.
+ * Task.java: Ditto.
+ * ProcBlockAction.java: Ditto.
+
2008-02-27 Andrew Cagney <cagney@redhat.com>
* Id.java: Delete.
diff --git a/frysk-core/frysk/proc/Host.java b/frysk-core/frysk/proc/Host.java
index 6d15454..f1984ff 100644
--- a/frysk-core/frysk/proc/Host.java
+++ b/frysk-core/frysk/proc/Host.java
@@ -43,9 +43,7 @@ import java.util.Collection;
import java.util.Map;
import java.util.HashMap;
import java.util.Observable; // XXX: Temporary.
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
+import frysk.rsl.Log;
/**
* A host machine.
@@ -55,12 +53,13 @@ import java.util.logging.Logger;
*/
public abstract class Host implements Comparable {
- static protected final Logger logger = Logger.getLogger("frysk");//.proc
+ private static final Log fine = Log.fine(Host.class);
+
/**
* The host corresponds to a specific system.
*/
protected Host() {
- logger.log(Level.FINE, "{0} Host\n", this);
+ fine.log(this, "Host");
}
// Maintain a collection of all known Tasks.
@@ -72,15 +71,15 @@ public abstract class Host implements Comparable {
Map taskPool = new HashMap();
void add(Task task) {
- logger.log(Level.FINEST, "{0} add Task\n", this);
+ fine.log(this, "add Task");
taskPool.put(task.getTaskId(), task);
}
void remove(Task task) {
- logger.log(Level.FINEST, "{0} remove Task\n", this);
+ fine.log(this, "remove Task");
taskPool.remove(task.getTaskId());
}
void removeTasks(Collection c) {
- logger.log(Level.FINE, "{0} removeTasks Collection\n", this);
+ fine.log(this, "removeTasks Collection");
taskPool.values().removeAll(c);
}
@@ -88,7 +87,7 @@ public abstract class Host implements Comparable {
* XXX: Should not be public.
*/
public void remove(Proc proc) {
- logger.log(Level.FINEST, "{0} remove Proc\n", this);
+ fine.log(this, "remove Proc");
observableProcRemovedXXX.notify(proc);
}
@@ -127,7 +126,7 @@ public abstract class Host implements Comparable {
*/
public final void requestCreateAttachedProc(String[] args,
TaskObserver.Attached attachedObserver) {
- logger.log(Level.FINE, "{0} requestCreateAttachedProc String[] TaskObserver.Attached\n", this);
+ fine.log(this, "requestCreateAttachedProc String[] TaskObserver.Attached");
requestCreateAttachedProc(null, null, null, args, attachedObserver);
}
diff --git a/frysk-core/frysk/proc/Proc.java b/frysk-core/frysk/proc/Proc.java
index 3aa0a24..e38db75 100644
--- a/frysk-core/frysk/proc/Proc.java
+++ b/frysk-core/frysk/proc/Proc.java
@@ -48,20 +48,19 @@ import java.util.Map;
import java.util.Observable;
import java.util.Observer;
import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import frysk.sys.ProcessIdentifier;
import frysk.sys.ProcessIdentifierFactory;
import frysk.util.CountDownLatch;
import frysk.event.Event;
import frysk.sys.Signal;
+import frysk.rsl.Log;
/**
* A UNIX Process, containing tasks, memory, ...
*/
public abstract class Proc implements Comparable {
- protected static final Logger logger = Logger.getLogger(ProcLogger.LOGGER_ID);
+ private static final Log fine = Log.fine(Proc.class);
private CountDownLatch quitLatch;
@@ -159,7 +158,7 @@ public abstract class Proc implements Comparable {
*/
protected Proc(Host host, Proc parent, int pid) {
this(pid, parent, host, null);
- logger.log(Level.FINEST, "{0} new - create unattached running proc\n", this);
+ fine.log(this, "new - create unattached running proc");
}
/**
@@ -174,7 +173,7 @@ public abstract class Proc implements Comparable {
*/
protected Proc(Task task, int fork) {
this(fork, task.getProc(), task.getProc().getHost(), task);
- logger.log(Level.FINE, "{0} new - create attached running proc\n", this);
+ fine.log(this, "new - create attached running proc");
}
/** XXX: Should not be public. */
@@ -210,7 +209,7 @@ public abstract class Proc implements Comparable {
* Request that the Proc be forcefully detached. Quickly.
*/
public void requestAbandon() {
- logger.log(Level.FINE, "{0} abandon\n", this);
+ fine.log(this, "abandon");
performDetach();
observations.clear();
}
@@ -222,7 +221,7 @@ public abstract class Proc implements Comparable {
* @param e The event to run upon successful detach.
*/
public void requestAbandonAndRunEvent(final Event e) {
- logger.log(Level.FINE, "{0} abandonAndRunEvent\n", this);
+ fine.log(this, "abandonAndRunEvent");
requestAbandon();
observableDetached.addObserver(new Observer() {
public void update(Observable o, Object arg) {
@@ -282,7 +281,7 @@ public abstract class Proc implements Comparable {
* XXX: This should not be public.
*/
public void add(Proc child) {
- logger.log(Level.FINEST, "{0} add(Proc) -- a child process\n", this);
+ fine.log(this, "add(Proc) -- a child process");
childPool.add(child);
}
@@ -292,7 +291,7 @@ public abstract class Proc implements Comparable {
* XXX: This should not be public.
*/
public void remove(Proc child) {
- logger.log(Level.FINEST, "{0} remove(Proc) -- a child process\n", this);
+ fine.log(this, "remove(Proc) -- a child process");
childPool.remove(child);
}
@@ -310,7 +309,7 @@ public abstract class Proc implements Comparable {
public class ObservableXXX extends Observable {
/** XXX: Should not be public. */
public void notify(Object o) {
- logger.log(Level.FINE, "{0} notify -- all observers\n", o);
+ fine.log(this, "notify -- all observers\n", o);
setChanged();
notifyObservers(o);
}
@@ -335,7 +334,7 @@ public abstract class Proc implements Comparable {
* Remove Task from this Proc.
*/
protected void remove(Task task) {
- logger.log(Level.FINEST, "{0} remove(Task) -- within this Proc\n", this);
+ fine.log(this, "remove(Task) -- within this Proc");
host.observableTaskRemovedXXX.notify(task);
taskPool.remove(task.getTaskId());
host.remove(task);
@@ -347,7 +346,7 @@ public abstract class Proc implements Comparable {
* XXX: Should not be public.
*/
public void retain(Task task) {
- logger.log(Level.FINE, "{0} retain(Task) -- remove all but task\n", this);
+ fine.log(this, "retain(Task) -- remove all but task");
HashMap new_tasks = new HashMap();
new_tasks = (HashMap) ((HashMap) taskPool).clone();
new_tasks.values().remove(task);
diff --git a/frysk-core/frysk/proc/ProcBlockAction.java b/frysk-core/frysk/proc/ProcBlockAction.java
index 52c6f24..afe4ac9 100644
--- a/frysk-core/frysk/proc/ProcBlockAction.java
+++ b/frysk-core/frysk/proc/ProcBlockAction.java
@@ -43,8 +43,7 @@ package frysk.proc;
import java.io.File;
import java.util.Iterator;
import java.util.LinkedList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import frysk.rsl.Log;
import frysk.isa.signals.Signal;
import frysk.event.Event;
import frysk.proc.dead.LinuxCoreFactory;
@@ -59,8 +58,9 @@ import frysk.proc.dead.LinuxCoreFactory;
* called on all tasks.
*
*/
-public class ProcBlockAction
-{
+public class ProcBlockAction {
+ private static final Log fine = Log.fine(ProcBlockAction.class);
+
private ProcObserver.ProcAction action;
private ProcBlockTaskObserver taskObserver = new ProcBlockTaskObserver();
@@ -127,33 +127,29 @@ public class ProcBlockAction
}
- protected static final Logger logger = Logger.getLogger("frysk");
-
protected Proc proc;
private LinkedList tasks = new LinkedList();
private LinkedList taskList;
- /**
- * Creates a ProcBlockAction which will attach to the given process stopping
- * all of its tasks, performing the requested action on each task, and then
- * removing itself.
- *
- * @param theProc a non-null Process.
- */
- public ProcBlockAction (Proc theProc, ProcObserver.ProcAction action)
- {
- logger.log(Level.FINE, "{0} new\n", this);
- proc = theProc;
- this.action = action;
-
- taskList = proc.getTasks();
- requestAdd();
- }
+ /**
+ * Creates a ProcBlockAction which will attach to the given
+ * process stopping all of its tasks, performing the requested
+ * action on each task, and then removing itself.
+ *
+ * @param theProc a non-null Process.
+ */
+ public ProcBlockAction(Proc theProc, ProcObserver.ProcAction action) {
+ fine.log(this, "new");
+ proc = theProc;
+ this.action = action;
+ taskList = proc.getTasks();
+ requestAdd();
+ }
public ProcBlockAction(int pid) {
- logger.log(Level.FINE, "{0} new\n", this);
+ fine.log(this, "new");
Manager.host.requestProc(pid, new FindProc() {
public void procFound(Proc proc) {
ProcBlockAction.this.proc = proc;
@@ -191,10 +187,8 @@ public class ProcBlockAction
{
Task mainTask = proc.getMainTask();
- if (mainTask == null)
- {
- logger.log(Level.FINE, "Could not get main thread of "
- + "this process\n {0}", proc);
+ if (mainTask == null) {
+ fine.log("Could not get main thread of this process", proc);
action.addFailed(proc, new RuntimeException("Process lost: could not get "
+ "the main thread of this "
+ "process.\n" + proc));
@@ -241,8 +235,9 @@ public class ProcBlockAction
if (task != null)
taskList.remove(task);
- logger.log(Level.FINEST, "{0} this taskList, {1} proc.taskList\n",
- new Object[] { taskList, proc.getTasks() });
+ if (fine.logging())
+ fine.log(this, "this taskList", taskList, "proc.taskList",
+ proc.getTasks());
if (taskList.isEmpty())
{
diff --git a/frysk-core/frysk/proc/ProcEvent.java b/frysk-core/frysk/proc/ProcEvent.java
index a84da2c..215d20a 100644
--- a/frysk-core/frysk/proc/ProcEvent.java
+++ b/frysk-core/frysk/proc/ProcEvent.java
@@ -40,24 +40,21 @@
package frysk.proc;
import frysk.event.Event;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import frysk.rsl.Log;
+
+public abstract class ProcEvent implements Event {
+ private static final Log fine = Log.fine(ProcEvent.class);
-public abstract class ProcEvent
- implements Event
-{
- private static Logger logger = Logger.getLogger(ProcLogger.LOGGER_ID);
protected Proc proc;
protected TaskId taskId; // Random task within Proc.
public ProcEvent () {
}
public ProcEvent(Proc proc) {
- logger.log (Level.FINE, "", this);
this.proc = proc;
+ fine.log(this, "new", proc);
}
- public Proc getProc ()
- {
- logger.log (Level.FINE, "", this);
+ public Proc getProc() {
+ fine.log(this, "getProc", proc);
return proc;
}
/**
diff --git a/frysk-core/frysk/proc/StressAttachDetachRapidlyForkingMainTask.java b/frysk-core/frysk/proc/StressAttachDetachRapidlyForkingMainTask.java
index d0652ab..8ed1346 100644
--- a/frysk-core/frysk/proc/StressAttachDetachRapidlyForkingMainTask.java
+++ b/frysk-core/frysk/proc/StressAttachDetachRapidlyForkingMainTask.java
@@ -41,7 +41,7 @@ package frysk.proc;
import java.util.Collection;
import java.util.HashSet;
-import java.util.logging.Level;
+import frysk.rsl.Log;
import frysk.event.TimerEvent;
import frysk.proc.ProcObserver.ProcTasks;
import frysk.testbed.TestLib;
@@ -52,9 +52,9 @@ import frysk.testbed.DaemonBlockedAtEntry;
* Check that the observer TaskObserver.Forked works.
*/
-public class StressAttachDetachRapidlyForkingMainTask
- extends TestLib
-{
+public class StressAttachDetachRapidlyForkingMainTask extends TestLib {
+ private static final Log fine = Log.fine(StressAttachDetachRapidlyForkingMainTask.class);
+
static int numberOfForks = 450;
static int numberOfForksResident = 2;
@@ -94,22 +94,19 @@ public class StressAttachDetachRapidlyForkingMainTask
{
failedCount++;
}
- public Action updateForkedParent (Task parent, Task offspring)
- {
+ public Action updateForkedParent(Task parent, Task offspring) {
count++;
-
- logger.log(Level.INFO, "updatedForkedParent count of: " + count + " for: " +
- parent.getProc().getCommand());
+ fine.log("updatedForkedParent count of", count, "for",
+ parent.getProc().getCommand());
parent.requestUnblock (this);
return Action.BLOCK;
}
public Action updateForkedOffspring(Task parent,
final Task offspring) {
-
- logger.log(Level.INFO, "updatedForkedOffspring count of: " + count +
- " belonging to parent: " + parent.getProc().getCommand() +
- ". My child ID is: " + offspring.getTid());
+ fine.log("updatedForkedOffspring count of", count,
+ "belonging to parent", parent.getProc().getCommand(),
+ "my child ID is", offspring.getTid());
offspring.requestAddForkedObserver(ForkObserver.this);
offspring.requestUnblock(ForkObserver.this);
@@ -122,34 +119,23 @@ public class StressAttachDetachRapidlyForkingMainTask
// Add a tasks observer to add observers to fork's children
new ProcTasksObserver(child.getMainTask().getProc(), new ProcTasks(){
- public void deletedFrom(Object observable)
- {
- logger.log(Level.INFO,"ProcTasksObserver.deleted from fired");
+ public void deletedFrom(Object observable) {
+ fine.log("ProcTasksObserver.deleted from fired");
}
-
- public void addFailed(Object observable, Throwable w)
- {
- logger.log(Level.INFO,"ProcTasksObserver.addFailed failed");
+ public void addFailed(Object observable, Throwable w) {
+ fine.log("ProcTasksObserver.addFailed failed");
}
-
- public void addedTo(Object observable)
- {
- logger.log(Level.INFO,"ProcTasksObserver.addedTo fired");
+ public void addedTo(Object observable) {
+ fine.log("ProcTasksObserver.addedTo fired");
}
-
- public void existingTask(Task task)
- {
- logger.log(Level.INFO,"ProcTasksObserver.existingTask fired");
+ public void existingTask(Task task) {
+ fine.log("ProcTasksObserver.existingTask fired");
}
-
- public void taskRemoved(final Task task)
- {
- logger.log(Level.INFO,"ProcTasksObserver.taskRemoved fired");
+ public void taskRemoved(final Task task) {
+ fine.log("ProcTasksObserver.taskRemoved fired");
}
-
- public void taskAdded(final Task task)
- {
- logger.log(Level.INFO,"ProcTasksObserver.taskAdded fired");
+ public void taskAdded(final Task task) {
+ fine.log("ProcTasksObserver.taskAdded fired");
}
}
);
diff --git a/frysk-core/frysk/proc/SyscallExaminer.java b/frysk-core/frysk/proc/SyscallExaminer.java
index 23ab4cf..1a20b1d 100644
--- a/frysk-core/frysk/proc/SyscallExaminer.java
+++ b/frysk-core/frysk/proc/SyscallExaminer.java
@@ -41,7 +41,7 @@ package frysk.proc;
import java.util.Observer;
import java.util.Observable;
-import java.util.logging.Level;
+import frysk.rsl.Log;
import frysk.testbed.TestLib;
import frysk.testbed.TaskObserverBase;
import frysk.isa.syscalls.Syscall;
@@ -50,13 +50,8 @@ import frysk.isa.syscalls.Syscall;
* Superclass for tests that examine process state at a system call.
*/
-public class SyscallExaminer
- extends TestLib
-{
- // public TestExamineSyscall()
- // {
- // super();
- // }
+public class SyscallExaminer extends TestLib {
+ private static final Log fine = Log.fine(SyscallExaminer.class);
// Timers, observers, counters, etc.. needed for the test.
public class Tester
@@ -126,8 +121,7 @@ public class SyscallExaminer
Task task = (Task) obj;
if (!isChildOfMine (task.getProc()))
return;
- logger.log(Level.FINEST, "Registering pid {0} for kill",
- new Integer(task.getTid()));
+ fine.log("Registering pid for kill", task);
}
}
}
diff --git a/frysk-core/frysk/proc/Task.java b/frysk-core/frysk/proc/Task.java
index 99d6474..75ca7a7 100644
--- a/frysk-core/frysk/proc/Task.java
+++ b/frysk-core/frysk/proc/Task.java
@@ -45,16 +45,15 @@ import frysk.isa.syscalls.SyscallTableFactory;
import inua.eio.ByteBuffer;
import java.util.Set;
import java.util.HashSet;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import frysk.isa.registers.Register;
import frysk.isa.ISA;
import frysk.isa.banks.RegisterBanks;
import frysk.isa.signals.SignalTable;
import frysk.isa.signals.SignalTableFactory;
+import frysk.rsl.Log;
public abstract class Task {
- protected static final Logger logger = Logger.getLogger(ProcLogger.LOGGER_ID);
+ private static final Log fine = Log.fine(Task.class);
/**
* If known, as a result of tracing clone or fork, the task that
@@ -135,7 +134,7 @@ public abstract class Task {
*/
hooks/post-receive
--
frysk system monitor/debugger
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-28 19:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-28 19:08 [SCM] master: More conversion to frysk.rsl cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).