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 |