You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(73) |
Sep
(92) |
Oct
(9) |
Nov
(80) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(92) |
Feb
(52) |
Mar
(71) |
Apr
(64) |
May
(53) |
Jun
(10) |
Jul
(111) |
Aug
(93) |
Sep
(134) |
Oct
|
Nov
|
Dec
|
From: Marek P. <ma...@us...> - 2002-03-07 17:15:44
|
Update of /cvsroot/javaprofiler/library/demo/07 In directory usw-pr-cvs1:/tmp/cvs-serv20471/demo/07 Modified Files: Test.java Log Message: small changes in examples Index: Test.java =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/07/Test.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Test.java 6 Mar 2002 22:03:20 -0000 1.1 --- Test.java 7 Mar 2002 17:15:38 -0000 1.2 *************** *** 74,93 **** iprof.getCallTreeThruIterator( sid.objId, true); ! if( ct_iterator == null) ! System.out.println( "calltree is empty !"); ! else { ! int numOfItems = 0; ! // count number of items in calltree ! while( ct_iterator.hasNext()) { ! ! numOfItems++; ! ct_iterator.next(); ! } System.out.println( "okay, #items = " + numOfItems); - } System.out.println(); --- 74,91 ---- iprof.getCallTreeThruIterator( sid.objId, true); ! int numOfItems = 0; ! // count number of items in calltree ! while( ct_iterator.hasNext()) { ! numOfItems++; ! ct_iterator.next(); ! } + if( numOfItems == 0) + System.out.println( "calltree is empty !"); + else System.out.println( "okay, #items = " + numOfItems); System.out.println(); |
From: Lukas P. <pe...@us...> - 2002-03-07 10:37:41
|
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 |
From: Lukas P. <pe...@us...> - 2002-03-07 10:36:16
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv27736/net/sourceforge/javaprofiler/jpiimpl/data Added Files: CallTreeData.java Log Message: call tree item class --- NEW FILE: CallTreeData.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License Version * 1.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is available at http://www.sun.com/ * * The Original Code is the Java Profiler module. * The Initial Developers of the Original Code are Jan Stola, Pavel Vacha, * Michal Pise, Petr Luner, Lukas Petru and Marek Przeczek. * Portions created by Jan Stola are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Pavel Vacha are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Michal Pise are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Petr Luner are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Lukas Petru are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Marek Przeczek are Copyright (C) 2000-2001. All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.jpiimpl.data; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; import java.io.Serializable; /** Call tree item of profiled application. Items are connected in a tree-like * graph structure. * @author Lukas Petru */ public class CallTreeData implements Serializable { /** time spent in the method (including sub-calls) */ private long cumulativeTime; /** number of calls of the method */ private long hits; /** time spent in the method (excluding sub-calls) */ private long pureTime; /** method of this item */ private MethodData method; /** methods called by this method * (list of sCallTree objects, can be null) */ private List children; /** parent item (method from which current method was called) */ private CallTreeData parent; /** number of children that are to be added while building call-tree */ int missingChildrenCount; /** Creates new CallTreeData item. * @param caller Parent item * @aMethod Method which this item represents. * @aCumulativeTime Cumulative time * @aHits Number of hits * @aPureTime Pure time */ CallTreeData (CallTreeData caller, MethodData aMethod, long aCumulativeTime, long aHits, long aPureTime) { parent = caller; method = aMethod; cumulativeTime = aCumulativeTime; hits = aHits; pureTime = aPureTime; children = Collections.EMPTY_LIST; } /** Creates new CallTreeData item. * @param caller Parent item * @aMethod Method which this item represents. * @aData sCallTree class as returned by communication layer. */ CallTreeData (CallTreeData caller, MethodData aMethod, IProf.sCallTree aData) { this (caller, aMethod, aData.cumulativeTime, aData.hits, aData.pureTime); } /** Adds child item. (Method which was called from current method.) */ void addChild (CallTreeData child) { if (children == Collections.EMPTY_LIST) children = new LinkedList (); children.add(child); } /** Returns method of this item. */ public MethodData getMethod () { return method; } /** Returns parent of this item in the tree. */ public CallTreeData getParent () { return parent; } /** Returns cumulative time. */ public long getCumulativeTime () { return cumulativeTime; } /** Returns hit count. */ public long getHits () { return hits; } /** returns pure time. */ public long getPureTime () { return pureTime; } } /* * $Log: CallTreeData.java,v $ * Revision 1.1 2002/03/07 10:36:13 petrul * call tree item class * */ |
From: Lukas P. <pe...@us...> - 2002-03-07 10:35:28
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv27538/net/sourceforge/javaprofiler/jpiimpl/data Modified Files: ThreadData.java Log Message: callTree field added Index: ThreadData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ThreadData.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** ThreadData.java 4 Mar 2002 23:59:53 -0000 1.17 --- ThreadData.java 7 Mar 2002 10:35:24 -0000 1.18 *************** *** 59,63 **** */ private Map CPUMethods; - /** * Map of methods invoked in this thread. --- 59,62 ---- *************** *** 65,68 **** --- 64,70 ---- */ private Map MonMethods; + /** Call tree of methods in this thread. + */ + private CallTreeData callTree; /** *************** *** 305,312 **** --- 307,331 ---- return (MonThreadMethodData)MonMethods.get(ID); } + + /** Returns tree of method calls in this thread. + * @return Root of call tree for this thread + */ + public CallTreeData getCallTree () { + return callTree; + } + + /** Set tree of method calls in this thread. + * @param root Root of call tree for this thread + */ + public void setCallTree (CallTreeData root) { + callTree = root; + } } /* * $Log$ + * Revision 1.18 2002/03/07 10:35:24 petrul + * callTree field added + * * Revision 1.17 2002/03/04 23:59:53 vachis * removed/delayed allocation, use of Collections.EMPTY_MAP |
From: Marek P. <ma...@us...> - 2002-03-07 00:27:24
|
Update of /cvsroot/javaprofiler/library/src/prof In directory usw-pr-cvs1:/tmp/cvs-serv14504/src/prof Modified Files: prof.h Log Message: 'clearFlag' parameter implementation Index: prof.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/prof/prof.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** prof.h 31 Jan 2002 12:31:00 -0000 1.40 --- prof.h 7 Mar 2002 00:27:21 -0000 1.41 *************** *** 878,881 **** --- 878,882 ---- ** @param includeInfo include information about object ** @param optionalArg optional argument (depends on type of data) + ** @param clearFlag clear flag that an object has been changed ** @param seq output sequence ** *************** *** 890,896 **** jint includeInfo, // in (jint) jint optionalArg, // in (jint) seqID& seq) { // out ! return getAllOrChanged( objId, what, includeInfo, optionalArg, seq, 1); } --- 891,898 ---- jint includeInfo, // in (jint) jint optionalArg, // in (jint) + jint clearFlag, // in (jint) seqID& seq) { // out ! return getAllOrChanged( objId, what, includeInfo, optionalArg, clearFlag, seq, 1); } *************** *** 905,908 **** --- 907,911 ---- ** @param includeInfo include information about object ** @param optionalArg optional argument (depends on type of data) + ** @param clearFlag clear flag that an object has been changed ** @param seq output sequence ** *************** *** 917,923 **** jint includeInfo, // in (jint) jint optionalArg, // in (jint) seqID& seq) { // out ! return getAllOrChanged( objId, what, includeInfo, optionalArg, seq, 0); } --- 920,927 ---- jint includeInfo, // in (jint) jint optionalArg, // in (jint) + jint clearFlag, // in (jint) seqID& seq) { // out ! return getAllOrChanged( objId, what, includeInfo, optionalArg, clearFlag, seq, 0); } *************** *** 965,968 **** --- 969,973 ---- jint includeInfo, jint optionalArg, + jint clearFlag, seqID& seq, int all); *************** *** 1007,1010 **** --- 1012,1016 ---- ** @param includeInfo include information about object ** @param optionalArg optional argument (depends on type of object) + ** @param clearFlag clear flag that an object has been changed ** ** @see getDataFromList_filter() */ *************** *** 1016,1020 **** eSeqType st, jint includeInfo, ! jint optionalArg) { T* a = list.first(); --- 1022,1027 ---- eSeqType st, jint includeInfo, ! jint optionalArg, ! jint clearFlag) { T* a = list.first(); *************** *** 1024,1028 **** seq.add( copy( new sID, a, getInfoId( a, st), includeInfo)); ! a->setUnchanged(); } --- 1031,1035 ---- seq.add( copy( new sID, a, getInfoId( a, st), includeInfo)); ! if( clearFlag) a->setUnchanged(); } |
From: Marek P. <ma...@us...> - 2002-03-07 00:27:24
|
Update of /cvsroot/javaprofiler/library/src/commun In directory usw-pr-cvs1:/tmp/cvs-serv14504/src/commun Modified Files: iprof.cpp iprof.h Log Message: 'clearFlag' parameter implementation Index: iprof.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/iprof.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** iprof.cpp 31 Jan 2002 12:30:59 -0000 1.13 --- iprof.cpp 7 Mar 2002 00:27:21 -0000 1.14 *************** *** 242,251 **** jint optionalArg = ntohl( *(const jint*)buf); seqID seq; jint rc; ! if( all) rc = getAll( objId, (eSeqType)what, includeInfo, optionalArg, seq); ! else rc = getChanged( objId, (eSeqType)what, includeInfo, optionalArg, seq); b.clear( seq.length()*sizeof( sID)); --- 242,254 ---- jint optionalArg = ntohl( *(const jint*)buf); + buf += sizeof( optionalArg); + + jint clearFlag = ntohl( *(const jint*)buf); seqID seq; jint rc; ! if( all) rc = getAll( objId, (eSeqType)what, includeInfo, optionalArg, clearFlag, seq); ! else rc = getChanged( objId, (eSeqType)what, includeInfo, optionalArg, clearFlag, seq); b.clear( seq.length()*sizeof( sID)); Index: iprof.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/iprof.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** iprof.h 31 Jan 2002 12:30:59 -0000 1.15 --- iprof.h 7 Mar 2002 00:27:21 -0000 1.16 *************** *** 676,679 **** --- 676,680 ---- jint includeInfo, // in (jint) jint optionalArg, // in (jint) + jint clearFlag, // in (jint) seqID& seq) = 0; // out *************** *** 687,690 **** --- 688,692 ---- jint includeInfo, // in (jint) jint optionalArg, // in (jint) + jint clearFlag, // in (jint) seqID& seq) = 0; // out |
From: Marek P. <ma...@us...> - 2002-03-07 00:27:24
|
Update of /cvsroot/javaprofiler/library/src/commun2 In directory usw-pr-cvs1:/tmp/cvs-serv14504/src/commun2 Modified Files: prof_interface.cpp Log Message: 'clearFlag' parameter implementation Index: prof_interface.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun2/prof_interface.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** prof_interface.cpp 31 Jan 2002 12:31:00 -0000 1.17 --- prof_interface.cpp 7 Mar 2002 00:27:21 -0000 1.18 *************** *** 299,302 **** --- 299,303 ---- jint iI, // in jint oA, // in + jint cF, // in seqID& seq, // out int all) { // in *************** *** 309,314 **** case CLASSES: { ! getDataFromList( classes, seq, all, what, iI, oA); ! break; } --- 310,314 ---- case CLASSES: { ! getDataFromList( classes, seq, all, what, iI, oA, cF); break; } *************** *** 319,323 **** while( c) { ! getDataFromList( c->methods, seq, all, what, iI, oA); c = classes.next( c); --- 319,323 ---- while( c) { ! getDataFromList( c->methods, seq, all, what, iI, oA, cF); c = classes.next( c); *************** *** 335,339 **** while( m) { ! getDataFromList( m->allocTraces, seq, all, what, iI, oA); m = c->methods.next( m); } --- 335,339 ---- while( m) { ! getDataFromList( m->allocTraces, seq, all, what, iI, oA, cF); m = c->methods.next( m); } *************** *** 353,357 **** while( m) { ! getDataFromList( m->cpuTraces, seq, all, what, iI, oA); m = c->methods.next( m); } --- 353,357 ---- while( m) { ! getDataFromList( m->cpuTraces, seq, all, what, iI, oA, cF); m = c->methods.next( m); } *************** *** 371,375 **** while( m) { ! getDataFromList( m->monTraces, seq, all, what, iI, oA); m = c->methods.next( m); } --- 371,375 ---- while( m) { ! getDataFromList( m->monTraces, seq, all, what, iI, oA, cF); m = c->methods.next( m); } *************** *** 383,387 **** case OBJECT_TYPES: { ! getDataFromList( allocObjects, seq, all, what, iI, oA); break; } --- 383,387 ---- case OBJECT_TYPES: { ! getDataFromList( allocObjects, seq, all, what, iI, oA, cF); break; } *************** *** 389,393 **** case THREADS: { ! getDataFromList( threads, seq, all, what, iI, oA); break; } --- 389,393 ---- case THREADS: { ! getDataFromList( threads, seq, all, what, iI, oA, cF); break; } *************** *** 395,399 **** case GROUPS_OF_THREADS: { ! getDataFromList( groupsOfThreads, seq, all, what, iI, oA); break; } --- 395,399 ---- case GROUPS_OF_THREADS: { ! getDataFromList( groupsOfThreads, seq, all, what, iI, oA, cF); break; } *************** *** 401,405 **** case ARENAS: { ! getDataFromList( arenas, seq, all, what, iI, oA); break; } --- 401,405 ---- case ARENAS: { ! getDataFromList( arenas, seq, all, what, iI, oA, cF); break; } *************** *** 407,411 **** case GCS: { ! getDataFromList( gcStat, seq, all, what, iI, oA); break; } --- 407,411 ---- case GCS: { ! getDataFromList( gcStat, seq, all, what, iI, oA, cF); break; } *************** *** 427,433 **** Class* c = static_cast<Class*>( p); ! if( what == CLASS_FIELDS_STATICS) getDataFromList( c->statics, seq, all, what, iI, oA); ! else if( what == CLASS_FIELDS_INSTANCES) getDataFromList( c->instances, seq, all, what, iI, oA); ! else getDataFromList( c->methods, seq, all, what, iI, oA); break; --- 427,433 ---- Class* c = static_cast<Class*>( p); ! if( what == CLASS_FIELDS_STATICS) getDataFromList( c->statics, seq, all, what, iI, oA, cF); ! else if( what == CLASS_FIELDS_INSTANCES) getDataFromList( c->instances, seq, all, what, iI, oA, cF); ! else getDataFromList( c->methods, seq, all, what, iI, oA, cF); break; *************** *** 446,456 **** Method* m = static_cast<Method*>( p); ! if( what == ALLOC_METHOD_OBJECTS) getDataFromList( m->allocObjectMethods, seq, all, what, iI, oA); ! else if( what == ALLOC_METHOD_THREADS) getDataFromList( m->allocThreadMethods, seq, all, what, iI, oA); ! else if( what == ALLOC_METHOD_TRACES) getDataFromList( m->allocTraces, seq, all, what, iI, oA); ! else if( what == CPU_METHOD_THREADS) getDataFromList( m->cpuThreadMethods, seq, all, what, iI, oA); ! else if( what == CPU_METHOD_TRACES) getDataFromList( m->cpuTraces, seq, all, what, iI, oA); ! else if( what == MON_METHOD_THREADS) getDataFromList( m->monThreadMethods, seq, all, what, iI, oA); ! else getDataFromList( m->monTraces, seq, all, what, iI, oA); break; --- 446,456 ---- Method* m = static_cast<Method*>( p); ! if( what == ALLOC_METHOD_OBJECTS) getDataFromList( m->allocObjectMethods, seq, all, what, iI, oA, cF); ! else if( what == ALLOC_METHOD_THREADS) getDataFromList( m->allocThreadMethods, seq, all, what, iI, oA, cF); ! else if( what == ALLOC_METHOD_TRACES) getDataFromList( m->allocTraces, seq, all, what, iI, oA, cF); ! else if( what == CPU_METHOD_THREADS) getDataFromList( m->cpuThreadMethods, seq, all, what, iI, oA, cF); ! else if( what == CPU_METHOD_TRACES) getDataFromList( m->cpuTraces, seq, all, what, iI, oA, cF); ! else if( what == MON_METHOD_THREADS) getDataFromList( m->monThreadMethods, seq, all, what, iI, oA, cF); ! else getDataFromList( m->monTraces, seq, all, what, iI, oA, cF); break; *************** *** 464,469 **** AllocTrace* tr = static_cast<AllocTrace*>( p); ! if( what == ALLOC_TRACE_OBJECTS) getDataFromList( tr->objectTraces, seq, all, what, iI, oA); ! else getDataFromList( tr->threadTraces, seq, all, what, iI, oA); break; --- 464,469 ---- AllocTrace* tr = static_cast<AllocTrace*>( p); ! if( what == ALLOC_TRACE_OBJECTS) getDataFromList( tr->objectTraces, seq, all, what, iI, oA, cF); ! else getDataFromList( tr->threadTraces, seq, all, what, iI, oA, cF); break; *************** *** 477,482 **** AllocObject* o = static_cast<AllocObject*>( p); ! if( what == ALLOC_OBJECT_METHODS) getDataFromList( o->objectMethods, seq, all, what, iI, oA); ! else getDataFromList( o->threadObjects, seq, all, what, iI, oA); break; --- 477,482 ---- AllocObject* o = static_cast<AllocObject*>( p); ! if( what == ALLOC_OBJECT_METHODS) getDataFromList( o->objectMethods, seq, all, what, iI, oA, cF); ! else getDataFromList( o->threadObjects, seq, all, what, iI, oA, cF); break; *************** *** 490,495 **** AllocObjectMethod* om = static_cast<AllocObjectMethod*>( p); ! if( what == ALLOC_OBJECT_METHOD_THREADS) getDataFromList( om->threadObjectMethods, seq, all, what, iI, oA); ! else getDataFromList( om->objectTraces, seq, all, what, iI, oA); break; --- 490,495 ---- AllocObjectMethod* om = static_cast<AllocObjectMethod*>( p); ! if( what == ALLOC_OBJECT_METHOD_THREADS) getDataFromList( om->threadObjectMethods, seq, all, what, iI, oA, cF); ! else getDataFromList( om->objectTraces, seq, all, what, iI, oA, cF); break; *************** *** 501,505 **** AllocObjectTrace* otr = static_cast<AllocObjectTrace*>( p); ! getDataFromList( otr->threadObjectTraces, seq, all, what, iI, oA); break; --- 501,505 ---- AllocObjectTrace* otr = static_cast<AllocObjectTrace*>( p); ! getDataFromList( otr->threadObjectTraces, seq, all, what, iI, oA, cF); break; *************** *** 515,522 **** Thread* th = static_cast<Thread*>( p); ! if( what == ALLOC_THREAD_OBJECTS) getDataFromList( th->allocThreadObjects, seq, all, what, iI, oA); ! else if( what == ALLOC_THREAD_METHODS) getDataFromList( th->allocThreadMethods, seq, all, what, iI, oA); ! else if( what == CPU_THREAD_METHODS) getDataFromList( th->cpuThreadMethods, seq, all, what, iI, oA); ! else getDataFromList( th->monThreadMethods, seq, all, what, iI, oA); break; --- 515,522 ---- Thread* th = static_cast<Thread*>( p); ! if( what == ALLOC_THREAD_OBJECTS) getDataFromList( th->allocThreadObjects, seq, all, what, iI, oA, cF); ! else if( what == ALLOC_THREAD_METHODS) getDataFromList( th->allocThreadMethods, seq, all, what, iI, oA, cF); ! else if( what == CPU_THREAD_METHODS) getDataFromList( th->cpuThreadMethods, seq, all, what, iI, oA, cF); ! else getDataFromList( th->monThreadMethods, seq, all, what, iI, oA, cF); break; *************** *** 528,532 **** AllocThreadObject* to = static_cast<AllocThreadObject*>( p); ! getDataFromList( to->threadObjectMethods, seq, all, what, iI, oA); break; --- 528,532 ---- AllocThreadObject* to = static_cast<AllocThreadObject*>( p); ! getDataFromList( to->threadObjectMethods, seq, all, what, iI, oA, cF); break; *************** *** 538,542 **** AllocThreadObjectMethod* tom = static_cast<AllocThreadObjectMethod*>( p); ! getDataFromList( tom->threadObjectTraces, seq, all, what, iI, oA); break; --- 538,542 ---- AllocThreadObjectMethod* tom = static_cast<AllocThreadObjectMethod*>( p); ! getDataFromList( tom->threadObjectTraces, seq, all, what, iI, oA, cF); break; *************** *** 550,555 **** AllocThreadMethod* tm = static_cast<AllocThreadMethod*>( p); ! if( what == ALLOC_THREAD_METHOD_OBJECTS) getDataFromList( tm->threadObjectMethods, seq, all, what, iI, oA); ! else getDataFromList( tm->threadTraces, seq, all, what, iI, oA); break; --- 550,555 ---- AllocThreadMethod* tm = static_cast<AllocThreadMethod*>( p); ! if( what == ALLOC_THREAD_METHOD_OBJECTS) getDataFromList( tm->threadObjectMethods, seq, all, what, iI, oA, cF); ! else getDataFromList( tm->threadTraces, seq, all, what, iI, oA, cF); break; *************** *** 561,565 **** AllocThreadTrace* ttr = static_cast<AllocThreadTrace*>( p); ! getDataFromList( ttr->threadObjectTraces, seq, all, what, iI, oA); break; --- 561,565 ---- AllocThreadTrace* ttr = static_cast<AllocThreadTrace*>( p); ! getDataFromList( ttr->threadObjectTraces, seq, all, what, iI, oA, cF); break; *************** *** 571,575 **** CpuTrace* tr = static_cast<CpuTrace*>( p); ! getDataFromList( tr->threadTraces, seq, all, what, iI, oA); break; --- 571,575 ---- CpuTrace* tr = static_cast<CpuTrace*>( p); ! getDataFromList( tr->threadTraces, seq, all, what, iI, oA, cF); break; *************** *** 581,585 **** CpuThreadMethod* tm = static_cast<CpuThreadMethod*>( p); ! getDataFromList( tm->threadTraces, seq, all, what, iI, oA); break; --- 581,585 ---- CpuThreadMethod* tm = static_cast<CpuThreadMethod*>( p); ! getDataFromList( tm->threadTraces, seq, all, what, iI, oA, cF); break; *************** *** 591,595 **** MonTrace* tr = static_cast<MonTrace*>( p); ! getDataFromList( tr->threadTraces, seq, all, what, iI, oA); break; --- 591,595 ---- MonTrace* tr = static_cast<MonTrace*>( p); ! getDataFromList( tr->threadTraces, seq, all, what, iI, oA, cF); break; *************** *** 601,605 **** MonThreadMethod* tm = static_cast<MonThreadMethod*>( p); ! getDataFromList( tm->threadTraces, seq, all, what, iI, oA); break; --- 601,605 ---- MonThreadMethod* tm = static_cast<MonThreadMethod*>( p); ! getDataFromList( tm->threadTraces, seq, all, what, iI, oA, cF); break; *************** *** 611,615 **** GroupThread* g = static_cast<GroupThread*>( p); ! getDataFromList( g->threads, seq, all, what, iI, oA); break; --- 611,615 ---- GroupThread* g = static_cast<GroupThread*>( p); ! getDataFromList( g->threads, seq, all, what, iI, oA, cF); break; |
From: Marek P. <ma...@us...> - 2002-03-07 00:27:24
|
Update of /cvsroot/javaprofiler/library In directory usw-pr-cvs1:/tmp/cvs-serv14504 Modified Files: TODO Log Message: 'clearFlag' parameter implementation Index: TODO =================================================================== RCS file: /cvsroot/javaprofiler/library/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** TODO 6 Mar 2002 18:01:53 -0000 1.9 --- TODO 7 Mar 2002 00:27:21 -0000 1.10 *************** *** 1,5 **** - 2002-03-06 - - * modify IProf.getChanged()/getAll() methods - - add new 'flag' parameter - --- 0 ---- |
From: Marek P. <ma...@us...> - 2002-03-07 00:24:53
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv13649/net/sourceforge/javaprofiler/jpiimpl/commun Modified Files: IProf.java Log Message: new 'clearFlag' parameter added to IProf.getAll()/IProf.getChanged() Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** IProf.java 6 Mar 2002 17:59:34 -0000 1.13 --- IProf.java 7 Mar 2002 00:24:49 -0000 1.14 *************** *** 1608,1611 **** --- 1608,1612 ---- ** @param includeInfo include information about object ** @param optionalArg optional argument (depends on type of object) + ** @param clearFlag clear flag that an item has been changed ** ** @return iterator for objects having statistic data (sID objects) *************** *** 1619,1623 **** boolean sameOutputObject, boolean includeInfo, ! int optionalArg) throws COMMUN_Exception, --- 1620,1625 ---- boolean sameOutputObject, boolean includeInfo, ! int optionalArg, ! boolean clearFlag) throws COMMUN_Exception, *************** *** 1635,1638 **** --- 1637,1643 ---- _buf.putInt( optionalArg); + + if( clearFlag) _buf.putInt( 1); + else _buf.putInt( 0); _commun.write( _buf); *************** *** 1667,1670 **** --- 1672,1676 ---- ** @param includeInfo include information about object ** @param optionalArg optional argument (depends on type of object) + ** @param clearFlag clear flag that an item has been changed ** ** @return linked list of sID objects *************** *** 1676,1680 **** int seqType, boolean includeInfo, ! int optionalArg) throws COMMUN_Exception, --- 1682,1687 ---- int seqType, boolean includeInfo, ! int optionalArg, ! boolean clearFlag) throws COMMUN_Exception, *************** *** 1683,1689 **** UNKNOWN_Exception { ! Iterator iterator = getChangedOrAllThruIterator( ! funcType, objId, seqType, false, ! includeInfo, optionalArg); LinkedList list = new LinkedList(); --- 1690,1697 ---- UNKNOWN_Exception { ! Iterator iterator = ! getChangedOrAllThruIterator( ! funcType, objId, seqType, false, ! includeInfo, optionalArg, clearFlag); LinkedList list = new LinkedList(); *************** *** 1724,1729 **** ** @param includeInfo include information about object ** @param optionalArg optional argument (depends on type of object) ** ! ** @return linked list of sID objects ** ** @see getInfo(), getData(), getAll(), getChanged(), --- 1732,1738 ---- ** @param includeInfo include information about object ** @param optionalArg optional argument (depends on type of object) + ** @param clearFlag clear flag that an item has been changed ** ! ** @return linked list of #sID objects ** ** @see getInfo(), getData(), getAll(), getChanged(), *************** *** 1734,1737 **** --- 1743,1766 ---- int seqType, boolean includeInfo, + int optionalArg, + boolean clearFlag) + + throws COMMUN_Exception, + BAD_OBJ_ID_Exception, + BAD_COMMAND_Exception, + UNKNOWN_Exception { + + return getChangedOrAll( F_GET_ALL, objId, seqType, + includeInfo, optionalArg, clearFlag); + } + + /** Get all objects with all statistic data. + ** + ** @see getAll(), getChanged(), getChangedOrAll(), + ** getAllThruIterator(), getChangedThruIterator() */ + + public synchronized LinkedList getAll( int objId, + int seqType, + boolean includeInfo, int optionalArg) *************** *** 1742,1746 **** return getChangedOrAll( F_GET_ALL, objId, seqType, ! includeInfo, optionalArg); } --- 1771,1793 ---- return getChangedOrAll( F_GET_ALL, objId, seqType, ! includeInfo, optionalArg, true); ! } ! ! /** Get all objects with all statistic data. ! ** ! ** @see getAll(), getChanged(), getChangedOrAll(), ! ** getAllThruIterator(), getChangedThruIterator() */ ! ! public synchronized LinkedList getAll( int objId, ! int seqType, ! boolean clearFlag) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAll( F_GET_ALL, objId, seqType, ! false, NO_OPTIONAL_ARG, clearFlag); } *************** *** 1758,1762 **** return getChangedOrAll( F_GET_ALL, objId, seqType, ! false, NO_OPTIONAL_ARG); } --- 1805,1832 ---- return getChangedOrAll( F_GET_ALL, objId, seqType, ! false, NO_OPTIONAL_ARG, true); ! } ! ! /** Get all objects with all statistic data. ! ** ! ** @see getAllThruIterator(), getChangedThruIterator(), ! ** getChangedOrAllThruIterator(), getAll(), getChanged() */ ! ! public synchronized ! Iterator getAllThruIterator( int objId, ! int seqType, ! boolean sameOutputObject, ! boolean includeInfo, ! int optionalArg, ! boolean clearFlag) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAllThruIterator( F_GET_ALL, objId, ! seqType, sameOutputObject, includeInfo, ! optionalArg, clearFlag); } *************** *** 1775,1784 **** throws COMMUN_Exception, BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_ALL, objId, seqType, ! sameOutputObject, includeInfo, ! optionalArg); } --- 1845,1875 ---- throws COMMUN_Exception, BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_ALL, objId, ! seqType, sameOutputObject, includeInfo, ! optionalArg, true); ! } ! ! /** Get all objects with all statistic data. ! ** ! ** @see getAllThruIterator(), getChangedThruIterator(), ! ** getChangedOrAllThruIterator(), getAll(), getChanged() */ ! ! public synchronized ! Iterator getAllThruIterator( int objId, ! int seqType, ! boolean sameOutputObject, ! boolean clearFlag) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAllThruIterator( F_GET_ALL, objId, ! seqType, sameOutputObject, false, ! NO_OPTIONAL_ARG, clearFlag); } *************** *** 1798,1804 **** UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_ALL, objId, seqType, ! sameOutputObject, false, ! NO_OPTIONAL_ARG); } --- 1889,1895 ---- UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_ALL, objId, ! seqType, sameOutputObject, false, ! NO_OPTIONAL_ARG, true); } *************** *** 1826,1833 **** ** #MON_THREAD_METHOD_TRACES. ** ! ** @param objId identifier of object having a data ! ** @param seqType specified action ** ! ** @return linked list of sID objects ** ** @see getInfo(), getData(), getAll(), getChanged(), --- 1917,1927 ---- ** #MON_THREAD_METHOD_TRACES. ** ! ** @param objId identifier of object having a data ! ** @param seqType specified action ! ** @param includeInfo include information about object ! ** @param optionalArg optional argument (depends on type of object) ! ** @param clearFlag clear flag that an item has been changed ** ! ** @return linked list of #sID objects ** ** @see getInfo(), getData(), getAll(), getChanged(), *************** *** 1838,1841 **** --- 1932,1955 ---- int seqType, boolean includeInfo, + int optionalArg, + boolean clearFlag) + + throws COMMUN_Exception, + BAD_OBJ_ID_Exception, + BAD_COMMAND_Exception, + UNKNOWN_Exception { + + return getChangedOrAll( F_GET_CHANGED, objId, seqType, + includeInfo, optionalArg, clearFlag); + } + + /** Get all objects with changed statistic data. + ** + ** @see getChanged(), getAll(), getChangedOrAll(), + ** getChangedThruIterator(), getAllThruIterator() */ + + public synchronized LinkedList getChanged( int objId, + int seqType, + boolean includeInfo, int optionalArg) *************** *** 1846,1850 **** return getChangedOrAll( F_GET_CHANGED, objId, seqType, ! includeInfo, optionalArg); } --- 1960,1982 ---- return getChangedOrAll( F_GET_CHANGED, objId, seqType, ! includeInfo, optionalArg, true); ! } ! ! /** Get all objects with changed statistic data. ! ** ! ** @see getChanged(), getAll(), getChangedOrAll(), ! ** getChangedThruIterator(), getAllThruIterator() */ ! ! public synchronized LinkedList getChanged( int objId, ! int seqType, ! boolean clearFlag) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAll( F_GET_CHANGED, objId, seqType, ! false, NO_OPTIONAL_ARG, clearFlag); } *************** *** 1862,1866 **** return getChangedOrAll( F_GET_CHANGED, objId, seqType, ! false, NO_OPTIONAL_ARG); } --- 1994,2021 ---- return getChangedOrAll( F_GET_CHANGED, objId, seqType, ! false, NO_OPTIONAL_ARG, true); ! } ! ! /** Get all objects with changed statistic data. ! ** ! ** @see getChangedThruIterator(), getAllThruIterator(), ! ** getChangedOrAllThruIterator(), getChanged(), getAll() */ ! ! public synchronized ! Iterator getChangedThruIterator( int objId, ! int seqType, ! boolean sameOutputObject, ! boolean includeInfo, ! int optionalArg, ! boolean clearFlag) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAllThruIterator( F_GET_CHANGED, objId, ! seqType, sameOutputObject, includeInfo, ! optionalArg, clearFlag); } *************** *** 1882,1888 **** UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_CHANGED, objId, seqType, ! sameOutputObject, includeInfo, ! optionalArg); } --- 2037,2064 ---- UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_CHANGED, objId, ! seqType, sameOutputObject, includeInfo, ! optionalArg, true); ! } ! ! /** Get all objects with changed statistic data. ! ** ! ** @see getChangedThruIterator(), getAllThruIterator(), ! ** getChangedOrAllThruIterator(), getChanged(), getAll() */ ! ! public synchronized ! Iterator getChangedThruIterator( int objId, ! int seqType, ! boolean sameOutputObject, ! boolean clearFlag) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAllThruIterator( F_GET_CHANGED, objId, ! seqType, sameOutputObject, false, ! NO_OPTIONAL_ARG, clearFlag); } *************** *** 1902,1908 **** UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_CHANGED, objId, seqType, ! sameOutputObject, false, ! NO_OPTIONAL_ARG); } --- 2078,2084 ---- UNKNOWN_Exception { ! return getChangedOrAllThruIterator( F_GET_CHANGED, objId, ! seqType, sameOutputObject, false, ! NO_OPTIONAL_ARG, true); } *************** *** 2184,2194 **** UNKNOWN_Exception { ! try { ! ! if( !getCallTreeAll( threadObjId)) return null; ! } ! catch( COMMUN_Exception e) { throw e;} ! catch( BAD_OBJ_ID_Exception e) { throw e;} ! catch( UNKNOWN_Exception e) { throw e;} int pos = 4; --- 2360,2364 ---- UNKNOWN_Exception { ! if( !getCallTreeAll( threadObjId)) return null; int pos = 4; *************** *** 2354,2364 **** UNKNOWN_Exception { - try { ! if( !getCallTreeAll( threadObjId)) return null; ! } ! catch( COMMUN_Exception e) { throw e;} ! catch( BAD_OBJ_ID_Exception e) { throw e;} ! catch( UNKNOWN_Exception e) { throw e;} Iterator iterator = --- 2524,2529 ---- UNKNOWN_Exception { ! if( !getCallTreeAll( threadObjId)) return null; Iterator iterator = |
From: Marek P. <ma...@us...> - 2002-03-06 22:03:23
|
Update of /cvsroot/javaprofiler/library/demo/07 In directory usw-pr-cvs1:/tmp/cvs-serv25203/demo/07 Added Files: Makefile Makefile.mak Makefile.rules README Test.java dir.info Log Message: examples --- NEW FILE: Makefile --- include ../../config.mk include Makefile.rules --- NEW FILE: Makefile.mak --- !include ../../config.mk !include Makefile.rules --- NEW FILE: Makefile.rules --- Test.o \ Test.obj: $(JAVAC) $(JAVACFLAGS) Test.java --- NEW FILE: README --- This example show how to gain a calltree from the library using the getCallTreeThruIterator() method. --- NEW FILE: Test.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ import java.lang.*; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; public class Test { // communication interface private IProf iprof = null; public void runTest() { // initialize and start communication // we use socket communication where Java module will // stay for a server (so dynamic library must stay for a client) iprof = new IProf(); iprof.run(); try { // first of all, we need a thread ID Iterator iterator = iprof.getAllThruIterator( 0, IProf.THREADS, true); while( iterator.hasNext()) { IProf.sID sid = (IProf.sID)iterator.next(); // ask for more info IProf.sThreadInfo sti = (IProf.sThreadInfo)iprof.getInfo( sid.infoId, IProf.THREAD_INFO); System.out.println( "thread: " +sti.threadName); System.out.println( "info ID: " + sid.infoId); System.out.println( "object ID: " + sid.objId); // now, ask for calltree iterator of this thread Iterator ct_iterator = iprof.getCallTreeThruIterator( sid.objId, true); if( ct_iterator == null) System.out.println( "calltree is empty !"); else { int numOfItems = 0; // count number of items in calltree while( ct_iterator.hasNext()) { numOfItems++; ct_iterator.next(); } System.out.println( "okay, #items = " + numOfItems); } System.out.println(); } // now, i don't want anything else, // so I shutdown profiled JVM definitely iprof.shutdown(); } catch( Exception e) { System.err.println( "an error occurred, exception:"); System.err.println( e.getClass().getName()); } // communication must be stopped even if an error occurred ! iprof.stop(); iprof = null; } public static void main( String[] arg) { // let's run the test (new Test()).runTest(); } }; --- NEW FILE: dir.info --- FILES = Test CLEAN_FILES = *.class |
From: Marek P. <ma...@us...> - 2002-03-06 22:03:23
|
Update of /cvsroot/javaprofiler/library/demo/06 In directory usw-pr-cvs1:/tmp/cvs-serv25203/demo/06 Modified Files: README Test.java Log Message: examples Index: README =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** README 4 Mar 2002 23:57:08 -0000 1.2 --- README 6 Mar 2002 22:03:20 -0000 1.3 *************** *** 1,2 **** ! This example show how to gain a calltree from the library ! using the getCallTreeThruIterator() method. --- 1 ---- ! This example show how to gain a calltree from the library. Index: Test.java =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/Test.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Test.java 4 Mar 2002 23:57:08 -0000 1.3 --- Test.java 6 Mar 2002 22:03:20 -0000 1.4 *************** *** 70,93 **** System.out.println( "object ID: " + sid.objId); ! // now, ask for calltree iterator of this thread ! Iterator ct_iterator = ! iprof.getCallTreeThruIterator( sid.objId, true); ! if( ct_iterator == null) System.out.println( "calltree is empty !"); ! else { ! ! int numOfItems = 0; ! ! // count number of items in calltree ! while( ct_iterator.hasNext()) { ! ! numOfItems++; ! ct_iterator.next(); ! } ! ! System.out.println( "okay, #items = " ! + numOfItems); ! } System.out.println(); --- 70,82 ---- System.out.println( "object ID: " + sid.objId); ! // now, ask for calltree of this thread ! IProf.sCallTree ct = ! iprof.getCallTree( sid.objId); ! if( ct == null) System.out.println( "calltree is empty !"); ! else ! System.out.println( "okay, #items = " ! + ct.numOfItems); System.out.println(); |
From: Marek P. <ma...@us...> - 2002-03-06 22:02:16
|
Update of /cvsroot/javaprofiler/library/demo/07 In directory usw-pr-cvs1:/tmp/cvs-serv24835/demo/07 Log Message: Directory /cvsroot/javaprofiler/library/demo/07 added to the repository |
From: Marek P. <ma...@us...> - 2002-03-06 18:01:56
|
Update of /cvsroot/javaprofiler/library In directory usw-pr-cvs1:/tmp/cvs-serv7544 Modified Files: TODO Log Message: changes Index: TODO =================================================================== RCS file: /cvsroot/javaprofiler/library/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** TODO 4 Mar 2002 23:57:08 -0000 1.8 --- TODO 6 Mar 2002 18:01:53 -0000 1.9 *************** *** 1,6 **** ! 2002-03-05 - * improve communication - - decrease buffer wasting in Java IProf * modify IProf.getChanged()/getAll() methods - add new 'flag' parameter --- 1,4 ---- ! 2002-03-06 * modify IProf.getChanged()/getAll() methods - add new 'flag' parameter |
From: Marek P. <ma...@us...> - 2002-03-06 18:00:42
|
Update of /cvsroot/javaprofiler/library/src/commun In directory usw-pr-cvs1:/tmp/cvs-serv7084/src/commun Modified Files: buffer.cpp buffer.h communSocket.cpp Log Message: communication improvements Index: buffer.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/buffer.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** buffer.cpp 21 Nov 2001 22:31:42 -0000 1.5 --- buffer.cpp 6 Mar 2002 18:00:38 -0000 1.6 *************** *** 132,133 **** --- 132,146 ---- _buf = new char[_bufSize]; } + + void Buffer::useBuffer( char* buf, jint size) { + + if( _buf != buf) { + + if( _buf) delete[] _buf; + + _buf = buf; + _bufSize = size; + } + + _size = size; + } Index: buffer.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/buffer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** buffer.h 2 Mar 2002 15:48:44 -0000 1.6 --- buffer.h 6 Mar 2002 18:00:38 -0000 1.7 *************** *** 117,120 **** --- 117,128 ---- jint getSize() const { return _size;} + /** Get size of buffer. This method returns size of whole + ** buffer, so a number which can be greater or equal to + ** size of data. + ** + ** @return size of buffer */ + + jint getBufSize() const { return _bufSize;} + /** Clear buffer. It truncates buffer to zero length, ** everything stored in the buffer will be lost. */ *************** *** 164,167 **** --- 172,186 ---- void operator=( const Buffer& b); + + /** Use external buffer. This method replaces internal + ** buffer by external one. We use it when we have + ** preallocated array of known size and we want to use + ** it as Buffer object (that's better than use copy + ** constructor for that because it is much faster). + ** + ** @param buf pointer to external buffer + ** @param size size of external buffer */ + + void useBuffer( char* buf, jint size); private: Index: communSocket.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/communSocket.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** communSocket.cpp 26 Jan 2002 22:50:27 -0000 1.12 --- communSocket.cpp 6 Mar 2002 18:00:38 -0000 1.13 *************** *** 205,209 **** if( size) { ! char* buf = new char[size]; rc = recv( _csock, buf, size, 0); --- 205,214 ---- if( size) { ! int bb = (size <= b.getBufSize()); ! ! char* buf; ! ! if( bb) buf = const_cast<char*>( b.getBuffer()); ! else buf = new char[size]; rc = recv( _csock, buf, size, 0); *************** *** 215,221 **** #endif ! if( !_failed) b = Buffer( buf, size); ! ! delete[] buf; } else b.clear(); --- 220,225 ---- #endif ! if( !_failed) b.useBuffer( buf, size); ! else if( !bb) delete[] buf; } else b.clear(); |
From: Marek P. <ma...@us...> - 2002-03-06 18:00:41
|
Update of /cvsroot/javaprofiler/library/src/commun3 In directory usw-pr-cvs1:/tmp/cvs-serv7084/src/commun3 Modified Files: communShMem.cpp Log Message: communication improvements Index: communShMem.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun3/communShMem.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** communShMem.cpp 26 Jan 2002 22:50:27 -0000 1.8 --- communShMem.cpp 6 Mar 2002 18:00:38 -0000 1.9 *************** *** 66,70 **** jint num = size/shmemSize; ! char* buf = new char[size]; char* q = buf; --- 66,76 ---- jint num = size/shmemSize; ! int bb = (size <= b.getBufSize()); ! ! char* buf; ! ! if( bb) buf = const_cast<char*>( b.getBuffer()); ! else buf = new char[size]; ! char* q = buf; *************** *** 92,97 **** } ! if( !_failed) b = Buffer( buf, size); ! delete[] buf; } else b.clear(); --- 98,103 ---- } ! if( !_failed) b.useBuffer( buf, size); ! else if( !bb) delete[] buf; } else b.clear(); |
From: Marek P. <ma...@us...> - 2002-03-06 17:59:39
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv6696/net/sourceforge/javaprofiler/jpiimpl/commun Modified Files: Buffer.java CommunSocket.java IProf.java Log Message: communication improvements Index: Buffer.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/Buffer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Buffer.java 21 Nov 2001 22:05:55 -0000 1.2 --- Buffer.java 6 Mar 2002 17:59:34 -0000 1.3 *************** *** 50,61 **** private byte[] _buf; ! /// size of buffer private int _size; /// Default constructor. public Buffer() { ! _size = 0; ! _buf = null; } --- 50,68 ---- private byte[] _buf; ! /// size of data in buffer private int _size; + /// size of whole buffer + private int _bufSize; + + /// number of bytes to allocate in one + private static final int RESERVED = 50; + /// Default constructor. public Buffer() { ! _size = 0; ! _bufSize = 0; ! _buf = null; } *************** *** 69,74 **** public Buffer( byte[] buf, int size) { ! _size = size; ! _buf = new byte[_size]; copyBuffer( _buf, buf, _size); --- 76,82 ---- public Buffer( byte[] buf, int size) { ! _size = size; ! _bufSize = size; ! _buf = new byte[_size]; copyBuffer( _buf, buf, _size); *************** *** 84,89 **** public Buffer useBuffer( byte[] buf, int size) { _size = size; - _buf = buf; return this; --- 92,102 ---- public Buffer useBuffer( byte[] buf, int size) { + if( _buf != buf) { + + _buf = buf; + _bufSize = size; + } + _size = size; return this; *************** *** 104,115 **** public int getSize() { return _size;} /** Clear buffer. It truncates buffer to zero length, ** everything stored in the buffer will be lost. */ ! public void clear() { ! ! _size = 0; ! _buf = null; ! } /** Put integer into buffer. By this method you can insert Java --- 117,132 ---- public int getSize() { return _size;} + /** Get size of buffer. This method returns + ** size of whole buffer, so a number which can be + ** greater or equal to size of data stored in buffer. + ** + ** @return size of whole buffer */ + + public int getBufSize() { return _bufSize;} + /** Clear buffer. It truncates buffer to zero length, ** everything stored in the buffer will be lost. */ ! public void clear() { _size = 0;} /** Put integer into buffer. By this method you can insert Java *************** *** 124,129 **** public Buffer putInt( int c) { ! _buf = copyBuffer( new byte[_size+4], _buf, _size); ! _size = _size+4; for( int i = 0; i < 4; i++) { --- 141,151 ---- public Buffer putInt( int c) { ! if( _size+4 > _bufSize) { ! ! _buf = copyBuffer( new byte[_bufSize+RESERVED], _buf, _size); ! _bufSize += RESERVED; ! } ! ! _size += 4; for( int i = 0; i < 4; i++) { Index: CommunSocket.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/CommunSocket.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** CommunSocket.java 27 Jan 2002 22:56:11 -0000 1.3 --- CommunSocket.java 6 Mar 2002 17:59:34 -0000 1.4 *************** *** 153,157 **** } ! byte[] nbuf = new byte[size]; int pos = 0; --- 153,161 ---- } ! byte[] nbuf; ! ! if( size <= b.getBufSize()) nbuf = b.getBuffer(); ! else nbuf = new byte[size]; ! int pos = 0; Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** IProf.java 4 Mar 2002 23:58:04 -0000 1.12 --- IProf.java 6 Mar 2002 17:59:34 -0000 1.13 *************** *** 244,248 **** throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended) --- 244,248 ---- throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended) *************** *** 272,276 **** throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( !_threadsSuspended) --- 272,276 ---- throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( !_threadsSuspended) *************** *** 301,305 **** throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended || _gcDisabled == 0) --- 301,305 ---- throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended || _gcDisabled == 0) *************** *** 327,331 **** throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended) --- 327,331 ---- throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended) *************** *** 353,357 **** throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended || _gcDisabled > 0) --- 353,357 ---- throws COMMUN_Exception, ! UNAVAILABLE_Exception { if( _threadsSuspended || _gcDisabled > 0) *************** *** 1412,1416 **** /// constant for no optional argument in call to getAll()/getChanged() public static final int NO_OPTIONAL_ARG = 0; ! /** Iterator thru statistic data. This class implements ** an iterator which can be used to iterate thru --- 1412,1416 ---- /// constant for no optional argument in call to getAll()/getChanged() public static final int NO_OPTIONAL_ARG = 0; ! /** Iterator thru statistic data. This class implements ** an iterator which can be used to iterate thru *************** *** 1463,1466 **** --- 1463,1468 ---- _pos = 4; _numItems = _dataBuf.getInt( 0); + + if( !hasNext()) releaseBuffer(); } *************** *** 1550,1553 **** --- 1552,1557 ---- } + if( !hasNext()) releaseBuffer(); + return _stat; } *************** *** 1574,1577 **** --- 1578,1594 ---- throw new UnsupportedOperationException(); } + + /** Release internal iterator's buffer. It releases buffer. */ + + private void releaseBuffer() { + + if( _dataBuf.getBufSize() > _buf.getBufSize()) { + + _buf = _dataBuf; + _buf.clear(); + } + + _dataBuf = null; + } }; *************** *** 1672,1679 **** LinkedList list = new LinkedList(); ! while( iterator.hasNext()) { ! ! list.addLast( iterator.next()); ! } return list; --- 1689,1693 ---- LinkedList list = new LinkedList(); ! while( iterator.hasNext()) list.addLast( iterator.next()); return list; *************** *** 2134,2138 **** _buf.putInt( F_GET_CALLTREE); _buf.putInt( threadObjId); ! _commun.write( _buf); if( _commun.hasFailed()) throw new COMMUN_Exception(); --- 2148,2152 ---- _buf.putInt( F_GET_CALLTREE); _buf.putInt( threadObjId); ! _commun.write( _buf); if( _commun.hasFailed()) throw new COMMUN_Exception(); *************** *** 2216,2220 **** if( parent == null) break; - } --- 2230,2233 ---- *************** *** 2234,2238 **** /// internal buffer with binary data ! private Buffer _dataBuf; /** indication whether still use same object --- 2247,2251 ---- /// internal buffer with binary data ! private Buffer _dataBuf = null; /** indication whether still use same object *************** *** 2245,2249 **** /// output item (one item of the calltree) ! private sCallTree _item; /// internal buffer size --- 2258,2262 ---- /// output item (one item of the calltree) ! private sCallTree _item = null; /// internal buffer size *************** *** 2261,2264 **** --- 2274,2279 ---- _bufSize = _dataBuf.getSize(); + + if( !hasNext()) releaseBuffer(); } *************** *** 2290,2293 **** --- 2305,2310 ---- _pos = getCallTreeItem( _dataBuf, _pos, _item); + if( !hasNext()) releaseBuffer(); + return _item; } *************** *** 2300,2303 **** --- 2317,2333 ---- throw new UnsupportedOperationException(); } + + /** Release internal iterator's buffer. It releases buffer. */ + + private void releaseBuffer() { + + if( _dataBuf.getBufSize() > _buf.getBufSize()) { + + _buf = _dataBuf; + _buf.clear(); + } + + _dataBuf = null; + } }; *************** *** 2330,2334 **** catch( COMMUN_Exception e) { throw e;} catch( BAD_OBJ_ID_Exception e) { throw e;} ! catch( UNKNOWN_Exception e) { throw e;} Iterator iterator = --- 2360,2364 ---- catch( COMMUN_Exception e) { throw e;} catch( BAD_OBJ_ID_Exception e) { throw e;} ! catch( UNKNOWN_Exception e) { throw e;} Iterator iterator = |
From: Pavel V. <va...@us...> - 2002-03-06 17:47:56
|
Update of /cvsroot/javaprofiler/test/snapshot In directory usw-pr-cvs1:/tmp/cvs-serv2970 Modified Files: TestSnap.java PrintSnap.java Log Message: You can choose not to include Types or CPU/Mon/Alloc Threads/Traces Index: TestSnap.java =================================================================== RCS file: /cvsroot/javaprofiler/test/snapshot/TestSnap.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TestSnap.java 4 Mar 2002 00:14:09 -0000 1.3 --- TestSnap.java 6 Mar 2002 17:47:52 -0000 1.4 *************** *** 61,66 **** conf.withArenas = true; conf.withGC = true; ! conf.withTraces = true; ! conf.withThreads = true; //only traces with more hits than this will be extracted conf.CPUTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; --- 61,72 ---- conf.withArenas = true; conf.withGC = true; ! conf.withCPUTraces = true; ! conf.withMonTraces = true; ! conf.withAllocTraces = true; ! conf.withCPUThreads = true; ! conf.withMonThreads = true; ! conf.withAllocThreads = true; ! conf.withTypes = true; ! conf.withCallTree = true; //only traces with more hits than this will be extracted conf.CPUTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; Index: PrintSnap.java =================================================================== RCS file: /cvsroot/javaprofiler/test/snapshot/PrintSnap.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** PrintSnap.java 4 Mar 2002 00:14:09 -0000 1.4 --- PrintSnap.java 6 Mar 2002 17:47:52 -0000 1.5 *************** *** 61,66 **** conf.withArenas = true; conf.withGC = true; ! conf.withTraces = true; ! conf.withThreads = true; //only traces with more hits than this will be extracted conf.CPUTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; --- 61,72 ---- conf.withArenas = true; conf.withGC = true; ! conf.withCPUTraces = true; ! conf.withMonTraces = true; ! conf.withAllocTraces = true; ! conf.withCPUThreads = true; ! conf.withMonThreads = true; ! conf.withAllocThreads = true; ! conf.withTypes = true; ! conf.withCallTree = true; //only traces with more hits than this will be extracted conf.CPUTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; |
From: Pavel V. <va...@us...> - 2002-03-06 17:47:29
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv2846 Modified Files: SnapshotImpl.java Log Message: You can choose not to include Types or CPU/Mon/Alloc Threads/Traces Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** SnapshotImpl.java 4 Mar 2002 00:13:56 -0000 1.13 --- SnapshotImpl.java 6 Mar 2002 17:47:24 -0000 1.14 *************** *** 63,75 **** public boolean withMon = true; /** Whether include even discrimination to traces. */ ! public boolean withTraces = true; /** Whether include discrimination to threads. */ ! public boolean withThreads = true; /** Whether inlucde snapshot of arenas. */ public boolean withArenas = true; /** Whether inlucde snapshot of garbage collector. */ public boolean withGC = true; - /** Whether inlucde call tree */ - public boolean withCallTree = true; /**Only traces with more hits than this will be extracted. Use <code>IProf.NO_OPTIONAL_ARG</code> for extraction of all traces.*/ --- 63,81 ---- public boolean withMon = true; /** Whether include even discrimination to traces. */ ! public boolean withAllocTraces = true; ! public boolean withCPUTraces = true; ! public boolean withMonTraces = true; /** Whether include discrimination to threads. */ ! public boolean withAllocThreads = true; ! public boolean withCPUThreads = true; ! public boolean withMonThreads = true; ! /** Whether inlucde call tree in snapwhot of CPU*/ ! public boolean withCallTree = true; ! /** Whether include types in snapshot of allocations*/ ! public boolean withTypes = true; /** Whether inlucde snapshot of arenas. */ public boolean withArenas = true; /** Whether inlucde snapshot of garbage collector. */ public boolean withGC = true; /**Only traces with more hits than this will be extracted. Use <code>IProf.NO_OPTIONAL_ARG</code> for extraction of all traces.*/ *************** *** 83,87 **** public Object clone() throws CloneNotSupportedException { ! return super.clone(); } --- 89,93 ---- public Object clone() throws CloneNotSupportedException { ! return super.clone(); //do field by field copy } *************** *** 333,415 **** List actLst = new LinkedList(); //temporary list List actLst2 = new LinkedList(); //temporary list - List actLst3 = new LinkedList(); try { //Add some info like time, data, etc. - if (conf.withCPU || conf.withAlloc || conf.withMon) { ! extract( null, classes, IProf.CLASSES, IProf.NO_OPTIONAL_ARG, iprof ); //get class fields ! extract( classes, null, IProf.CLASS_FIELDS_STATICS, IProf.NO_OPTIONAL_ARG, iprof ); ! extract( classes, null, IProf.CLASS_FIELDS_INSTANCES, IProf.NO_OPTIONAL_ARG, iprof ); //extract( classes, methods, IProf.CLASS_METHODS, IProf.NO_OPTIONAL_ARG, iprof ); extract( null, methods, IProf.METHODS, IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withThreads ) { extract( null, groupThreads, IProf.GROUPS_OF_THREADS, ! IProf.NO_OPTIONAL_ARG, iprof ); //extract( groupThreads, threads, IProf.GROUP_THREADS, // IProf.NO_OPTIONAL_ARG, iprof ); extract( null, threads, IProf.THREADS, ! IProf.NO_OPTIONAL_ARG, iprof ); } } if( conf.withCPU ) { ! if( conf.withTraces ) { //extract( methods, null, IProf.CPU_METHOD_TRACES, // CPUTraces_MinVal, iprof ); extract( null, null, IProf.CPU_TRACES, ! conf.CPUTraces_MinVal, iprof ); } ! if( conf.withThreads ) { ! extract( threads, (conf.withTraces) ? actLst : null, ! IProf.CPU_THREAD_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withTraces ) { extract( actLst, null, IProf.CPU_THREAD_METHOD_TRACES, ! conf.CPUTraces_MinVal, iprof ); } } } ! if( conf.withAlloc ) { ! actLst3.clear(); actLst2.clear(); actLst.clear(); ! extract( null, allocTypes, IProf.OBJECT_TYPES, ! IProf.NO_OPTIONAL_ARG, iprof ); ! extract( allocTypes, (conf.withTraces)? actLst : null, ! IProf.ALLOC_OBJECT_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withTraces ) { //extract( methods, null, IProf.ALLOC_METHOD_TRACES, // AllocTraces_MinVal, iprof ); extract( null, null, IProf.ALLOC_TRACES, ! conf.AllocTraces_MinVal, iprof ); ! extract( actLst, null, IProf.ALLOC_OBJECT_METHOD_TRACES, ! conf.AllocTraces_MinVal, iprof ); } ! if( conf.withThreads ) { actLst.clear(); actLst2.clear(); ! actLst3.clear(); ! extract( threads, null, IProf.ALLOC_THREAD_OBJECTS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! extract( threads, actLst, IProf.ALLOC_THREAD_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withTraces ) { ! extract( actLst, null, IProf.ALLOC_THREAD_METHOD_TRACES, ! conf.AllocTraces_MinVal, iprof ); } ! extract( actLst, (conf.withTraces)? actLst2 : null, ! IProf.ALLOC_THREAD_METHOD_OBJECTS, IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withTraces ) { ! extract( actLst2, null, IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES, ! conf.AllocTraces_MinVal, iprof); } } } if( conf.withMon ) { ! if( conf.withTraces ) { //extract( methods, null, IProf.MON_METHOD_TRACES, // IProf.NO_OPTIONAL_ARG, iprof ); --- 339,441 ---- List actLst = new LinkedList(); //temporary list List actLst2 = new LinkedList(); //temporary list try { + //PENDING //Add some info like time, data, etc. if (conf.withCPU || conf.withAlloc || conf.withMon) { ! extract( null, classes, IProf.CLASSES, ! IProf.NO_OPTIONAL_ARG, iprof ); //get class fields ! extract( classes, null, IProf.CLASS_FIELDS_STATICS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! extract( classes, null, IProf.CLASS_FIELDS_INSTANCES, ! IProf.NO_OPTIONAL_ARG, iprof ); //extract( classes, methods, IProf.CLASS_METHODS, IProf.NO_OPTIONAL_ARG, iprof ); extract( null, methods, IProf.METHODS, IProf.NO_OPTIONAL_ARG, iprof ); ! ! if( conf.withCPUThreads || conf.withMonThreads || conf.withAllocThreads || ! (conf.withCPU && conf.withCallTree) ) { extract( null, groupThreads, IProf.GROUPS_OF_THREADS, ! IProf.NO_OPTIONAL_ARG, iprof ); //extract( groupThreads, threads, IProf.GROUP_THREADS, // IProf.NO_OPTIONAL_ARG, iprof ); extract( null, threads, IProf.THREADS, ! IProf.NO_OPTIONAL_ARG, iprof ); } } + if( conf.withCPU ) { ! if( conf.withCPUTraces ) { //extract( methods, null, IProf.CPU_METHOD_TRACES, // CPUTraces_MinVal, iprof ); extract( null, null, IProf.CPU_TRACES, ! conf.CPUTraces_MinVal, iprof ); } ! if( conf.withCPUThreads ) { ! extract( threads, (conf.withCPUTraces) ? actLst : null, ! IProf.CPU_THREAD_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withCPUTraces ) { extract( actLst, null, IProf.CPU_THREAD_METHOD_TRACES, ! conf.CPUTraces_MinVal, iprof ); } } + //PENDING + //call tree } ! ! if( conf.withAlloc ) { actLst2.clear(); actLst.clear(); ! if ( conf.withTypes ) { ! extract( null, allocTypes, IProf.OBJECT_TYPES, ! IProf.NO_OPTIONAL_ARG, iprof ); ! extract( allocTypes, (conf.withAllocTraces)? actLst : null, ! IProf.ALLOC_OBJECT_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! } ! if( conf.withAllocTraces ) { //extract( methods, null, IProf.ALLOC_METHOD_TRACES, // AllocTraces_MinVal, iprof ); extract( null, null, IProf.ALLOC_TRACES, ! conf.AllocTraces_MinVal, iprof ); ! if ( conf.withTypes ) { ! extract( actLst, null, IProf.ALLOC_OBJECT_METHOD_TRACES, ! conf.AllocTraces_MinVal, iprof ); ! } } ! ! if( conf.withAllocThreads ) { actLst.clear(); actLst2.clear(); ! if ( conf.withTypes ) { ! extract( threads, null, IProf.ALLOC_THREAD_OBJECTS, ! IProf.NO_OPTIONAL_ARG, iprof ); } ! extract( threads, ! (conf.withTypes || conf.withAllocTraces) ? actLst : null, ! IProf.ALLOC_THREAD_METHODS, IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withAllocTraces ) { ! extract( actLst, null, IProf.ALLOC_THREAD_METHOD_TRACES, ! conf.AllocTraces_MinVal, iprof ); ! } ! ! if ( conf.withTypes ) { ! extract( actLst, (conf.withAllocTraces)? actLst2 : null, ! IProf.ALLOC_THREAD_METHOD_OBJECTS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withAllocTraces ) { ! extract( actLst2, null, ! IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES, ! conf.AllocTraces_MinVal, iprof); ! } } } } + if( conf.withMon ) { ! if( conf.withMonTraces ) { //extract( methods, null, IProf.MON_METHOD_TRACES, // IProf.NO_OPTIONAL_ARG, iprof ); *************** *** 417,428 **** IProf.NO_OPTIONAL_ARG, iprof ); } ! if( conf.withThreads ) { actLst.clear(); ! extract( threads, (conf.withTraces) ? actLst : null, ! IProf.MON_THREAD_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withTraces ) { extract( actLst, null, IProf.MON_THREAD_METHOD_TRACES, ! conf.MonTraces_MinVal, iprof ); } } --- 443,454 ---- IProf.NO_OPTIONAL_ARG, iprof ); } ! if( conf.withMonThreads ) { actLst.clear(); ! extract( threads, (conf.withMonTraces) ? actLst : null, ! IProf.MON_THREAD_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); ! if( conf.withMonTraces ) { extract( actLst, null, IProf.MON_THREAD_METHOD_TRACES, ! conf.MonTraces_MinVal, iprof ); } } *************** *** 633,643 **** case IProf.OBJECT_TYPES: { ! //FIXMEE ClassData clz = (ClassData) libIDs.get( new Integer( ((IProf.sObjectInfo) sid.info).classObjId)); - //ClassData clz = null; return new AllocTypeData( sid, clz ); - //have to look at sid.info.isArray, probably in object - //before calling getClazz() } --- 659,666 ---- case IProf.OBJECT_TYPES: { ! //may be null ClassData clz = (ClassData) libIDs.get( new Integer( ((IProf.sObjectInfo) sid.info).classObjId)); return new AllocTypeData( sid, clz ); } *************** *** 1020,1027 **** } }; ! ! ! //toString() ! ////copy debuging printf from library } --- 1043,1047 ---- } }; ! } *************** *** 1029,1034 **** //TODO: // write exception handling code properly ! // solve inconsitences with AllocClassData names, ?expansion from classes ! // serialize, // shloud I read default configuration somewhere? --- 1049,1054 ---- //TODO: // write exception handling code properly ! // ?expansion from classes ! // filters // shloud I read default configuration somewhere? *************** *** 1037,1040 **** --- 1057,1063 ---- /* * $Log$ + * Revision 1.14 2002/03/06 17:47:24 vachis + * You can choose not to include Types or CPU/Mon/Alloc Threads/Traces + * * Revision 1.13 2002/03/04 00:13:56 vachis * configuration class added |
From: Lukas P. <pe...@us...> - 2002-03-05 22:13:35
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv17092/net/sourceforge/javaprofiler/jpiimpl/data Added Files: MutableInteger.java Log Message: class intended for speed-up purpose --- NEW FILE: MutableInteger.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License Version * 1.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is available at http://www.sun.com/ * * The Original Code is the Java Profiler module. * The Initial Developers of the Original Code are Jan Stola, Pavel Vacha, * Michal Pise, Petr Luner, Lukas Petru and Marek Przeczek. * Portions created by Jan Stola are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Pavel Vacha are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Michal Pise are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Petr Luner are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Lukas Petru are Copyright (C) 2000-2001. All Rights Reserved. * Portions created by Marek Przeczek are Copyright (C) 2000-2001. All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.jpiimpl.data; /** This class contains single field whose type is int. Compared to * {@link java.lang.Integer java.lang.Integer}, this class allows changing of * the value. When it has the same value as some Integer instance, this * class' equals() method implementation returns true. * * @author Lukas Petru */ final class MutableInteger extends Number { private int _value; /** Constructs a newly allocated MutableInteger object initialized with * value 0. */ public MutableInteger () { } /** Constructs a newly allocated MutableInteger object that represents the * specified int value. */ public MutableInteger (int value) { _value=value; } /** Constructs a newly allocated MutableInteger object that represents the * int value indicated by the String parameter. * @see java.lang.Integer#parseInt(java.lang.String) Integer.parseInt(java.lang.String) */ public MutableInteger (String s) { _value=Integer.parseInt(s); } /** Set new value. */ public void set (int value) { _value=value; } /** @return a hash code value for this object, equal to the primitive int * value represented by this Integer object. */ public int hashCode() { return _value; } /** Compares this object to the specified object. The result is true if and * only if the argument is not null and is an Integer object or * MutableIntegerthat object that contains the same int value as this * object. */ public boolean equals(Object o) { if (o instanceof Integer || o instanceof MutableInteger) return _value == ((Number)o).intValue(); else return false; } public int intValue () { return _value; } public long longValue () { return _value; } public float floatValue () { return _value; } public double doubleValue () { return _value; } public String toString () { return Integer.toString(_value); } } /* * $Log: MutableInteger.java,v $ * Revision 1.1 2002/03/05 22:13:29 petrul * class intended for speed-up purpose * */ |
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv14898 Modified Files: ThreadData.java MonTraceData.java MonThreadMethodData.java CPUTraceData.java CPUThreadMethodData.java ClassData.java AllocTypeTraceData.java AllocTypeMethodData.java AllocTypeData.java AllocTraceData.java AllocThreadTypeMethodData.java AllocThreadTypeData.java AllocThreadTraceData.java AllocThreadMethodData.java Log Message: removed/delayed allocation, use of Collections.EMPTY_MAP Index: ThreadData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ThreadData.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** ThreadData.java 3 Mar 2002 01:20:09 -0000 1.16 --- ThreadData.java 4 Mar 2002 23:59:53 -0000 1.17 *************** *** 82,90 **** this.parent=parent; //warning probably may be null this.active=active; ! children=new LinkedList(); ! types=new HashMap(); ! allocMethods=new HashMap(); ! CPUMethods=new HashMap(); ! MonMethods=new HashMap(); } --- 82,90 ---- this.parent=parent; //warning probably may be null this.active=active; ! children=Collections.EMPTY_LIST; ! types=Collections.EMPTY_MAP; ! allocMethods=Collections.EMPTY_MAP; ! CPUMethods=Collections.EMPTY_MAP; ! MonMethods=Collections.EMPTY_MAP; } *************** *** 175,178 **** --- 175,180 ---- */ void addChild(ThreadData child) { + if ( children == Collections.EMPTY_LIST ) + children = new LinkedList(); children.add(child); } *************** *** 194,198 **** */ void addType(AllocThreadTypeData allocType) { ! //FIXME: types.put(allocType.getID(), allocType); } --- 196,201 ---- */ void addType(AllocThreadTypeData allocType) { ! if ( types == Collections.EMPTY_MAP ) ! types = new HashMap(); types.put(allocType.getID(), allocType); } *************** *** 225,228 **** --- 228,233 ---- */ void addAllocMethod(AllocThreadMethodData method) { + if ( allocMethods == Collections.EMPTY_MAP ) + allocMethods = new HashMap(); allocMethods.put(method.getMethod().getID(), method); } *************** *** 254,257 **** --- 259,264 ---- */ void addCPUMethod(CPUThreadMethodData method) { + if ( CPUMethods == Collections.EMPTY_MAP ) + CPUMethods = new HashMap(); CPUMethods.put(method.getMethod().getID(), method); } *************** *** 283,286 **** --- 290,295 ---- */ void addMonMethod(MonThreadMethodData method) { + if ( MonMethods == Collections.EMPTY_MAP ) + MonMethods = new HashMap(); MonMethods.put(method.getMethod().getID(), method); } *************** *** 300,303 **** --- 309,315 ---- /* * $Log$ + * Revision 1.17 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.16 2002/03/03 01:20:09 vachis * type of ID changed from int to Integer Index: MonTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonTraceData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** MonTraceData.java 3 Mar 2002 01:20:09 -0000 1.5 --- MonTraceData.java 4 Mar 2002 23:59:53 -0000 1.6 *************** *** 58,62 **** this.method=method; this.frames=frames; ! threads=new HashMap(); } --- 58,62 ---- this.method=method; this.frames=frames; ! threads=Collections.EMPTY_MAP; } *************** *** 108,111 **** --- 108,113 ---- */ void addThread(MonThreadTraceData thread) { + if ( threads == Collections.EMPTY_MAP ) + threads = new HashMap(); threads.put(thread.getThreadMethod().getThread().getID(), thread); } *************** *** 126,129 **** --- 128,134 ---- /* * $Log$ + * Revision 1.6 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.5 2002/03/03 01:20:09 vachis * type of ID changed from int to Integer Index: MonThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonThreadMethodData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** MonThreadMethodData.java 3 Mar 2002 01:20:09 -0000 1.4 --- MonThreadMethodData.java 4 Mar 2002 23:59:53 -0000 1.5 *************** *** 53,57 **** this.thread=thread; this.method=method; ! traces=new HashMap(); } --- 53,57 ---- this.thread=thread; this.method=method; ! traces=Collections.EMPTY_MAP; } *************** *** 103,106 **** --- 103,108 ---- */ void addTrace(MonThreadTraceData trace) { + if ( traces == Collections.EMPTY_MAP ) + traces = new HashMap(); traces.put(trace.getTrace().getID(), trace); } *************** *** 122,125 **** --- 124,130 ---- /* * $Log$ + * Revision 1.5 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.4 2002/03/03 01:20:09 vachis * type of ID changed from int to Integer Index: CPUTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUTraceData.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** CPUTraceData.java 3 Mar 2002 01:20:08 -0000 1.8 --- CPUTraceData.java 4 Mar 2002 23:59:53 -0000 1.9 *************** *** 56,60 **** this.method=method; this.frames=frames; ! threads=new HashMap(); } --- 56,60 ---- this.method=method; this.frames=frames; ! threads=Collections.EMPTY_MAP; } *************** *** 105,108 **** --- 105,110 ---- */ void addThread(CPUThreadTraceData thread) { + if ( threads == Collections.EMPTY_MAP ) + threads = new HashMap(); threads.put(thread.getThreadMethod().getThread().getID(), thread); } *************** *** 123,126 **** --- 125,131 ---- /* * $Log$ + * Revision 1.9 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.8 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: CPUThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUThreadMethodData.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** CPUThreadMethodData.java 3 Mar 2002 01:20:08 -0000 1.7 --- CPUThreadMethodData.java 4 Mar 2002 23:59:53 -0000 1.8 *************** *** 52,56 **** this.thread=thread; this.method=method; ! traces=new HashMap(); } --- 52,56 ---- this.thread=thread; this.method=method; ! traces=Collections.EMPTY_MAP; } *************** *** 102,105 **** --- 102,107 ---- */ void addTrace(CPUThreadTraceData trace) { + if ( traces == Collections.EMPTY_MAP ) + traces = new HashMap(); traces.put( trace.getTrace().getID(), trace); } *************** *** 120,123 **** --- 122,128 ---- /* * $Log$ + * Revision 1.8 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.7 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: ClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ClassData.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ClassData.java 3 Mar 2002 01:20:08 -0000 1.9 --- ClassData.java 4 Mar 2002 23:59:53 -0000 1.10 *************** *** 91,95 **** this.active=active; ! this.methods= new LinkedList(); } --- 91,95 ---- this.active=active; ! this.methods=Collections.EMPTY_LIST; } *************** *** 124,129 **** ((IProf.sClassInfo)sid.info).sourceName, ((IProf.sClassInfo)sid.info).numInterfaces,// 0, ! 0, new LinkedList(), ! 0, new LinkedList(), sid.active); } --- 124,129 ---- ((IProf.sClassInfo)sid.info).sourceName, ((IProf.sClassInfo)sid.info).numInterfaces,// 0, ! 0, Collections.EMPTY_LIST, ! 0, Collections.EMPTY_LIST, sid.active); } *************** *** 146,149 **** --- 146,151 ---- */ void addMethod(MethodData method) { + if ( methods == Collections.EMPTY_LIST ) + methods = new LinkedList(); methods.add( method ); numMethods++; *************** *** 268,271 **** --- 270,276 ---- /* * $Log$ + * Revision 1.10 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.9 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocTypeTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTypeTraceData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AllocTypeTraceData.java 3 Mar 2002 01:20:08 -0000 1.3 --- AllocTypeTraceData.java 4 Mar 2002 23:59:53 -0000 1.4 *************** *** 53,57 **** this.typeMethod=typeMethod; this.trace=trace; ! threads=new HashMap(); } --- 53,57 ---- this.typeMethod=typeMethod; this.trace=trace; ! threads=Collections.EMPTY_MAP; } *************** *** 105,108 **** --- 105,110 ---- */ void addThread(AllocThreadTypeTraceData thread) { + if ( threads == Collections.EMPTY_MAP ) + threads = new HashMap(); threads.put( thread.getThreadTrace().getThreadMethod().getThread().getID(), thread); } *************** *** 125,128 **** --- 127,133 ---- /* * $Log$ + * Revision 1.4 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.3 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocTypeMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTypeMethodData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AllocTypeMethodData.java 3 Mar 2002 01:20:08 -0000 1.3 --- AllocTypeMethodData.java 4 Mar 2002 23:59:53 -0000 1.4 *************** *** 60,65 **** this.type=type; this.method=method; ! traces=new HashMap(); ! threads=new HashMap(); } --- 60,65 ---- this.type=type; this.method=method; ! traces=Collections.EMPTY_MAP; ! threads=Collections.EMPTY_MAP; } *************** *** 113,116 **** --- 113,118 ---- */ void addTrace(AllocTypeTraceData trace) { + if ( traces == Collections.EMPTY_MAP ) + traces = new HashMap(); traces.put(trace.getTrace().getID(), trace); } *************** *** 146,149 **** --- 148,153 ---- */ void addThread(AllocThreadTypeMethodData thread) { + if ( threads == Collections.EMPTY_MAP ) + threads = new HashMap(); threads.put(thread.getThreadType().getThread().getID(), thread); } *************** *** 165,168 **** --- 169,175 ---- /* * $Log$ + * Revision 1.4 2002/03/04 23:59:53 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.3 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocTypeData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTypeData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** AllocTypeData.java 3 Mar 2002 01:20:08 -0000 1.5 --- AllocTypeData.java 4 Mar 2002 23:59:54 -0000 1.6 *************** *** 60,65 **** this.clazz=classData; this.arrayType=arrayType; ! methods=new HashMap(); //??use EMPTY_MAP ! threads= Collections.EMPTY_MAP; } --- 60,65 ---- this.clazz=classData; this.arrayType=arrayType; ! methods=Collections.EMPTY_MAP; ! threads=Collections.EMPTY_MAP; } *************** *** 109,112 **** --- 109,114 ---- */ void addMethod(AllocTypeMethodData method) { + if ( methods == Collections.EMPTY_MAP ) + methods = new HashMap(); methods.put(method.getMethod().getID(), method); } *************** *** 159,162 **** --- 161,167 ---- /* * $Log$ + * Revision 1.6 2002/03/04 23:59:54 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.5 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTraceData.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** AllocTraceData.java 3 Mar 2002 01:20:08 -0000 1.14 --- AllocTraceData.java 4 Mar 2002 23:59:54 -0000 1.15 *************** *** 61,66 **** this.method=method; this.frames=frames; ! types=new HashMap(); ! threads=new HashMap(); } --- 61,66 ---- this.method=method; this.frames=frames; ! types=Collections.EMPTY_MAP; ! threads=Collections.EMPTY_MAP; } *************** *** 113,117 **** */ void addType(AllocTypeTraceData allocType) { ! //FIXMEE: types.put(allocType.getID(), allocType); } --- 113,118 ---- */ void addType(AllocTypeTraceData allocType) { ! if ( types == Collections.EMPTY_MAP ) ! types = new HashMap(); types.put(allocType.getID(), allocType); } *************** *** 144,147 **** --- 145,150 ---- */ void addThread(AllocThreadTraceData thread) { + if ( threads == Collections.EMPTY_MAP ) + threads = new HashMap(); threads.put( thread.getThreadMethod().getThread().getID(), thread); } *************** *** 163,166 **** --- 166,172 ---- /* * $Log$ + * Revision 1.15 2002/03/04 23:59:54 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.14 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocThreadTypeMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadTypeMethodData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AllocThreadTypeMethodData.java 3 Mar 2002 01:20:08 -0000 1.3 --- AllocThreadTypeMethodData.java 4 Mar 2002 23:59:54 -0000 1.4 *************** *** 58,62 **** this.typeMethod=typeMethod; this.threadMethod=threadMethod; ! traces=new HashMap(); } --- 58,62 ---- this.typeMethod=typeMethod; this.threadMethod=threadMethod; ! traces=Collections.EMPTY_MAP; } *************** *** 123,126 **** --- 123,128 ---- */ void addTrace(AllocThreadTypeTraceData trace) { + if ( traces == Collections.EMPTY_MAP ) + traces = new HashMap(); traces.put(trace.getTypeTrace().getTrace().getID(), trace); } *************** *** 143,146 **** --- 145,151 ---- /* * $Log$ + * Revision 1.4 2002/03/04 23:59:54 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.3 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocThreadTypeData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadTypeData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AllocThreadTypeData.java 3 Mar 2002 01:20:08 -0000 1.3 --- AllocThreadTypeData.java 4 Mar 2002 23:59:54 -0000 1.4 *************** *** 51,55 **** this.thread=thread; this.type=type; ! methods=new HashMap(); } --- 51,55 ---- this.thread=thread; this.type=type; ! methods=Collections.EMPTY_MAP; } *************** *** 105,108 **** --- 105,110 ---- */ void addMethod(AllocThreadTypeMethodData method) { + if ( methods == Collections.EMPTY_MAP ) + methods = new HashMap(); methods.put( method.getTypeMethod().getMethod().getID(), method); } *************** *** 125,128 **** --- 127,133 ---- /* * $Log$ + * Revision 1.4 2002/03/04 23:59:54 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.3 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocThreadTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadTraceData.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** AllocThreadTraceData.java 3 Mar 2002 01:20:08 -0000 1.12 --- AllocThreadTraceData.java 4 Mar 2002 23:59:54 -0000 1.13 *************** *** 53,57 **** this.threadMethod=threadMethod; this.trace=trace; ! types=new HashMap(); } --- 53,57 ---- this.threadMethod=threadMethod; this.trace=trace; ! types=Collections.EMPTY_MAP; } *************** *** 106,110 **** */ void addType(AllocThreadTypeTraceData allocType) { ! // FIXME: types.put( allocType.getID(), allocType); } --- 106,111 ---- */ void addType(AllocThreadTypeTraceData allocType) { ! if ( types == Collections.EMPTY_MAP ) ! types = new HashMap(); types.put( allocType.getID(), allocType); } *************** *** 127,130 **** --- 128,134 ---- /* * $Log$ + * Revision 1.13 2002/03/04 23:59:54 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.12 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer Index: AllocThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadMethodData.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** AllocThreadMethodData.java 3 Mar 2002 01:20:08 -0000 1.12 --- AllocThreadMethodData.java 4 Mar 2002 23:59:54 -0000 1.13 *************** *** 57,62 **** this.thread=thread; this.method=method; ! types=new HashMap(); ! traces=new HashMap(); } --- 57,62 ---- this.thread=thread; this.method=method; ! types=Collections.EMPTY_MAP; ! traces=Collections.EMPTY_MAP; } *************** *** 110,114 **** */ void addType(AllocThreadTypeMethodData allocType) { ! //FIXME types.put( allocType.getID(), allocType); } --- 110,115 ---- */ void addType(AllocThreadTypeMethodData allocType) { ! if ( types == Collections.EMPTY_MAP ) ! types = new HashMap(); types.put( allocType.getID(), allocType); } *************** *** 142,145 **** --- 143,148 ---- */ void addTrace(AllocThreadTraceData trace) { + if ( traces == Collections.EMPTY_MAP ) + traces = new HashMap(); traces.put( trace.getTrace().getID(), trace); } *************** *** 160,163 **** --- 163,169 ---- /* * $Log$ + * Revision 1.13 2002/03/04 23:59:54 vachis + * removed/delayed allocation, use of Collections.EMPTY_MAP + * * Revision 1.12 2002/03/03 01:20:08 vachis * type of ID changed from int to Integer |
From: Marek P. <ma...@us...> - 2002-03-04 23:58:07
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv14397/net/sourceforge/javaprofiler/jpiimpl/commun Modified Files: IProf.java Log Message: calltree iterator added Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** IProf.java 28 Feb 2002 11:49:26 -0000 1.11 --- IProf.java 4 Mar 2002 23:58:04 -0000 1.12 *************** *** 1592,1599 **** ** @param optionalArg optional argument (depends on type of object) ** ! ** @return iterator for objects having statistic data ** ** @see getAllThruIterator(), getChangedThruIterator(), ! ** StatDataIterator, getChangedOrAll() */ private Iterator getChangedOrAllThruIterator( int funcType, --- 1592,1599 ---- ** @param optionalArg optional argument (depends on type of object) ** ! ** @return iterator for objects having statistic data (sID objects) ** ** @see getAllThruIterator(), getChangedThruIterator(), ! ** StatDataIterator, getChangedOrAll(), sID */ private Iterator getChangedOrAllThruIterator( int funcType, *************** *** 2071,2075 **** public LinkedList children; ! /// number of children (always zero) public int numOfChildren; --- 2071,2075 ---- public LinkedList children; ! /// number of children (used only for getCallTreeThruIterator()) public int numOfChildren; *************** *** 2114,2131 **** } ! /** Get calltree. This method returns the whole calltree ! ** of methods for given thread. ** ** @param threadObjId thread's object ID ** ! ** @return == null (calltree is empty); ! ** != null (a reference to the root of calltree) */ - public synchronized sCallTree getCallTree( int threadObjId) - throws COMMUN_Exception, BAD_OBJ_ID_Exception, UNKNOWN_Exception { ! _buf.clear(); _buf.putInt( F_GET_CALLTREE); --- 2114,2134 ---- } ! /** Get calltree to binary buffer. This method only reads ! ** the whole calltree to binary buffer. It is used internally ! ** by getCallTree() and getCallTreeThruIterator() methods. ** ** @param threadObjId thread's object ID ** ! ** @return true (calltree is not empty); ! ** false (calltree is empty) ! ** ! ** @see getCallTree(), getCallTreeThruIterator() */ ! ! private boolean getCallTreeAll( int threadObjId) throws COMMUN_Exception, BAD_OBJ_ID_Exception, UNKNOWN_Exception { ! _buf.clear(); _buf.putInt( F_GET_CALLTREE); *************** *** 2134,2155 **** _commun.write( _buf); if( _commun.hasFailed()) throw new COMMUN_Exception(); ! _commun.read( _buf); if( _commun.hasFailed()) throw new COMMUN_Exception(); ! int pos = 0; ! ! int rc = _buf.getInt( pos); ! pos += 4; if( rc != RC_OK) { ! if( rc == RC_BAD_OBJ_ID) throw new BAD_OBJ_ID_Exception(); ! throw new UNKNOWN_Exception(); } ! ! if( _buf.getSize() == 4) return null; sCallTree parent = null; --- 2137,2182 ---- _commun.write( _buf); if( _commun.hasFailed()) throw new COMMUN_Exception(); ! _commun.read( _buf); if( _commun.hasFailed()) throw new COMMUN_Exception(); ! int rc = _buf.getInt( 0); if( rc != RC_OK) { ! if( rc == RC_BAD_OBJ_ID) throw new BAD_OBJ_ID_Exception(); ! throw new UNKNOWN_Exception(); } ! ! return ( _buf.getSize() != 4); ! } ! ! /** Get calltree. This method returns the whole calltree ! ** of methods for given thread. ! ** ! ** @param threadObjId thread's object ID ! ** ! ** @return == null (calltree is empty); ! ** != null (a reference to the root of calltree) ! ** ! ** @see getCallTreeAll(), getCallTreeThruIterator() */ ! ! public synchronized sCallTree getCallTree( int threadObjId) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! UNKNOWN_Exception { ! ! try { ! ! if( !getCallTreeAll( threadObjId)) return null; ! } ! catch( COMMUN_Exception e) { throw e;} ! catch( BAD_OBJ_ID_Exception e) { throw e;} ! catch( UNKNOWN_Exception e) { throw e;} ! ! int pos = 4; sCallTree parent = null; *************** *** 2193,2196 **** --- 2220,2341 ---- return root; + } + + /** CallTree iterator. This class is an implementation + ** of general Iterator interface. It can be used to gain + ** items of calltree one after one another (eg. when + ** we need to build our own calltree and don't want to + ** use IProf's internal one. remove() method is not + ** implemented. + ** + ** @see Iterator, getCallTreeThruIterator() */ + + private class CallTreeIterator implements Iterator { + + /// internal buffer with binary data + private Buffer _dataBuf; + + /** indication whether still use same object + ** as output object or not */ + + private boolean _sameObject; + + /// actual position in the internal buffer + private int _pos = 4; + + /// output item (one item of the calltree) + private sCallTree _item; + + /// internal buffer size + private int _bufSize; + + /** Constructor. It initializes internal member variables. + ** + ** @param buf buffer with binary data + ** @param sameObject whether use same object as an output (all the time) or not */ + + public CallTreeIterator( Buffer buf, boolean sameObject) { + + _dataBuf = buf; + _sameObject = sameObject; + + _bufSize = _dataBuf.getSize(); + } + + /** Has next item. This method returns true if there is an item (next one) + ** in the buffer. It returns false if there is no other item in the buffer. + ** + ** @return true/false + ** + ** @see next() */ + + public boolean hasNext() { + + return (_pos < _bufSize); + } + + /** Next item. This method returns next (or first) item from the buffer. + ** It throws an exception if there is no other item in the buffer. + ** + ** @return a reference to sCallTree output object + ** + ** @see hasNext() */ + + public Object next() throws NoSuchElementException { + + if( !hasNext()) throw new NoSuchElementException(); + + if( !_sameObject || _item == null) _item = new sCallTree(); + + _pos = getCallTreeItem( _dataBuf, _pos, _item); + + return _item; + } + + /** Remove item. This method should remove an item from the list. + ** But it is not implemented and throws an exception everytime. */ + + public void remove() throws UnsupportedOperationException { + + throw new UnsupportedOperationException(); + } + }; + + /** Get calltree item thru iterator. This method returns an Iterator + ** object which can be used for iterating thru items of calltree. + ** This can be used if someone is not comfortable with calltree structure + ** returned by IProf class (by getCallTree() method) and wants to implement + ** its own one. An iterator returns structures of sCallTree type. + ** + ** @param threadObjId thread's object ID + ** @param sameOutputObject store output to same structure everytime + ** + ** @return an iterator of objects of sCallTree class; + ** or null (if calltree is empty) + ** + ** @see getCallTree(), getCallTreeThruIterator(), sCallTree */ + + public synchronized + Iterator getCallTreeThruIterator( int threadObjId, + boolean sameOutputObject) + + throws COMMUN_Exception, + BAD_OBJ_ID_Exception, + UNKNOWN_Exception { + + try { + + if( !getCallTreeAll( threadObjId)) return null; + } + catch( COMMUN_Exception e) { throw e;} + catch( BAD_OBJ_ID_Exception e) { throw e;} + catch( UNKNOWN_Exception e) { throw e;} + + Iterator iterator = + new CallTreeIterator( _buf, sameOutputObject); + + _buf = new Buffer(); + + return iterator; } }; |
From: Marek P. <ma...@us...> - 2002-03-04 23:57:11
|
Update of /cvsroot/javaprofiler/library In directory usw-pr-cvs1:/tmp/cvs-serv14047 Modified Files: TODO Log Message: small changes new example Index: TODO =================================================================== RCS file: /cvsroot/javaprofiler/library/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** TODO 28 Feb 2002 11:03:09 -0000 1.7 --- TODO 4 Mar 2002 23:57:08 -0000 1.8 *************** *** 1 **** ! --- 1,7 ---- ! 2002-03-05 ! ! * improve communication ! - decrease buffer wasting in Java IProf ! * modify IProf.getChanged()/getAll() methods ! - add new 'flag' parameter ! |
From: Marek P. <ma...@us...> - 2002-03-04 23:57:11
|
Update of /cvsroot/javaprofiler/library/demo In directory usw-pr-cvs1:/tmp/cvs-serv14047/demo Modified Files: Makefile.rules dir.info Log Message: small changes new example Index: Makefile.rules =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/Makefile.rules,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Makefile.rules 31 Jan 2002 12:30:59 -0000 1.6 --- Makefile.rules 4 Mar 2002 23:57:08 -0000 1.7 *************** *** 95,96 **** --- 95,112 ---- $(MAKE) $(MFLAGS) 06 clean + 07.dir: + cd 07 + $(MAKE) $(MFLAGS) + cd .. + + 07.dir.2: + $(MAKE) $(MFLAGS) 07 + + 07.clean: + cd 07 + $(MAKE) $(MFLAGS) clean + cd .. + + 07.clean.2: + $(MAKE) $(MFLAGS) 07 clean + Index: dir.info =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/dir.info,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** dir.info 31 Jan 2002 12:30:59 -0000 1.6 --- dir.info 4 Mar 2002 23:57:08 -0000 1.7 *************** *** 1 **** ! DIRS = 01 02 03 04 05 06 --- 1 ---- ! DIRS = 01 02 03 04 05 06 07 |
From: Marek P. <ma...@us...> - 2002-03-04 23:57:11
|
Update of /cvsroot/javaprofiler/library/demo/06 In directory usw-pr-cvs1:/tmp/cvs-serv14047/demo/07 Modified Files: README Test.java Log Message: small changes new example Index: README =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** README 31 Jan 2002 12:31:03 -0000 1.1 --- README 4 Mar 2002 23:57:08 -0000 1.2 *************** *** 1 **** ! This example show how to gain a calltree from the library. --- 1,2 ---- ! This example show how to gain a calltree from the library ! using the getCallTreeThruIterator() method. Index: Test.java =================================================================== RCS file: /cvsroot/javaprofiler/library/demo/06/Test.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Test.java 28 Feb 2002 10:19:50 -0000 1.2 --- Test.java 4 Mar 2002 23:57:08 -0000 1.3 *************** *** 70,82 **** System.out.println( "object ID: " + sid.objId); ! // now, ask for calltree of this thread ! IProf.sCallTree ct = ! iprof.getCallTree( sid.objId); ! if( ct == null) System.out.println( "calltree is empty !"); ! else ! System.out.println( "okay, #items = " ! + ct.numOfItems); System.out.println(); --- 70,93 ---- System.out.println( "object ID: " + sid.objId); ! // now, ask for calltree iterator of this thread ! Iterator ct_iterator = ! iprof.getCallTreeThruIterator( sid.objId, true); ! if( ct_iterator == null) System.out.println( "calltree is empty !"); ! else { ! ! int numOfItems = 0; ! ! // count number of items in calltree ! while( ct_iterator.hasNext()) { ! ! numOfItems++; ! ct_iterator.next(); ! } ! ! System.out.println( "okay, #items = " ! + numOfItems); ! } System.out.println(); |
From: Pavel V. <va...@us...> - 2002-03-04 23:50:10
|
Update of /cvsroot/javaprofiler/test/snapshot In directory usw-pr-cvs1:/tmp/cvs-serv11864 Modified Files: compare.bat Log Message: CutTotals.sed added Index: compare.bat =================================================================== RCS file: /cvsroot/javaprofiler/test/snapshot/compare.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** compare.bat 13 Feb 2002 11:25:51 -0000 1.1 --- compare.bat 4 Mar 2002 23:50:02 -0000 1.2 *************** *** 3,4 **** --- 3,9 ---- diff tmp_a.txt tmp_b.txt > df.txt del tmp_a.txt tmp_b.txt + sed -f CutTotals.sed %1 | sort > tmp_a2.txt + sed -f CutTotals.sed %2 | sort > tmp_b2.txt + diff tmp_a2.txt tmp_b2.txt >> df.txt + del tmp_a2.txt tmp_b2.txt + |