From: Pavel V. <va...@us...> - 2001-12-03 10:38:01
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv31263 Modified Files: SnapshotImpl.java Log Message: chages to getAll() with info Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** SnapshotImpl.java 2001/11/20 22:31:45 1.1 --- SnapshotImpl.java 2001/12/03 10:37:57 1.2 *************** *** 49,69 **** private LinkedList gcs = new LinkedList(); ! //conf ! boolean withTraces = true; ! boolean withThreads = true; boolean withCPU = true; boolean withAlloc = true; boolean withMon = true; ! //boolean withArenas = true; boolean withGC = true; //other boolean haveSnapshot = false; ! ! ! /** Creates new SnapshotImpl */ public SnapshotImpl( IProf iprof ) { ! //PENDING pass configuration makeSnapshot( iprof ); } --- 49,91 ---- private LinkedList gcs = new LinkedList(); ! //default conf boolean withCPU = true; boolean withAlloc = true; boolean withMon = true; ! //boolean withArenas = true; boolean withGC = true; + boolean withTraces = true; + boolean withThreads = true; + //only traces with more hits than this will be extracted + int CPUTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; + //only traces with more allocations than this will be extracted + int AllocTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; + //only traces with more hits than this will be extracted + int MonTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; //other boolean haveSnapshot = false; ! /** Creates new SnapshotImpl */ public SnapshotImpl( IProf iprof ) { ! makeSnapshot( iprof ); ! } ! ! //maybe use soem configuration object ! public SnapshotImpl( IProf iprof, boolean withCPU, boolean withAlloc, ! boolean withMon, boolean withGC, boolean withTraces, ! boolean withThreads, ! int CPUTraces_MinVal, ! int AllocTraces_MinVal, ! int MonTraces_MinVal ) { ! this.withCPU = withCPU; ! this.withAlloc = withAlloc; ! this.withMon = withMon; ! this.withGC = withGC; ! this.withTraces = withTraces; ! this.withThreads = withThreads; ! this.CPUTraces_MinVal = CPUTraces_MinVal; ! this.AllocTraces_MinVal = AllocTraces_MinVal; ! this.MonTraces_MinVal = MonTraces_MinVal; makeSnapshot( iprof ); } *************** *** 83,103 **** //Add some info like time, data, etc. //?? use clear() or different lists ! if (withCPU || withAlloc || withMon) { ! extract( null, classes, IProf.CLASSES, iprof ); ! extract( classes, methods, IProf.CLASS_METHODS, iprof ); if( withThreads ) { ! extract( null, groupThreads, IProf.GROUPS_OF_THREADS, iprof ); ! extract( groupThreads, threads, IProf.GROUP_THREADS, iprof ); } } if( withCPU ) { if( withTraces ) { ! extract( methods, null, IProf.CPU_METHOD_TRACES, iprof ); } if( withThreads ) { extract( threads, (withTraces) ? actLst : null, ! IProf.CPU_THREAD_METHODS, iprof ); if( withTraces ) { ! extract( actLst, null, IProf.CPU_THREAD_METHOD_TRACES, iprof ); } } --- 105,138 ---- //Add some info like time, data, etc. //?? use clear() or different lists ! if (withCPU || withAlloc || withMon) { ! extract( null, classes, IProf.CLASSES, IProf.NO_OPTIONAL_ARG, iprof ); ! //pending 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( 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( withCPU ) { if( withTraces ) { ! //extract( methods, null, IProf.CPU_METHOD_TRACES, ! // CPUTraces_MinVal, iprof ); ! extract( null, null, IProf.CPU_TRACES, ! CPUTraces_MinVal, iprof ); } if( withThreads ) { extract( threads, (withTraces) ? actLst : null, ! IProf.CPU_THREAD_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); if( withTraces ) { ! extract( actLst, null, IProf.CPU_THREAD_METHOD_TRACES, ! CPUTraces_MinVal, iprof ); } } *************** *** 108,117 **** actLst.clear(); //PENDING ! extract( null, actLst3, IProf.OBJECT_TYPES, iprof ); extract( actLst3, (withTraces)? actLst : null, ! IProf.ALLOC_OBJECT_METHODS, iprof ); if( withTraces ) { ! extract( methods, null, IProf.ALLOC_METHOD_TRACES, iprof ); ! extract( actLst, null, IProf.ALLOC_OBJECT_METHOD_TRACES, iprof ); } if( withThreads ) { --- 143,158 ---- actLst.clear(); //PENDING ! extract( null, actLst3, IProf.OBJECT_TYPES, ! IProf.NO_OPTIONAL_ARG, iprof ); extract( actLst3, (withTraces)? actLst : null, ! IProf.ALLOC_OBJECT_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); if( withTraces ) { ! //extract( methods, null, IProf.ALLOC_METHOD_TRACES, ! // AllocTraces_MinVal, iprof ); ! extract( null, null, IProf.ALLOC_TRACES, ! AllocTraces_MinVal, iprof ); ! extract( actLst, null, IProf.ALLOC_OBJECT_METHOD_TRACES, ! AllocTraces_MinVal, iprof ); } if( withThreads ) { *************** *** 119,132 **** actLst2.clear(); actLst3.clear(); ! extract( threads, null, IProf.ALLOC_THREAD_OBJECTS, iprof ); ! extract( threads, actLst, IProf.ALLOC_THREAD_METHODS, iprof ); if( withTraces ) { ! extract( actLst, null, IProf.ALLOC_THREAD_METHOD_TRACES, iprof ); } extract( actLst, (withTraces)? actLst2 : null, ! IProf.ALLOC_THREAD_OBJECT_METHODS, iprof ); if( withTraces ) { extract( actLst2, null, IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES, ! iprof); } } --- 160,177 ---- 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( withTraces ) { ! extract( actLst, null, IProf.ALLOC_THREAD_METHOD_TRACES, ! AllocTraces_MinVal, iprof ); } extract( actLst, (withTraces)? actLst2 : null, ! IProf.ALLOC_THREAD_OBJECT_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); if( withTraces ) { extract( actLst2, null, IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES, ! AllocTraces_MinVal, iprof); } } *************** *** 134,145 **** if( withMon ) { if( withTraces ) { ! extract( methods, null, IProf.MON_METHOD_TRACES, iprof ); } if( withThreads ) { actLst.clear(); extract( threads, (withTraces) ? actLst : null, ! IProf.MON_THREAD_METHODS, iprof ); if( withTraces ) { ! extract( actLst, null, IProf.MON_THREAD_METHOD_TRACES, iprof ); } } --- 179,195 ---- if( withMon ) { if( withTraces ) { ! //extract( methods, null, IProf.MON_METHOD_TRACES, ! // IProf.NO_OPTIONAL_ARG, iprof ); ! extract( null, null, IProf.MON_TRACES, ! IProf.NO_OPTIONAL_ARG, iprof ); } if( withThreads ) { actLst.clear(); extract( threads, (withTraces) ? actLst : null, ! IProf.MON_THREAD_METHODS, ! IProf.NO_OPTIONAL_ARG, iprof ); if( withTraces ) { ! extract( actLst, null, IProf.MON_THREAD_METHOD_TRACES, ! MonTraces_MinVal, iprof ); } } *************** *** 147,154 **** //?//PENDING //if ( withArenas ) { ! // extract( null, arenas, IProf.ARENAS ); //} if ( withGC ) { ! extract( null, gcs, IProf.GCS, iprof ); } } --- 197,204 ---- //?//PENDING //if ( withArenas ) { ! // extract( null, arenas, IProf.NO_OPTIONAL_ARG, IProf.ARENAS ); //} if ( withGC ) { ! extract( null, gcs, IProf.GCS, IProf.NO_OPTIONAL_ARG, iprof ); } } *************** *** 308,313 **** *(data classes will have constructors for Buffer) */ ! private void extract( List in, List out, int whatType, IProf iprof ) ! throws COMMUN_Exception { //trhows boolean pass = false; ListIterator iter, iterInner; --- 358,363 ---- *(data classes will have constructors for Buffer) */ ! private void extract( List in, List out, int whatType, int optArg, IProf iprof ) ! throws COMMUN_Exception { //throws boolean pass = false; ListIterator iter, iterInner; *************** *** 316,320 **** IDObjectData obj, objInner, objOpposite; ! if ( in != null ) { pass = true; iter = null; --- 366,370 ---- IDObjectData obj, objInner, objOpposite; ! if ( in == null ) { pass = true; iter = null; *************** *** 330,334 **** //IProf.sInfo ci = (IProf.sClassInfo)iprof.getInfo( sid.infoId, IProf.CLASS_INFO); if ( iter == null ) { ! listInner = iprof.getAll( 0, whatType ); pass = false; obj = null; --- 380,385 ---- //IProf.sInfo ci = (IProf.sClassInfo)iprof.getInfo( sid.infoId, IProf.CLASS_INFO); if ( iter == null ) { ! listInner = iprof.getAll( 0, whatType, ! IProf.isObjWithInfo( whatType), optArg ); pass = false; obj = null; *************** *** 336,345 **** else{ obj = (IDObjectData) iter.next(); ! listInner = iprof.getAll( obj.getID(), whatType ); } //Prof.sInfo will be in IProf.sId //fill in the former calling, there will be special param iterInner = listInner.listIterator(); while( iterInner.hasNext() ) { sid = (IProf.sID) iterInner.next(); //this could by factory --- 387,402 ---- else{ obj = (IDObjectData) iter.next(); ! listInner = iprof.getAll( obj.getID(), whatType, ! IProf.isObjWithInfo( whatType), optArg ); } //Prof.sInfo will be in IProf.sId //fill in the former calling, there will be special param iterInner = listInner.listIterator(); + //dbg + int i=0; + try { while( iterInner.hasNext() ) { + //dbg + i++; sid = (IProf.sID) iterInner.next(); //this could by factory *************** *** 349,352 **** --- 406,411 ---- out.add( objInner ); } + //dbg + }catch (Exception e) { System.out.print("zz");}; } } *************** *** 367,373 **** System.out.println( "Uknown exception\n" ); } }; ! private static IDObjectData createAndPutIn( int whatType, IProf.sID sid, IDObjectData refObj ) { switch( whatType ) { --- 426,436 ---- System.out.println( "Uknown exception\n" ); } + catch ( Exception e ) { + System.out.println( "Bad objID\n" ); + } + }; ! private IDObjectData createAndPutIn( int whatType, IProf.sID sid, IDObjectData refObj ) { switch( whatType ) { *************** *** 375,600 **** return new ClassData( sid ); } case IProf.OBJECT_TYPES: { ! return new AllocClassData( sid, null ); //sid.info.left } ! // case IProf.THREADS: { //??should I support this? ! // return new ThreadData( sid ); ! // break; ! // } case IProf.GROUPS_OF_THREADS: { return new ThreadGroupData( sid ); } case IProf.ARENAS: { return new AllocArenaData( sid ); } case IProf.GCS: { return new GCData( sid ); } case IProf.GROUP_THREADS: { ! ThreadGroupData rf = (ThreadGroupData) refObj; ! ThreadData newObj = new ThreadData( sid, rf, null ); //?z info ! rf.addThread( newObj ); ! //PENDING connect to object from sid.info return newObj; } // case IProf.CLASS_FIELDS_STATICS: return new ClassData( sid ); // case IProf.CLASS_FIELDS_INSTANCES: return new ClassData( sid ); ! // case IProf.CLASS_METHODS: { //shoul I support this ! // return new MethodData( sid ); ! // break; ! // } case IProf.ALLOC_METHOD_TRACES: { MethodData rf = (MethodData) refObj; AllocTraceData newObj = new AllocTraceData( sid, rf ); rf.addAllocTrace( newObj ); - //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_METHOD_OBJECTS: { ! MethodData rf = (MethodData) refObj; ! AllocClassMethodData newObj = new AllocClassMethodData( sid, null, rf ); //sid.info.up ! rf.addClass( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHODS: { ! AllocClassData rf = (AllocClassData) refObj; ! AllocClassMethodData newObj = new AllocClassMethodData( sid, rf, null ); //sid.info.left ! rf.addMethod( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_TRACE_OBJECTS: { ! AllocTraceData rf = (AllocTraceData) refObj; ! AllocClassTraceData newObj = new AllocClassTraceData( sid, null, rf ); //sid.info.left ! rf.addClass( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHOD_TRACES:{ ! AllocClassMethodData rf = (AllocClassMethodData) refObj; ! AllocClassTraceData newObj = new AllocClassTraceData( sid, rf, null ); //sid.info.left ! rf.addTrace( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_THREADS: { ! AllocClassData rf = (AllocClassData) refObj; ! AllocThreadClassData newObj = new AllocThreadClassData( sid, null, rf ); //sid.info.left] ! rf.addThread( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_OBJECTS: { ! ThreadData rf = (ThreadData) refObj; ! AllocThreadClassData newObj = new AllocThreadClassData( sid, rf, null ); //sid.info.left ! rf.addClass( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHOD_THREADS:{ ! AllocClassMethodData rf =(AllocClassMethodData) refObj; AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( ! sid, null, rf, null ); //sid.info.left ! rf.addThread( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_OBJECT_METHODS:{ ! AllocThreadClassData rf = (AllocThreadClassData) refObj; AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( ! sid, rf, null, null ); //sid.info.left ! rf.addMethod( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_METHOD_OBJECTS:{ ! AllocThreadMethodData rf = (AllocThreadMethodData) refObj; AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( ! sid, null, null, rf ); //sid.info.left ! rf.addClass( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHOD_TRACE_THREADS:{ ! AllocClassTraceData rf = (AllocClassTraceData) refObj; AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( ! sid, rf, null, null ); //sid.info.left ! rf.addThread( newObj ); ! //PENDING connect to object from sid.info return newObj; ! } case IProf.ALLOC_THREAD_METHOD_TRACE_OBJECTS:{ ! AllocThreadTraceData rf = (AllocThreadTraceData) refObj; AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( ! sid, null, null, rf ); //sid.info.left ! rf.addClass( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES:{ ! AllocThreadClassMethodData rf = (AllocThreadClassMethodData) refObj; AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( ! sid, null, rf, null ); //sid.info.left ! rf.addTrace( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_METHODS: { ! ThreadData rf =(ThreadData) refObj; AllocThreadMethodData newObj = new AllocThreadMethodData( ! sid, rf, null ); //sid.info.left ! rf.addAllocMethod( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_METHOD_TRACES:{ ! AllocThreadMethodData rf = (AllocThreadMethodData) refObj; AllocThreadTraceData newObj = new AllocThreadTraceData( ! sid, rf, null ); //sid.info.left ! rf.addTrace( newObj ); ! //PENDING connect to object from sid.info return newObj; } ! case IProf.CPU_METHOD_TRACES: { ! MethodData rf = (MethodData) refObj; ! CPUTraceData newObj = new CPUTraceData( sid, rf ); ! rf.addCPUTrace( newObj ); return newObj; } case IProf.CPU_METHOD_THREADS: { ! MethodData rf = (MethodData) refObj; ! CPUThreadMethodData newObj = new CPUThreadMethodData( sid, null, rf ); //sid.info.left ! rf.addCPUThread( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.CPU_THREAD_METHODS: { ! ThreadData rf = (ThreadData) refObj; ! CPUThreadMethodData newObj = new CPUThreadMethodData( sid, rf, null ); //sid.info.left ! rf.addCPUMethod( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.CPU_METHOD_TRACE_THREADS:{ ! CPUTraceData rf = (CPUTraceData) refObj; ! CPUThreadTraceData newObj = new CPUThreadTraceData( sid, null, rf ); //sid.info.left ! rf.addThread( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.CPU_THREAD_METHOD_TRACES:{ ! CPUThreadMethodData rf = (CPUThreadMethodData) refObj; ! CPUThreadTraceData newObj = new CPUThreadTraceData( sid, rf, null ); //sid.info.left ! rf.addTrace( newObj ); ! //PENDING connect to object from sid.info return newObj; } ! case IProf.MON_METHOD_TRACES: { ! MethodData rf = (MethodData) refObj; ! MonTraceData newObj = new MonTraceData( sid, rf ); ! rf.addMonTrace( newObj ); return newObj; } case IProf.MON_METHOD_THREADS: { ! MethodData rf = (MethodData) refObj; ! MonThreadMethodData newObj = new MonThreadMethodData( sid, null, rf ); //sid.info.left ! rf.addMonThread( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.MON_THREAD_METHODS: { ! ThreadData rf = (ThreadData) refObj; ! MonThreadMethodData newObj = new MonThreadMethodData( sid, rf, null ); //sid.info.left ! rf.addMonMethod( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.MON_METHOD_TRACE_THREADS:{ ! MonTraceData rf = (MonTraceData) refObj; ! MonThreadTraceData newObj = new MonThreadTraceData( sid, null, rf ); //sid.info.left ! rf.addThread( newObj ); ! //PENDING connect to object from sid.info return newObj; } case IProf.MON_THREAD_METHOD_TRACES:{ ! MonThreadMethodData rf = (MonThreadMethodData) refObj; ! MonThreadTraceData newObj = new MonThreadTraceData( sid, rf, null ); //sid.info.left ! rf.addTrace( newObj ); ! //PENDING connect to object from sid.info return newObj; } - // case IProf.MON_TRACES: return new ClassData( sid ); //PENDING default: return null; //throw some excetion } }; - - //toString() --- 438,779 ---- return new ClassData( sid ); } + case IProf.OBJECT_TYPES: { ! //get class reference ! return new AllocClassData( sid, null ); } ! case IProf.GROUPS_OF_THREADS: { return new ThreadGroupData( sid ); } + case IProf.ARENAS: { return new AllocArenaData( sid ); } + case IProf.GCS: { return new GCData( sid ); } + //// + case IProf.THREADS: { + ThreadGroupData up = (ThreadGroupData) + libIDs.get( new Integer( sid.parentUpObjId )); + ThreadData parent = (ThreadData) libIDs.get( new Integer( + ((IProf.sThreadInfo) sid.info).parentObjId)); + ThreadData newObj = new ThreadData( sid, up, parent ); + up.addThread( newObj ); + parent.addChild( newObj ); + return newObj; + } case IProf.GROUP_THREADS: { ! ThreadGroupData up = (ThreadGroupData) refObj; ! ThreadData parent = (ThreadData) libIDs.get( new Integer( ! ((IProf.sThreadInfo) sid.info).parentObjId)); ! ThreadData newObj = new ThreadData( sid, up, parent ); ! up.addThread( newObj ); ! parent.addChild( newObj ); return newObj; } + //// // case IProf.CLASS_FIELDS_STATICS: return new ClassData( sid ); + // case IProf.CLASS_FIELDS_INSTANCES: return new ClassData( sid ); ! //// ! case IProf.METHODS: { ! ClassData up = (ClassData) libIDs.get( new Integer(sid.parentUpObjId) ); ! MethodData newObj = new MethodData( sid, up ); ! // up.addMethod( newObj ); //FIXME ! return newObj; ! } ! case IProf.CLASS_METHODS: { ! ClassData up = (ClassData) refObj; ! MethodData newObj = new MethodData( sid, up ); ! // up.addMethod( newObj ); //FIXME ! return newObj; ! } ! //// ! ////****************** case IProf.ALLOC_METHOD_TRACES: { MethodData rf = (MethodData) refObj; AllocTraceData newObj = new AllocTraceData( sid, rf ); rf.addAllocTrace( newObj ); return newObj; } + case IProf.ALLOC_METHOD_OBJECTS: { ! MethodData lf = (MethodData) refObj; ! AllocClassData up = (AllocClassData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! AllocClassMethodData newObj = new AllocClassMethodData( sid, up, lf ); ! lf.addClass( newObj ); ! up.addMethod( newObj ); return newObj; } case IProf.ALLOC_OBJECT_METHODS: { ! MethodData lf = (MethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! AllocClassData up = (AllocClassData) refObj; ! AllocClassMethodData newObj = new AllocClassMethodData( sid, up, lf ); ! lf.addClass( newObj ); ! up.addMethod( newObj ); return newObj; } + //// case IProf.ALLOC_TRACE_OBJECTS: { ! AllocClassMethodData up = (AllocClassMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! AllocTraceData lf = (AllocTraceData) refObj; ! AllocClassTraceData newObj = new AllocClassTraceData( sid, up, lf ); ! lf.addClass( newObj ); ! up.addTrace( newObj ); return newObj; } case IProf.ALLOC_OBJECT_METHOD_TRACES:{ ! AllocClassMethodData up = (AllocClassMethodData) refObj; ! AllocTraceData lf = (AllocTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! AllocClassTraceData newObj = new AllocClassTraceData( sid, up, lf ); ! lf.addClass( newObj ); ! up.addTrace( newObj ); return newObj; } + //// case IProf.ALLOC_OBJECT_THREADS: { ! AllocClassData lf = (AllocClassData) refObj; ! ThreadData up = (ThreadData) libIDs.get( new Integer( sid.parentUpObjId)); ! AllocThreadClassData newObj = new AllocThreadClassData( sid, up, lf ); ! up.addClass( newObj ); ! lf.addThread( newObj ); return newObj; } case IProf.ALLOC_THREAD_OBJECTS: { ! AllocClassData lf = (AllocClassData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! ThreadData up = (ThreadData) refObj; ! AllocThreadClassData newObj = new AllocThreadClassData( sid, up, lf ); ! lf.addThread( newObj ); ! up.addClass( newObj ); return newObj; } + //// case IProf.ALLOC_OBJECT_METHOD_THREADS:{ ! AllocClassMethodData lf =(AllocClassMethodData) refObj; ! AllocThreadClassData up = (AllocThreadClassData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! AllocThreadMethodData rg = (AllocThreadMethodData) ! libIDs.get( new Integer( sid.parentRightObjId )); AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( ! sid, up, lf, rg ); ! lf.addThread( newObj ); ! up.addMethod( newObj ); ! rg.addClass( newObj ); return newObj; } case IProf.ALLOC_THREAD_OBJECT_METHODS:{ ! AllocClassMethodData lf =(AllocClassMethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! AllocThreadClassData up = (AllocThreadClassData) refObj; ! AllocThreadMethodData rg = (AllocThreadMethodData) ! libIDs.get( new Integer( sid.parentRightObjId )); AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( ! sid, up, lf, rg ); ! lf.addThread( newObj ); ! up.addMethod( newObj ); ! rg.addClass( newObj ); return newObj; } case IProf.ALLOC_THREAD_METHOD_OBJECTS:{ ! AllocClassMethodData lf =(AllocClassMethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! AllocThreadClassData up = (AllocThreadClassData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! AllocThreadMethodData rg = (AllocThreadMethodData) refObj; AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( ! sid, up, lf, rg ); ! lf.addThread( newObj ); ! up.addMethod( newObj ); ! rg.addClass( newObj ); return newObj; } + //// case IProf.ALLOC_OBJECT_METHOD_TRACE_THREADS:{ ! AllocClassTraceData lf = (AllocClassTraceData) refObj; ! AllocThreadClassMethodData up = (AllocThreadClassMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! AllocThreadTraceData rg = (AllocThreadTraceData) ! libIDs.get( new Integer( sid.parentRightObjId )); AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( ! sid, lf, up, rg ); ! lf.addThread( newObj ); ! up.addTrace( newObj ); ! rg.addClass( newObj ); return newObj; ! } case IProf.ALLOC_THREAD_METHOD_TRACE_OBJECTS:{ ! AllocClassTraceData lf = (AllocClassTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! AllocThreadClassMethodData up = (AllocThreadClassMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! AllocThreadTraceData rg = (AllocThreadTraceData) refObj; AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( ! sid, lf, up, rg ); ! lf.addThread( newObj ); ! up.addTrace( newObj ); ! rg.addClass( newObj ); return newObj; } case IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES:{ ! AllocClassTraceData lf = (AllocClassTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! AllocThreadClassMethodData up = (AllocThreadClassMethodData) refObj; ! AllocThreadTraceData rg = (AllocThreadTraceData) ! libIDs.get( new Integer( sid.parentRightObjId )); AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( ! sid, lf, up, rg ); ! lf.addThread( newObj ); ! up.addTrace( newObj ); ! rg.addClass( newObj ); return newObj; } + //// case IProf.ALLOC_THREAD_METHODS: { ! MethodData lf = (MethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! ThreadData up =(ThreadData) refObj; AllocThreadMethodData newObj = new AllocThreadMethodData( ! sid, up, lf ); ! up.addAllocMethod( newObj ); ! // lf.addAllocThread( newObj ); //FIXME return newObj; } + //// case IProf.ALLOC_THREAD_METHOD_TRACES:{ ! AllocTraceData lf = (AllocTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! AllocThreadMethodData up = (AllocThreadMethodData) refObj; AllocThreadTraceData newObj = new AllocThreadTraceData( ! sid, up, lf ); ! up.addTrace( newObj ); ! // lf.addThread( newObj ); //FIXME return newObj; } ! ! //this is not implemented in IProf, yet?? ! //case IProf.ALLOC_METHOD_THREADS ! //case IProf.ALLOC_TRACE_THREADS ! //// ! ////****************** ! case IProf.CPU_TRACES: { ! MethodData up = (MethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! CPUTraceData newObj = new CPUTraceData( sid, up ); ! up.addCPUTrace( newObj ); ! return newObj; ! } case IProf.CPU_METHOD_TRACES: { ! MethodData up = (MethodData) refObj; ! CPUTraceData newObj = new CPUTraceData( sid, up ); ! up.addCPUTrace( newObj ); return newObj; } + //// case IProf.CPU_METHOD_THREADS: { ! MethodData lf = (MethodData) refObj; ! ThreadData up = (ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! CPUThreadMethodData newObj = new CPUThreadMethodData( sid, up, lf ); ! lf.addCPUThread( newObj ); ! up.addCPUMethod( newObj ); return newObj; } case IProf.CPU_THREAD_METHODS: { ! MethodData lf = (MethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! ThreadData up = (ThreadData) refObj; ! CPUThreadMethodData newObj = new CPUThreadMethodData( sid, up, lf ); ! lf.addCPUThread( newObj ); ! up.addCPUMethod( newObj ); return newObj; } + //// case IProf.CPU_METHOD_TRACE_THREADS:{ ! CPUTraceData lf = (CPUTraceData) refObj; ! CPUThreadMethodData up = (CPUThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! CPUThreadTraceData newObj = new CPUThreadTraceData( sid, up, lf ); ! lf.addThread( newObj ); ! up.addTrace( newObj ); return newObj; } case IProf.CPU_THREAD_METHOD_TRACES:{ ! CPUTraceData lf = (CPUTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! CPUThreadMethodData up = (CPUThreadMethodData) refObj; ! CPUThreadTraceData newObj = new CPUThreadTraceData( sid, up, lf ); ! lf.addThread( newObj ); ! up.addTrace( newObj ); return newObj; } ! ///// ! ////****************** case IProf.MON_METHOD_TRACES: { ! MethodData up = (MethodData) refObj; ! MonTraceData newObj = new MonTraceData( sid, up ); ! up.addMonTrace( newObj ); return newObj; } + case IProf.MON_TRACES: { + MethodData up = (MethodData) + libIDs.get( new Integer( sid.parentUpObjId )); + MonTraceData newObj = new MonTraceData( sid, up ); + up.addMonTrace( newObj ); + return newObj; + } + ///// case IProf.MON_METHOD_THREADS: { ! MethodData lf = (MethodData) refObj; ! ThreadData up = (ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! MonThreadMethodData newObj = new MonThreadMethodData( sid, up, lf ); ! lf.addMonThread( newObj ); ! up.addMonMethod( newObj ); return newObj; } case IProf.MON_THREAD_METHODS: { ! MethodData lf = (MethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! ThreadData up = (ThreadData) refObj; ! MonThreadMethodData newObj = new MonThreadMethodData( sid, up, lf ); ! lf.addMonThread( newObj ); ! up.addMonMethod( newObj ); return newObj; } + ///// case IProf.MON_METHOD_TRACE_THREADS:{ ! MonTraceData lf = (MonTraceData) refObj; ! MonThreadMethodData up = (MonThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! MonThreadTraceData newObj = new MonThreadTraceData( sid, up, lf ); ! lf.addThread( newObj ); ! up.addTrace( newObj ); return newObj; } case IProf.MON_THREAD_METHOD_TRACES:{ ! MonTraceData lf = (MonTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ! MonThreadMethodData up = (MonThreadMethodData) refObj; ! MonThreadTraceData newObj = new MonThreadTraceData( sid, up, lf ); ! lf.addThread( newObj ); ! up.addTrace( newObj ); return newObj; } //PENDING default: return null; //throw some excetion + } }; //toString() *************** *** 602,614 **** } - //?? - //Constrocts for Data object from Buffer - //concting to tree in obejcts? //TODO: // write exception handling code properly /* * $Log$ * Revision 1.1 2001/11/20 22:31:45 vachis * Snapshot implementation --- 781,795 ---- } //TODO: // write exception handling code properly + //write passing configuration + /* * $Log$ + * Revision 1.2 2001/12/03 10:37:57 vachis + * chages to getAll() with info + * * Revision 1.1 2001/11/20 22:31:45 vachis * Snapshot implementation |