|
From: Pavel V. <va...@us...> - 2002-04-20 22:40:53
|
Update of /cvsroot/javaprofiler/test/snapshot
In directory usw-pr-cvs1:/tmp/cvs-serv7126
Modified Files:
TestSnap.java PrintSnap.java
Log Message:
changes because of new IProf.run() prototype
Index: TestSnap.java
===================================================================
RCS file: /cvsroot/javaprofiler/test/snapshot/TestSnap.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** TestSnap.java 9 Apr 2002 08:19:29 -0000 1.6
--- TestSnap.java 20 Apr 2002 22:40:50 -0000 1.7
***************
*** 92,134 ****
public void runTest() {
! // initialize and start communication
! //iprof = new IProf();
! iprof = new IProf( new CommunSetupSocket() );
! //iprof = new IProf( new CommunSetupShMem() );
! if ( !iprof.run() ) {
! System.err.println("Error in communication");
! return;
! }
!
! 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();
}
--- 92,130 ----
public void runTest() {
! // initialize and start communication
! //iprof = new IProf();
! iprof = new IProf( new CommunSetupSocket() );
! //iprof = new IProf( new CommunSetupShMem() );
! try {
! iprof.run();
! 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());
! e.printStackTrace();
! }
!
! // 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();
}
Index: PrintSnap.java
===================================================================
RCS file: /cvsroot/javaprofiler/test/snapshot/PrintSnap.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** PrintSnap.java 13 Mar 2002 21:09:31 -0000 1.6
--- PrintSnap.java 20 Apr 2002 22:40:50 -0000 1.7
***************
*** 89,129 ****
public void runTest() {
! // initialize and start communication
! //iprof = new IProf();
! iprof = new IProf( new CommunSetupSocket() );
! //iprof = new IProf( new CommunSetupShMem() );
!
! if ( !iprof.run() ) {
! System.err.println("Error in communication");
! return;
! }
!
! try {
! System.err.println( "Ready" );
! // til profiled program is going, do nothing
! while( !iprof.isShutdowned()) Thread.sleep( 1000);
!
! System.err.println( "DebugOut START" );
! printSnapShot();
! System.err.println( "DebugOut END" );
! 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();
}
--- 89,127 ----
public void runTest() {
! // initialize and start communication
! //iprof = new IProf();
! iprof = new IProf( new CommunSetupSocket() );
! //iprof = new IProf( new CommunSetupShMem() );
!
! try {
! iprof.run();
!
! System.err.println( "Ready" );
! // til profiled program is going, do nothing
! while( !iprof.isShutdowned()) Thread.sleep( 1000);
!
! System.err.println( "DebugOut START" );
! printSnapShot();
! System.err.println( "DebugOut END" );
! iprof.shutdown();
! }
! catch( Exception e) {
!
! System.err.println( "an error occurred, exception:");
! System.err.println( e.getClass().getName());
! e.printStackTrace();
! }
!
! // 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();
}
|