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: Pavel V. <va...@us...> - 2002-01-14 08:01:34
|
Update of /cvsroot/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv23928 Added Files: readme.txt build.xml Log Message: ant build script --- NEW FILE: readme.txt --- Building with Ant: ------------------ a) If ou have ant with script wrapper you can use. ant -buildfile build.xml [target] b) If you have installed Ant in the do-it-yourself way, Ant can be started with: java org.apache.tools.ant.Main -buildfile build.xml [target] This assumes you have set your classpath to include: ant.jar (if you have neatbeans, it can be found in netbeans/modules/ant.jat) jars/classes for your XML parser the JDK's required jar/zip files (in your $(JDK_HOME)/lib/tools.jar) c) Double click on build.xml in netbeans IDE Targets: ------- compile compilation jar makes jar package javadoc genarates documentation doxygen generates doxygen documentation clean cleaning all all this, its default Example: ------- set JAVA_HOME=d:\j2sdk1.4.0-beta3 set CLASSPATH=%CLASSPATH%;d:\netbeans\modules\ant.jar;%JAVA_HOME%\lib\tools.jar d:\j2sdk1.4.0-beta3\bin\java org.apache.tools.ant.Main ---------------------------------------------------------------------- If you do not have any Ant, you can get it from http://jakarta.apache.org/builds/jakarta-ant/release/v1.4.1/bin/ --- NEW FILE: build.xml --- <?xml version="1.0" encoding="UTF-8"?> <project basedir="../" default="compile" name="jpiimpl"> <!-- Common classpath --> <path id="project.classpath"> <pathelement location="jpiimpl"/> <pathelement location="interface"/> </path> <target name="init"> <!-- You can set up any variables you want used throughout the script here. --> <property name="hello" value="world"/> </target> <!-- <target depends="init" name="interface"> <javac debug="true" failonerror="true" srcdir="interface/net"> <classpath> <pathelement location="jpiimpl"/> <pathelement location="interface"/> </classpath> <src> <pathelement location="jpiimpl/net"/> <pathelement location="interface/net"/> </src> </javac> </target> --> <target depends="init" name="compile"> <property name="cp" refid="project.classpath"/> <echo message="Classpath is ${cp}"/> <javac classpathref="project.classpath" debug="true" failonerror="true"> <src> <pathelement location="jpiimpl/net"/> <pathelement location="interface/net"/> </src> </javac> </target> <target depends="init,compile" name="jar"> <!-- To make a standalone app: --> <!-- 1. Create a myapp.mf manifest somewhere. --> <!-- 2. Put in it: --> <!-- Manifest-Version: 1.0 --> <!-- Main-Class: com.foo.Main --> <!-- 3. Pass to <jar>: manifest="myapp.mf" --> <jar basedir="jpiimpl" compress="true" jarfile="jpiimpl/jpiimpl.jar" defaultexcludes="yes"> <!-- How can I include interface too? --> <include name="net/**/*"/> <exclude name="**/*.java"/> <exclude name="**/*.form"/> <exclude name="**/.nbattrs"/> <exclude name="jpiimpl.mf"/> <exclude name="jpiimpl.jar"/> <exclude name="docs"/> </jar> </target> <target depends="init,jar,javadoc,doxygen" description="Build everything." name="all"> <echo message="Application built. "/> </target> <!-- <target name="test" depends="init,all" description="Try running it."> <java classname="com.foo.Main" fork="true" failonerror="true"> <classpath> <pathelement location="."/> </classpath> --> <!-- Pass some args, perhaps: --> <!-- <arg value="-myfile"/> --> <!-- Will be given as an absolute path: --> <!-- <arg file="myfile.txt"/> </java> </target> --> <!-- group="JPI_interface net.sourceforge.net.jpi*,JPI_implementation net.sourceforge.net.jpiimpl*" --> <target depends="init" description="Javadoc for my API." name="javadoc"> <mkdir dir="docs/javadoc"/> <javadoc defaultexcludes="yes" destdir="docs/javadoc" private="on"> <package name="net.sourceforge.javaprofiler.jpiimpl.*"/> <package name="net.sourceforge.javaprofiler.jpi.*"/> <sourcepath> <pathelement location="interface"/> <pathelement location="jpiimpl"/> </sourcepath> </javadoc> </target> <target depends="init" description="Doxygen documentation for my API." name="doxygen"> <mkdir dir="docs/doxygen"/> </target> <target depends="init" description="Clean all build products." name="clean"> <delete> <fileset dir="jpiimpl"> <include name="**/*.class"/> </fileset> </delete> <delete> <fileset dir="interface"> <include name="**/*.class"/> </fileset> </delete> <delete file="jpiimpl.jar"/> <delete dir="docs/javadoc"/> <delete dir="docs/doxygen"/> </target> </project> |
From: Pavel V. <va...@us...> - 2002-01-14 08:00:53
|
Update of /cvsroot/javaprofiler/jpiimpl/docs In directory usw-pr-cvs1:/tmp/cvs-serv23786/docs Log Message: Directory /cvsroot/javaprofiler/jpiimpl/docs added to the repository |
From: Pavel V. <va...@us...> - 2002-01-11 22:24:05
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv6048 Modified Files: SnapshotImpl.java Log Message: added allocObjects list, methods for getting allocObjects and groupOfThreads Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** SnapshotImpl.java 2001/12/27 23:30:35 1.7 --- SnapshotImpl.java 2002/01/11 22:24:02 1.8 *************** *** 46,49 **** --- 46,50 ---- private LinkedList groupThreads = new LinkedList(); private LinkedList threads = new LinkedList(); + private LinkedList allocObjects = new LinkedList(); //private LinkedList arenas = new LinkedList(); private LinkedList gcs = new LinkedList(); *************** *** 258,261 **** --- 259,280 ---- } + //some public classes, that are not in interface yet + /** Returns list of objects, that can be allocated, e.g. class, array of class, + * array of int, etc. + * + * @return list of allocatable objects. + */ + public List allocObjects() { + return allocObjects; + } + + /** Retuns list of Group of threads. + * + * @return list of Group of threads. + */ + public List groupOfThreads() { + return groupThreads; + } + ////////////////////////////////////////////////////////////////////////////// // Private classes *************** *** 337,343 **** actLst2.clear(); actLst.clear(); ! 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 ); --- 356,362 ---- actLst2.clear(); actLst.clear(); ! extract( null, allocObjects, IProf.OBJECT_TYPES, IProf.NO_OPTIONAL_ARG, iprof ); ! extract( allocObjects, (withTraces)? actLst : null, IProf.ALLOC_OBJECT_METHODS, IProf.NO_OPTIONAL_ARG, iprof ); *************** *** 458,462 **** if ( iter == null ) { iterInner = iprof.getAllThruIterator( 0, whatType, true, ! IProf.isObjWithInfo( whatType), optArg ); pass = false; obj = null; --- 477,481 ---- if ( iter == null ) { iterInner = iprof.getAllThruIterator( 0, whatType, true, ! IProf.isObjWithInfo( whatType), optArg ); pass = false; obj = null; *************** *** 465,469 **** obj = (IDObjectData) iter.next(); iterInner = iprof.getAllThruIterator( obj.getID(), whatType, ! true, IProf.isObjWithInfo( whatType), optArg ); } --- 484,488 ---- obj = (IDObjectData) iter.next(); iterInner = iprof.getAllThruIterator( obj.getID(), whatType, ! true, IProf.isObjWithInfo( whatType), optArg ); } *************** *** 595,601 **** case IProf.OBJECT_TYPES: { //FIXMEE ! //ClassData clz = (ClassData) libIDs.get( new Integer( ! // ((IProf.sObjectInfo) sid.info).classObjId)); ! ClassData clz = null; return new AllocClassData( sid, clz ); //have to look at sid.info.isArray, probably in object --- 614,620 ---- case IProf.OBJECT_TYPES: { //FIXMEE ! ClassData clz = (ClassData) libIDs.get( new Integer( ! ((IProf.sObjectInfo) sid.info).classObjId)); ! //ClassData clz = null; return new AllocClassData( sid, clz ); //have to look at sid.info.isArray, probably in object *************** *** 617,621 **** case IProf.THREADS: { ThreadGroupData up = (ThreadGroupData) ! libIDs.get( new Integer( sid.parentUpObjId )); Integer parentID = new Integer( ((IProf.sThreadInfo) sid.info).parentObjId); ThreadData parent = (ThreadData) libIDs.get( parentID); --- 636,640 ---- case IProf.THREADS: { ThreadGroupData up = (ThreadGroupData) ! libIDs.get( new Integer( sid.parentUpObjId )); Integer parentID = new Integer( ((IProf.sThreadInfo) sid.info).parentObjId); ThreadData parent = (ThreadData) libIDs.get( parentID); *************** *** 672,676 **** MethodData rf = (MethodData) refObj; AllocTraceData newObj = new AllocTraceData( sid, rf, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); rf.addAllocTrace( newObj ); return newObj; --- 691,695 ---- MethodData rf = (MethodData) refObj; AllocTraceData newObj = new AllocTraceData( sid, rf, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); rf.addAllocTrace( newObj ); return newObj; *************** *** 680,684 **** libIDs.get( new Integer( sid.parentUpObjId )); AllocTraceData newObj = new AllocTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addAllocTrace( newObj ); return newObj; --- 699,703 ---- libIDs.get( new Integer( sid.parentUpObjId )); AllocTraceData newObj = new AllocTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addAllocTrace( newObj ); return newObj; *************** *** 688,693 **** 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 ); --- 707,712 ---- 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 ); *************** *** 696,700 **** 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 ); --- 715,719 ---- 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 ); *************** *** 706,710 **** 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 ); --- 725,729 ---- 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 ); *************** *** 716,720 **** AllocClassMethodData up = (AllocClassMethodData) refObj; AllocTraceData lf = (AllocTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); AllocClassTraceData newObj = new AllocClassTraceData( sid, up, lf ); lf.addClass( newObj ); --- 735,739 ---- AllocClassMethodData up = (AllocClassMethodData) refObj; AllocTraceData lf = (AllocTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); AllocClassTraceData newObj = new AllocClassTraceData( sid, up, lf ); lf.addClass( newObj ); *************** *** 733,737 **** 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 ); --- 752,756 ---- 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 ); *************** *** 744,750 **** 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 ); --- 763,769 ---- 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 ); *************** *** 756,763 **** 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 ); --- 775,782 ---- 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 ); *************** *** 769,775 **** 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( --- 788,794 ---- 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( *************** *** 784,790 **** 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 ); --- 803,809 ---- 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 ); *************** *** 796,802 **** 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( --- 815,821 ---- 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( *************** *** 809,816 **** 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 ); --- 828,835 ---- 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 ); *************** *** 823,827 **** case IProf.ALLOC_THREAD_METHODS: { MethodData lf = (MethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ThreadData up =(ThreadData) refObj; AllocThreadMethodData newObj = new AllocThreadMethodData( --- 842,846 ---- case IProf.ALLOC_THREAD_METHODS: { MethodData lf = (MethodData) ! libIDs.get( new Integer( sid.parentLeftObjId )); ThreadData up =(ThreadData) refObj; AllocThreadMethodData newObj = new AllocThreadMethodData( *************** *** 835,839 **** MethodData lf = (MethodData) refObj; ThreadData up =(ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId )); AllocThreadMethodData newObj = new AllocThreadMethodData( sid, up, lf ); --- 854,858 ---- MethodData lf = (MethodData) refObj; ThreadData up =(ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId )); AllocThreadMethodData newObj = new AllocThreadMethodData( sid, up, lf ); *************** *** 845,849 **** case IProf.ALLOC_THREAD_METHOD_TRACES:{ AllocTraceData lf = (AllocTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); AllocThreadMethodData up = (AllocThreadMethodData) refObj; AllocThreadTraceData newObj = new AllocThreadTraceData( --- 864,868 ---- case IProf.ALLOC_THREAD_METHOD_TRACES:{ AllocTraceData lf = (AllocTraceData) ! libIDs.get( new Integer( sid.parentLeftObjId )); AllocThreadMethodData up = (AllocThreadMethodData) refObj; AllocThreadTraceData newObj = new AllocThreadTraceData( *************** *** 857,861 **** AllocTraceData lf = (AllocTraceData) refObj; AllocThreadMethodData up = (AllocThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); AllocThreadTraceData newObj = new AllocThreadTraceData( sid, up, lf ); --- 876,880 ---- AllocTraceData lf = (AllocTraceData) refObj; AllocThreadMethodData up = (AllocThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId ) ); AllocThreadTraceData newObj = new AllocThreadTraceData( sid, up, lf ); *************** *** 868,874 **** case IProf.CPU_TRACES: { MethodData up = (MethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); CPUTraceData newObj = new CPUTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addCPUTrace( newObj ); return newObj; --- 887,893 ---- case IProf.CPU_TRACES: { MethodData up = (MethodData) ! libIDs.get( new Integer( sid.parentUpObjId ) ); CPUTraceData newObj = new CPUTraceData( sid, up, ! createFramesFromInfo((IProf.sTraceInfo) sid.info) ); up.addCPUTrace( newObj ); return newObj; *************** *** 877,881 **** MethodData up = (MethodData) refObj; CPUTraceData newObj = new CPUTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addCPUTrace( newObj ); return newObj; --- 896,900 ---- MethodData up = (MethodData) refObj; CPUTraceData newObj = new CPUTraceData( sid, up, ! createFramesFromInfo((IProf.sTraceInfo) sid.info) ); up.addCPUTrace( newObj ); return newObj; *************** *** 885,889 **** MethodData lf = (MethodData) refObj; ThreadData up = (ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId )); CPUThreadMethodData newObj = new CPUThreadMethodData( sid, up, lf ); lf.addCPUThread( newObj ); --- 904,908 ---- MethodData lf = (MethodData) refObj; ThreadData up = (ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId) ); CPUThreadMethodData newObj = new CPUThreadMethodData( sid, up, lf ); lf.addCPUThread( newObj ); *************** *** 893,897 **** 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 ); --- 912,916 ---- 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 ); *************** *** 904,908 **** CPUTraceData lf = (CPUTraceData) refObj; CPUThreadMethodData up = (CPUThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); CPUThreadTraceData newObj = new CPUThreadTraceData( sid, up, lf ); lf.addThread( newObj ); --- 923,927 ---- CPUTraceData lf = (CPUTraceData) refObj; CPUThreadMethodData up = (CPUThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId ) ); CPUThreadTraceData newObj = new CPUThreadTraceData( sid, up, lf ); lf.addThread( newObj ); *************** *** 912,916 **** 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 ); --- 931,935 ---- 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 ); *************** *** 924,928 **** MethodData up = (MethodData) refObj; MonTraceData newObj = new MonTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addMonTrace( newObj ); return newObj; --- 943,947 ---- MethodData up = (MethodData) refObj; MonTraceData newObj = new MonTraceData( sid, up, ! createFramesFromInfo((IProf.sTraceInfo) sid.info) ); up.addMonTrace( newObj ); return newObj; *************** *** 932,936 **** libIDs.get( new Integer( sid.parentUpObjId )); MonTraceData newObj = new MonTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addMonTrace( newObj ); return newObj; --- 951,955 ---- libIDs.get( new Integer( sid.parentUpObjId )); MonTraceData newObj = new MonTraceData( sid, up, ! createFramesFromInfo((IProf.sTraceInfo) sid.info) ); up.addMonTrace( newObj ); return newObj; *************** *** 940,944 **** MethodData lf = (MethodData) refObj; ThreadData up = (ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId )); MonThreadMethodData newObj = new MonThreadMethodData( sid, up, lf ); lf.addMonThread( newObj ); --- 959,963 ---- MethodData lf = (MethodData) refObj; ThreadData up = (ThreadData) ! libIDs.get( new Integer( sid.parentUpObjId )); MonThreadMethodData newObj = new MonThreadMethodData( sid, up, lf ); lf.addMonThread( newObj ); *************** *** 948,952 **** 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 ); --- 967,971 ---- 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 ); *************** *** 959,963 **** MonTraceData lf = (MonTraceData) refObj; MonThreadMethodData up = (MonThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); MonThreadTraceData newObj = new MonThreadTraceData( sid, up, lf ); lf.addThread( newObj ); --- 978,982 ---- MonTraceData lf = (MonTraceData) refObj; MonThreadMethodData up = (MonThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); MonThreadTraceData newObj = new MonThreadTraceData( sid, up, lf ); lf.addThread( newObj ); *************** *** 967,971 **** 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 ); --- 986,990 ---- 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 ); *************** *** 990,993 **** --- 1009,1014 ---- //TODO: // write exception handling code properly + // solve problems with AllocClassData, rename to AllocObjectData + // //shloud I read default configuration somewhere? *************** *** 996,999 **** --- 1017,1023 ---- /* * $Log$ + * Revision 1.8 2002/01/11 22:24:02 vachis + * added allocObjects list, methods for getting allocObjects and groupOfThreads + * * Revision 1.7 2001/12/27 23:30:35 vachis * comments |
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv5719 Modified Files: ThreadData.java MonTraceData.java MonThreadTraceData.java MonThreadMethodData.java MethodData.java CPUTraceData.java CPUThreadTraceData.java CPUThreadMethodData.java AllocTraceData.java AllocThreadTraceData.java AllocThreadMethodData.java AllocThreadClassTraceData.java AllocThreadClassMethodData.java AllocThreadClassData.java AllocClassTraceData.java AllocClassMethodData.java AllocClassData.java Log Message: unnecessary test removed Index: ThreadData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ThreadData.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** ThreadData.java 2001/12/27 14:11:39 1.10 --- ThreadData.java 2002/01/11 22:22:16 1.11 *************** *** 99,104 **** this(sid.objId, ((IProf.sThreadInfo)sid.info).threadName, group, parent, sid.active); ! if (sid.alloc != null) ! setStatistics(sid.alloc); } --- 99,105 ---- this(sid.objId, ((IProf.sThreadInfo)sid.info).threadName, group, parent, sid.active); ! ! //if (sid.alloc != null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 300,303 **** --- 301,307 ---- /* * $Log$ + * Revision 1.11 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.10 2001/12/27 14:11:39 vachis * new setParent() method Index: MonTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonTraceData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** MonTraceData.java 2001/12/09 23:22:05 1.3 --- MonTraceData.java 2002/01/11 22:22:16 1.4 *************** *** 68,76 **** */ MonTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! ! if (sid.mon!=null) ! addToMonStat(sid.mon.hits, sid.mon.time); } --- 68,75 ---- */ MonTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! //if (sid.mon!=null) //do not test this, its an error ! addToMonStat(sid.mon.hits, sid.mon.time); } *************** *** 127,130 **** --- 126,132 ---- /* * $Log$ + * Revision 1.4 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.3 2001/12/09 23:22:05 vachis * frames added Index: MonThreadTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonThreadTraceData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MonThreadTraceData.java 2001/12/02 15:31:16 1.2 --- MonThreadTraceData.java 2002/01/11 22:22:16 1.3 *************** *** 61,67 **** MonThreadTraceData( IProf.sID sid, MonThreadMethodData threadMethod, MonTraceData trace ) { ! this( sid.objId, threadMethod, trace ); ! if (sid.mon!=null) ! addToMonStat(sid.mon.hits, sid.mon.time); } --- 61,68 ---- MonThreadTraceData( IProf.sID sid, MonThreadMethodData threadMethod, MonTraceData trace ) { ! this( sid.objId, threadMethod, trace ); ! ! //if (sid.mon!=null) //do not test this, its an error ! addToMonStat(sid.mon.hits, sid.mon.time); } *************** *** 88,91 **** --- 89,95 ---- /* * $Log$ + * Revision 1.3 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.2 2001/12/02 15:31:16 petrul * changed constructor code Index: MonThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonThreadMethodData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MonThreadMethodData.java 2001/12/02 15:29:13 1.2 --- MonThreadMethodData.java 2002/01/11 22:22:16 1.3 *************** *** 64,70 **** */ MonThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { ! this( sid.objId, thread, method ); ! if (sid.mon!=null) ! addToMonStat(sid.mon.hits, sid.mon.time); } --- 64,71 ---- */ MonThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { ! this( sid.objId, thread, method ); ! ! //if (sid.mon!=null) //do not test this, its an error ! addToMonStat(sid.mon.hits, sid.mon.time); } *************** *** 121,124 **** --- 122,128 ---- /* * $Log$ + * Revision 1.3 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.2 2001/12/02 15:29:13 petrul * changed constructor code Index: MethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MethodData.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** MethodData.java 2001/12/27 14:17:31 1.8 --- MethodData.java 2002/01/11 22:22:16 1.9 *************** *** 136,139 **** --- 136,141 ---- ((IProf.sMethodInfo)sid.info).startLineno, ((IProf.sMethodInfo)sid.info).endLineno, clazz); + + //we need if there, somereferences may not be valid if (sid.cpu!=null) addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); *************** *** 532,535 **** --- 534,540 ---- /* * $Log$ + * Revision 1.9 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.8 2001/12/27 14:17:31 vachis * expansion to threads Index: CPUTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUTraceData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** CPUTraceData.java 2001/12/09 23:22:05 1.6 --- CPUTraceData.java 2002/01/11 22:22:16 1.7 *************** *** 66,73 **** */ CPUTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! if (sid.cpu!=null) ! addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } --- 66,73 ---- */ CPUTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! //if (sid.cpu!=null) //do not test this, its an error ! addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } *************** *** 123,126 **** --- 123,129 ---- /* * $Log$ + * Revision 1.7 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.6 2001/12/09 23:22:05 vachis * frames added Index: CPUThreadTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUThreadTraceData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** CPUThreadTraceData.java 2001/12/02 13:41:22 1.4 --- CPUThreadTraceData.java 2002/01/11 22:22:16 1.5 *************** *** 56,62 **** CPUThreadTraceData( IProf.sID sid, CPUThreadMethodData threadMethod, CPUTraceData trace ) { ! this( sid.objId, threadMethod, trace ); ! if (sid.cpu!=null) ! addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } --- 56,63 ---- CPUThreadTraceData( IProf.sID sid, CPUThreadMethodData threadMethod, CPUTraceData trace ) { ! this( sid.objId, threadMethod, trace ); ! ! //if (sid.cpu!=null) //do not test this, its an error ! addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } *************** *** 83,86 **** --- 84,90 ---- /* * $Log$ + * Revision 1.5 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.4 2001/12/02 13:41:22 petrul * changed constructor code Index: CPUThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUThreadMethodData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** CPUThreadMethodData.java 2001/12/02 13:37:33 1.5 --- CPUThreadMethodData.java 2002/01/11 22:22:16 1.6 *************** *** 63,69 **** */ CPUThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { ! this( sid.objId, thread, method ); ! if (sid.cpu!=null) ! addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } --- 63,70 ---- */ CPUThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { ! this( sid.objId, thread, method ); ! ! //if (sid.cpu!=null) //do not test this, its an error ! addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } *************** *** 119,122 **** --- 120,126 ---- /* * $Log$ + * Revision 1.6 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.5 2001/12/02 13:37:33 petrul * changed constructor code Index: AllocTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTraceData.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** AllocTraceData.java 2001/12/27 14:12:31 1.8 --- AllocTraceData.java 2002/01/11 22:22:16 1.9 *************** *** 73,80 **** */ AllocTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 73,80 ---- */ AllocTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 164,167 **** --- 164,170 ---- /* * $Log$ + * Revision 1.9 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.8 2001/12/27 14:12:31 vachis * expansion to threads Index: AllocThreadTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadTraceData.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** AllocThreadTraceData.java 2001/12/09 23:20:01 1.7 --- AllocThreadTraceData.java 2002/01/11 22:22:16 1.8 *************** *** 63,69 **** AllocThreadTraceData( IProf.sID sid, AllocThreadMethodData threadMethod, AllocTraceData trace ) { ! this( sid.objId, threadMethod, trace ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 63,70 ---- AllocThreadTraceData( IProf.sID sid, AllocThreadMethodData threadMethod, AllocTraceData trace ) { ! this( sid.objId, threadMethod, trace ); ! ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 127,130 **** --- 128,134 ---- /* * $Log$ + * Revision 1.8 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.7 2001/12/09 23:20:01 vachis * temporary fix, classData may be null Index: AllocThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadMethodData.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** AllocThreadMethodData.java 2001/12/09 23:20:01 1.7 --- AllocThreadMethodData.java 2002/01/11 22:22:16 1.8 *************** *** 69,75 **** */ AllocThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { ! this( sid.objId, thread, method ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 69,76 ---- */ AllocThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { ! this( sid.objId, thread, method ); ! ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 160,163 **** --- 161,167 ---- /* * $Log$ + * Revision 1.8 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.7 2001/12/09 23:20:01 vachis * temporary fix, classData may be null Index: AllocThreadClassTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadClassTraceData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocThreadClassTraceData.java 2001/12/01 20:11:38 1.4 --- AllocThreadClassTraceData.java 2002/01/11 22:22:16 1.5 *************** *** 63,69 **** AllocThreadClassMethodData threadClassMethod, AllocThreadTraceData threadTrace ) { ! this( sid.objId, classTrace, threadClassMethod, threadTrace ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 63,70 ---- AllocThreadClassMethodData threadClassMethod, AllocThreadTraceData threadTrace ) { ! this( sid.objId, classTrace, threadClassMethod, threadTrace ); ! ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 99,102 **** --- 100,106 ---- /* * $Log$ + * Revision 1.5 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.4 2001/12/01 20:11:38 petrul * changed constructor code Index: AllocThreadClassMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadClassMethodData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocThreadClassMethodData.java 2001/12/01 20:06:49 1.6 --- AllocThreadClassMethodData.java 2002/01/11 22:22:16 1.7 *************** *** 72,78 **** AllocThreadClassMethodData( IProf.sID sid, AllocThreadClassData threadClass, AllocClassMethodData classMethod, AllocThreadMethodData threadMethod ) { ! this( sid.objId, threadClass, classMethod, threadMethod ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 72,79 ---- AllocThreadClassMethodData( IProf.sID sid, AllocThreadClassData threadClass, AllocClassMethodData classMethod, AllocThreadMethodData threadMethod ) { ! this( sid.objId, threadClass, classMethod, threadMethod ); ! ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 142,145 **** --- 143,149 ---- /* * $Log$ + * Revision 1.7 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.6 2001/12/01 20:06:49 petrul * changed constructor code Index: AllocThreadClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadClassData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocThreadClassData.java 2001/12/01 20:03:27 1.6 --- AllocThreadClassData.java 2002/01/11 22:22:16 1.7 *************** *** 62,68 **** */ AllocThreadClassData( IProf.sID sid, ThreadData thread, AllocClassData clazz ) { ! this( sid.objId, thread, clazz ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 62,69 ---- */ AllocThreadClassData( IProf.sID sid, ThreadData thread, AllocClassData clazz ) { ! this( sid.objId, thread, clazz ); ! ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 124,127 **** --- 125,131 ---- /* * $Log$ + * Revision 1.7 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.6 2001/12/01 20:03:27 petrul * changed constructor code Index: AllocClassTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocClassTraceData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocClassTraceData.java 2001/12/01 19:56:03 1.6 --- AllocClassTraceData.java 2002/01/11 22:22:16 1.7 *************** *** 64,70 **** AllocClassTraceData( IProf.sID sid, AllocClassMethodData classMethod, AllocTraceData trace) { ! this( sid.objId, classMethod, trace ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 64,71 ---- AllocClassTraceData( IProf.sID sid, AllocClassMethodData classMethod, AllocTraceData trace) { ! this( sid.objId, classMethod, trace ); ! ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 124,127 **** --- 125,131 ---- /* * $Log$ + * Revision 1.7 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.6 2001/12/01 19:56:03 petrul * changed constructor code Index: AllocClassMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocClassMethodData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocClassMethodData.java 2001/12/01 19:51:44 1.6 --- AllocClassMethodData.java 2002/01/11 22:22:16 1.7 *************** *** 71,77 **** */ AllocClassMethodData( IProf.sID sid, AllocClassData clazz, MethodData method ) { ! this( sid.objId, clazz, method ); ! if (sid.alloc!=null) ! setStatistics(sid.alloc); } --- 71,78 ---- */ AllocClassMethodData( IProf.sID sid, AllocClassData clazz, MethodData method ) { ! this( sid.objId, clazz, method ); ! ! //if (sid.alloc!=null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 163,166 **** --- 164,170 ---- /* * $Log$ + * Revision 1.7 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.6 2001/12/01 19:51:44 petrul * changed constructor code Index: AllocClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocClassData.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** AllocClassData.java 2001/12/06 20:27:22 1.7 --- AllocClassData.java 2002/01/11 22:22:16 1.8 *************** *** 69,76 **** * @param clazz class to which this allocation data belongs. */ ! AllocClassData( IProf.sID sid, ClassData clazz ) { ! this( sid.objId, clazz, ((IProf.sObjectInfo) sid.info).isArray ); ! if (sid.alloc != null) ! setStatistics(sid.alloc); } --- 69,77 ---- * @param clazz class to which this allocation data belongs. */ ! AllocClassData(IProf.sID sid, ClassData clazz) { ! this( sid.objId, clazz, ((IProf.sObjectInfo) sid.info).isArray ); ! ! //if (sid.alloc != null) //do not test this, its an error ! setStatistics(sid.alloc); } *************** *** 156,159 **** --- 157,163 ---- /* * $Log$ + * Revision 1.8 2002/01/11 22:22:16 vachis + * unnecessary test removed + * * Revision 1.7 2001/12/06 20:27:22 vachis * use isArray atribute |
From: Pavel V. <va...@us...> - 2002-01-04 00:11:30
|
Update of /cvsroot/javaprofiler/test/snapshot In directory usw-pr-cvs1:/tmp/cvs-serv7679 Added Files: runsnap.bat run2.bat run1.bat Log Message: files for testing SnapshotImpl on windows. you also need Notepad.jar --- NEW FILE: runsnap.bat --- SET CLASSPATH=..\..\jpiimpl;..\..\interface;.\;%CLASSPATH% set path=d:\j2sdk1.4.0-beta3\bin;%path% java TestSnap rem > outsnap.txt --- NEW FILE: run2.bat --- SET CLASSPATH=.\SwingSet2.jar;%CLASSPATH% set path=d:\j2sdk1.4.0-beta3\bin;%path% java -Xrun\Project\javaprof\library\src\profiler\profiler:commun_type=socket SwingSet2 > out2.txt --- NEW FILE: run1.bat --- SET CLASSPATH=.\Notepad.jar;%CLASSPATH% rem java -Xrunprofiler Notepad rem java Notepad set path=d:\j2sdk1.4.0-beta3\bin;%path% java -Xrun\Project\javaprof\library\src\profiler\profiler:commun_type=socket Notepad rem > out1.txt |
From: Pavel V. <va...@us...> - 2001-12-27 23:30:39
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv24263 Modified Files: SnapshotImpl.java Log Message: comments Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** SnapshotImpl.java 2001/12/27 14:21:23 1.6 --- SnapshotImpl.java 2001/12/27 23:30:35 1.7 *************** *** 67,77 **** private boolean haveSnapshot = false; ! /** Creates new SnapshotImpl */ public SnapshotImpl( IProf iprof ) { makeSnapshot( iprof ); } ! /** Creates new SnapshotImpl */ ! //maybe use soem configuration object public SnapshotImpl( IProf iprof, boolean withCPU, boolean withAlloc, boolean withMon, boolean withGC, boolean withTraces, --- 67,102 ---- private boolean haveSnapshot = false; ! /** Creates new <code>SnapshotImpl</code> (mirror of library structures) ! * with default configuration. Default ! * configuration includes maximum snapshot. It means: snapshot of CPU, ! * allocations, monitors and garbage collector; ! * discimination to traces and threads and no restriction for traces. ! * ! * @param iprof Communacation object (you have to be connected to profiled VM). ! */ public SnapshotImpl( IProf iprof ) { makeSnapshot( iprof ); } ! /** Creates new <code>SnapshotImpl</code> (mirror of library structures). ! * You can adjust this snapshot with following params ! * ! *@param iprof Communacation object (you have to be connected to profiled VM). ! *@param withCPU Whether include snapshot of CPU. ! *@param withAlloc Whether include snapshot of allocations. ! *@param withMon Whether include snapshot of monitors. ! *@param withGC Whether inlucde snapshot of garbage collector. ! * ! *@param withTraces Whether include even discrimination to traces. ! *@param withThreads Whether include discrimination to threads. ! * ! *@param CPUTraces_MinVal Only traces with more hits than this will be extracted. ! * Use <code>IProf.NO_OPTIONAL_ARG</code> for extraction of all traces. ! *@param AllocTraces_MinVal Only traces with more allocations than this will be extracted. ! * Use <code>IProf.NO_OPTIONAL_ARG</code> for extraction of all traces. ! *@param MonTraces_MinVal Only traces with more hits than this will be extracted. ! * Use <code>IProf.NO_OPTIONAL_ARG</code> for extraction of all traces. ! */ ! //maybe use some configuration object public SnapshotImpl( IProf iprof, boolean withCPU, boolean withAlloc, boolean withMon, boolean withGC, boolean withTraces, *************** *** 97,100 **** --- 122,132 ---- ////////////////////////////////////////////////////////////////////////// + /** + * Returns number of threads that were running by the time the snapshot + * was made. + * + * @return number of threads that were running by the time the snapshot + * was made. + */ public int getThreadCount() { return threads.size(); *************** *** 244,249 **** // Private methods ////////////////////////////////////////////////////////////////////////////// ! //init method private void makeSnapshot( IProf iprof ) { --- 276,288 ---- // Private methods ////////////////////////////////////////////////////////////////////////////// + // It usually uses libIDs field. ! /** Makes snapshot (mirror of library structures), it reads configuration ! * from private fields of <code>SnapshotImpl</code>. ! * This method is called from contructor, that sets configuration. ! * ! * @param iprof Communacation object (you have to be connected to profiled VM). ! * @see SnapshotImpl#SnapshotImpl() ! */ private void makeSnapshot( IProf iprof ) { *************** *** 370,378 **** ! /* ! *You can't call following method in any order you think ! *You have to extract more general objects first! ! *This methods directly uses mirror strucutre and libIDs. */ private void extract( List in, List out, int whatType, int optArg, IProf iprof ) throws COMMUN_Exception { //throws --- 409,436 ---- ! /**This method is used by makeSnapshot() to create mirror of library structures. ! * It calls <code>iptof.getAll()</code> for each object in list <code>in</code>, ! * with params <code>whatType and optArg </code>. In other words it expands ! * each object in list ! * <code>in</code> with respect to <code>whatType</code> and with optional param ! * <code>optArg</code>. Then it creates objects from extracted data and ! * connects they into the "mirror" structure. That's why you have to extract ! * more general objects first! ! * ! *@param in List of objects on which <code>whatType</code> operation is used. ! * It could be null, it depeneds on <code>whatType</code> operation. ! *@param out If this param is not null than created objects are connected ! * to this list. Use this if you need call some operation on this objects. ! *@param whatType Desired operation, it's one o <code>IProf</code>'s constants. ! *@param optArg Optional argument passed to IProf.getAll(), depends on <code>whatType</code> ! * operation. In many cases it's just <code>IProf.NO_OPTIONAL_ARG</code>. ! * {@link net.sourceforge.javaprofiler.jpiimpl.commun.IProf.getAll} ! *@param iprof Communacation object (you have to be connected to profiled VM). ! * ! *@see net.sourceforge.javaprofiler.jpiimpl.commun.IProf#getAll() ! *@see net.sourceforge.javaprofiler.jpiimpl.commun.IProf */ + /*This methods directly uses and modifies mirror strucutre and libIDs. + */ private void extract( List in, List out, int whatType, int optArg, IProf iprof ) throws COMMUN_Exception { //throws *************** *** 413,417 **** int i=0; j++; ! try { while( iterInner.hasNext() ) { //dbg --- 471,475 ---- int i=0; j++; ! //try { while( iterInner.hasNext() ) { //dbg *************** *** 426,433 **** } //dbg ! } catch (Exception e) ! { ! System.out.print("zz" + e.toString() + " " ); ! }; postOpIterLst = doPostOpIter( whatType, obj, postOpIterLst ); --- 484,491 ---- } //dbg ! //} catch (Exception e) ! //{ ! // System.out.print("zz" + e.toString() + " " ); ! //}; postOpIterLst = doPostOpIter( whatType, obj, postOpIterLst ); *************** *** 453,465 **** catch ( UNKNOWN_Exception e ) { System.out.println( "Uknown exception\n" ); - } - catch ( Exception e ) { - System.out.println( "Exception\n" ); } }; ! /* Uses postOpIterLst, return new List, which should be used used in next ! * iteration */ private List doPostOpIter( int whatType, IDObjectData refObj, List postOpIterLst ) { --- 511,524 ---- catch ( UNKNOWN_Exception e ) { System.out.println( "Uknown exception\n" ); } + // catch ( Exception e ) { + // System.out.println( "Exception\n" ); + // } }; ! /* Uses postOpIterLst, returns new List, which should be used used in next ! * iteration. It called for each extract operation (each obect in List ! * <code>in</code> in method <code>extract()</code> */ private List doPostOpIter( int whatType, IDObjectData refObj, List postOpIterLst ) { *************** *** 482,485 **** --- 541,546 ---- } + /* This method is called at the end of <code>extract()</code> method. + */ private void doPostOp( int whatType, List postOpLst ) { ListIterator iter; *************** *** 499,502 **** --- 560,565 ---- }; + /*Creates ArrayList of <code>TraceFrameData</code> from <code> IProf.sTraceInfo</code>. + */ private List createFramesFromInfo( IProf.sTraceInfo trcInfo ) { int num = trcInfo.numFrames; *************** *** 512,516 **** }; ! private IDObjectData createAndPutIn( int whatType, IProf.sID sid, IDObjectData refObj, List postOpLst, --- 575,588 ---- }; ! /** Creates and returns new object, its type depends on <code>whatType</code> operation, ! * this object carries information from <code>sid</code>. Finally this new ! * object is conected to mirror structure, optionaly connected to <code> ! * postOpLst</code> or <code> postOpIterLst </code> lists for furter manipulation. ! * ! *@returns object, which type depends on <code>whatType</code> operation ! *param whatType constant of operation (constant from IProf) used in extract() method ! *param sid contains statistic and sometimes also info data ! *@see SnapshotImpl#extract() ! */ private IDObjectData createAndPutIn( int whatType, IProf.sID sid, IDObjectData refObj, List postOpLst, *************** *** 919,925 **** --- 991,1002 ---- // write exception handling code properly + //shloud I read default configuration somewhere? + /* * $Log$ + * Revision 1.7 2001/12/27 23:30:35 vachis + * comments + * * Revision 1.6 2001/12/27 14:21:23 vachis * finished connecting threads and class fields to mirror |
From: Pavel V. <va...@us...> - 2001-12-27 14:21:25
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv21731 Modified Files: SnapshotImpl.java Log Message: finished connecting threads and class fields to mirror Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** SnapshotImpl.java 2001/12/09 23:27:34 1.5 --- SnapshotImpl.java 2001/12/27 14:21:23 1.6 *************** *** 41,45 **** private HashMap libIDs = new HashMap(); //converts libIds to references ! //its different for different snapshots! private LinkedList classes = new LinkedList(); private LinkedList methods = new LinkedList(); --- 41,45 ---- private HashMap libIDs = new HashMap(); //converts libIds to references ! private LinkedList classes = new LinkedList(); private LinkedList methods = new LinkedList(); *************** *** 93,98 **** ! ! ////////////////////////////////////////////////////////////////////////// public int getThreadCount() { --- 93,99 ---- ! ////////////////////////////////////////////////////////////////////////// ! // implementation of Snapdhot interface ! ////////////////////////////////////////////////////////////////////////// public int getThreadCount() { *************** *** 226,229 **** --- 227,245 ---- ////////////////////////////////////////////////////////////////////////////// + // Private classes + ////////////////////////////////////////////////////////////////////////////// + /* Auxiliary object for building tree of threads + */ + class PostOpThreadData { + private Integer parentID; + private ThreadData threadData; + + PostOpThreadData( Integer parentID, ThreadData threadData ) { + this.parentID = parentID ; + this.threadData = threadData; + } + } + + ////////////////////////////////////////////////////////////////////////////// // Private methods ////////////////////////////////////////////////////////////////////////////// *************** *** 282,286 **** actLst2.clear(); actLst.clear(); - //PENDING extract( null, actLst3, IProf.OBJECT_TYPES, IProf.NO_OPTIONAL_ARG, iprof ); --- 298,301 ---- *************** *** 366,370 **** Iterator iterInner; IProf.sID sid; ! LinkedList listInner; IDObjectData obj, objInner, objOpposite; --- 381,387 ---- Iterator iterInner; IProf.sID sid; ! List listInner; ! List postOpLst = new LinkedList(); ! List postOpIterLst = new LinkedList(); IDObjectData obj, objInner, objOpposite; *************** *** 378,386 **** //dbg int j=0; try { - //add hashtables for IDs (temporary) while( pass || iter.hasNext() ) { - //IProf.sID sid = (IProf.sID) ((IDObjectData) in.next()).getID; - //IProf.sInfo ci = (IProf.sClassInfo)iprof.getInfo( sid.infoId, IProf.CLASS_INFO); if ( iter == null ) { iterInner = iprof.getAllThruIterator( 0, whatType, true, --- 395,401 ---- //dbg int j=0; + try { while( pass || iter.hasNext() ) { if ( iter == null ) { iterInner = iprof.getAllThruIterator( 0, whatType, true, *************** *** 404,409 **** sid = (IProf.sID) iterInner.next(); //this could by factory ! objInner = createAndPutIn( whatType, sid, obj ); ! libIDs.put( new Integer(objInner.getID()), objInner ); if ( out != null ) out.add( objInner ); --- 419,425 ---- sid = (IProf.sID) iterInner.next(); //this could by factory ! objInner = createAndPutIn( whatType, sid, obj, postOpLst, ! postOpIterLst ); ! libIDs.put( new Integer(objInner.getID()), objInner ); if ( out != null ) out.add( objInner ); *************** *** 415,421 **** --- 431,440 ---- }; + postOpIterLst = doPostOpIter( whatType, obj, postOpIterLst ); + if ( iter == null ) //one pass break; } + doPostOp( whatType, postOpLst ); } //PENDING trow other exception *************** *** 440,447 **** }; ! //TODO: Build thread tree ! // if (parent != null ) ! // parent.addChild( newObj ); private List createFramesFromInfo( IProf.sTraceInfo trcInfo ) { --- 459,501 ---- }; + + /* Uses postOpIterLst, return new List, which should be used used in next + * iteration + */ + private List doPostOpIter( int whatType, IDObjectData refObj, List postOpIterLst ) { + if ( postOpIterLst == null ) + return new LinkedList(); + if ( refObj != null ) + return postOpIterLst; + + switch( whatType ) { + case IProf.CLASS_FIELDS_INSTANCES: { + ((ClassData) refObj).setInstaceFields( postOpIterLst ); + return new LinkedList(); + } + case IProf.CLASS_FIELDS_STATICS: { + ((ClassData) refObj).setStaticFields( postOpIterLst ); + return new LinkedList(); + } + default: return postOpIterLst; + } + } ! private void doPostOp( int whatType, List postOpLst ) { ! ListIterator iter; ! PostOpThreadData obj; ! ThreadData parent; ! ! if ( postOpLst != null ) { ! if( whatType == IProf.GROUP_THREADS || whatType == IProf.THREADS) { ! iter = postOpLst.listIterator(); ! while( iter.hasNext() ) { ! obj = (PostOpThreadData) iter.next(); ! parent = (ThreadData) libIDs.get( obj.parentID ); ! obj.threadData.setParent( parent ); ! } ! } ! } ! }; private List createFramesFromInfo( IProf.sTraceInfo trcInfo ) { *************** *** 449,453 **** int i; ! List frames = new LinkedList(); for( i = 0; i < num; i++ ) frames.add(new TraceFrameData( trcInfo.frames[i].lineno, --- 503,507 ---- int i; ! List frames = new ArrayList( trcInfo.numFrames ); for( i = 0; i < num; i++ ) frames.add(new TraceFrameData( trcInfo.frames[i].lineno, *************** *** 457,473 **** return frames; }; private IDObjectData createAndPutIn( int whatType, IProf.sID sid, ! IDObjectData refObj ) { switch( whatType ) { case IProf.CLASSES: { - /* List tmpLst = new LinkedList(); - tmpLst.add( - List flds_stat = new LinkedList(); - List flds_inst = new LinkedList(); - extract( tmpLst, flds_stat, IProf.CLASS_FIELDS_STATICS, - IProf.NO_OPTIONAL_ARG, iprof ); - extract( tmpLst, flds_inst, IProf.CLASS_FIELDS_INSTANCES, - IProf.NO_OPTIONAL_ARG, iprof );*/ return new ClassData( sid ); } --- 511,521 ---- return frames; }; + private IDObjectData createAndPutIn( int whatType, IProf.sID sid, ! IDObjectData refObj, List postOpLst, ! List postOpIterLst) { switch( whatType ) { case IProf.CLASSES: { return new ClassData( sid ); } *************** *** 498,517 **** 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 ); ! // if (parent != null ) ! // 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 ); ! // if (parent != null ) ! // parent.addChild( newObj ); return newObj; } --- 546,569 ---- ThreadGroupData up = (ThreadGroupData) libIDs.get( new Integer( sid.parentUpObjId )); ! Integer parentID = new Integer( ((IProf.sThreadInfo) sid.info).parentObjId); ! ThreadData parent = (ThreadData) libIDs.get( parentID); ThreadData newObj = new ThreadData( sid, up, parent ); up.addThread( newObj ); ! if (parent != null ) ! parent.addChild( newObj ); ! else //assign parent later ! postOpLst.add( new PostOpThreadData( parentID, newObj ) ); return newObj; } case IProf.GROUP_THREADS: { ThreadGroupData up = (ThreadGroupData) refObj; ! Integer parentID = new Integer( ((IProf.sThreadInfo) sid.info).parentObjId); ! ThreadData parent = (ThreadData) libIDs.get( parentID ); ThreadData newObj = new ThreadData( sid, up, parent ); up.addThread( newObj ); ! if (parent != null ) ! parent.addChild( newObj ); ! else //assign parent later ! postOpLst.add( new PostOpThreadData( parentID, newObj ) ); return newObj; } *************** *** 520,525 **** ClassData rf = (ClassData) refObj; ClassFieldData newObj = new ClassFieldData( sid ); ! //PENDING ! // rf.addStatField( newObj ); return newObj; } --- 572,576 ---- ClassData rf = (ClassData) refObj; ClassFieldData newObj = new ClassFieldData( sid ); ! postOpIterLst.add( newObj ); //later setStaticFileds() is called to this List return newObj; } *************** *** 528,533 **** ClassData rf = (ClassData) refObj; ClassFieldData newObj = new ClassFieldData( sid ); ! //PENDING ! // rf.addInstField( newObj ); return newObj; } --- 579,583 ---- ClassData rf = (ClassData) refObj; ClassFieldData newObj = new ClassFieldData( sid ); ! postOpIterLst.add( newObj ); //later setInstanceFileds() is called to this List return newObj; } *************** *** 706,712 **** sid, up, lf ); up.addAllocMethod( newObj ); ! // lf.addAllocThread( newObj ); //FIXME return newObj; } //// case IProf.ALLOC_THREAD_METHOD_TRACES:{ --- 756,773 ---- sid, up, lf ); up.addAllocMethod( newObj ); ! lf.addAllocThread( newObj ); return newObj; } + //this is not implemented in IProf, yet?? + case IProf.ALLOC_METHOD_THREADS: { + MethodData lf = (MethodData) refObj; + ThreadData up =(ThreadData) + libIDs.get( new Integer( sid.parentUpObjId )); + AllocThreadMethodData newObj = new AllocThreadMethodData( + sid, up, lf ); + up.addAllocMethod( newObj ); + lf.addAllocThread( newObj ); + return newObj; + } //// case IProf.ALLOC_THREAD_METHOD_TRACES:{ *************** *** 717,727 **** 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 //// ////****************** --- 778,795 ---- sid, up, lf ); up.addTrace( newObj ); ! lf.addThread( newObj ); return newObj; } ! //this is not implemented in IProf, yet?? ! case IProf.ALLOC_METHOD_TRACE_THREADS: { ! AllocTraceData lf = (AllocTraceData) refObj; ! AllocThreadMethodData up = (AllocThreadMethodData) ! libIDs.get( new Integer( sid.parentUpObjId )); ! AllocThreadTraceData newObj = new AllocThreadTraceData( ! sid, up, lf ); ! up.addTrace( newObj ); ! lf.addThread( newObj ); ! return newObj; ! } //// ////****************** *************** *** 850,862 **** //TODO: // write exception handling code properly - // write building of thread tree - // finish extraction of class fields (connect to tree) - - //?write recursively build of missing parts of tree, needed for a) question - //get traces.hits() > 50, and expands to all children /* * $Log$ * Revision 1.5 2001/12/09 23:27:34 vachis * connecting MethodData to ClassData --- 918,928 ---- //TODO: // write exception handling code properly /* * $Log$ + * Revision 1.6 2001/12/27 14:21:23 vachis + * finished connecting threads and class fields to mirror + * * Revision 1.5 2001/12/09 23:27:34 vachis * connecting MethodData to ClassData *************** *** 875,877 **** * Snapshot implementation * ! */ \ No newline at end of file --- 941,944 ---- * Snapshot implementation * ! */ ! |
From: Pavel V. <va...@us...> - 2001-12-27 14:17:35
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv20688 Modified Files: MethodData.java Log Message: expansion to threads fixies Index: MethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MethodData.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** MethodData.java 2001/12/09 23:21:01 1.7 --- MethodData.java 2001/12/27 14:17:31 1.8 *************** *** 68,71 **** --- 68,76 ---- private HashMap allocTraces; /** + * Map of threads of this method where some objects were allocated. + * Mapping of {@link AllocThreadMethodData} objects and thread IDs. + */ + private HashMap allocThreads; + /** * Map of classes whose instances were allocated in this method. * Mapping of {@link AllocClassMethodData} objects and class IDs. *************** *** 112,115 **** --- 117,121 ---- this.clazz=clazz; allocTraces=new HashMap(); + allocThreads=new HashMap();; CPUTraces=new HashMap(); classes=new HashMap(); *************** *** 234,239 **** CPUTraces.put(new Integer(trace.getID()), trace); } - /** * Returns map of monitor traces of this method. --- 240,255 ---- CPUTraces.put(new Integer(trace.getID()), trace); } + /** + * Returns trace (with given ID) of this method. + * + * @param ID ID of the trace. + * @return trace (with given ID) of this method or <code>null</code> + * if such trace does not exist. + */ + public CPUTraceData getCPUTrace(int ID) { + return (CPUTraceData)CPUTraces.get(new Integer(ID)); + } + /** * Returns map of monitor traces of this method. *************** *** 253,260 **** MonTraces.put(new Integer(trace.getID()), trace); } ! ! /** ! * Returns trace (with given ID) of this method. * * @param ID ID of the trace. --- 269,275 ---- MonTraces.put(new Integer(trace.getID()), trace); } ! /** ! * Returns monitor trace (with given ID) of this method. * * @param ID ID of the trace. *************** *** 262,267 **** * if such trace does not exist. */ ! public AllocTraceData getCPUTrace(int ID) { ! return (AllocTraceData)CPUTraces.get(new Integer(ID)); } --- 277,282 ---- * if such trace does not exist. */ ! public MonTraceData getMonTrace(int ID) { ! return (MonTraceData)MonTraces.get(new Integer(ID)); } *************** *** 300,303 **** --- 315,350 ---- } + /** + * Returns threads of this method where some objects + * were allocated. + * + * @return mapping of {@link AllocThreadMethodData} objects and thread IDs. + */ + public Map getAllocThreads() { + return allocThreads; + } + + /** + * Adds threads of this method where some objects + * were allocated. + * + * @param thread threads in which this method allocated some object. + */ + void addAllocThread(AllocThreadMethodData thread) { + allocThreads.put( thread.getThread(), thread); + } + + /** + * Returns thread (with given ID) of this method where some objects + * were allocated. + * + * @param ID ID of the thread. + * @return thread (with given ID) in which this method allocated some object + * or <code>null</code> if such thread does not exist. + */ + public AllocThreadMethodData getAllocThread(int ID) { + return (AllocThreadMethodData) allocThreads.get(new Integer(ID)); + } + /** * Returns threads in which this method was invoked. *************** *** 485,488 **** --- 532,539 ---- /* * $Log$ + * Revision 1.8 2001/12/27 14:17:31 vachis + * expansion to threads + * fixies + * * Revision 1.7 2001/12/09 23:21:01 vachis * temporary fix, classData may be null |
From: Pavel V. <va...@us...> - 2001-12-27 14:14:36
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv19919 Modified Files: ClassData.java Log Message: new methods for setting fields lists Index: ClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ClassData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** ClassData.java 2001/12/09 23:24:39 1.6 --- ClassData.java 2001/12/27 14:14:33 1.7 *************** *** 146,149 **** --- 146,171 ---- /** + * Sets Instance fields defined in this class. + * + * @param fields fields defined in this class. It should be + * <code>List</code> of {@link ClassFieldData} objects. + */ + void setInstaceFields(List fields) { + this.instanceFields = fields; + numInstanceFields = this.instanceFields.size(); + } + + /** + * Sets Static fields defined in this class. + * + * @param fields fields defined in this class. It should be + * <code>List</code> of {@link ClassFieldData} objects. + */ + void setStaticFields(List fields) { + this.staticFields = fields; + numStaticFields = this.staticFields.size(); + } + + /** * Returns name of this class. * *************** *** 240,243 **** --- 262,268 ---- /* * $Log$ + * Revision 1.7 2001/12/27 14:14:33 vachis + * new methods for setting fields lists + * * Revision 1.6 2001/12/09 23:24:39 vachis * new addMethod() method |
From: Pavel V. <va...@us...> - 2001-12-27 14:12:33
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv19435 Modified Files: AllocTraceData.java Log Message: expansion to threads Index: AllocTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTraceData.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** AllocTraceData.java 2001/12/09 23:20:01 1.7 --- AllocTraceData.java 2001/12/27 14:12:31 1.8 *************** *** 43,46 **** --- 43,51 ---- */ private Map classes; + /** + * Map of threads in which this trace appeared. + * Mapping of {@link AllocThreadTraceData} objects and thread IDs. + */ + private Map threads; /** *************** *** 57,60 **** --- 62,66 ---- this.frames=frames; classes=new HashMap(); + threads=new HashMap(); } *************** *** 123,126 **** --- 129,162 ---- return (AllocClassTraceData)classes.get(new Integer(ID)); } + + /** + * Returns map of threads in which this trace appeared. + * + * @return mapping of {@link AllocThreadTraceData} objects and thread IDs. + */ + public Map getThreads() { + return threads; + } + + /** + * Adds thread in which this trace appeared. + * + * @param thread thread in which this trace appeared. + */ + void addThread(AllocThreadTraceData thread) { + threads.put(thread.getThreadMethod().getThread(), thread); + } + + /** + * Returns thread (with given ID) in which this trace appeared. + * + * @param ID ID of the thread. + * @return thread (with given ID) in which this trace appeared + * or <code>null</code> if such thread does not exist. + */ + public AllocThreadTraceData getThread(int ID) { + return (AllocThreadTraceData)threads.get(new Integer(ID)); + } + } *************** *** 128,131 **** --- 164,170 ---- /* * $Log$ + * Revision 1.8 2001/12/27 14:12:31 vachis + * expansion to threads + * * Revision 1.7 2001/12/09 23:20:01 vachis * temporary fix, classData may be null |
From: Pavel V. <va...@us...> - 2001-12-27 14:11:42
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv19201 Modified Files: ThreadData.java Log Message: new setParent() method Index: ThreadData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ThreadData.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ThreadData.java 2001/12/09 23:21:01 1.9 --- ThreadData.java 2001/12/27 14:11:39 1.10 *************** *** 129,132 **** --- 129,142 ---- return parent; } + + /** + * Sets parent for this thread. Use this, if you can't pass parent + * param to constructor. + * + * @param parent parent of this thread. + */ + void setParent( ThreadData parent ) { + this.parent = parent; + } /** *************** *** 185,189 **** //temporary fix if ( clazz.getClazz().getClassData() != null ) ! classes.put(new Integer(clazz.getClazz().getClassData().getID()), clazz); } --- 195,199 ---- //temporary fix if ( clazz.getClazz().getClassData() != null ) ! classes.put(new Integer(clazz.getClazz().getClassData().getID()), clazz); } *************** *** 290,293 **** --- 300,306 ---- /* * $Log$ + * Revision 1.10 2001/12/27 14:11:39 vachis + * new setParent() method + * * Revision 1.9 2001/12/09 23:21:01 vachis * temporary fix, classData may be null |
From: Pavel V. <va...@us...> - 2001-12-27 14:08:01
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv18228 Modified Files: IDObjectData.java Log Message: no message Index: IDObjectData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/IDObjectData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** IDObjectData.java 2001/09/29 21:01:33 1.2 --- IDObjectData.java 2001/12/27 14:07:56 1.3 *************** *** 48,55 **** --- 48,68 ---- } + //inherited from Object + // /** + // * HashCode is ID of the object. + // * + // * @return ID of the object. + // */ + // public int hashCode() { + // return ID; + // } + } /* * $Log$ + * Revision 1.3 2001/12/27 14:07:56 vachis + * no message + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. |
From: Pavel V. <va...@us...> - 2001-12-10 09:43:29
|
Update of /cvsroot/javaprofiler/test/snapshot In directory usw-pr-cvs1:/tmp/cvs-serv27959 Added Files: TestSnap.java Log Message: test of SnapshotImpl --- NEW FILE: TestSnap.java --- //java -Xrun\Project\javaprof\library\src\profiler\profiler:commun_type=socket Notepad /* * 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.*; import net.sourceforge.javaprofiler.jpiimpl.data.*; import net.sourceforge.javaprofiler.jpi.*; public class TestSnap { // communication interface private IProf iprof = null; // number of all methods together private int numMethods = 0; public void getSnapShot( ) { //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; long start = System.currentTimeMillis(); Snapshot mirror = new SnapshotImpl( iprof, withCPU, withAlloc, withMon, withGC, withTraces, withThreads, CPUTraces_MinVal, AllocTraces_MinVal, MonTraces_MinVal); System.out.println( mirror.time() ); long end = System.currentTimeMillis(); System.out.println( "\n\nTime TestSnap: " + (end - start) ); } public void runTest() { // initialize and start communication //iprof = new IProf(); iprof = new IProf( new CommunSetupSocket() ); iprof.run(); try { System.out.println( "Ready" ); // til profiled program is going, do nothing //while( !iprof.isShutdowned()) Thread.sleep( 1000); // profiled program has finished, so ask for all classes getSnapShot(); // 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 TestSnap()).runTest(); } }; //GetCurtime |
From: Pavel V. <va...@us...> - 2001-12-10 09:42:49
|
Update of /cvsroot/javaprofiler/test/snapshot In directory usw-pr-cvs1:/tmp/cvs-serv27749/snapshot Log Message: Directory /cvsroot/javaprofiler/test/snapshot added to the repository |
From: Pavel V. <va...@us...> - 2001-12-09 23:29:29
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv27287 Modified Files: VirtualMachineImpl.java Log Message: impl of enableGC(), snapshot() Index: VirtualMachineImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/VirtualMachineImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** VirtualMachineImpl.java 2001/11/17 12:02:17 1.1 --- VirtualMachineImpl.java 2001/12/09 23:29:25 1.2 *************** *** 27,30 **** --- 27,31 ---- import net.sourceforge.javaprofiler.jpi.event.EventQueue; import net.sourceforge.javaprofiler.jpiimpl.commun.*; + import net.sourceforge.javaprofiler.jpiimpl.data.*; /** *************** *** 36,39 **** --- 37,41 ---- public class VirtualMachineImpl implements VirtualMachine { private IProf iprof; + private boolean isSuspendedVM; public VirtualMachineImpl(IProf iprof) { *************** *** 48,52 **** */ public void enableGC(boolean enable) { ! //PENDING } --- 50,63 ---- */ public void enableGC(boolean enable) { ! try { ! if( enable ) { ! iprof.enableGC(); ! } ! else { ! iprof.disableGC(); ! } ! } catch (COMMUN_Exception e) { ! throw new VMDisconnectedException(); ! } } *************** *** 89,94 **** */ public Snapshot createSnapshot() { ! //PENDING ! return null; } --- 100,110 ---- */ public Snapshot createSnapshot() { ! //pending: to pass configuration ! //pending: if not_suspendedVM then suspendVM and resumeVM ! suspendThreads(); ! Snapshot snap = new SnapshotImpl( iprof ); ! resumeThreads(); ! return snap; ! //return null; } *************** *** 236,240 **** */ public void gc() { ! //PENDING } --- 252,260 ---- */ public void gc() { ! try { ! iprof.runGC(); ! } catch (COMMUN_Exception e) { ! throw new VMDisconnectedException(); ! } } *************** *** 267,270 **** --- 287,293 ---- /* * $Log$ + * Revision 1.2 2001/12/09 23:29:25 vachis + * impl of enableGC(), snapshot() + * * Revision 1.1 2001/11/17 12:02:17 stolis * First version of VirtualMachineImpl. |
From: Pavel V. <va...@us...> - 2001-12-09 23:27:37
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv26904 Modified Files: SnapshotImpl.java Log Message: connecting MethodData to ClassData extection of class fields; frames fix Index: SnapshotImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/SnapshotImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** SnapshotImpl.java 2001/12/05 00:40:05 1.4 --- SnapshotImpl.java 2001/12/09 23:27:34 1.5 *************** *** 37,42 **** */ public class SnapshotImpl implements Snapshot { ! String name; ! long time; private HashMap libIDs = new HashMap(); //converts libIds to references --- 37,42 ---- */ public class SnapshotImpl implements Snapshot { ! private String name; ! private long time; private HashMap libIDs = new HashMap(); //converts libIds to references *************** *** 50,69 **** //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 */ --- 50,69 ---- //default conf ! private boolean withCPU = true; ! private boolean withAlloc = true; ! private boolean withMon = true; //boolean withArenas = true; ! private boolean withGC = true; ! private boolean withTraces = true; ! private boolean withThreads = true; //only traces with more hits than this will be extracted ! private int CPUTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; //only traces with more allocations than this will be extracted ! private int AllocTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; //only traces with more hits than this will be extracted ! private int MonTraces_MinVal = IProf.NO_OPTIONAL_ARG; //2; //other ! private boolean haveSnapshot = false; /** Creates new SnapshotImpl */ *************** *** 72,75 **** --- 72,76 ---- } + /** Creates new SnapshotImpl */ //maybe use soem configuration object public SnapshotImpl( IProf iprof, boolean withCPU, boolean withAlloc, *************** *** 91,217 **** } - - //init method - private void makeSnapshot( IProf iprof ) - { - //PENDING - //if ( haveSnapshot ) - //throw vyjimku; - long start = System.currentTimeMillis(); - LinkedList actLst = new LinkedList(); //temporary list - LinkedList actLst2 = new LinkedList(); //temporary list - LinkedList actLst3 = new LinkedList(); - try { - //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 ); - } - } - } - if( withAlloc ) { - actLst3.clear(); - actLst2.clear(); - 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 ) { - 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( 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); - } - } - } - 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 ); - } - } - } - //?//PENDING - //if ( withArenas ) { - // extract( null, arenas, IProf.NO_OPTIONAL_ARG, IProf.ARENAS ); - //} - if ( withGC ) { - extract( null, gcs, IProf.GCS, IProf.NO_OPTIONAL_ARG, iprof ); - } - } - catch ( COMMUN_Exception e ) { - System.out.println( "Erron in communication\n" ); - } - catch( Exception e ) { - System.out.println( "Just error\n" + e); - } - - long end = System.currentTimeMillis(); - System.out.println( "\n\nTime: " + (end - start) ); - } ////////////////////////////////////////////////////////////////////////// --- 92,97 ---- } + ////////////////////////////////////////////////////////////////////////// *************** *** 349,352 **** --- 229,358 ---- ////////////////////////////////////////////////////////////////////////////// + //init method + private void makeSnapshot( IProf iprof ) + { + //PENDING + //if ( haveSnapshot ) + //throw vyjimku; + + long start = System.currentTimeMillis(); + LinkedList actLst = new LinkedList(); //temporary list + LinkedList actLst2 = new LinkedList(); //temporary list + LinkedList actLst3 = new LinkedList(); + try { + + //Add some info like time, data, etc. + + + if (withCPU || withAlloc || 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( 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 ); + } + } + } + if( withAlloc ) { + actLst3.clear(); + actLst2.clear(); + 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 ) { + 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( withTraces ) { + extract( actLst, null, IProf.ALLOC_THREAD_METHOD_TRACES, + AllocTraces_MinVal, iprof ); + } + extract( actLst, (withTraces)? actLst2 : null, + IProf.ALLOC_THREAD_METHOD_OBJECTS, + IProf.NO_OPTIONAL_ARG, iprof ); + if( withTraces ) { + extract( actLst2, null, IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES, + AllocTraces_MinVal, iprof); + } + } + } + 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 ); + } + } + } + //?//PENDING + //if ( withArenas ) { + // extract( null, arenas, IProf.NO_OPTIONAL_ARG, IProf.ARENAS ); + //} + if ( withGC ) { + extract( null, gcs, IProf.GCS, IProf.NO_OPTIONAL_ARG, iprof ); + } + } + catch ( COMMUN_Exception e ) { + System.out.println( "Erron in communication\n" ); + } + catch( Exception e ) { + System.out.println( "Just error\n" + e); + } + + long end = System.currentTimeMillis(); + System.out.println( "\n\nTime: " + (end - start) ); + } + + /* *You can't call following method in any order you think *************** *** 354,361 **** *This methods directly uses mirror strucutre and libIDs. */ - - /* Maybe rewrite it with direct use of commun.Commun and commun.Buffer - *(data classes will have constructors for Buffer) - */ private void extract( List in, List out, int whatType, int optArg, IProf iprof ) throws COMMUN_Exception { //throws --- 360,363 ---- *************** *** 409,413 **** //dbg } catch (Exception e) ! { System.out.print("zz");}; if ( iter == null ) //one pass --- 411,417 ---- //dbg } catch (Exception e) ! { ! System.out.print("zz" + e.toString() + " " ); ! }; if ( iter == null ) //one pass *************** *** 437,450 **** }; private IDObjectData createAndPutIn( int whatType, IProf.sID sid, IDObjectData refObj ) { switch( whatType ) { case IProf.CLASSES: { return new ClassData( sid ); } case IProf.OBJECT_TYPES: { ! ClassData clz = (ClassData) libIDs.get( new Integer( ! ((IProf.sObjectInfo) sid.info).classObjId)); return new AllocClassData( sid, clz ); //have to look at sid.info.isArray, probably in object --- 441,481 ---- }; + //TODO: Build thread tree + // if (parent != null ) + // parent.addChild( newObj ); + + private List createFramesFromInfo( IProf.sTraceInfo trcInfo ) { + int num = trcInfo.numFrames; + int i; + + List frames = new LinkedList(); + for( i = 0; i < num; i++ ) + frames.add(new TraceFrameData( trcInfo.frames[i].lineno, + ((MethodData) libIDs.get( + new Integer(trcInfo.frames[i].methodObjId )) + ) )); + return frames; + }; + private IDObjectData createAndPutIn( int whatType, IProf.sID sid, IDObjectData refObj ) { switch( whatType ) { case IProf.CLASSES: { + /* List tmpLst = new LinkedList(); + tmpLst.add( + List flds_stat = new LinkedList(); + List flds_inst = new LinkedList(); + extract( tmpLst, flds_stat, IProf.CLASS_FIELDS_STATICS, + IProf.NO_OPTIONAL_ARG, iprof ); + extract( tmpLst, flds_inst, IProf.CLASS_FIELDS_INSTANCES, + IProf.NO_OPTIONAL_ARG, iprof );*/ return new ClassData( sid ); } case IProf.OBJECT_TYPES: { ! //FIXMEE ! //ClassData clz = (ClassData) libIDs.get( new Integer( ! // ((IProf.sObjectInfo) sid.info).classObjId)); ! ClassData clz = null; return new AllocClassData( sid, clz ); //have to look at sid.info.isArray, probably in object *************** *** 471,476 **** ThreadData newObj = new ThreadData( sid, up, parent ); up.addThread( newObj ); ! if (parent != null ) ! parent.addChild( newObj ); return newObj; } --- 502,507 ---- ThreadData newObj = new ThreadData( sid, up, parent ); up.addThread( newObj ); ! // if (parent != null ) ! // parent.addChild( newObj ); return newObj; } *************** *** 481,496 **** 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; } --- 512,540 ---- ThreadData newObj = new ThreadData( sid, up, parent ); up.addThread( newObj ); ! // if (parent != null ) ! // parent.addChild( newObj ); return newObj; } //// ! case IProf.CLASS_FIELDS_STATICS: { ! ClassData rf = (ClassData) refObj; ! ClassFieldData newObj = new ClassFieldData( sid ); ! //PENDING ! // rf.addStatField( newObj ); ! return newObj; ! } ! case IProf.CLASS_FIELDS_INSTANCES: { ! ClassData rf = (ClassData) refObj; ! ClassFieldData newObj = new ClassFieldData( sid ); ! //PENDING ! // rf.addInstField( newObj ); ! return newObj; ! } //// case IProf.METHODS: { ClassData up = (ClassData) libIDs.get( new Integer(sid.parentUpObjId) ); MethodData newObj = new MethodData( sid, up ); ! up.addMethod( newObj ); return newObj; } *************** *** 498,502 **** ClassData up = (ClassData) refObj; MethodData newObj = new MethodData( sid, up ); ! // up.addMethod( newObj ); //FIXME return newObj; } --- 542,546 ---- ClassData up = (ClassData) refObj; MethodData newObj = new MethodData( sid, up ); ! up.addMethod( newObj ); return newObj; } *************** *** 505,512 **** 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: { --- 549,565 ---- case IProf.ALLOC_METHOD_TRACES: { MethodData rf = (MethodData) refObj; ! AllocTraceData newObj = new AllocTraceData( sid, rf, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); rf.addAllocTrace( newObj ); return newObj; } + case IProf.ALLOC_TRACES: { + MethodData up = (MethodData) + libIDs.get( new Integer( sid.parentUpObjId )); + AllocTraceData newObj = new AllocTraceData( sid, up, + createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); + up.addAllocTrace( newObj ); + return newObj; + } case IProf.ALLOC_METHOD_OBJECTS: { *************** *** 676,680 **** MethodData up = (MethodData) libIDs.get( new Integer( sid.parentUpObjId )); ! CPUTraceData newObj = new CPUTraceData( sid, up ); up.addCPUTrace( newObj ); return newObj; --- 729,734 ---- MethodData up = (MethodData) libIDs.get( new Integer( sid.parentUpObjId )); ! CPUTraceData newObj = new CPUTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addCPUTrace( newObj ); return newObj; *************** *** 682,686 **** case IProf.CPU_METHOD_TRACES: { MethodData up = (MethodData) refObj; ! CPUTraceData newObj = new CPUTraceData( sid, up ); up.addCPUTrace( newObj ); return newObj; --- 736,741 ---- case IProf.CPU_METHOD_TRACES: { MethodData up = (MethodData) refObj; ! CPUTraceData newObj = new CPUTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addCPUTrace( newObj ); return newObj; *************** *** 728,732 **** case IProf.MON_METHOD_TRACES: { MethodData up = (MethodData) refObj; ! MonTraceData newObj = new MonTraceData( sid, up ); up.addMonTrace( newObj ); return newObj; --- 783,788 ---- case IProf.MON_METHOD_TRACES: { MethodData up = (MethodData) refObj; ! MonTraceData newObj = new MonTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addMonTrace( newObj ); return newObj; *************** *** 735,739 **** MethodData up = (MethodData) libIDs.get( new Integer( sid.parentUpObjId )); ! MonTraceData newObj = new MonTraceData( sid, up ); up.addMonTrace( newObj ); return newObj; --- 791,796 ---- MethodData up = (MethodData) libIDs.get( new Integer( sid.parentUpObjId )); ! MonTraceData newObj = new MonTraceData( sid, up, ! createFramesFromInfo( (IProf.sTraceInfo) sid.info ) ); up.addMonTrace( newObj ); return newObj; *************** *** 780,784 **** default: return null; ! //throw some excetion } --- 837,841 ---- default: return null; ! //throw some exception } *************** *** 793,802 **** //TODO: // write exception handling code properly ! // write extraction of class fields - //write passing configuration /* * $Log$ * Revision 1.4 2001/12/05 00:40:05 vachis * fixies --- 850,866 ---- //TODO: // write exception handling code properly ! // write building of thread tree ! // finish extraction of class fields (connect to tree) ! ! //?write recursively build of missing parts of tree, needed for a) question ! //get traces.hits() > 50, and expands to all children /* * $Log$ + * Revision 1.5 2001/12/09 23:27:34 vachis + * connecting MethodData to ClassData + * extection of class fields; frames fix + * * Revision 1.4 2001/12/05 00:40:05 vachis * fixies |
From: Pavel V. <va...@us...> - 2001-12-09 23:24:41
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv26220 Modified Files: ClassData.java Log Message: new addMethod() method Index: ClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ClassData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ClassData.java 2001/12/02 12:12:04 1.5 --- ClassData.java 2001/12/09 23:24:39 1.6 *************** *** 97,106 **** * @param sid data returned by communication layer */ ClassData( IProf.sID sid ) { this(sid.objId, ((IProf.sClassInfo)sid.info).className, ((IProf.sClassInfo)sid.info).sourceName, ! ((IProf.sClassInfo)sid.info).numInterfaces, 0, 0, null, 0, null, sid.active); ! } /** --- 97,123 ---- * @param sid data returned by communication layer */ + ClassData( IProf.sID sid, int numStaticFields, List staticFields, + int numInstanceFields, List instanceFields ) { + this(sid.objId, ((IProf.sClassInfo)sid.info).className, + ((IProf.sClassInfo)sid.info).sourceName, + ((IProf.sClassInfo)sid.info).numInterfaces, 0, //pending + numStaticFields, staticFields, + numInstanceFields, instanceFields, + sid.active); + } + + /** + * Creates new ClassData. + * + * @param sid data returned by communication layer + */ ClassData( IProf.sID sid ) { this(sid.objId, ((IProf.sClassInfo)sid.info).className, ((IProf.sClassInfo)sid.info).sourceName, ! ((IProf.sClassInfo)sid.info).numInterfaces, 0, //pending ! 0, null, ! 0, null, sid.active); ! } /** *************** *** 112,115 **** --- 129,146 ---- void setMethods(List methods) { this.methods=methods; + numMethods = this.methods.size(); + } + + /** + * Adds new method defined in this class. + * + * @param method method defined in this class. + */ + void addMethod(MethodData method) { + if (methods == null) + methods = new LinkedList(); + methods.add( method ); + numMethods++; + //pending? exception if method is in list } *************** *** 209,212 **** --- 240,246 ---- /* * $Log$ + * Revision 1.6 2001/12/09 23:24:39 vachis + * new addMethod() method + * * Revision 1.5 2001/12/02 12:12:04 petrul * changed constructor code |
From: Pavel V. <va...@us...> - 2001-12-09 23:23:20
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv25975 Modified Files: ClassFieldData.java Log Message: constructor for IProf.sid Index: ClassFieldData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ClassFieldData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ClassFieldData.java 2001/09/29 21:01:33 1.2 --- ClassFieldData.java 2001/12/09 23:23:18 1.3 *************** *** 21,24 **** --- 21,26 ---- package net.sourceforge.javaprofiler.jpiimpl.data; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Static or instance field of class. *************** *** 46,49 **** --- 48,61 ---- /** + * Creates new ClassFieldData + * + * @param sid data returned by communication layer . + */ + ClassFieldData( IProf.sID sid ) { + this(sid.objId, ((IProf.sClassFieldInfo) sid.info).fieldName, + ((IProf.sClassFieldInfo) sid.info).fieldSignature); + } + + /** * Returns name of the field. * *************** *** 67,70 **** --- 79,85 ---- /* * $Log$ + * Revision 1.3 2001/12/09 23:23:18 vachis + * constructor for IProf.sid + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. |
From: Pavel V. <va...@us...> - 2001-12-09 23:22:08
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv25739 Modified Files: MonTraceData.java CPUTraceData.java Log Message: frames added Index: MonTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MonTraceData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** MonTraceData.java 2001/12/02 15:33:30 1.2 --- MonTraceData.java 2001/12/09 23:22:05 1.3 *************** *** 67,73 **** * @param method profiling data for this method. */ ! MonTraceData( IProf.sID sid, MethodData method ) { ! this( sid.objId, method, null ); //sid...method ); ! if (sid.mon!=null) addToMonStat(sid.mon.hits, sid.mon.time); } --- 67,75 ---- * @param method profiling data for this method. */ ! MonTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! ! ! if (sid.mon!=null) addToMonStat(sid.mon.hits, sid.mon.time); } *************** *** 125,128 **** --- 127,133 ---- /* * $Log$ + * Revision 1.3 2001/12/09 23:22:05 vachis + * frames added + * * Revision 1.2 2001/12/02 15:33:30 petrul * changed constructor code Index: CPUTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUTraceData.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** CPUTraceData.java 2001/12/02 14:34:49 1.5 --- CPUTraceData.java 2001/12/09 23:22:05 1.6 *************** *** 65,71 **** * @param method profiling data for this method. */ ! CPUTraceData( IProf.sID sid, MethodData method ) { ! this( sid.objId, method, null ); //sid...method ); ! if (sid.cpu!=null) addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } --- 65,72 ---- * @param method profiling data for this method. */ ! CPUTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! ! if (sid.cpu!=null) addToCPUStat(sid.cpu.hits, sid.cpu.pureTime); } *************** *** 122,125 **** --- 123,129 ---- /* * $Log$ + * Revision 1.6 2001/12/09 23:22:05 vachis + * frames added + * * Revision 1.5 2001/12/02 14:34:49 petrul * changed constructor code |
From: Pavel V. <va...@us...> - 2001-12-09 23:21:04
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv25427 Modified Files: ThreadData.java MethodData.java Log Message: temporary fix, classData may be null Index: ThreadData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ThreadData.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** ThreadData.java 2001/12/05 00:39:26 1.8 --- ThreadData.java 2001/12/09 23:21:01 1.9 *************** *** 182,186 **** */ void addClass(AllocThreadClassData clazz) { ! classes.put(new Integer(clazz.getClazz().getClassData().getID()), clazz); } --- 182,189 ---- */ void addClass(AllocThreadClassData clazz) { ! //FIXME: classData may be null => throws null pointer exception ! //temporary fix ! if ( clazz.getClazz().getClassData() != null ) ! classes.put(new Integer(clazz.getClazz().getClassData().getID()), clazz); } *************** *** 287,290 **** --- 290,296 ---- /* * $Log$ + * Revision 1.9 2001/12/09 23:21:01 vachis + * temporary fix, classData may be null + * * Revision 1.8 2001/12/05 00:39:26 vachis * MonMethods fix Index: MethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MethodData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** MethodData.java 2001/12/02 15:18:43 1.6 --- MethodData.java 2001/12/09 23:21:01 1.7 *************** *** 280,285 **** * @param clazz class whose instances were allocated in this method. */ ! void addClass(AllocClassMethodData clazz) { ! classes.put(new Integer(clazz.getClazz().getClassData().getID()), clazz); } --- 280,289 ---- * @param clazz class whose instances were allocated in this method. */ ! void addClass(AllocClassMethodData clazz) { ! //!!FIXME in some cases, like array of int (it can be recognised from ! // clazz.isArrary>1) instance clazz have null refernce to class ! //temporary fix ! if( clazz.getClazz().getClassData() != null ) ! classes.put(new Integer(clazz.getClazz().getClassData().getID()), clazz); } *************** *** 481,484 **** --- 485,491 ---- /* * $Log$ + * Revision 1.7 2001/12/09 23:21:01 vachis + * temporary fix, classData may be null + * * Revision 1.6 2001/12/02 15:18:43 petrul * changed constructor code |
From: Pavel V. <va...@us...> - 2001-12-09 23:20:06
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv25151 Modified Files: AllocTraceData.java AllocThreadTraceData.java AllocThreadMethodData.java Log Message: temporary fix, classData may be null Index: AllocTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTraceData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocTraceData.java 2001/12/01 20:33:26 1.6 --- AllocTraceData.java 2001/12/09 23:20:01 1.7 *************** *** 66,72 **** * <code>List</code> of {@link TraceFrameData} objects. */ ! AllocTraceData( IProf.sID sid, MethodData method ) { ! this( sid.objId, method, null ); //sid.info.frames ! if (sid.alloc!=null) setStatistics(sid.alloc); } --- 66,73 ---- * <code>List</code> of {@link TraceFrameData} objects. */ ! AllocTraceData( IProf.sID sid, MethodData method, List frames ) { ! this( sid.objId, method, frames ); ! ! if (sid.alloc!=null) setStatistics(sid.alloc); } *************** *** 105,109 **** */ void addClass(AllocClassTraceData clazz) { ! classes.put(new Integer(clazz.getClassMethod().getClazz().getClassData().getID()), clazz); } --- 106,113 ---- */ void addClass(AllocClassTraceData clazz) { ! //FIXMEE: classDaa may be null => it throws null pointer exception ! //temporary fix ! if (clazz.getClassMethod().getClazz().getClassData() != null) ! classes.put(new Integer(clazz.getClassMethod().getClazz().getClassData().getID()), clazz); } *************** *** 124,127 **** --- 128,134 ---- /* * $Log$ + * Revision 1.7 2001/12/09 23:20:01 vachis + * temporary fix, classData may be null + * * Revision 1.6 2001/12/01 20:33:26 petrul * changed constructor code Index: AllocThreadTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadTraceData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocThreadTraceData.java 2001/12/01 20:31:08 1.6 --- AllocThreadTraceData.java 2001/12/09 23:20:01 1.7 *************** *** 104,108 **** */ void addClass(AllocThreadClassTraceData clazz) { ! classes.put(new Integer(clazz.getClassTrace().getClassMethod().getClazz().getClassData().getID()), clazz); } --- 104,111 ---- */ void addClass(AllocThreadClassTraceData clazz) { ! // FIXME: classData may be null => it throws null pointer excepion ! //temporary fix ! if( clazz.getClassTrace().getClassMethod().getClazz().getClassData() != null ) ! classes.put(new Integer(clazz.getClassTrace().getClassMethod().getClazz().getClassData().getID()), clazz); } *************** *** 124,127 **** --- 127,133 ---- /* * $Log$ + * Revision 1.7 2001/12/09 23:20:01 vachis + * temporary fix, classData may be null + * * Revision 1.6 2001/12/01 20:31:08 petrul * changed constructor code Index: AllocThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadMethodData.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocThreadMethodData.java 2001/12/01 20:27:59 1.6 --- AllocThreadMethodData.java 2001/12/09 23:20:01 1.7 *************** *** 108,111 **** --- 108,114 ---- */ void addClass(AllocThreadClassMethodData clazz) { + //FIXME class classData maybe null => it throws null pointer exception + //temporary fix + if( clazz.getClassMethod().getClazz().getClassData() != null ) classes.put(new Integer(clazz.getClassMethod().getClazz().getClassData().getID()), clazz); } *************** *** 157,160 **** --- 160,166 ---- /* * $Log$ + * Revision 1.7 2001/12/09 23:20:01 vachis + * temporary fix, classData may be null + * * Revision 1.6 2001/12/01 20:27:59 petrul * changed constructor code |
From: Marek P. <ma...@us...> - 2001-12-09 21:09:11
|
Update of /cvsroot/javaprofiler/library/src/commun2 In directory usw-pr-cvs1:/tmp/cvs-serv27035/src/commun2 Modified Files: prof_interface.cpp Log Message: new features Index: prof_interface.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun2/prof_interface.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** prof_interface.cpp 2001/11/28 00:02:41 1.15 --- prof_interface.cpp 2001/12/09 21:09:09 1.16 *************** *** 1047,1067 **** switch( cI) { - case IdObject::ALLOC_TRACE: { // optionalArg ... number of live instances ! AllocStatData* alloc = static_cast<AllocTrace*>( o); if( alloc->allocNumInstancesLive < optionalArg) return 0; break; } ! case IdObject::CPU_TRACE: { // optionalArg ... number of hits ! CpuStatData* cpu = static_cast<CpuTrace*>( o); if( cpu->hits < optionalArg) return 0; break; } ! case IdObject::MON_TRACE: { // optionalArg ... number of hits - MonStatData* mon = static_cast<MonTrace*>( o); if( mon->hits < optionalArg) return 0; --- 1047,1127 ---- switch( cI) { ! case IdObject::ALLOC_TRACE: ! case IdObject::ALLOC_OBJECT_TRACE: ! case IdObject::ALLOC_THREAD_OBJECT_TRACE: ! case IdObject::ALLOC_THREAD_TRACE: { // optionalArg ... number of live instances ! ! AllocStatData* alloc = NULL; ! ! switch( cI) { ! case IdObject::ALLOC_TRACE: { ! ! alloc = static_cast<AllocTrace*>( o); ! break; ! } ! case IdObject::ALLOC_OBJECT_TRACE: { ! ! alloc = static_cast<AllocObjectTrace*>( o); ! break; ! } ! case IdObject::ALLOC_THREAD_OBJECT_TRACE: { ! ! alloc = static_cast<AllocThreadObjectTrace*>( o); ! break; ! } ! case IdObject::ALLOC_THREAD_TRACE: { ! ! alloc = static_cast<AllocThreadTrace*>( o); ! break; ! } ! } ! if( alloc->allocNumInstancesLive < optionalArg) return 0; break; } ! ! case IdObject::CPU_TRACE: ! case IdObject::CPU_THREAD_TRACE: { // optionalArg ... number of hits ! ! CpuStatData* cpu = NULL; ! switch( cI) { ! case IdObject::CPU_TRACE: { ! ! cpu = static_cast<CpuTrace*>( o); ! break; ! } ! case IdObject::CPU_THREAD_TRACE: { ! ! cpu = static_cast<CpuThreadTrace*>( o); ! break; ! } ! } ! if( cpu->hits < optionalArg) return 0; break; } ! ! case IdObject::MON_TRACE: ! case IdObject::MON_THREAD_TRACE: { // optionalArg ... number of hits ! ! MonStatData* mon = NULL; ! ! switch( cI) { ! case IdObject::MON_TRACE: { ! ! mon = static_cast<MonTrace*>( o); ! break; ! } ! case IdObject::MON_THREAD_TRACE: { ! ! mon = static_cast<MonThreadTrace*>( o); ! break; ! } ! } if( mon->hits < optionalArg) return 0; |
From: Marek P. <ma...@us...> - 2001-12-09 16:50:45
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv24729/net/sourceforge/javaprofiler/jpiimpl/commun Modified Files: CommunSetupSocket.java IProf.java Log Message: bug fixes Index: CommunSetupSocket.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/CommunSetupSocket.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** CommunSetupSocket.java 2001/11/21 22:05:55 1.2 --- CommunSetupSocket.java 2001/12/09 16:50:42 1.3 *************** *** 79,81 **** --- 79,94 ---- this.port = port; } + + /** Constructor. It takes setup from given parameters. + ** 'connectMode' argument can take one of the following values: + ** #SERVER_MODE or #CLIENT_MODE. + ** + ** @param connectMode connect mode */ + + public CommunSetupSocket( int connectMode) { + + super( COMMUN_SOCKET); + + this.connectMode = connectMode; + } }; Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** IProf.java 2001/12/03 15:49:56 1.8 --- IProf.java 2001/12/09 16:50:42 1.9 *************** *** 92,96 **** ** true (ok, communication started) */ ! public boolean run() { return !( _commun.hasFailed() || !_commun.initialize());} /** Stop client/server communication. It stops communication --- 92,99 ---- ** true (ok, communication started) */ ! public boolean run() { ! ! return !( _commun.hasFailed() || !_commun.initialize()); ! } /** Stop client/server communication. It stops communication *************** *** 100,105 **** ** @see run() */ ! public synchronized void stop() { _commun.stopCommun();} /// remote shutdown() method identifier private static final int F_SHUTDOWN = 0; --- 103,118 ---- ** @see run() */ ! public synchronized void stop() { ! ! try { ! ! if( _threadsSuspended) resumeVM(); ! while( _gcDisabled != 0) enableGC(); ! } ! catch( Exception e) {} + _commun.stopCommun(); + } + /// remote shutdown() method identifier private static final int F_SHUTDOWN = 0; *************** *** 621,626 **** cf.fieldSignature = b.getString( offset); ! offset += cf.fieldName.length()+1; ! return offset; } --- 634,639 ---- cf.fieldSignature = b.getString( offset); ! offset += cf.fieldSignature.length()+1; ! return offset; } *************** *** 1459,1463 **** if( _numItems <= 0) throw new NoSuchElementException(); ! _numItems--; --- 1472,1476 ---- if( _numItems <= 0) throw new NoSuchElementException(); ! _numItems--; *************** *** 1517,1521 **** boolean hasInfo = ( _dataBuf.getInt( _pos) != 0); _pos += 4; ! if( hasInfo) { --- 1530,1534 ---- boolean hasInfo = ( _dataBuf.getInt( _pos) != 0); _pos += 4; ! if( hasInfo) { *************** *** 1525,1528 **** --- 1538,1542 ---- sOffset o = new sOffset( _pos); _stat.info = getInfo( _stat.infoType, _dataBuf, o, _stat.info); + _pos = o.offset; } *************** *** 1532,1536 **** _stat.info = null; } ! return _stat; } --- 1546,1550 ---- _stat.info = null; } ! return _stat; } |
From: Marek P. <ma...@us...> - 2001-12-09 16:49:35
|
Update of /cvsroot/javaprofiler/library/demo/05 In directory usw-pr-cvs1:/tmp/cvs-serv24402/demo/05 Added Files: Makefile Makefile.mak Makefile.rules README Test.java dir.info Log Message: socket communication fixes --- 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 demonstrates how to easily set up a type of communication. Here we use default type of communication (sockets) but we turned round sides of communication, so a Java module stands for server side and dynamic profiler library stands for client side of communication. This requires to call an application being profiled with special library's parameter 'connect_mode' set to 'client' (default is 'server'): $ java -Xrunprofiler:connect_mode=client -jar <profiled_application.jar> This sample writes names of loaded classes and their static fields to the console. --- 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; private void askForClasses() throws Exception { int numClasses = 0; // ask for all classes Iterator iterator = iprof.getAllThruIterator( 0, IProf.CLASSES, true, true, IProf.NO_OPTIONAL_ARG); while( iterator.hasNext()) { // take the first one directly from I/O buffer // every time returned, sid references to same object // only data inside it are changed // WHY: because 'sameOutputObject' of getAllThruIterator() // was set to 'true' => we don't waste our memory IProf.sID sid = (IProf.sID)iterator.next(); // write class name IProf.sClassInfo ci = (IProf.sClassInfo)sid.info; System.out.println( "CLASS: " + ci.className); Iterator fieldIterator = iprof.getAllThruIterator( sid.objId, IProf.CLASS_FIELDS_STATICS, true, true, IProf.NO_OPTIONAL_ARG); while( fieldIterator.hasNext()) { IProf.sID fsid = (IProf.sID)fieldIterator.next(); IProf.sClassFieldInfo fi = (IProf.sClassFieldInfo)fsid.info; System.out.println( "STATIC FIELD: " + fi.fieldName); } numClasses++; System.out.println(); } System.out.println( "NUMBER OF CLASSES: " + numClasses); } 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( new CommunSetupSocket( CommunSetupSocket.SERVER_MODE)); iprof.run(); try { // til profiled program is going, do nothing while( !iprof.isShutdowned()) { System.out.println( "waiting..."); Thread.sleep( 1000); } // profiled program has finished, so ask for all classes askForClasses(); // 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...> - 2001-12-09 16:49:35
|
Update of /cvsroot/javaprofiler/library/src/commun In directory usw-pr-cvs1:/tmp/cvs-serv24402/src/commun Modified Files: communSocket.cpp iprof.cpp Log Message: socket communication fixes Index: communSocket.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/communSocket.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** communSocket.cpp 2001/11/28 23:34:52 1.10 --- communSocket.cpp 2001/12/09 16:49:32 1.11 *************** *** 122,126 **** #else if( _csock >= 0) { ! shutdown( _csock, SHUT_RDWR); close( _csock); --- 122,126 ---- #else if( _csock >= 0) { ! shutdown( _csock, SHUT_RDWR); close( _csock); *************** *** 151,154 **** --- 151,167 ---- FD_ZERO( &_fds); FD_SET( _csock, &_fds); + } + else if( _connectMode) { // failed and is client + #ifdef WIN32 + shutdown( _csock, SD_BOTH); + closesocket( _csock); + + _csock = socket( AF_INET, SOCK_STREAM, 0); + #else + shutdown( _csock, SHUT_RDWR); + close( _csock); + + _csock = socket( PF_INET, SOCK_STREAM, 0); + #endif } Index: iprof.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/iprof.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** iprof.cpp 2001/11/28 00:02:40 1.11 --- iprof.cpp 2001/12/09 16:49:32 1.12 *************** *** 79,83 **** conEstabl = 0; ! if( !_commun->initialize()) return 0; conEstabl = 1; --- 79,87 ---- conEstabl = 0; ! if( !_commun->initialize()) { ! ! Delay::delay( 100); ! return 0; ! } conEstabl = 1; |