|
From: Marek P. <ma...@us...> - 2002-08-06 20:05:12
|
Update of /cvsroot/javaprofiler/library/src/prof
In directory usw-pr-cvs1:/tmp/cvs-serv17475/src/prof
Modified Files:
prof.cpp prof.h prof_jvm.cpp
Log Message:
new feature, data_dump_request
pressing ctrl+break (on win32), ctrl+\ (on unix) causes the JVM to exit (abort)
Index: prof.cpp
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/prof/prof.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** prof.cpp 15 Jul 2002 21:55:12 -0000 1.30
--- prof.cpp 6 Aug 2002 20:05:08 -0000 1.31
***************
*** 62,66 ****
tF( 5, JVMPI_EVENT_COMPILED_METHOD_LOAD, NULL);
tF( 6, JVMPI_EVENT_COMPILED_METHOD_UNLOAD, NULL);
! tF( 7, JVMPI_EVENT_DATA_DUMP_REQUEST, NULL);
tF( 8, JVMPI_EVENT_DATA_RESET_REQUEST, NULL);
tF( 9, JVMPI_EVENT_GC_FINISH, &Prof::event_gcFinish);
--- 62,66 ----
tF( 5, JVMPI_EVENT_COMPILED_METHOD_LOAD, NULL);
tF( 6, JVMPI_EVENT_COMPILED_METHOD_UNLOAD, NULL);
! tF( 7, JVMPI_EVENT_DATA_DUMP_REQUEST, &Prof::event_dataDumpRequest);
tF( 8, JVMPI_EVENT_DATA_RESET_REQUEST, NULL);
tF( 9, JVMPI_EVENT_GC_FINISH, &Prof::event_gcFinish);
***************
*** 152,154 ****
--- 152,159 ----
if( _prof) _prof->runEvent( event);
+ }
+
+ void Prof::event_dataDumpRequest( JVMPI_Event* event) {
+
+ abort();
}
Index: prof.h
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/prof/prof.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** prof.h 15 Jul 2002 21:55:12 -0000 1.45
--- prof.h 6 Aug 2002 20:05:08 -0000 1.46
***************
*** 522,525 ****
--- 522,539 ----
void event_classUnload( JVMPI_Event* event);
+ /** Data dump request. This method is a JVMPI_EVENT_DATA_DUMP_REQUEST
+ ** event handler. This event is sent by the VM to request the profiler
+ ** agent to dump its data. This is just a hint and the profiler agent
+ ** need not react to this event. This is useful for processing command
+ ** line signals from users. For example, in the Java 2 SDK a Ctrl-Break
+ ** on Windows and Ctrl-\ on Solaris causes the VM to send this event
+ ** to the profiler agent. There is no event specific information.
+ **
+ ** @param event JVMPI_Event structure describing the event
+ **
+ ** @see runEvent(), JVMPI specification */
+
+ void event_dataDumpRequest( JVMPI_Event* event);
+
/** GC start. This method is a JVMPI_EVENT_GC_START
** event handler. This event is sent when GC is about to start.
Index: prof_jvm.cpp
===================================================================
RCS file: /cvsroot/javaprofiler/library/src/prof/prof_jvm.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** prof_jvm.cpp 17 Jul 2002 22:05:56 -0000 1.30
--- prof_jvm.cpp 6 Aug 2002 20:05:08 -0000 1.31
***************
*** 478,481 ****
--- 478,483 ----
jvmpiInterface->DisableEvent( JVMPI_EVENT_JVM_INIT_DONE, NULL);
+ jvmpiInterface->EnableEvent( JVMPI_EVENT_DATA_DUMP_REQUEST, NULL);
+
if( setup.cpu.turnedOn && setup.cpu.sampling) sampling.startThread( 1);
|