Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data
In directory usw-pr-cvs1:/tmp/cvs-serv28034/net/sourceforge/javaprofiler/jpiimpl/data
Modified Files:
SnapshotImpl.java
Log Message:
call tree snapshot added
Index: SnapshotImpl.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** SnapshotImpl.java 6 Mar 2002 17:47:24 -0000 1.14
--- SnapshotImpl.java 7 Mar 2002 10:37:38 -0000 1.15
***************
*** 461,464 ****
--- 461,473 ----
extract( null, gcs, IProf.GCS, IProf.NO_OPTIONAL_ARG, iprof );
}
+ // set call-trees in ThreadData objects
+ if (conf.withCallTree) {
+ Iterator thIt = threads.iterator ();
+ while (thIt.hasNext ()) {
+ ThreadData thread = (ThreadData) thIt.next ();
+ thread.setCallTree (threadCallTree (iprof, thread.getID ().
+ intValue ()));
+ }
+ }
}
catch ( COMMUN_Exception e ) {
***************
*** 583,586 ****
--- 592,628 ----
};
+ /** Returns call tree for selected thread.
+ * @param iprof Communacation object (you have to be connected to profiled VM).
+ * @param threadID identifies the Thread.
+ * @return Complete call tree for selected thread.
+ */
+ private CallTreeData threadCallTree (IProf iprof, int threadID) throws
+ COMMUN_Exception, BAD_OBJ_ID_Exception, UNKNOWN_Exception {
+ CallTreeData root = null;
+ Iterator ctIt = iprof.getCallTreeThruIterator (threadID, true);
+ if (ctIt.hasNext ()) {
+ IProf.sCallTree sRoot = (IProf.sCallTree) ctIt.next ();
+ MethodData method = (MethodData) libIDs.get (new Integer (
+ sRoot.methodObjId));
+ root = new CallTreeData (null, method, sRoot);
+ root.missingChildrenCount = sRoot.numOfChildren;
+ }
+ CallTreeData current = root;
+ while (current != null) {
+ if (current.missingChildrenCount > 0) {
+ IProf.sCallTree sChild = (IProf.sCallTree) ctIt.next ();
+ MethodData method = (MethodData) libIDs.get (new Integer (
+ sChild.methodObjId));
+ CallTreeData child = new CallTreeData (null, method, sChild);
+ child.missingChildrenCount = sChild.numOfChildren;
+ current.addChild (child);
+ current = child;
+ } else {
+ current = current.getParent();
+ }
+ }
+ return root;
+ }
+
/* Uses postOpIterLst, returns new List, which should be used used in next
* iteration. It called for each extract operation (each obect in List
***************
*** 1057,1060 ****
--- 1099,1105 ----
/*
* $Log$
+ * Revision 1.15 2002/03/07 10:37:38 petrul
+ * call tree snapshot added
+ *
* Revision 1.14 2002/03/06 17:47:24 vachis
* You can choose not to include Types or CPU/Mon/Alloc Threads/Traces
|