From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26767 invoked by alias); 26 Feb 2008 23:31:32 -0000 Received: (qmail 26740 invoked by uid 367); 26 Feb 2008 23:31:31 -0000 Date: Tue, 26 Feb 2008 23:31:00 -0000 Message-ID: <20080226233131.26723.qmail@sourceware.org> From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Delete ProcId. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a2762d9fc264df8287bfa9830b1148b4e4143970 X-Git-Newrev: 61fd2dad20bc97f51520127afbc3f9dc9de3b28a Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00257.txt.bz2 The branch, master has been updated via 61fd2dad20bc97f51520127afbc3f9dc9de3b28a (commit) from a2762d9fc264df8287bfa9830b1148b4e4143970 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 61fd2dad20bc97f51520127afbc3f9dc9de3b28a Author: Andrew Cagney Date: Tue Feb 26 18:30:54 2008 -0500 Delete ProcId. frysk-core/frysk/proc/ChangeLog 2008-02-26 Andrew Cagney * ProcId.java: Delete. * TestId.java: Delete. * Proc.java (getId()): Delete. (id): Delete. frysk-core/frysk/proc/dead/ChangeLog 2008-02-26 Andrew Cagney * TestLinuxCore.java: Update to match Proc. frysk-gui/frysk/gui/monitor/ChangeLog 2008-02-26 Andrew Cagney * ProcWiseDataModel.java: Use proc, not ProcId as key. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/proc/ChangeLog | 5 + frysk-core/frysk/proc/Proc.java | 7 -- frysk-core/frysk/proc/ProcId.java | 77 ----------------- frysk-core/frysk/proc/TestId.java | 89 -------------------- frysk-core/frysk/proc/dead/ChangeLog | 2 + frysk-core/frysk/proc/dead/TestLinuxCore.java | 1 - frysk-gui/frysk/gui/monitor/ChangeLog | 4 + frysk-gui/frysk/gui/monitor/ProcWiseDataModel.java | 14 ++-- 8 files changed, 17 insertions(+), 182 deletions(-) delete mode 100644 frysk-core/frysk/proc/ProcId.java delete mode 100644 frysk-core/frysk/proc/TestId.java First 500 lines of diff: diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog index 5341302..625155c 100644 --- a/frysk-core/frysk/proc/ChangeLog +++ b/frysk-core/frysk/proc/ChangeLog @@ -1,5 +1,10 @@ 2008-02-26 Andrew Cagney + * ProcId.java: Delete. + * TestId.java: Delete. + * Proc.java (getId()): Delete. + (id): Delete. + * Proc.java (Proc): Do not call Host.add(Proc). * Host.java (procPool): Delete. (add(Proc)): Delete. diff --git a/frysk-core/frysk/proc/Proc.java b/frysk-core/frysk/proc/Proc.java index bfa2cfd..5c8c081 100644 --- a/frysk-core/frysk/proc/Proc.java +++ b/frysk-core/frysk/proc/Proc.java @@ -63,14 +63,8 @@ import frysk.sys.Signal; public abstract class Proc implements Comparable { protected static final Logger logger = Logger.getLogger(ProcLogger.LOGGER_ID); - final ProcId id; - private CountDownLatch quitLatch; - public ProcId getId() { - return id; - } - /** * If known, due to the tracing of a fork, the Task that created * this process. @@ -152,7 +146,6 @@ public abstract class Proc implements Comparable { private Proc(int pid, Proc parent, Host host, Task creator) { this.host = host; this.pid = pid; - this.id = new ProcId(pid); this.parent = parent; this.creator = creator; // Keep parent informed. diff --git a/frysk-core/frysk/proc/ProcId.java b/frysk-core/frysk/proc/ProcId.java deleted file mode 100644 index ec73bad..0000000 --- a/frysk-core/frysk/proc/ProcId.java +++ /dev/null @@ -1,77 +0,0 @@ -// This file is part of the program FRYSK. -// -// Copyright 2005, 2006, Red Hat Inc. -// -// FRYSK is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// FRYSK is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with FRYSK; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Red Hat, Inc. gives You the -// additional right to link the code of FRYSK with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of FRYSK through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Red Hat, Inc. may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the FRYSK code and other code -// used in conjunction with FRYSK except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. - -package frysk.proc; - -/** - * Light weight identifier for a process. - * - * This implements comparable so can be used for searching and the - * like. Anything wanting to search for a process should use this. - */ - -public class ProcId - extends Id -{ - ProcId () - { - super (); - } - public ProcId (int id) - { - super (id); - } - public String toString () - { - return ("{ProcId," + super.toString () + "}"); - } - protected boolean isCompatible (Object o) - { - return (o instanceof ProcId); - } - - /** - * Get the PID of this ProcessID. - * @return the pid - */ - public int intValue() - { - return id; // field in superclass - } -} diff --git a/frysk-core/frysk/proc/TestId.java b/frysk-core/frysk/proc/TestId.java deleted file mode 100644 index 8a8e926..0000000 --- a/frysk-core/frysk/proc/TestId.java +++ /dev/null @@ -1,89 +0,0 @@ -// This file is part of the program FRYSK. -// -// Copyright 2005, 2006, Red Hat Inc. -// -// FRYSK is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// FRYSK is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with FRYSK; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Red Hat, Inc. gives You the -// additional right to link the code of FRYSK with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of FRYSK through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Red Hat, Inc. may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the FRYSK code and other code -// used in conjunction with FRYSK except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. - -package frysk.proc; - -import frysk.junit.TestCase; - -/** - * Test that Id compares actually work as expected. - */ - -public class TestId - extends TestCase -{ - Id id1 = new Id (1); - Id id2 = new Id (2); - Id id3 = new Id (3); - TaskId tid1 = new TaskId (1); - TaskId tid2 = new TaskId (2); - ProcId pid1 = new ProcId (1); - ProcId pid2 = new ProcId (2); - /** - * Equals with base class works. - */ - public void testIdEquals () - { - assertTrue ("id1.equals (id1)", id1.equals (id1)); - assertFalse ("id1.equals (id2)", id1.equals (id2)); - } - - public void testIdCompareTo () - { - assertTrue ("id2.compareTo (id1)", id2.compareTo (id1) < 0); - assertTrue ("id2.compareTo (id2)", id2.compareTo (id2) == 0); - assertTrue ("id2.compareTo (id3)", id2.compareTo (id3) > 0); - } - - public void testTaskId () - { - // An Id works with anything? - assertTrue ("tid1.equals (tid1)", tid1.equals (tid1)); - assertFalse ("tid1.equals (tid2)", tid1.equals (tid2)); - assertFalse ("tid1.equals (pid2)", tid1.equals (pid2)); - assertFalse ("tid1.equals (pid1)", tid1.equals (pid1)); - } - public void testProcId () - { - assertTrue ("pid1.equals (pid1)", pid1.equals (pid1)); - assertFalse ("pid1.equals (pid2)", pid1.equals (pid2)); - assertFalse ("pid1.equals (tid1)", pid1.equals (tid1)); - assertFalse ("pid1.equals (tid2)", pid1.equals (tid2)); - } -} diff --git a/frysk-core/frysk/proc/dead/ChangeLog b/frysk-core/frysk/proc/dead/ChangeLog index 0498f3e..f7d188f 100644 --- a/frysk-core/frysk/proc/dead/ChangeLog +++ b/frysk-core/frysk/proc/dead/ChangeLog @@ -1,5 +1,7 @@ 2008-02-26 Andrew Cagney + * TestLinuxCore.java: Update to match Proc. + * TestLinuxExe.java (testRequestProc()): New. (testRequestProc()): New. * DeadHost.java (getProc()): New; abstract. diff --git a/frysk-core/frysk/proc/dead/TestLinuxCore.java b/frysk-core/frysk/proc/dead/TestLinuxCore.java index 2860a80..634a592 100644 --- a/frysk-core/frysk/proc/dead/TestLinuxCore.java +++ b/frysk-core/frysk/proc/dead/TestLinuxCore.java @@ -215,7 +215,6 @@ public class TestLinuxCore extends TestLib { public void testLinuxProcPopulation() { assertNotNull("Proc exists in corefile", coreProc); assertEquals("PID", 26799, coreProc.getPid()); - assertEquals("ProcID", 26799, coreProc.getId().id); assertEquals("getParent", null, coreProc.getParent()); assertEquals("getCommand", "segfault", coreProc.getCommand()); assertEquals("getExe", "/home/pmuldoon/segfault", coreProc.getExe()); diff --git a/frysk-gui/frysk/gui/monitor/ChangeLog b/frysk-gui/frysk/gui/monitor/ChangeLog index 65919d1..6957086 100644 --- a/frysk-gui/frysk/gui/monitor/ChangeLog +++ b/frysk-gui/frysk/gui/monitor/ChangeLog @@ -1,3 +1,7 @@ +2008-02-26 Andrew Cagney + + * ProcWiseDataModel.java: Use proc, not ProcId as key. + 2008-02-13 Andrew Cagney * ProcWiseDataModel.java: Update to match Scan. diff --git a/frysk-gui/frysk/gui/monitor/ProcWiseDataModel.java b/frysk-gui/frysk/gui/monitor/ProcWiseDataModel.java index dee2016..980445b 100644 --- a/frysk-gui/frysk/gui/monitor/ProcWiseDataModel.java +++ b/frysk-gui/frysk/gui/monitor/ProcWiseDataModel.java @@ -308,14 +308,14 @@ public class ProcWiseDataModel if (!guiProc.isOwned()) return; - TreeIter parent = (TreeIter) iterMap.get(proc.getId()); + TreeIter parent = (TreeIter) iterMap.get(proc); if (parent == null) { // new process name parent = treeStore.appendRow(null); if (parent != null) - iterMap.put(proc.getId(), parent); + iterMap.put(proc, parent); } treeStore.setValue(parent, nameDC, guiProc.getExecutableName()); @@ -357,11 +357,9 @@ public class ProcWiseDataModel { TreeIter parent = null; - if (proc != null) - { - try - { - parent = (TreeIter) iterMap.get(proc.getId()); + if (proc != null) { + try { + parent = (TreeIter) iterMap.get(proc); } catch (Exception e) { @@ -397,7 +395,7 @@ public class ProcWiseDataModel } treeStore.removeRow(parent); - iterMap.remove(proc.getId()); + iterMap.remove(proc); return; } hooks/post-receive -- frysk system monitor/debugger