Update of /cvsroot/javaprofiler/test/snapshot
In directory usw-pr-cvs1:/tmp/cvs-serv18810
Modified Files:
readme.txt
Added Files:
PrintSnap.java printsnap.bat
Log Message:
classes for printing DebugOutput
--- NEW FILE: PrintSnap.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.jpiimpl.*;
import net.sourceforge.javaprofiler.jpi.*;
public class PrintSnap {
// communication interface
private IProf iprof = null;
// number of all methods together
private int numMethods = 0;
public void printSnapShot( ) {
//conf
boolean withCPU = true;
boolean withAlloc = true;
boolean withMon = true;
boolean withTraces = true;
boolean withThreads = true;
boolean withArenas = true;
boolean withGC = true;
int CPUTraces_MinVal = IProf.NO_OPTIONAL_ARG;
int AllocTraces_MinVal = IProf.NO_OPTIONAL_ARG;
int MonTraces_MinVal = IProf.NO_OPTIONAL_ARG;
DebugOutput dbgPrn = new DebugOutput();
SnapshotImpl mirror = new SnapshotImpl( iprof, withCPU, withAlloc,
withMon, withTraces, withThreads, withArenas, withGC,
CPUTraces_MinVal,
AllocTraces_MinVal,
MonTraces_MinVal);
dbgPrn.print( mirror );
}
public void runTest() {
// initialize and start communication
//iprof = new IProf();
iprof = new IProf( new CommunSetupSocket() );
iprof.run();
try {
System.out.println( "Ready" );
printSnapShot();
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 PrintSnap()).runTest();
}
};
--- NEW FILE: printsnap.bat ---
SET JAVA_HOME=d:\j2sdk1.4.0-rc
rem ****************************
rem SET CLASSPATH=..\..\jpiimpl;..\..\interface;.\;%CLASSPATH%
SET CLASSPATH=..\..\jpiimpl\jpiimpl.jar;.\;%CLASSPATH%
set path=%JAVA_HOME%\bin;%path%
java PrintSnap > snapout.txt
Index: readme.txt
===================================================================
RCS file: /cvsroot/javaprofiler/test/snapshot/readme.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** readme.txt 2002/01/15 22:08:21 1.1
--- readme.txt 2002/01/26 19:36:18 1.2
***************
*** 1,4 ****
! how to compile TestSnap:
! ------------------------
SET CLASSPATH=..\..\jpiimpl\jpiimpl.jar;.\;%CLASSPATH%
! d:\j2sdk1.4.0-beta3\bin\javac TestSnap.java
\ No newline at end of file
--- 1,4 ----
! how to compile TestSnap and PrintSnap:
! --------------------------------------
SET CLASSPATH=..\..\jpiimpl\jpiimpl.jar;.\;%CLASSPATH%
! d:\j2sdk1.4.0-rc\bin\javac TestSnap.java PrintSnap.java
\ No newline at end of file
|