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: Marek P. <ma...@us...> - 2001-11-21 22:31:54
|
Update of /cvsroot/javaprofiler/library/doc/interface In directory usw-pr-cvs1:/tmp/cvs-serv12170/doc/interface Modified Files: doc_html.conf doc_latex.conf Log Message: some parts completely rewritten; changes in communication interface to make it faster; ported to linux Index: doc_html.conf =================================================================== RCS file: /cvsroot/javaprofiler/library/doc/interface/doc_html.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** doc_html.conf 2001/09/27 10:07:28 1.2 --- doc_html.conf 2001/11/21 22:31:51 1.3 *************** *** 666,670 **** # omitted =1 is assumed. ! PREDEFINED = # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then --- 666,670 ---- # omitted =1 is assumed. ! PREDEFINED = USE_RAW_MONITORS USE_ALLOCATOR # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then Index: doc_latex.conf =================================================================== RCS file: /cvsroot/javaprofiler/library/doc/interface/doc_latex.conf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** doc_latex.conf 2001/09/25 18:57:55 1.1 --- doc_latex.conf 2001/11/21 22:31:51 1.2 *************** *** 666,670 **** # omitted =1 is assumed. ! PREDEFINED = # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then --- 666,670 ---- # omitted =1 is assumed. ! PREDEFINED = USE_RAW_MONITORS USE_ALLOCATOR # If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then |
From: Marek P. <ma...@us...> - 2001-11-21 22:31:54
|
Update of /cvsroot/javaprofiler/library/src/shared In directory usw-pr-cvs1:/tmp/cvs-serv12170/src/shared Modified Files: Makefile.rules class.cpp class.h classField.cpp classField.h dir.info groupThread.h method.cpp method.h thread.cpp thread.h trace.cpp trace.h traceFrame.cpp traceFrame.h Added Files: groupThread.cpp traceKey.h Log Message: some parts completely rewritten; changes in communication interface to make it faster; ported to linux --- NEW FILE: groupThread.cpp --- /* * 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. */ #include "../shared/groupThread.h" Buffer& GroupThread::infoToBin( Buffer& b) { b += groupName; return b; } --- NEW FILE: traceKey.h --- /* * 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. */ #ifndef _TRACE_KEY_H_ #define _TRACE_KEY_H_ #include "../main/includes.h" #include "../main/const.h" /** Key for Trace class. ** Used for searching in hash tables. ** ** @author Petr Luner */ struct TraceKey { private: /// internally used frames JVMPI_CallFrame _frames[MAX_TRACE]; public: /// number of call frames int numFrames; /// call frames JVMPI_CallFrame* frames; /// Initialization. TraceKey() : frames( _frames) {} }; #endif // _TRACE_KEY_H_ Index: Makefile.rules =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/Makefile.rules,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Makefile.rules 2001/07/28 04:11:17 1.4 --- Makefile.rules 2001/11/21 22:31:50 1.5 *************** *** 1,23 **** class.o \ ! class.obj: class.cpp ../main/includes.h $(CCC) $(CPPFLAGS) class.cpp classField.o \ ! classField.obj: classField.cpp ../main/includes.h $(CCC) $(CPPFLAGS) classField.cpp method.o \ ! method.obj: method.cpp ../main/includes.h $(CCC) $(CPPFLAGS) method.cpp trace.o \ ! trace.obj: trace.cpp ../main/includes.h $(CCC) $(CPPFLAGS) trace.cpp thread.o \ ! thread.obj: thread.cpp ../main/includes.h $(CCC) $(CPPFLAGS) thread.cpp traceFrame.o \ ! traceFrame.obj: traceFrame.cpp ../main/includes.h $(CCC) $(CPPFLAGS) traceFrame.cpp --- 1,27 ---- class.o \ ! class.obj: class.cpp $(CCC) $(CPPFLAGS) class.cpp classField.o \ ! classField.obj: classField.cpp $(CCC) $(CPPFLAGS) classField.cpp method.o \ ! method.obj: method.cpp $(CCC) $(CPPFLAGS) method.cpp trace.o \ ! trace.obj: trace.cpp $(CCC) $(CPPFLAGS) trace.cpp thread.o \ ! thread.obj: thread.cpp $(CCC) $(CPPFLAGS) thread.cpp traceFrame.o \ ! traceFrame.obj: traceFrame.cpp $(CCC) $(CPPFLAGS) traceFrame.cpp + + groupThread.o \ + groupThread.obj: groupThread.cpp + $(CCC) $(CPPFLAGS) groupThread.cpp Index: class.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/class.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** class.cpp 2001/09/18 22:19:29 1.4 --- class.cpp 2001/11/21 22:31:51 1.5 *************** *** 33,40 **** */ ! #include "../main/includes.h" - Allocator Class::_allocator( sizeof( Class)); - Buffer& Class::infoToBin( Buffer& b) { --- 33,44 ---- */ ! #include "../shared/class.h" ! #include "../prof/prof.h" ! #include "../alloc/allocObject.h" ! ! #ifdef USE_ALLOCATOR ! Allocator Class::_allocator; ! #endif Buffer& Class::infoToBin( Buffer& b) { *************** *** 61,66 **** } } - - - - \ No newline at end of file --- 65,66 ---- Index: class.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/class.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** class.h 2001/09/02 20:14:22 1.15 --- class.h 2001/11/21 22:31:51 1.16 *************** *** 36,39 **** --- 36,50 ---- #define _CLASS_H_ + #include "../main/includes.h" + #include "../list/listItem.h" + #include "../commun2/idObject.h" + #include "../commun/binaryFormat.h" + #include "../string/string.h" + #include "../list/list.h" + #include "../shared/method.h" + #include "../shared/classField.h" + #include "../commun/buffer.h" + #include "../allocator/allocator.h" + /** Java class. This class consists of data aquired ** by receiving a JVMPI_EVENT_CLASS_LOAD event. There *************** *** 47,52 **** ** @author Marek Przeczek, Petr Luner */ ! class Class: public LI1, public LI2, ! public IdObject, public InfoBinaryFormat { public: --- 58,65 ---- ** @author Marek Przeczek, Petr Luner */ ! class Class: public LI1, ! public LI2, ! public IdObject, ! public InfoBinaryFormat { public: *************** *** 103,124 **** allocObject( NULL), allocObjectArray( NULL) ! {}; /** Retrieves object's key. ** ! ** @param key where to store the key ** @return key ** ** @see Hash */ ! const jobjectID& getKey(jobjectID& key) { ! ! return key = classId; ! } /** Compares object with given key. ** ** @param key key ** @return 1 (true); ** 0 (false) --- 116,139 ---- allocObject( NULL), allocObjectArray( NULL) + + {} ! /// Destructor. ! virtual ~Class() {} /** Retrieves object's key. ** ! ** @param key where to store the key ! ** ** @return key ** ** @see Hash */ ! const jobjectID& getKey(jobjectID& key) { return key = classId;} /** Compares object with given key. ** ** @param key key + ** ** @return 1 (true); ** 0 (false) *************** *** 126,143 **** ** @see Hash */ ! int operator==(const jobjectID& key) { ! ! return (classId == key); ! } /** Hash function. ** ! ** @param reference to a key ** @return hash value */ - - static int hashKey(const jobjectID& key) { ! return (int)key; ! } /** Convert info to binary. This method converts information --- 141,153 ---- ** @see Hash */ ! int operator==(const jobjectID& key) { return (classId == key);} /** Hash function. ** ! ** @param key reference to a key ! ** ** @return hash value */ ! static int hashKey(const jobjectID& key) { return (int)key;} /** Convert info to binary. This method converts information *************** *** 155,158 **** --- 165,169 ---- void deactivate(); + #ifdef USE_ALLOCATOR private: *************** *** 164,172 **** /** Overloaded new() operator. */ ! void* operator new( size_t) { return _allocator.get();} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} public: --- 175,184 ---- /** Overloaded new() operator. */ ! void* operator new( size_t sz) { return _allocator.get( sz);} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} + #endif public: *************** *** 174,178 **** /** Class identification. ** ! ** @return unique class type identified */ virtual eClassIdent getClassIdent() { return CLASS;} --- 186,190 ---- /** Class identification. ** ! ** @return unique class type identifier */ virtual eClassIdent getClassIdent() { return CLASS;} Index: classField.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/classField.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** classField.cpp 2001/09/02 20:14:22 1.2 --- classField.cpp 2001/11/21 22:31:51 1.3 *************** *** 33,37 **** */ ! #include "../main/includes.h" ! Allocator ClassField::_allocator( sizeof( ClassField)); --- 33,47 ---- */ ! #include "../shared/classField.h" ! #ifdef USE_ALLOCATOR ! Allocator ClassField::_allocator; ! #endif ! ! Buffer& ClassField::infoToBin( Buffer& b) { ! ! b += fieldName; ! b += fieldSignature; ! ! return b; ! } Index: classField.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/classField.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** classField.h 2001/09/02 20:14:22 1.11 --- classField.h 2001/11/21 22:31:51 1.12 *************** *** 36,39 **** --- 36,47 ---- #define _CLASS_FIELD_H_ + #include "../main/includes.h" + #include "../list/listItem.h" + #include "../commun2/idObject.h" + #include "../commun/binaryFormat.h" + #include "../string/string.h" + #include "../commun/buffer.h" + #include "../allocator/allocator.h" + /** Class field. This class consists of data about ** a field defined in a Java class. This data is gained *************** *** 44,49 **** ** @author Marek Przeczek */ ! class ClassField: public LI1, public IdObject, ! public InfoBinaryFormat { public: --- 52,58 ---- ** @author Marek Przeczek */ ! class ClassField: public LI1, ! public IdObject, ! public InfoBinaryFormat { public: *************** *** 56,59 **** --- 65,74 ---- public: + /// Default constructor. + ClassField() {} + + /// Destructor. + virtual ~ClassField() {} + /** Convert info to binary. This method converts information ** data to binary format in which it is sent thru communication *************** *** 63,75 **** ** ** @return reference to same Buffer object as argument 'b' */ - - virtual Buffer& infoToBin( Buffer& b) { - - b += fieldName; - b += fieldSignature; ! return b; ! } private: --- 78,85 ---- ** ** @return reference to same Buffer object as argument 'b' */ ! virtual Buffer& infoToBin( Buffer& b); + #ifdef USE_ALLOCATOR private: *************** *** 81,89 **** /** Overloaded new() operator. */ ! void* operator new( size_t) { return _allocator.get();} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} public: --- 91,100 ---- /** Overloaded new() operator. */ ! void* operator new( size_t sz) { return _allocator.get( sz);} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} + #endif public: *************** *** 91,95 **** /** Class identification. ** ! ** @return unique class type identified */ virtual eClassIdent getClassIdent() { return CLASS_FIELD;} --- 102,106 ---- /** Class identification. ** ! ** @return unique class type identifier */ virtual eClassIdent getClassIdent() { return CLASS_FIELD;} Index: dir.info =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/dir.info,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dir.info 2001/07/28 04:11:17 1.5 --- dir.info 2001/11/21 22:31:51 1.6 *************** *** 1,3 **** ! FILES = class classField method thread trace traceFrame ! CLEAN_FILES = *.pdb *.obj *.o --- 1,2 ---- ! FILES = class classField groupThread method thread trace traceFrame CLEAN_FILES = *.pdb *.obj *.o Index: groupThread.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/groupThread.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** groupThread.h 2001/09/02 20:14:22 1.9 --- groupThread.h 2001/11/21 22:31:51 1.10 *************** *** 36,39 **** --- 36,48 ---- #define _GROUP_THREAD_H_ + #include "../main/includes.h" + #include "../list/listItem.h" + #include "../commun2/idObject.h" + #include "../commun/binaryFormat.h" + #include "../string/string.h" + #include "../list/list.h" + #include "../shared/thread.h" + #include "../commun/buffer.h" + /** Group of threads. This class consists of data aquired ** by receiving the JVMPI_EVENT_THREAD_START event. *************** *** 43,48 **** ** @author Marek Przeczek */ ! class GroupThread: public LI1, public IdObject, ! public InfoBinaryFormat { public: --- 52,58 ---- ** @author Marek Przeczek */ ! class GroupThread: public LI1, ! public IdObject, ! public InfoBinaryFormat { public: *************** *** 55,58 **** --- 65,74 ---- public: + /// Default constructor. + GroupThread() {} + + /// Destructor. + virtual ~GroupThread() {} + /** Convert info to binary. This method converts information ** data to binary format in which it is sent thru communication *************** *** 62,72 **** ** ** @return reference to same Buffer object as argument 'b' */ - - virtual Buffer& infoToBin( Buffer& b) { - - b += groupName; ! return b; ! } public: --- 78,83 ---- ** ** @return reference to same Buffer object as argument 'b' */ ! virtual Buffer& infoToBin( Buffer& b); public: *************** *** 74,78 **** /** Class identification. ** ! ** @return unique class type identified */ virtual eClassIdent getClassIdent() { return GROUP_THREAD;} --- 85,89 ---- /** Class identification. ** ! ** @return unique class type identifier */ virtual eClassIdent getClassIdent() { return GROUP_THREAD;} Index: method.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/method.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** method.cpp 2001/09/18 22:19:29 1.13 --- method.cpp 2001/11/21 22:31:51 1.14 *************** *** 33,40 **** */ ! #include "../main/includes.h" - Allocator Method::_allocator( sizeof( Method)); - Buffer& Method::infoToBin( Buffer& b) { --- 33,50 ---- */ ! #include "../shared/method.h" ! #include "../shared/class.h" ! #include "../prof/prof.h" ! #include "../alloc/allocThreadMethod.h" ! #include "../cpu/cpuThreadMethod.h" ! #include "../mon/monThreadMethod.h" ! #include "../alloc/allocTrace.h" ! #include "../cpu/cpuTrace.h" ! #include "../mon/monTrace.h" ! ! #ifdef USE_ALLOCATOR ! Allocator Method::_allocator; ! #endif Buffer& Method::infoToBin( Buffer& b) { *************** *** 69,73 **** mtm = monThreadMethods.next(mtm); } ! AllocTrace* at = allocTraces.first(); while (at) { --- 79,83 ---- mtm = monThreadMethods.next(mtm); } ! AllocTrace* at = allocTraces.first(); while (at) { *************** *** 87,89 **** --- 97,120 ---- mt = monTraces.next(mt); } + } + + int Method::isActive() { + + return (clss) ? clss->isActive() : 1; + } + + int Method::isChanged() { + + return (activeChanged() || + AllocStatData::dataChanged() || + CpuStatData::dataChanged() || + MonStatData::dataChanged()); // order dependent ! + } + + void Method::setUnchanged() { + + IdObject::setUnchanged(); + AllocStatData::clearDataChanged(); + CpuStatData::clearDataChanged(); + MonStatData::clearDataChanged(); } Index: method.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/method.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** method.h 2001/09/02 20:14:22 1.20 --- method.h 2001/11/21 22:31:51 1.21 *************** *** 36,39 **** --- 36,58 ---- #define _METHOD_H_ + #include "../main/includes.h" + #include "../list/listItem.h" + #include "../commun2/idObject.h" + #include "../alloc/allocStatData.h" + #include "../cpu/cpuStatData.h" + #include "../mon/monStatData.h" + #include "../commun/binaryFormat.h" + #include "../string/string.h" + #include "../list/list.h" + #include "../alloc/allocTrace.h" + #include "../alloc/allocObjectMethod.h" + #include "../alloc/allocThreadMethod.h" + #include "../cpu/cpuTrace.h" + #include "../cpu/cpuThreadMethod.h" + #include "../mon/monTrace.h" + #include "../mon/monThreadMethod.h" + #include "../commun/buffer.h" + #include "../allocator/allocator.h" + /** Java method. This class consists of data about ** loaded Java method (gained by receiving *************** *** 44,53 **** ** @author Marek Przeczek, Petr Luner */ ! class Method: public IdObject, ! public LI1, public LI2, ! public AllocStatData, ! public CpuStatData, ! public MonStatData, ! public InfoBinaryFormat { public: --- 63,73 ---- ** @author Marek Przeczek, Petr Luner */ ! class Method: public LI1, ! public LI2, ! public IdObject, ! public AllocStatData, ! public CpuStatData, ! public MonStatData, ! public InfoBinaryFormat { public: *************** *** 103,121 **** {} /** Retrieves object's key. ** ! ** @param key where to store the key ** @return key ** ** @see Hash */ ! const jmethodID& getKey(jmethodID& key) { ! ! return key = methodId; ! } /** Compares object with given key. ** ** @param key key ** @return 1 (true); ** 0 (false) --- 123,143 ---- {} + /// Destructor. + virtual ~Method() {} + /** Retrieves object's key. ** ! ** @param key where to store the key ! ** ** @return key ** ** @see Hash */ ! const jmethodID& getKey(jmethodID& key) { return key = methodId;} /** Compares object with given key. ** ** @param key key + ** ** @return 1 (true); ** 0 (false) *************** *** 123,140 **** ** @see Hash */ ! int operator==(const jmethodID& key) { ! ! return (methodId == key); ! } /** Hash function. ** ! ** @param reference to a key ** @return hash value */ - - static int hashKey(const jmethodID& key) { ! return (int)key; ! } /** Convert info to binary. This method converts information --- 145,157 ---- ** @see Hash */ ! int operator==(const jmethodID& key) { return (methodId == key);} /** Hash function. ** ! ** @param key reference to a key ! ** ** @return hash value */ ! static int hashKey(const jmethodID& key) { return (int)key;} /** Convert info to binary. This method converts information *************** *** 152,155 **** --- 169,173 ---- void deactivate(); + #ifdef USE_ALLOCATOR private: *************** *** 161,169 **** /** Overloaded new() operator. */ ! void* operator new( size_t) { return _allocator.get();} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} public: --- 179,188 ---- /** Overloaded new() operator. */ ! void* operator new( size_t sz) { return _allocator.get( sz);} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} + #endif public: *************** *** 171,175 **** /** Class identification. ** ! ** @return unique class type identified */ virtual eClassIdent getClassIdent() { return METHOD;} --- 190,194 ---- /** Class identification. ** ! ** @return unique class type identifier */ virtual eClassIdent getClassIdent() { return METHOD;} *************** *** 181,185 **** ** 1 (active) */ ! virtual int isActive() { return (clss) ? clss->isActive() : 1;} /** Indication that object has changed its data. --- 200,204 ---- ** 1 (active) */ ! virtual int isActive(); /** Indication that object has changed its data. *************** *** 188,205 **** ** 1 (data changed) */ ! virtual int isChanged() { return (activeChanged() || ! AllocStatData::dataChanged() || ! CpuStatData::dataChanged() || ! MonStatData::dataChanged());} // order dependent ! /** Set the structure is unchanged although it may not be. */ ! virtual void setUnchanged() { ! ! IdObject::setUnchanged(); ! AllocStatData::clearDataChanged(); ! CpuStatData::clearDataChanged(); ! MonStatData::clearDataChanged(); ! } }; --- 207,215 ---- ** 1 (data changed) */ ! virtual int isChanged(); /** Set the structure is unchanged although it may not be. */ ! virtual void setUnchanged(); }; Index: thread.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/thread.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** thread.cpp 2001/09/18 22:19:29 1.9 --- thread.cpp 2001/11/21 22:31:51 1.10 *************** *** 33,40 **** */ ! #include "../main/includes.h" - Allocator Thread::_allocator( sizeof( Thread)); - Buffer& Thread::infoToBin( Buffer& b) { --- 33,48 ---- */ ! #include "../shared/thread.h" ! #include "../shared/groupThread.h" ! #include "../alloc/allocThreadObject.h" ! #include "../alloc/allocThreadMethod.h" ! #include "../cpu/cpuThreadMethod.h" ! #include "../mon/monThreadMethod.h" ! #include "../prof/prof.h" ! ! #ifdef USE_ALLOCATOR ! Allocator Thread::_allocator; ! #endif Buffer& Thread::infoToBin( Buffer& b) { *************** *** 77,79 **** --- 85,93 ---- mtm = monThreadMethods.next(mtm); } + } + + void Thread::setUnchanged() { + + IdObject::setUnchanged(); + clearDataChanged(); } Index: thread.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/thread.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** thread.h 2001/09/02 20:14:22 1.22 --- thread.h 2001/11/21 22:31:51 1.23 *************** *** 36,39 **** --- 36,56 ---- #define _THREAD_H_ + #include "../main/includes.h" + #include "../list/listItem.h" + #include "../alloc/allocStatData.h" + #include "../commun2/idObject.h" + #include "../commun/binaryFormat.h" + #include "../string/string.h" + #include "../list/list.h" + #include "../shared/thread.h" + #include "../alloc/allocThreadObject.h" + #include "../alloc/allocThreadMethod.h" + #include "../cpu/cpuThreadMethod.h" + #include "../mon/monThreadMethod.h" + #include "../cpu/cpuStack.h" + #include "../main/const.h" + #include "../commun/buffer.h" + #include "../allocator/allocator.h" + /** Thread. This class consists of data gained ** by receiving the JVMPI_EVENT_THREAD_START event. *************** *** 46,52 **** ** @author Marek Przeczek, Petr Luner */ ! class Thread: public LI1, public LI2, public LI3, public LI4, ! public LI5, public AllocStatData, public IdObject, ! public InfoBinaryFormat { public: --- 63,74 ---- ** @author Marek Przeczek, Petr Luner */ ! class Thread: public LI1, ! public LI2, ! public LI3, ! public LI4, ! public LI5, ! public AllocStatData, ! public IdObject, ! public InfoBinaryFormat { public: *************** *** 89,92 **** --- 111,115 ---- /** Call trace for general temporary usage. ** There are MAX_TRACE frames. */ + JVMPI_CallTrace callTrace; *************** *** 101,104 **** --- 124,128 ---- ** event occured for this thread. The flag is cleared ** in JVMPI_EVENT_MONITOR_CONTENDED_ENTERED event. */ + int monitorEnter; *************** *** 106,109 **** --- 130,134 ---- ** Holds the object id of the last ** JVMPI_EVENT_MONITOR_CONTENDED_ENTER event. */ + jobjectID monitorEnterObject; *************** *** 111,114 **** --- 136,140 ---- ** Holds the time of the last ** JVMPI_EVENT_MONITOR_CONTENDED_ENTER event. */ + unsigned long monitorEnterTime; *************** *** 130,154 **** monitorEnter(0), monitorEnterObject(0), ! monitorEnterTime(0) - { callTrace.frames = _frames; } /** Retrieves object's key. ** - ** @param key where to store the key ** @return key ** ** @see Hash */ ! JNIEnv* const& getKey(JNIEnv*& key) { ! ! return key = threadEnvId; ! } /** Compares object with given key. ** ** @param key key ** @return 1 (true); ** 0 (false) --- 156,181 ---- monitorEnter(0), monitorEnterObject(0), ! monitorEnterTime(0) { callTrace.frames = _frames; } + /// Destructor. + virtual ~Thread() {} + /** Retrieves object's key. + ** + ** @param key where to store the key ** ** @return key ** ** @see Hash */ ! JNIEnv* const& getKey(JNIEnv*& key) { return key = threadEnvId;} /** Compares object with given key. ** ** @param key key + ** ** @return 1 (true); ** 0 (false) *************** *** 156,174 **** ** @see Hash */ ! int operator==(JNIEnv* const& key) { ! ! return (threadEnvId == key); ! } /** Hash function. ** ! ** @param reference to a key ** @return hash value */ ! static int hashKey(JNIEnv* const& key) { - return (int)key; - } - /** Convert info to binary. This method converts information ** data to binary format in which it is sent thru communication --- 183,196 ---- ** @see Hash */ ! int operator==(JNIEnv* const& key) { return (threadEnvId == key);} /** Hash function. ** ! ** @param key reference to a key ! ** ** @return hash value */ ! static int hashKey(JNIEnv* const& key) { return (int)key;} /** Convert info to binary. This method converts information ** data to binary format in which it is sent thru communication *************** *** 185,188 **** --- 207,211 ---- void deactivate(); + #ifdef USE_ALLOCATOR private: *************** *** 194,202 **** /** Overloaded new() operator. */ ! void* operator new( size_t) { return _allocator.get();} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} public: --- 217,226 ---- /** Overloaded new() operator. */ ! void* operator new( size_t sz) { return _allocator.get( sz);} /** Overloaded delete() operator. */ void operator delete( void* unit) { _allocator.put( unit);} + #endif public: *************** *** 204,208 **** /** Class identification. ** ! ** @return unique class type identified */ virtual eClassIdent getClassIdent() { return THREAD;} --- 228,232 ---- /** Class identification. ** ! ** @return unique class type identifier */ virtual eClassIdent getClassIdent() { return THREAD;} *************** *** 225,233 **** /** Set the structure is unchanged although it may not be. */ ! virtual void setUnchanged() { ! ! IdObject::setUnchanged(); ! clearDataChanged(); ! } }; --- 249,253 ---- /** Set the structure is unchanged although it may not be. */ ! virtual void setUnchanged(); }; Index: trace.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/trace.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** trace.cpp 2001/09/02 20:14:22 1.8 --- trace.cpp 2001/11/21 22:31:51 1.9 *************** *** 33,37 **** */ ! #include "../main/includes.h" Trace::~Trace() { --- 33,39 ---- */ ! #include "../shared/trace.h" ! #include "../shared/traceFrame.h" ! #include "../shared/method.h" Trace::~Trace() { *************** *** 53,55 **** --- 55,97 ---- return b; + } + + const TraceKey& Trace::getKey(TraceKey& key) { + + TraceFrame* tf = frames; + JVMPI_CallFrame* cf = key.frames; + + key.numFrames = numFrames; + for (int i = 0; i < numFrames; i++, tf++, cf++) { + cf->lineno = tf->lineno; + tf->method->getKey(cf->method_id); + } + + return key; + } + + int Trace::operator==(const TraceKey& key) { + + if (key.numFrames != numFrames) return 0; + + const JVMPI_CallFrame* cf = key.frames; + TraceFrame* tf = frames; + + for (int i = 0; i < numFrames; i++, tf++, cf++) + if( (tf->lineno != cf->lineno) || (!(*tf->method == cf->method_id))) return 0; + + return 1; + } + + int Trace::hashKey(const TraceKey& key) { + + const JVMPI_CallFrame* p = key.frames; + int sum = 0; + + for (int i = 0; i < key.numFrames; i++, p++) { + sum += (int)p->lineno; + sum += Method::hashKey(p->method_id); + } + + return sum; } Index: trace.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/trace.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** trace.h 2001/09/02 20:14:22 1.8 --- trace.h 2001/11/21 22:31:51 1.9 *************** *** 36,59 **** #define _TRACE_H_ ! /** Key for Trace class. ! ** Used for searching in hash tables. ! ** ! ** @author Petr Luner */ ! ! struct TraceKey { ! private: ! JVMPI_CallFrame _frames[MAX_TRACE]; ! ! public: ! /// number of call frames ! int numFrames; ! ! /// call frames ! JVMPI_CallFrame* frames; - TraceKey() { frames = _frames; } - }; - - /** Trace. This class consists of data aquired ** by calling a GetCallTrace() function of the JVMPI. --- 36,44 ---- #define _TRACE_H_ ! #include "../main/includes.h" ! #include "../commun/binaryFormat.h" ! #include "../shared/traceKey.h" ! #include "../commun/buffer.h" /** Trace. This class consists of data aquired ** by calling a GetCallTrace() function of the JVMPI. *************** *** 82,86 **** frames( NULL) ! {}; /// Destructor. --- 67,71 ---- frames( NULL) ! {} /// Destructor. *************** *** 88,150 **** /** Retrieves object's key. ** - ** @param key where to store the key ** @return key ** ** @see Hash */ - - const TraceKey& getKey(TraceKey& key) { - - TraceFrame* tf = frames; - JVMPI_CallFrame* cf = key.frames; ! key.numFrames = numFrames; ! for (int i = 0; i < numFrames; i++, tf++, cf++) { ! cf->lineno = tf->lineno; ! tf->method->getKey(cf->method_id); ! } - return key; - } - /** Compares object with given key. ** ** @param key key ** @return 1 (true); ** 0 (false) ** ** @see Hash */ - - int operator==(const TraceKey& key) { - - if (key.numFrames != numFrames) return 0; - - const JVMPI_CallFrame* cf = key.frames; - TraceFrame* tf = frames; - - for (int i = 0; i < numFrames; i++, tf++, cf++) - if( (tf->lineno != cf->lineno) || (!(*tf->method == cf->method_id))) return 0; ! return 1; ! } /** Hash function. ** ! ** @param reference to a key ** @return hash value */ - - static int hashKey(const TraceKey& key) { - - const JVMPI_CallFrame* p = key.frames; - int sum = 0; ! for (int i = 0; i < key.numFrames; i++, p++) { ! sum += (int)p->lineno; ! sum += Method::hashKey(p->method_id); ! } - return sum; - } - /** Convert info to binary. This method converts information ** data to binary format in which it is sent thru communication --- 73,104 ---- /** Retrieves object's key. + ** + ** @param key where to store the key ** ** @return key ** ** @see Hash */ ! const TraceKey& getKey(TraceKey& key); /** Compares object with given key. ** ** @param key key + ** ** @return 1 (true); ** 0 (false) ** ** @see Hash */ ! int operator==(const TraceKey& key); /** Hash function. ** ! ** @param key reference to a key ! ** ** @return hash value */ ! static int hashKey(const TraceKey& key); /** Convert info to binary. This method converts information ** data to binary format in which it is sent thru communication *************** *** 159,161 **** #endif // _TRACE_H_ - --- 113,114 ---- Index: traceFrame.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/traceFrame.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** traceFrame.cpp 2001/09/02 20:14:22 1.3 --- traceFrame.cpp 2001/11/21 22:31:51 1.4 *************** *** 33,37 **** */ ! #include "../main/includes.h" Allocator TraceFrame::_allocators[MAX_TRACE]; --- 33,39 ---- */ ! #include "../shared/traceFrame.h" + #ifdef USE_ALLOCATOR Allocator TraceFrame::_allocators[MAX_TRACE]; + #endif Index: traceFrame.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/shared/traceFrame.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** traceFrame.h 2001/09/02 20:14:22 1.8 --- traceFrame.h 2001/11/21 22:31:51 1.9 *************** *** 36,44 **** #define _TRACE_FRAME_H_ /** Trace frame. This class consists of information ** about one frame of method trace. It is used internally ! ** by AllocTrace and CpuTrace classes (by Trace class). ** ! ** @see AllocTrace, CpuTrace ** ** @author Marek Przeczek, Petr Luner */ --- 36,48 ---- #define _TRACE_FRAME_H_ + #include "../main/includes.h" + #include "../allocator/allocator.h" + #include "../main/const.h" + /** Trace frame. This class consists of information ** about one frame of method trace. It is used internally ! ** by AllocTrace, CpuTrace and MonTrace classes (by Trace class). ** ! ** @see AllocTrace, CpuTrace, MonTrace ** ** @author Marek Przeczek, Petr Luner */ *************** *** 52,59 **** --- 56,65 ---- Method* method; + #ifdef USE_ALLOCATOR private: /// allocators static Allocator _allocators[MAX_TRACE]; + #endif public: *************** *** 61,79 **** /** Allocates a new array of frames. ** ! ** @param size array size */ static TraceFrame* newArray(int size) { ! ! return reinterpret_cast<TraceFrame*>(_allocators[size - 1].get(size * sizeof(TraceFrame))); } /** Frees an array of frames. ** ! ** @param array frames array ! ** @param size array size */ static void deleteArray(TraceFrame* array, int size) { ! _allocators[size - 1].put(reinterpret_cast<void*>(array)); } }; --- 67,93 ---- /** Allocates a new array of frames. ** ! ** @param size array size */ static TraceFrame* newArray(int size) { ! ! #ifdef USE_ALLOCATOR ! return reinterpret_cast<TraceFrame*>(_allocators[size-1].get(size*sizeof(TraceFrame))); ! #else ! return ::new TraceFrame[size]; ! #endif } /** Frees an array of frames. ** ! ** @param array frames array ! ** @param size array size */ static void deleteArray(TraceFrame* array, int size) { ! #ifdef USE_ALLOCATOR ! _allocators[size-1].put( reinterpret_cast<void*>(array)); ! #else ! ::delete[] array; ! #endif } }; |
From: Marek P. <ma...@us...> - 2001-11-21 22:31:54
|
Update of /cvsroot/javaprofiler/library/src/string In directory usw-pr-cvs1:/tmp/cvs-serv12170/src/string Modified Files: Makefile.rules dir.info string.cpp string.h Log Message: some parts completely rewritten; changes in communication interface to make it faster; ported to linux Index: Makefile.rules =================================================================== RCS file: /cvsroot/javaprofiler/library/src/string/Makefile.rules,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Makefile.rules 2001/07/22 23:37:58 1.2 --- Makefile.rules 2001/11/21 22:31:51 1.3 *************** *** 1,4 **** string.o \ ! string.obj: string.cpp ../main/includes.h $(CCC) $(CPPFLAGS) string.cpp --- 1,4 ---- string.o \ ! string.obj: string.cpp $(CCC) $(CPPFLAGS) string.cpp Index: dir.info =================================================================== RCS file: /cvsroot/javaprofiler/library/src/string/dir.info,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dir.info 2001/07/28 04:11:17 1.4 --- dir.info 2001/11/21 22:31:51 1.5 *************** *** 1,3 **** ! FILES = string ! CLEAN_FILES = *.pdb *.obj *.o --- 1,2 ---- ! FILES = string CLEAN_FILES = *.pdb *.obj *.o Index: string.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/string/string.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** string.cpp 2001/09/02 20:14:22 1.6 --- string.cpp 2001/11/21 22:31:51 1.7 *************** *** 33,37 **** */ ! #include "../main/includes.h" String::String( const char* str) { --- 33,37 ---- */ ! #include "../string/string.h" String::String( const char* str) { Index: string.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/string/string.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** string.h 2001/09/02 20:14:22 1.8 --- string.h 2001/11/21 22:31:51 1.9 *************** *** 36,39 **** --- 36,41 ---- #define _STRINGX_H_ + #include "../main/includes.h" + /** Class implementing string. This class implements a C string in such ** a way it looks like primitive type. It is only a stupid implementation |
From: Marek P. <ma...@us...> - 2001-11-21 22:31:44
|
Update of /cvsroot/javaprofiler/library/src2/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv12170/src2/net/sourceforge/javaprofiler/jpiimpl/commun Added Files: README Log Message: some parts completely rewritten; changes in communication interface to make it faster; ported to linux --- NEW FILE: README --- There should be Java source files from CVS "jpiimpl" module's directory here. CVS module subdirectory: jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/ |
From: Marek P. <ma...@us...> - 2001-11-21 22:31:44
|
Update of /cvsroot/javaprofiler/library/templates In directory usw-pr-cvs1:/tmp/cvs-serv12170/templates Added Files: cpp_template header_template Log Message: some parts completely rewritten; changes in communication interface to make it faster; ported to linux --- NEW FILE: cpp_template --- /* * 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. */ --- NEW FILE: header_template --- /* * 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. */ |
From: Marek P. <ma...@us...> - 2001-11-21 22:28:07
|
Update of /cvsroot/javaprofiler/library/templates In directory usw-pr-cvs1:/tmp/cvs-serv11203/templates Log Message: Directory /cvsroot/javaprofiler/library/templates added to the repository |
From: Marek P. <ma...@us...> - 2001-11-21 22:27:36
|
Update of /cvsroot/javaprofiler/library/src2/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv11058/src2/net/sourceforge/javaprofiler/jpiimpl/commun Log Message: Directory /cvsroot/javaprofiler/library/src2/net/sourceforge/javaprofiler/jpiimpl/commun added to the repository |
From: Marek P. <ma...@us...> - 2001-11-21 22:27:24
|
Update of /cvsroot/javaprofiler/library/src2/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv11012/src2/net/sourceforge/javaprofiler/jpiimpl Log Message: Directory /cvsroot/javaprofiler/library/src2/net/sourceforge/javaprofiler/jpiimpl added to the repository |
From: Marek P. <ma...@us...> - 2001-11-21 22:27:10
|
Update of /cvsroot/javaprofiler/library/src2/net/sourceforge/javaprofiler In directory usw-pr-cvs1:/tmp/cvs-serv10914/src2/net/sourceforge/javaprofiler Log Message: Directory /cvsroot/javaprofiler/library/src2/net/sourceforge/javaprofiler added to the repository |
From: Marek P. <ma...@us...> - 2001-11-21 22:26:51
|
Update of /cvsroot/javaprofiler/library/src2/net/sourceforge In directory usw-pr-cvs1:/tmp/cvs-serv10870/src2/net/sourceforge Log Message: Directory /cvsroot/javaprofiler/library/src2/net/sourceforge added to the repository |
From: Marek P. <ma...@us...> - 2001-11-21 22:26:40
|
Update of /cvsroot/javaprofiler/library/src2/net In directory usw-pr-cvs1:/tmp/cvs-serv10808/src2/net Log Message: Directory /cvsroot/javaprofiler/library/src2/net added to the repository |
From: Marek P. <ma...@us...> - 2001-11-21 22:20:21
|
Update of /cvsroot/javaprofiler/library/demo/02 In directory usw-pr-cvs1:/tmp/cvs-serv9462/demo/02 Log Message: Directory /cvsroot/javaprofiler/library/demo/02 added to the repository |
From: Marek P. <ma...@us...> - 2001-11-21 22:15:32
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv7925/net/sourceforge/javaprofiler/jpiimpl/commun Modified Files: IProf.java Log Message: new comment Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** IProf.java 2001/11/21 22:05:55 1.4 --- IProf.java 2001/11/21 22:15:29 1.5 *************** *** 1225,1229 **** public static final int MAX_GET_ALL_CONST = 42; ! /// indication of no operation, used by getComplOp() method public static final int NO_OPERATION = MAX_GET_ALL_CONST; --- 1225,1229 ---- public static final int MAX_GET_ALL_CONST = 42; ! /// indication of no operation, used by getComplType2() method public static final int NO_OPERATION = MAX_GET_ALL_CONST; |
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv4591/net/sourceforge/javaprofiler/jpiimpl/commun Modified Files: BAD_COMMAND_Exception.java BAD_DATA_TYPE_Exception.java BAD_INFO_ID_Exception.java BAD_INFO_TYPE_Exception.java BAD_OBJ_ID_Exception.java Buffer.java COMMUN_Exception.java Commun.java CommunSetup.java CommunSetupShMem.java CommunSetupSocket.java CommunShMem.java CommunSocket.java IProf.java IProfException.java UNKNOWN_Exception.java Log Message: changes in communication interface IProf.getAll() and IProf.getChanged() methods changed Index: BAD_COMMAND_Exception.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/BAD_COMMAND_Exception.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BAD_COMMAND_Exception.java 2001/10/14 22:08:56 1.1 --- BAD_COMMAND_Exception.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Bad command exception. This exception is raised when a request for ** specified objID is not possible (eg. when you try (in one call to *************** *** 43,51 **** public class BAD_COMMAND_Exception extends IProfException {}; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 43,44 ---- Index: BAD_DATA_TYPE_Exception.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/BAD_DATA_TYPE_Exception.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BAD_DATA_TYPE_Exception.java 2001/10/14 22:08:56 1.1 --- BAD_DATA_TYPE_Exception.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Bad objID type exception. This exception is raised when used ID is ** of different type than specified (eg. when an object has statistic *************** *** 45,53 **** public class BAD_DATA_TYPE_Exception extends IProfException {}; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 45,46 ---- Index: BAD_INFO_ID_Exception.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/BAD_INFO_ID_Exception.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BAD_INFO_ID_Exception.java 2001/10/14 22:08:56 1.1 --- BAD_INFO_ID_Exception.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Bad infoID exception. This exception is raised when used ID is not ** an infoID of an object (eg. when objID is used as an infoID, this *************** *** 44,52 **** public class BAD_INFO_ID_Exception extends IProfException {}; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 44,45 ---- Index: BAD_INFO_TYPE_Exception.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/BAD_INFO_TYPE_Exception.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BAD_INFO_TYPE_Exception.java 2001/10/14 22:08:56 1.1 --- BAD_INFO_TYPE_Exception.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Bad infoID type exception. This exception is raised when type of ** infoID is bad (eg. infoID exists but is of different type than *************** *** 50,58 **** public class BAD_INFO_TYPE_Exception extends IProfException {}; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 50,51 ---- Index: BAD_OBJ_ID_Exception.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/BAD_OBJ_ID_Exception.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** BAD_OBJ_ID_Exception.java 2001/10/14 22:08:56 1.1 --- BAD_OBJ_ID_Exception.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Bad objectID exception. This exception is raised when used ID is not ** an objID of an object (eg. when an ID to which no object exists is *************** *** 44,52 **** public class BAD_OBJ_ID_Exception extends IProfException {}; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 44,45 ---- Index: Buffer.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/Buffer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Buffer.java 2001/10/14 22:08:56 1.1 --- Buffer.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** I/O buffer. This class implements an input/output buffer ** needed during communication between profiler dynamic library *************** *** 210,218 **** } }; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 210,211 ---- Index: COMMUN_Exception.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/COMMUN_Exception.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** COMMUN_Exception.java 2001/10/14 22:08:56 1.1 --- COMMUN_Exception.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Exception. This exception is raised when a communication failed ** (eg. when server falls down during communication). *************** *** 41,49 **** public class COMMUN_Exception extends IProfException {}; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 41,42 ---- Index: Commun.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/Commun.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Commun.java 2001/10/14 22:08:56 1.1 --- Commun.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Communication. This is a standard interface for all communication ** classes. Whole communication is done thru an instance of this *************** *** 89,97 **** public void stopCommun(); }; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 89,90 ---- Index: CommunSetup.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/CommunSetup.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CommunSetup.java 2001/10/14 22:08:56 1.1 --- CommunSetup.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Communication setup. Other classes holding setup data are inherited ** from this abstract class. *************** *** 71,79 **** } }; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 71,72 ---- Index: CommunSetupShMem.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/CommunSetupShMem.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CommunSetupShMem.java 2001/10/14 22:08:56 1.1 --- CommunSetupShMem.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Shared memory communication setup. This class contains setup data ** for shared memory communication. *************** *** 69,77 **** } }; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 69,70 ---- Index: CommunSetupSocket.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/CommunSetupSocket.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CommunSetupSocket.java 2001/10/14 22:08:56 1.1 --- CommunSetupSocket.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Socket communication setup. This class contains setup data ** for socket communication. *************** *** 80,88 **** } }; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 80,81 ---- Index: CommunShMem.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/CommunShMem.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CommunShMem.java 2001/10/14 22:08:56 1.1 --- CommunShMem.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Shared memory communication. This class implements shared memory ** communication and offers the user of this class the standard *************** *** 127,135 **** } }; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 127,128 ---- Index: CommunSocket.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/CommunSocket.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CommunSocket.java 2001/10/14 22:08:56 1.1 --- CommunSocket.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + import java.io.*; import java.lang.*; *************** *** 228,236 **** } }; - - /* - * $Log$ - * Revision 1.1 2001/10/14 22:08:56 stolis - * Content of src2 directory moved into the new location. - * - */ \ No newline at end of file --- 228,229 ---- Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** IProf.java 2001/11/20 22:21:40 1.3 --- IProf.java 2001/11/21 22:05:55 1.4 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ [...1108 lines suppressed...] ! return ALLOC_THREAD_METHOD_TRACE_OBJECTS; ! ! case ALLOC_THREAD_OBJECT_METHODS: ! ! return ALLOC_THREAD_METHOD_OBJECTS; ! ! case ALLOC_THREAD_METHOD_OBJECTS: ! ! return ALLOC_THREAD_OBJECT_METHODS; ! ! case ALLOC_THREAD_METHOD_TRACE_OBJECTS: ! ! return ALLOC_THREAD_OBJECT_METHOD_TRACES; ! ! default: ! ! return NO_OPERATION; ! } ! } ! }; Index: IProfException.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProfException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** IProfException.java 2001/10/14 22:08:56 1.1 --- IProfException.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 34,37 **** --- 32,37 ---- * Lukas Petru and Marek Przeczek. */ + + package net.sourceforge.javaprofiler.jpiimpl.commun; /** Exception. All custom exceptions raised by IProf class should be Index: UNKNOWN_Exception.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/UNKNOWN_Exception.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** UNKNOWN_Exception.java 2001/10/14 22:08:56 1.1 --- UNKNOWN_Exception.java 2001/11/21 22:05:55 1.2 *************** *** 1,4 **** - package net.sourceforge.javaprofiler.jpiimpl.commun; - /* * Sun Public License Notice --- 1,2 ---- *************** *** 35,38 **** --- 33,38 ---- */ + package net.sourceforge.javaprofiler.jpiimpl.commun; + /** Unknown exception. This exception is raised when a failure cannot ** be recognised, the only thing we know is that it happened in IProf *************** *** 41,43 **** ** @author Marek Przeczek */ ! public class UNKNOWN_Exception extends IProfException {}; \ No newline at end of file --- 41,43 ---- ** @author Marek Przeczek */ ! public class UNKNOWN_Exception extends IProfException {}; |
From: Pavel V. <va...@us...> - 2001-11-20 22:31:48
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv27483 Added Files: SnapshotImpl.java Log Message: Snapshot implementation --- NEW FILE: SnapshotImpl.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. */ package net.sourceforge.javaprofiler.jpiimpl.data; import java.util.*; import net.sourceforge.javaprofiler.jpi.*; import net.sourceforge.javaprofiler.jpi.dump.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; import net.sourceforge.javaprofiler.jpiimpl.data.*; /** * Implementation of Snapshot. * * @see net.sourceforge.javaprofiler.jpi.Snapshot * @author Pavel Vacha */ public class SnapshotImpl implements Snapshot { String name; long time; private HashMap libIDs = new HashMap(); //converts libIds to references //its different for different snapshots! private LinkedList classes = new LinkedList(); private LinkedList methods = new LinkedList(); private LinkedList groupThreads = new LinkedList(); private LinkedList threads = new LinkedList(); //private LinkedList arenas = new LinkedList(); private LinkedList gcs = new LinkedList(); //conf boolean withTraces = true; boolean withThreads = true; boolean withCPU = true; boolean withAlloc = true; boolean withMon = true; //boolean withArenas = true; boolean withGC = true; //other boolean haveSnapshot = false; /** Creates new SnapshotImpl */ public SnapshotImpl( IProf iprof ) { //PENDING pass configuration makeSnapshot( iprof ); } //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 ); extract( classes, methods, IProf.CLASS_METHODS, iprof ); if( withThreads ) { extract( null, groupThreads, IProf.GROUPS_OF_THREADS, iprof ); extract( groupThreads, threads, IProf.GROUP_THREADS, iprof ); } } if( withCPU ) { if( withTraces ) { extract( methods, null, IProf.CPU_METHOD_TRACES, iprof ); } if( withThreads ) { extract( threads, (withTraces) ? actLst : null, IProf.CPU_THREAD_METHODS, iprof ); if( withTraces ) { extract( actLst, null, IProf.CPU_THREAD_METHOD_TRACES, iprof ); } } } if( withAlloc ) { actLst3.clear(); actLst2.clear(); actLst.clear(); //PENDING extract( null, actLst3, IProf.OBJECT_TYPES, iprof ); extract( actLst3, (withTraces)? actLst : null, IProf.ALLOC_OBJECT_METHODS, iprof ); if( withTraces ) { extract( methods, null, IProf.ALLOC_METHOD_TRACES, iprof ); extract( actLst, null, IProf.ALLOC_OBJECT_METHOD_TRACES, iprof ); } if( withThreads ) { actLst.clear(); actLst2.clear(); actLst3.clear(); extract( threads, null, IProf.ALLOC_THREAD_OBJECTS, iprof ); extract( threads, actLst, IProf.ALLOC_THREAD_METHODS, iprof ); if( withTraces ) { extract( actLst, null, IProf.ALLOC_THREAD_METHOD_TRACES, iprof ); } extract( actLst, (withTraces)? actLst2 : null, IProf.ALLOC_THREAD_OBJECT_METHODS, iprof ); if( withTraces ) { extract( actLst2, null, IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES, iprof); } } } if( withMon ) { if( withTraces ) { extract( methods, null, IProf.MON_METHOD_TRACES, iprof ); } if( withThreads ) { actLst.clear(); extract( threads, (withTraces) ? actLst : null, IProf.MON_THREAD_METHODS, iprof ); if( withTraces ) { extract( actLst, null, IProf.MON_THREAD_METHOD_TRACES, iprof ); } } } //?//PENDING //if ( withArenas ) { // extract( null, arenas, IProf.ARENAS ); //} if ( withGC ) { extract( null, gcs, IProf.GCS, 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) ); } ////////////////////////////////////////////////////////////////////////// public int getThreadCount() { return threads.size(); } /** * Returns time when this snapshot was made. * * @return time when this snapshot was made. */ public long time() { return time; } /** * Performes monitor dump of the mirrored virtual machine. * A {@link MonitorInfo} object is included for all monitors * existing in the mirrored virtual machine. * * @return a <code>List</code> of {@link MonitorInfo} objects representing * monitors in the mirrored virtual machine. */ public List dumpMonitors() { //PENDIG return null; } /** * Returns size (in bytes) of free memory in the mirrored virtual machine. * * @return size (in bytes) of free memory in the mirrored virtual machine. */ public long freeMemory() { //PENDIG return 0; } /** * Returns <code>index</code>-th loaded type by the mirrored virtual machine. * * @param index index of some loaded type by the mirrored virtual machine. * @return a {@link ReferenceType} object representing <code>index</code>-th * loaded type by the mirrored virtual machine. */ public ReferenceType getClass(int index) { //PENDING //return classes.get( index ); return null; } /** * Returns number of all loaded types by the mirrored virtual machine. * * @return number of all loaded types by the mirrored virtual machine. */ public int getClassCount() { return classes.size(); } /** * Returns a list of the currently running threads. For each running thread * in the target VM, a {@link ThreadInfo} that holds information about it * is placed in the list. The returned list contains threads created through * <code>Thread</code>, all native threads attached to the target * VM through JNI, and system threads created by the target VM. * <p>Thread objects that have not yet been started * (through <code>Thread.start()</code>) and thread objects that * have completed their execution are not included in the returned list. * * @return a <code>List</code> of {@link ThreadInfo} objects, one for each * running thread in the mirrored VM. */ public List threads() { return threads; } /** * Sets name of this snapshot. * * @param name name of this snapshot. */ public void setName(String name) { this.name = name; } /** * Returns all loaded types. For each loaded type in the target VM * a {@link ReferenceType} will be placed in the returned list. The list * will include <code>ReferenceTypes</code> which mirror classes, interfaces, * and array types. * * @return a <code>List</code> of {@link ReferenceType} objects, each * mirroring a loaded type in the target VM. */ public List classes() { return classes; } /** * Returns size (in bytes) of allocated memory in the mirrored virtual * machine. * * @return size (in bytes) of allocated memory in the mirrored virtual * machine. */ public long totalMemory() { //PENDING return 0; } /** * Gets name of this snapshot. * * @return name of this snapshot. */ public String getName() { return name; } /** * Performed heap dump of the mirrored virtual machine. * * @return a {@link net.sourceforge.javaprofiler.jpi.dump.HeapDump} object * representing the content of the memory of the mirrored virtual machine. */ public HeapDump dumpHeap() { //PENDING return null; } ////////////////////////////////////////////////////////////////////////////// // Private methods ////////////////////////////////////////////////////////////////////////////// /* *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. */ /* 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, IProf iprof ) throws COMMUN_Exception { //trhows boolean pass = false; ListIterator iter, iterInner; IProf.sID sid; LinkedList listInner; IDObjectData obj, objInner, objOpposite; if ( in != null ) { pass = true; iter = null; } else { iter = in.listIterator(); } 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 ) { listInner = iprof.getAll( 0, whatType ); pass = false; obj = null; } else{ obj = (IDObjectData) iter.next(); listInner = iprof.getAll( obj.getID(), whatType ); } //Prof.sInfo will be in IProf.sId //fill in the former calling, there will be special param iterInner = listInner.listIterator(); while( iterInner.hasNext() ) { 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 ); } } } //PENDING trow other exception catch ( BAD_OBJ_ID_Exception e ) { System.out.println( "Bad objID\n" ); } /* catch ( BAD_INFO_ID_Exception e ) { System.out.println( "Bad infoID\n" ); } catch ( BAD_INFO_TYPE_Exception e ) { System.out.println( "Bad info type\n" ); }*/ catch ( BAD_COMMAND_Exception e ) { System.out.println( "Bad command\n" ); } catch ( UNKNOWN_Exception e ) { System.out.println( "Uknown exception\n" ); } }; private static IDObjectData createAndPutIn( int whatType, IProf.sID sid, IDObjectData refObj ) { switch( whatType ) { case IProf.CLASSES: { return new ClassData( sid ); } case IProf.OBJECT_TYPES: { return new AllocClassData( sid, null ); //sid.info.left } // case IProf.THREADS: { //??should I support this? // return new ThreadData( sid ); // break; // } case IProf.GROUPS_OF_THREADS: { return new ThreadGroupData( sid ); } case IProf.ARENAS: { return new AllocArenaData( sid ); } case IProf.GCS: { return new GCData( sid ); } case IProf.GROUP_THREADS: { ThreadGroupData rf = (ThreadGroupData) refObj; ThreadData newObj = new ThreadData( sid, rf, null ); //?z info rf.addThread( newObj ); //PENDING connect to object from sid.info return newObj; } // case IProf.CLASS_FIELDS_STATICS: return new ClassData( sid ); // case IProf.CLASS_FIELDS_INSTANCES: return new ClassData( sid ); // case IProf.CLASS_METHODS: { //shoul I support this // return new MethodData( sid ); // break; // } case IProf.ALLOC_METHOD_TRACES: { MethodData rf = (MethodData) refObj; AllocTraceData newObj = new AllocTraceData( sid, rf ); rf.addAllocTrace( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_METHOD_OBJECTS: { MethodData rf = (MethodData) refObj; AllocClassMethodData newObj = new AllocClassMethodData( sid, null, rf ); //sid.info.up rf.addClass( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHODS: { AllocClassData rf = (AllocClassData) refObj; AllocClassMethodData newObj = new AllocClassMethodData( sid, rf, null ); //sid.info.left rf.addMethod( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_TRACE_OBJECTS: { AllocTraceData rf = (AllocTraceData) refObj; AllocClassTraceData newObj = new AllocClassTraceData( sid, null, rf ); //sid.info.left rf.addClass( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHOD_TRACES:{ AllocClassMethodData rf = (AllocClassMethodData) refObj; AllocClassTraceData newObj = new AllocClassTraceData( sid, rf, null ); //sid.info.left rf.addTrace( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_THREADS: { AllocClassData rf = (AllocClassData) refObj; AllocThreadClassData newObj = new AllocThreadClassData( sid, null, rf ); //sid.info.left] rf.addThread( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_OBJECTS: { ThreadData rf = (ThreadData) refObj; AllocThreadClassData newObj = new AllocThreadClassData( sid, rf, null ); //sid.info.left rf.addClass( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHOD_THREADS:{ AllocClassMethodData rf =(AllocClassMethodData) refObj; AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( sid, null, rf, null ); //sid.info.left rf.addThread( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_OBJECT_METHODS:{ AllocThreadClassData rf = (AllocThreadClassData) refObj; AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( sid, rf, null, null ); //sid.info.left rf.addMethod( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_METHOD_OBJECTS:{ AllocThreadMethodData rf = (AllocThreadMethodData) refObj; AllocThreadClassMethodData newObj = new AllocThreadClassMethodData( sid, null, null, rf ); //sid.info.left rf.addClass( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_OBJECT_METHOD_TRACE_THREADS:{ AllocClassTraceData rf = (AllocClassTraceData) refObj; AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( sid, rf, null, null ); //sid.info.left rf.addThread( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_METHOD_TRACE_OBJECTS:{ AllocThreadTraceData rf = (AllocThreadTraceData) refObj; AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( sid, null, null, rf ); //sid.info.left rf.addClass( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES:{ AllocThreadClassMethodData rf = (AllocThreadClassMethodData) refObj; AllocThreadClassTraceData newObj = new AllocThreadClassTraceData( sid, null, rf, null ); //sid.info.left rf.addTrace( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_METHODS: { ThreadData rf =(ThreadData) refObj; AllocThreadMethodData newObj = new AllocThreadMethodData( sid, rf, null ); //sid.info.left rf.addAllocMethod( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.ALLOC_THREAD_METHOD_TRACES:{ AllocThreadMethodData rf = (AllocThreadMethodData) refObj; AllocThreadTraceData newObj = new AllocThreadTraceData( sid, rf, null ); //sid.info.left rf.addTrace( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.CPU_METHOD_TRACES: { MethodData rf = (MethodData) refObj; CPUTraceData newObj = new CPUTraceData( sid, rf ); rf.addCPUTrace( newObj ); return newObj; } case IProf.CPU_METHOD_THREADS: { MethodData rf = (MethodData) refObj; CPUThreadMethodData newObj = new CPUThreadMethodData( sid, null, rf ); //sid.info.left rf.addCPUThread( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.CPU_THREAD_METHODS: { ThreadData rf = (ThreadData) refObj; CPUThreadMethodData newObj = new CPUThreadMethodData( sid, rf, null ); //sid.info.left rf.addCPUMethod( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.CPU_METHOD_TRACE_THREADS:{ CPUTraceData rf = (CPUTraceData) refObj; CPUThreadTraceData newObj = new CPUThreadTraceData( sid, null, rf ); //sid.info.left rf.addThread( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.CPU_THREAD_METHOD_TRACES:{ CPUThreadMethodData rf = (CPUThreadMethodData) refObj; CPUThreadTraceData newObj = new CPUThreadTraceData( sid, rf, null ); //sid.info.left rf.addTrace( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.MON_METHOD_TRACES: { MethodData rf = (MethodData) refObj; MonTraceData newObj = new MonTraceData( sid, rf ); rf.addMonTrace( newObj ); return newObj; } case IProf.MON_METHOD_THREADS: { MethodData rf = (MethodData) refObj; MonThreadMethodData newObj = new MonThreadMethodData( sid, null, rf ); //sid.info.left rf.addMonThread( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.MON_THREAD_METHODS: { ThreadData rf = (ThreadData) refObj; MonThreadMethodData newObj = new MonThreadMethodData( sid, rf, null ); //sid.info.left rf.addMonMethod( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.MON_METHOD_TRACE_THREADS:{ MonTraceData rf = (MonTraceData) refObj; MonThreadTraceData newObj = new MonThreadTraceData( sid, null, rf ); //sid.info.left rf.addThread( newObj ); //PENDING connect to object from sid.info return newObj; } case IProf.MON_THREAD_METHOD_TRACES:{ MonThreadMethodData rf = (MonThreadMethodData) refObj; MonThreadTraceData newObj = new MonThreadTraceData( sid, rf, null ); //sid.info.left rf.addTrace( newObj ); //PENDING connect to object from sid.info return newObj; } // case IProf.MON_TRACES: return new ClassData( sid ); //PENDING default: return null; //throw some excetion } }; //toString() ////copy debuging printf from library } //?? //Constrocts for Data object from Buffer //concting to tree in obejcts? //TODO: // write exception handling code properly /* * $Log: SnapshotImpl.java,v $ * Revision 1.1 2001/11/20 22:31:45 vachis * Snapshot implementation * */ |
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv26597 Added Files: MonTraceData.java MonThreadTraceData.java MonThreadMethodData.java MonStatIDObjectData.java MonStatData.java Log Message: Monitors data classes --- NEW FILE: MonTraceData.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. */ package net.sourceforge.javaprofiler.jpiimpl.data; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonTraceData extends MonStatIDObjectData { /** * Frames that make up this trace. * List of {@link TraceFrameData} objects. */ private List frames; /** Profiling data for this method. */ private MethodData method; /** * Map of threads in which this trace appeared. * Mapping of {@link MonThreadTraceData} objects and thread IDs. */ private Map threads; /** * Creates new MonTraceData. * * @param ID unique ID of this object. * @param method profiling data for this method. * @param frames frames that make up this trace. It should be * <code>List</code> of {@link TraceFrameData} objects. */ MonTraceData(int ID, MethodData method, List frames) { super(ID); this.method=method; this.frames=frames; threads=new HashMap(); } /** * Creates new MonTraceData. * * @param sid data returned by communication layer * @param method profiling data for this method. */ MonTraceData( IProf.sID sid, MethodData method ) { this( sid.objId, method, null ); //sid...method ); //PENDING } /** * Returns frames that make up this trace. * * @return <code>List</code> of {@link TraceFrameData} objects. */ public List getFrames() { return frames; } /** * Returns profiling data for this method. * * @return profiling data for this method. */ public MethodData getMethod() { return method; } /** * Returns map of threads in which this trace appeared. * * @return mapping of {@link MonThreadTraceData} 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(MonThreadTraceData thread) { threads.put(new Integer(thread.getThreadMethod().getThread().getID()), 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 MonThreadTraceData getThread(int ID) { return (MonThreadTraceData)threads.get(new Integer(ID)); } } /* * $Log: MonTraceData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonThreadTraceData.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. */ package net.sourceforge.javaprofiler.jpiimpl.data; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonThreadTraceData extends MonStatIDObjectData { /** Profiling data for this thread and method. */ private MonThreadMethodData threadMethod; /** Profiling data for this trace. */ private MonTraceData trace; /** Creates new MonThreadTraceData */ /** * Creates new MonThreadTraceData. * * @param ID unique ID of this object. * @param threadMethod profiling data for this thread and method. * @param trace profiling data for this trace. */ MonThreadTraceData(int ID, MonThreadMethodData threadMethod, MonTraceData trace) { super(ID); this.threadMethod=threadMethod; this.trace=trace; } /** * Creates new MonThreadTraceData. * * @param sid data returned by communication layer * @param threadMethod profiling data for this thread and method. * @param trace profiling data for this trace. */ MonThreadTraceData( IProf.sID sid, MonThreadMethodData threadMethod, MonTraceData trace ) { this( sid.objId, threadMethod, trace ); //PENDING } /** * Returns profiling data for this thread and method. * * @return profiling data for this thread and method. */ public MonThreadMethodData getThreadMethod() { return threadMethod; } /** * Returns profiling data for this trace. * * @return profiling data for this trace. */ public MonTraceData getTrace() { return trace; } } /* * $Log: MonThreadTraceData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonThreadMethodData.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. */ package net.sourceforge.javaprofiler.jpiimpl.data; import java.util.*; import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonThreadMethodData extends MonStatIDObjectData { /** Profiling data for this thread. */ private ThreadData thread; /** Profiling data for this method. */ private MethodData method; /** * Map of traces of this method. * Mapping of {@link MonThreadTraceData} objects and trace IDs. */ private Map traces; /** Creates new MonThreadMethodData * * @param ID unique ID of this object. * @param thread profiling data for this thread. * @param method profiling data for this method. */ public MonThreadMethodData(int ID, ThreadData thread, MethodData method) { super(ID); this.thread=thread; this.method=method; traces=new HashMap(); } /** * Creates new MonThreadMethodData. * * @param sid data returned by communication layer * @param thread profiling data for this thread. * @param method profiling data for this method. */ MonThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { this( sid.objId, thread, method ); //PENDING } /** * Returns profiling data for this thread. * * @return profiling data for this thread. */ public ThreadData getThread() { return thread; } /** * Returns profiling data for this method. * * @return profiling data for this method. */ public MethodData getMethod() { return method; } /** * Returns map of traces of this method. * * @return mapping of {@link MonThreadTraceData} objects and trace IDs. */ public Map getTraces() { return traces; } /** * Adds trace of this method. * * @param trace trace of this method. */ void addTrace(MonThreadTraceData trace) { traces.put(new Integer(trace.getTrace().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 MonThreadTraceData getTrace(int ID) { return (MonThreadTraceData)traces.get(new Integer(ID)); } } /* * $Log: MonThreadMethodData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonStatIDObjectData.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. */ package net.sourceforge.javaprofiler.jpiimpl.data; /** * Class with statistic data for monitors profiling. * * @author Pavel Vacha */ public class MonStatIDObjectData extends IDObjectData implements MonStatData { /** Pure time spent by waiting for monitors. */ private long time; /** How many times waited this method */ private long hits; /** Creates new MonStatIDObjectData */ public MonStatIDObjectData(int ID) { super(ID); } /** * Adds given number of hits and time to the statistics. * * @param hits how many times waited this method * @param time pure time spent by waiting for monitors */ public void addToMonStat(long hits, long time) { this.hits+=hits; this.time+=time; } /** * Returns how many times waited this method * * @return how many times waited this method */ public long getMonHitCount() { return hits; } /** * Returns pure time spent by waiting for monitors * * @return pure time spent by waiting for monitors */ public long getMonTime() { return time; } } /* * $Log: MonStatIDObjectData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ --- NEW FILE: MonStatData.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. */ package net.sourceforge.javaprofiler.jpiimpl.data; /** * Class that implements this inteface holds statistic data * for monitors profiling. * * @author Pavel Vacha */ public interface MonStatData { /** * Adds given number of hits and time to the statistics. * * @param hits how many times waited this method * @param time pure time spent by wating for monitors */ public void addToMonStat ( long hits, long time ); /** * Returns how many times waited this method * * @return how many times waited this method */ public long getMonHitCount(); /** * Returns pure time spent by waiting for monitors * * @return pure time spent by waiting for monitors */ public long getMonTime(); } /* * $Log: MonStatData.java,v $ * Revision 1.1 2001/11/20 22:28:50 vachis * Monitors data classes * */ |
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data In directory usw-pr-cvs1:/tmp/cvs-serv25097 Modified Files: TraceData.java ThreadGroupData.java ThreadData.java MethodData.java GCData.java CPUTraceData.java CPUThreadTraceData.java CPUThreadMethodData.java CPUStatIDObjectData.java CPUStatData.java ClassData.java AllocTraceData.java AllocThreadTraceData.java AllocThreadMethodData.java AllocThreadClassTraceData.java AllocThreadClassMethodData.java AllocThreadClassData.java AllocClassTraceData.java AllocClassMethodData.java AllocClassData.java AllocArenaData.java Log Message: Contructors from IProf.sID and monitors statistic info Index: TraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/TraceData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** TraceData.java 2001/09/29 21:01:33 1.3 --- TraceData.java 2001/11/20 22:23:37 1.4 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Trace of some method. *************** *** 41,44 **** --- 43,49 ---- /* * $Log$ + * Revision 1.4 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.3 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ThreadGroupData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ThreadGroupData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ThreadGroupData.java 2001/09/29 21:01:33 1.2 --- ThreadGroupData.java 2001/11/20 22:23:37 1.3 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Information about one thread group. *************** *** 49,52 **** --- 51,64 ---- /** + * Creates new ThreadGroupData. + * + * @param sid data returned by communication layer + */ + ThreadGroupData( IProf.sID sid ) { + this( sid.objId, "" ); //sid...method ); + //PENDING + } + + /** * Returns name of this thread group. * *************** *** 88,91 **** --- 100,106 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ThreadData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ThreadData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ThreadData.java 2001/09/29 21:01:33 1.4 --- ThreadData.java 2001/11/20 22:23:37 1.5 *************** *** 23,30 **** import java.util.*; /** * Information about one thread. * ! * @author Jan Stola */ public class ThreadData extends AllocStatIDObjectData { --- 23,32 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Information about one thread. * ! * @author Jan Stola, Pavel Vacha */ public class ThreadData extends AllocStatIDObjectData { *************** *** 59,62 **** --- 61,70 ---- /** + * Map of methods invoked in this thread. + * Mapping of {@link MonThreadMethodData} objects and method IDs. + */ + private Map MonMethods; + + /** * Creates new ThreadData. * *************** *** 81,84 **** --- 89,104 ---- /** + * Creates new ThreadData. + * + * @param sid data returned by communication layer + * @param group group of this thread. + * @param parent parent of this thread. + */ + ThreadData( IProf.sID sid, ThreadGroupData group, ThreadData parent ) { + this( sid.objId, "", group, parent, false ); //sid...method ); + //PENDING + } + + /** * Returns name of this thread. * *************** *** 232,239 **** --- 252,290 ---- } + /** + * Map of methods invoked in this thread. (monitors data) + * + * @return mapping of {@link MonThreadMethodData} objects and method IDs. + */ + public Map getMonMethods() { + return MonMethods; + } + + /** + * Adds method invoked in this thread. (monitors data) + * + * @param method method invoked in this thread. + */ + void addMonMethod(MonThreadMethodData method) { + MonMethods.put(new Integer(method.getMethod().getID()), method); + } + + /** + * Returns method (with given ID) invoked in this thread. + * + * @param ID ID of the method. (monitors data) + * @return method (with given ID) invoked in this thread + * or <code>null</code> if such method does not exist. + */ + public MonThreadMethodData getMonMethod(int ID) { + return (MonThreadMethodData)MonMethods.get(new Integer(ID)); + } } /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: MethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/MethodData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** MethodData.java 2001/09/29 21:01:33 1.4 --- MethodData.java 2001/11/20 22:23:37 1.5 *************** *** 23,37 **** import java.util.*; /** * Method of some class. * ! * @author Jan Stola */ ! public class MethodData extends IDObjectData implements AllocStatData, CPUStatData { // Implementation of CPUStatData interface. /** Pure time spent in this method. */ ! private long time; /** How many times was this method called. */ ! private long hits; // Implementation of AllocStatData interface. /** Number of live instances. */ --- 23,45 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Method of some class. * ! * @author Jan Stola, Pavel Vacha */ ! public class MethodData extends IDObjectData implements AllocStatData, CPUStatData, ! MonStatData { // Implementation of CPUStatData interface. /** Pure time spent in this method. */ ! private long cpuTime; /** How many times was this method called. */ ! private long cpuHits; ! // Implementation of MontatData interface. ! /** Pure time spent by wating for monitors. */ ! private long monTime; ! /** How many times wated this method */ ! private long monHits; // Implementation of AllocStatData interface. /** Number of live instances. */ *************** *** 74,77 **** --- 82,95 ---- */ private HashMap CPUThreads; + /** + * Map of traces in which this method waited. + * Mapping of {@link CPUTraceData} objects and trace IDs. + */ + private HashMap MonTraces; + /** + * Map of threads in which this method waited. + * Mapping of {@link CPUThreadMethodData} objects and thread IDs. + */ + private HashMap MonThreads; /** *************** *** 97,103 **** --- 115,134 ---- classes=new HashMap(); CPUThreads=new HashMap(); + MonTraces=new HashMap(); + MonThreads=new HashMap(); } /** + * Creates new MethodData. + * + * @param sid data returned by communication layer + * @param clazz class this method belongs to. + */ + MethodData( IProf.sID sid, ClassData clazz ) { + this( sid.objId, "", "", 0, 0, clazz ); //sid...method ); + //PENDING + } + + /** * Returns name of the method. * *************** *** 177,186 **** * Returns map of traces of this method. * ! * @return mapping of {@link AllocTraceData} objects and trace IDs. */ public Map getCPUTraces() { return CPUTraces; } ! /** * Adds trace of this method. --- 208,217 ---- * Returns map of traces of this method. * ! * @return mapping of {@link CPUTraceData} objects and trace IDs. */ public Map getCPUTraces() { return CPUTraces; } ! /** * Adds trace of this method. *************** *** 188,195 **** * @param trace trace of this method. */ ! void addCPUTrace(AllocTraceData trace) { CPUTraces.put(new Integer(trace.getID()), trace); } /** * Returns trace (with given ID) of this method. --- 219,246 ---- * @param trace trace of this method. */ ! void addCPUTrace(CPUTraceData trace) { CPUTraces.put(new Integer(trace.getID()), trace); } + + + /** + * Returns map of monitor traces of this method. + * + * @return mapping of {@link MonTraceData} objects and trace IDs. + */ + public Map getMonTraces() { + return MonTraces; + } + /** + * Adds monitor trace of this method. + * + * @param trace monitor trace of this method. + */ + void addMonTrace(MonTraceData trace) { + MonTraces.put(new Integer(trace.getID()), trace); + } + + /** * Returns trace (with given ID) of this method. *************** *** 262,265 **** --- 313,345 ---- } + /** + * Returns threads in which this method was waiting. + * + * @return mapping of {@link MonThreadMethodData} objects and thread IDs. + */ + public Map getMonThreads() { + return MonThreads; + } + + /** + * Adds threads in which this method was wating. + * + * @param thread threads in which this method was waiting. + */ + void addMonThread(MonThreadMethodData thread) { + MonThreads.put(new Integer(thread.getThread().getID()), thread); + } + + /** + * Returns thread (with given ID) in which this method was waiting. + * + * @param ID ID of the thread. + * @return thread (with given ID) in which this method was wating + * or <code>null</code> if such thread does not exist. + */ + public MonThreadMethodData getMonThread(int ID) { + return (MonThreadMethodData)CPUThreads.get(new Integer(ID)); + } + // Implementation of CPUStatData interface. *************** *** 270,276 **** * @param time pure time spent in this method. */ ! public void addToStat(long hits, long time) { ! this.hits+=hits; ! this.time+=time; } --- 350,356 ---- * @param time pure time spent in this method. */ ! public void addToCPUStat(long hits, long time) { ! this.cpuHits+=hits; ! this.cpuTime+=time; } *************** *** 280,285 **** * @return how many times was this method. */ ! public long getHitCount() { ! return hits; } --- 360,365 ---- * @return how many times was this method. */ ! public long getCPUHitCount() { ! return cpuHits; } *************** *** 289,294 **** * @return pure time spent in this method. */ ! public long getTime() { ! return time; } --- 369,374 ---- * @return pure time spent in this method. */ ! public long getCPUTime() { ! return cpuTime; } *************** *** 353,360 **** --- 433,475 ---- } + //Implementation of MonStatData interface + + + /** + * Adds given number of hits and time to the statistics. + * + * @param hits how many times wated this method + * @param time pure time spent by wating for monitors + */ + public void addToMonStat(long hits, long time) { + this.monHits+=hits; + this.monTime+=time; + } + + /** + * Returns how many times wated this method + * + * @return how many times wated this method + */ + public long getMonHitCount() { + return monHits; + } + + /** + * Returns pure time spent by wating for monitors + * + * @return pure time spent by wating for monitors + */ + public long getMonTime() { + return monTime; + } + } /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: GCData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/GCData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** GCData.java 2001/09/29 21:01:33 1.2 --- GCData.java 2001/11/20 22:23:37 1.3 *************** *** 21,24 **** --- 21,25 ---- package net.sourceforge.javaprofiler.jpiimpl.data; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Data about one GC session. *************** *** 57,60 **** --- 58,71 ---- this.endTime=endTime; } + + /** + * Creates new GCData. + * + * @param sid data returned by communication layer + */ + GCData( IProf.sID sid ) { + this( sid.objId, 0, 0, 0, 0, 0 ); //sid...method ); + //PENDING + } /** *************** *** 107,110 **** --- 118,124 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: CPUTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUTraceData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** CPUTraceData.java 2001/09/29 21:01:33 1.3 --- CPUTraceData.java 2001/11/20 22:23:37 1.4 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * CPU profiling data for one trace. *************** *** 57,60 **** --- 59,73 ---- } + /** + * Creates new CPUTraceData. + * + * @param sid data returned by communication layer + * @param method profiling data for this method. + */ + CPUTraceData( IProf.sID sid, MethodData method ) { + this( sid.objId, method, null ); //sid...method ); + //PENDING + } + /** * Returns frames that make up this trace. *************** *** 108,111 **** --- 121,127 ---- /* * $Log$ + * Revision 1.4 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.3 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: CPUThreadTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUThreadTraceData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** CPUThreadTraceData.java 2001/09/29 21:01:33 1.2 --- CPUThreadTraceData.java 2001/11/20 22:23:37 1.3 *************** *** 21,24 **** --- 21,25 ---- package net.sourceforge.javaprofiler.jpiimpl.data; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * CPU profiling data for one thread and trace. *************** *** 46,49 **** --- 47,63 ---- } + /** + * Creates new CPUThreadTraceData. + * + * @param sid data returned by communication layer + * @param threadMethod profiling data for this thread and method. + * @param trace profiling data for this trace. + */ + CPUThreadTraceData( IProf.sID sid, CPUThreadMethodData threadMethod, + CPUTraceData trace ) { + this( sid.objId, threadMethod, trace ); + //PENDING + } + /** * Returns profiling data for this thread and method. *************** *** 68,71 **** --- 82,88 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: CPUThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUThreadMethodData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** CPUThreadMethodData.java 2001/09/29 21:01:33 1.3 --- CPUThreadMethodData.java 2001/11/20 22:23:37 1.4 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * CPU profiling data for one thread and method. *************** *** 54,57 **** --- 56,71 ---- /** + * Creates new CPUThreadMethodData. + * + * @param sid data returned by communication layer + * @param thread profiling data for this thread. + * @param method profiling data for this method. + */ + CPUThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { + this( sid.objId, thread, method ); + //PENDING + } + + /** * Returns profiling data for this thread. * *************** *** 104,107 **** --- 118,124 ---- /* * $Log$ + * Revision 1.4 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.3 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: CPUStatIDObjectData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUStatIDObjectData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** CPUStatIDObjectData.java 2001/09/29 21:01:33 1.2 --- CPUStatIDObjectData.java 2001/11/20 22:23:37 1.3 *************** *** 21,24 **** --- 21,25 ---- package net.sourceforge.javaprofiler.jpiimpl.data; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Class with statistic data for CPU profiling. *************** *** 48,52 **** * @param time pure time spent in this method or trace. */ ! public void addToStat(long hits, long time) { this.hits+=hits; this.time+=time; --- 49,53 ---- * @param time pure time spent in this method or trace. */ ! public void addToCPUStat(long hits, long time) { this.hits+=hits; this.time+=time; *************** *** 58,62 **** * @return how many times was this method or trace called. */ ! public long getHitCount() { return hits; } --- 59,63 ---- * @return how many times was this method or trace called. */ ! public long getCPUHitCount() { return hits; } *************** *** 67,71 **** * @return pure time spent in this method or trace. */ ! public long getTime() { return time; } --- 68,72 ---- * @return pure time spent in this method or trace. */ ! public long getCPUTime() { return time; } *************** *** 75,78 **** --- 76,82 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: CPUStatData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/CPUStatData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** CPUStatData.java 2001/09/29 21:01:33 1.2 --- CPUStatData.java 2001/11/20 22:23:37 1.3 *************** *** 35,39 **** * @param time pure time spent in this method or trace. */ ! public void addToStat(long hits, long time); /** --- 35,39 ---- * @param time pure time spent in this method or trace. */ ! public void addToCPUStat(long hits, long time); /** *************** *** 42,46 **** * @return how many times was this method or trace called. */ ! public long getHitCount(); /** --- 42,46 ---- * @return how many times was this method or trace called. */ ! public long getCPUHitCount(); /** *************** *** 49,53 **** * @return pure time spent in this method or trace. */ ! public long getTime(); } --- 49,53 ---- * @return pure time spent in this method or trace. */ ! public long getCPUTime(); } *************** *** 55,58 **** --- 55,61 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/ClassData.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ClassData.java 2001/09/29 21:01:33 1.3 --- ClassData.java 2001/11/20 22:23:37 1.4 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Java class. *************** *** 91,94 **** --- 93,106 ---- /** + * Creates new ClassData. + * + * @param sid data returned by communication layer + */ + ClassData( IProf.sID sid ) { + this( sid.objId, "", "", 0, 0, 0, null, 0, null, false ); //sid...method ); + //PENDING + } + + /** * Sets methods defined in this class. * *************** *** 195,198 **** --- 207,213 ---- /* * $Log$ + * Revision 1.4 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.3 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocTraceData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocTraceData.java 2001/09/29 21:01:33 1.4 --- AllocTraceData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Allocation data for one trace. *************** *** 58,61 **** --- 60,75 ---- /** + * Creates new AllocTraceData. + * + * @param sid data returned by communication layer + * @param method allocation data for this method. + * <code>List</code> of {@link TraceFrameData} objects. + */ + AllocTraceData( IProf.sID sid, MethodData method ) { + this( sid.objId, method, null ); //sid.info.frames + //PENDING + } + + /** * Returns frames that make up this trace. * *************** *** 109,112 **** --- 123,129 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocThreadTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadTraceData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocThreadTraceData.java 2001/09/29 21:01:33 1.4 --- AllocThreadTraceData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Allocation data for one thread and trace. *************** *** 54,57 **** --- 56,71 ---- /** + * Creates new AllocThreadTraceData. + * + * @param sid data returned by communication layer + * @param threadMethod allocation data for this thread and method. + */ + AllocThreadTraceData( IProf.sID sid, AllocThreadMethodData threadMethod, + AllocTraceData trace ) { + this( sid.objId, threadMethod, trace ); + //PENDING + } + + /** * Returns allocation data for this thread and method. * *************** *** 109,112 **** --- 123,129 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocThreadMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadMethodData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocThreadMethodData.java 2001/09/29 21:01:33 1.4 --- AllocThreadMethodData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Allocation data for one thread and method. *************** *** 59,62 **** --- 61,76 ---- } + /** + * Creates new AllocThreadMethodData. + * + * @param sid data returned by communication layer + * @param thread allocation data for this thread. + * @param method allocation data for this method. + */ + AllocThreadMethodData( IProf.sID sid, ThreadData thread, MethodData method ) { + this( sid.objId, thread, method ); + //PENDING + } + /** * Returns allocation data for this thread. *************** *** 142,145 **** --- 156,162 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocThreadClassTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadClassTraceData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AllocThreadClassTraceData.java 2001/09/29 21:01:33 1.2 --- AllocThreadClassTraceData.java 2001/11/20 22:23:37 1.3 *************** *** 21,24 **** --- 21,25 ---- package net.sourceforge.javaprofiler.jpiimpl.data; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Allocation data for one class, thread and trace. *************** *** 51,54 **** --- 52,70 ---- } + /** + * Creates new AllocThreadClassTraceData. + * + * @param sid data returned by communication layer + * @param classTrace allocation data for this class and trace. + * @param threadClassMethod allocation data for this class, thread and method. + * @param threadTrace allocation data for this thread and trace. + */ + AllocThreadClassTraceData( IProf.sID sid, AllocClassTraceData classTrace, + AllocThreadClassMethodData threadClassMethod, + AllocThreadTraceData threadTrace ) { + this( sid.objId, classTrace, threadClassMethod, threadTrace ); + //PENDING + } + /** * Returns allocation data for this class and trace. *************** *** 82,85 **** --- 98,104 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocThreadClassMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadClassMethodData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocThreadClassMethodData.java 2001/09/29 21:01:33 1.4 --- AllocThreadClassMethodData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Allocation data for one class, method and thread. *************** *** 58,61 **** --- 60,78 ---- traces=new HashMap(); } + + + /** + * Creates new AllocThreadClassMethodData. + * + * @param sid data returned by communication layer + * @param threadClass allocation data for this class and thread. + * @param classMethod allocation data for this class and method. + * @param threadMethod allocation data for this thread and method. + */ + AllocThreadClassMethodData( IProf.sID sid, AllocThreadClassData threadClass, + AllocClassMethodData classMethod, AllocThreadMethodData threadMethod ) { + this( sid.objId, threadClass, classMethod, threadMethod ); + //PENDING + } /** *************** *** 124,127 **** --- 141,147 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocThreadClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocThreadClassData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocThreadClassData.java 2001/09/29 21:01:33 1.4 --- AllocThreadClassData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,27 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Allocation data for one thread and class. *************** *** 53,56 **** --- 54,70 ---- } + /** + * Creates new AllocThreadClassdData. + * + * @param sid data returned by communication layer + * @param thread allocation data for this thread. + * @param clazz allocation data for this class. + */ + AllocThreadClassData( IProf.sID sid, ThreadData thread, AllocClassData clazz ) { + this( sid.objId, thread, clazz ); + //PENDING + } + + /** * Returns allocation data for this thread. *************** *** 109,112 **** --- 123,129 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocClassTraceData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocClassTraceData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocClassTraceData.java 2001/09/29 21:01:33 1.4 --- AllocClassTraceData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Allocation data for one class and trace. *************** *** 55,58 **** --- 57,72 ---- /** + * Creates new AllocClassTraceData. + * @param sid data returned by communication layer + * @param trace allocation data for this trace. + * @param classMethod allocation data for this class and method. + */ + AllocClassTraceData( IProf.sID sid, AllocClassMethodData classMethod, + AllocTraceData trace) { + this( sid.objId, classMethod, trace ); + //PENDING + } + + /** * Returns allocation data for this class and method. * *************** *** 109,112 **** --- 123,129 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocClassMethodData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocClassMethodData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocClassMethodData.java 2001/09/29 21:01:33 1.4 --- AllocClassMethodData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Allocation data for one class and method. *************** *** 60,63 **** --- 62,77 ---- threads=new HashMap(); } + + /** + * Creates new AllocClassMethodData. + * + * @param sid data returned by communication layer + * @param method allocation data for this method. + * @param clazz allocation data for this class. + */ + AllocClassMethodData( IProf.sID sid, AllocClassData clazz, MethodData method ) { + this( sid.objId, clazz, method ); + //PENDING + } /** *************** *** 95,99 **** * allocated. */ ! void addTraces(AllocClassTraceData trace) { traces.put(new Integer(trace.getTrace().getID()), trace); } --- 109,113 ---- * allocated. */ ! void addTrace(AllocClassTraceData trace) { traces.put(new Integer(trace.getTrace().getID()), trace); } *************** *** 128,132 **** * class allocated. */ ! void addThreads(AllocThreadClassMethodData thread) { threads.put(new Integer(thread.getThreadClass().getThread().getID()), thread); } --- 142,146 ---- * class allocated. */ ! void addThread(AllocThreadClassMethodData thread) { threads.put(new Integer(thread.getThreadClass().getThread().getID()), thread); } *************** *** 148,151 **** --- 162,168 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocClassData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocClassData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AllocClassData.java 2001/09/29 21:01:33 1.4 --- AllocClassData.java 2001/11/20 22:23:37 1.5 *************** *** 23,26 **** --- 23,27 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Allocation data for one class. *************** *** 64,67 **** --- 65,78 ---- /** + * Creates new AllocClassData. + * @param sid data returned by communication layer + * @param clazz class to which this allocation data belongs. + */ + AllocClassData( IProf.sID sid, ClassData clazz ) { + this( sid.objId, clazz, 0 ); //sid.info...... ) ; + //PENDING + } + + /** * Returns class to which this allocation data belongs. * *************** *** 144,147 **** --- 155,161 ---- /* * $Log$ + * Revision 1.5 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.4 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: AllocArenaData.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/data/AllocArenaData.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** AllocArenaData.java 2001/09/29 21:01:33 1.2 --- AllocArenaData.java 2001/11/20 22:23:37 1.3 *************** *** 23,26 **** --- 23,28 ---- import java.util.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; + /** * Allocation data about one arena. *************** *** 58,61 **** --- 60,72 ---- /** + * Creates new AllocArenaData. + * @param sid data returned by communication layer + */ + AllocArenaData( IProf.sID sid ) { + super( sid.objId ); + //PENDING + } + + /** * Returns ID of the arena. * *************** *** 116,119 **** --- 127,133 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:23:37 vachis + * Contructors from IProf.sID and monitors statistic info + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. |
From: Pavel V. <va...@us...> - 2001-11-20 22:21:44
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv24498 Modified Files: IProf.java Log Message: no message Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** IProf.java 2001/11/18 16:31:26 1.2 --- IProf.java 2001/11/20 22:21:40 1.3 *************** *** 1287,1291 **** } ! /** Returns first Complementary opperation for given type of opperation. * Complementary operation is another opperation how you can get object * of the same type, if you would started with another type of object. --- 1287,1291 ---- } ! /** Returns first complementary opperation for given type of opperation. * Complementary operation is another opperation how you can get object * of the same type, if you would started with another type of object. *************** *** 1297,1301 **** * * @return constant of first complementary opperation ! * @see getChanged(), getData(), getAll() */ public static int getComplType1( int typeOpp ) { --- 1297,1301 ---- * * @return constant of first complementary opperation ! * @see #getChanged(), #getData(), #getAll() */ public static int getComplType1( int typeOpp ) { *************** *** 1303,1307 **** } ! /** Returns second Complementary opperation for given type of opperation. * For the most of objects the second complemnetary opperation returns IProf.NO_OPERATION, * except operation producing AllocThreadObjectMethod or AllocThreadObjectTrace --- 1303,1307 ---- } ! /** Returns second complementary opperation for given type of opperation. * For the most of objects the second complemnetary opperation returns IProf.NO_OPERATION, * except operation producing AllocThreadObjectMethod or AllocThreadObjectTrace *************** *** 1311,1315 **** * * @return constant of second complementary opperation ! ** @see getChanged(), getData(), getAll() **/ public static int getComplType2( int typeOpp ) { --- 1311,1315 ---- * * @return constant of second complementary opperation ! ** @see #getChanged(),#getData(),#getAll() **/ public static int getComplType2( int typeOpp ) { *************** *** 1335,1338 **** --- 1335,1341 ---- /* * $Log$ + * Revision 1.3 2001/11/20 22:21:40 vachis + * no message + * * Revision 1.2 2001/11/18 16:31:26 vachis * New auxiliary functions for SnapshotImpl |
From: Pavel V. <va...@us...> - 2001-11-18 16:31:29
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv14278 Modified Files: IProf.java Log Message: New auxiliary functions for SnapshotImpl Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** IProf.java 2001/10/14 22:08:56 1.1 --- IProf.java 2001/11/18 16:31:26 1.2 *************** *** 1025,1028 **** --- 1025,1041 ---- /// request - method traces (monitor profiling) public static final int MON_TRACES = 38; + + //new not implemented ?yet + /// alloc data request - threads in which method have been called + public static final int ALLOC_METHOD_THREADS = 40; + + /// alloc data request - threads in which traces have been called + public static final int ALLOC_METHOD_TRACE_THREADS = 41; + + /// max{ all constant used in getAll()/getChanged()} + public static final int MAX_GET_ALL_CONST = 41; + + /// indicates no opperation, used in getComplOpp() + public static final int NO_OPPERATION = 42; /** Statistic data of the object. Each object *************** *** 1239,1246 **** --- 1252,1341 ---- return getChangedOrAll( F_GET_CHANGED, objId, seqType); } + + private static int oppTypes[] = new int[IProf.MAX_GET_ALL_CONST]; + //class initializer + { + //init + //oppTypes[ IProf.CLASSES ] = 0; //ostani =0 + oppTypes[IProf.ALLOC_METHOD_OBJECTS ]= IProf.ALLOC_OBJECT_METHODS; + oppTypes[IProf.ALLOC_TRACE_OBJECTS ]= IProf.ALLOC_OBJECT_METHOD_TRACES; + oppTypes[IProf.ALLOC_OBJECT_METHODS ]= IProf.ALLOC_METHOD_OBJECTS; + oppTypes[IProf.ALLOC_OBJECT_METHOD_TRACES ]= IProf.ALLOC_TRACE_OBJECTS; + oppTypes[IProf.ALLOC_OBJECT_THREADS ]= IProf.ALLOC_THREAD_OBJECTS; + + //these are ternary types + //PENDING synchonize with marek + oppTypes[IProf.ALLOC_OBJECT_METHOD_THREADS ]= IProf.ALLOC_THREAD_OBJECT_METHODS; + oppTypes[IProf.ALLOC_OBJECT_METHOD_TRACE_THREADS ]= IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES; + oppTypes[IProf.ALLOC_THREAD_OBJECT_METHODS ]= IProf.ALLOC_OBJECT_METHOD_THREADS; + oppTypes[IProf.ALLOC_THREAD_METHOD_OBJECTS ]= IProf.ALLOC_OBJECT_METHOD_THREADS; + oppTypes[IProf.ALLOC_THREAD_METHOD_TRACE_OBJECTS ]= IProf.ALLOC_OBJECT_METHOD_TRACE_THREADS; + + oppTypes[IProf.ALLOC_THREAD_OBJECTS ]= IProf.ALLOC_OBJECT_THREADS; + oppTypes[IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES ]= IProf.ALLOC_OBJECT_METHOD_TRACE_THREADS; + oppTypes[IProf.ALLOC_THREAD_METHODS ]= IProf.ALLOC_METHOD_THREADS; + oppTypes[IProf.ALLOC_THREAD_METHOD_TRACES ]= IProf.ALLOC_METHOD_TRACE_THREADS; + + oppTypes[IProf.CPU_METHOD_THREADS ]= IProf.CPU_THREAD_METHODS; + oppTypes[IProf.CPU_METHOD_TRACE_THREADS ]= IProf.CPU_THREAD_METHOD_TRACES; + oppTypes[IProf.CPU_THREAD_METHODS ]= IProf.CPU_METHOD_THREADS; + oppTypes[IProf.CPU_THREAD_METHOD_TRACES ]= IProf.CPU_METHOD_TRACE_THREADS; + oppTypes[IProf.MON_METHOD_THREADS ]= IProf.MON_THREAD_METHODS; + oppTypes[IProf.MON_METHOD_TRACE_THREADS ]= IProf.MON_THREAD_METHOD_TRACES; + oppTypes[IProf.MON_THREAD_METHODS ]= IProf.MON_METHOD_THREADS; + oppTypes[IProf.MON_THREAD_METHOD_TRACES ]= IProf.MON_METHOD_TRACE_THREADS; + } + + /** Returns first Complementary opperation for given type of opperation. + * Complementary operation is another opperation how you can get object + * of the same type, if you would started with another type of object. + * The first complementary operation, is the most left complemetary operation + * in the tree. (in the tree showing types of object and types of operation used + * in getAll()/getChanged() methods) + * + * @param typeOpp constant of operation for getAll()/getChanged() methods + * + * @return constant of first complementary opperation + * @see getChanged(), getData(), getAll() + */ + public static int getComplType1( int typeOpp ) { + return oppTypes[typeOpp]; + } + + /** Returns second Complementary opperation for given type of opperation. + * For the most of objects the second complemnetary opperation returns IProf.NO_OPERATION, + * except operation producing AllocThreadObjectMethod or AllocThreadObjectTrace + * objects + * + * @param typeOpp constant of operation for getAll()/getChanged() methods + * + * @return constant of second complementary opperation + ** @see getChanged(), getData(), getAll() + **/ + public static int getComplType2( int typeOpp ) { + switch (typeOpp) { + //PENDING synchonize with marek + case IProf.ALLOC_OBJECT_METHOD_THREADS: + return IProf.ALLOC_THREAD_METHOD_OBJECTS; + case IProf.ALLOC_OBJECT_METHOD_TRACE_THREADS: + return IProf.ALLOC_THREAD_METHOD_TRACE_OBJECTS; + case IProf.ALLOC_THREAD_OBJECT_METHODS: + return IProf.ALLOC_THREAD_METHOD_OBJECTS; + case IProf.ALLOC_THREAD_METHOD_OBJECTS: + return IProf.ALLOC_THREAD_OBJECT_METHODS; + case IProf.ALLOC_THREAD_METHOD_TRACE_OBJECTS: + return IProf.ALLOC_THREAD_OBJECT_METHOD_TRACES; + + default: return IProf.NO_OPPERATION; + } + } + }; /* * $Log$ + * Revision 1.2 2001/11/18 16:31:26 vachis + * New auxiliary functions for SnapshotImpl + * * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. |
From: Jan S. <st...@us...> - 2001-11-17 12:02:21
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv14381 Added Files: VirtualMachineImpl.java Log Message: First version of VirtualMachineImpl. --- NEW FILE: VirtualMachineImpl.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. */ package net.sourceforge.javaprofiler.jpiimpl; import java.util.*; import net.sourceforge.javaprofiler.jpi.*; import net.sourceforge.javaprofiler.jpi.dump.HeapDump; import net.sourceforge.javaprofiler.jpi.event.EventQueue; import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** * Implementation of Virtual Machine. * * @see net.sourceforge.javaprofiler.jpi.VirtualMachine * @author Jan Stola */ public class VirtualMachineImpl implements VirtualMachine { private IProf iprof; public VirtualMachineImpl(IProf iprof) { this.iprof=iprof; } /** * Enables/disables the garbage collection in the mirrored virtual machine. * * @param enable if <code>true</code> the garbage collection is enabled * otherwise its disabled. */ public void enableGC(boolean enable) { //PENDING } /** * Returns number of all loaded types by the mirrored virtual machine. * * @return number of all loaded types by the mirrored virtual machine. */ public int getClassCount() { //PENDING return 0; } /** * Performed heap dump of the mirrored virtual machine. * * @return a {@link net.sourceforge.javaprofiler.jpi.dump.HeapDump} object * representing the content of the memory of the mirrored virtual machine. */ public HeapDump dumpHeap() { //PENDING return null; } /** * Returns the <code>Process</code> object for this virtual machine if * launched by a launching connector. * * @return the <code>Process</code> object for this virtual machine, * or <code>null</code> if it was not launched by a launching connector. */ public Process process() { //PENDING return null; } /** * Creates the snapshot of the current profiling information about the mirrored * virtual machine. */ public Snapshot createSnapshot() { //PENDING return null; } /** * Causes the mirrored VM to terminate with the given error code. All * resources associated with this <code>VirtualMachine</code> are freed. * If the mirrored VM is remote, the communication channel to it will be * closed. Resources originating in this <code>VirtualMachine</code> * (<code>ClassInfo</code>, <code>ThreadInfo</code>, etc.) will become invalid. * Threads running in the mirrored VM are abruptly terminated. A thread death * exception is not thrown and finally blocks are not run. * * @param exitCode the exit code for the target VM. */ public void exit(int exitCode) { //PENDING try { iprof.exitVM(); } catch (COMMUN_Exception e) { throw new VMDisconnectedException(); } } /** * Returns size (in bytes) of allocated memory in the mirrored virtual * machine. * * @return size (in bytes) of allocated memory in the mirrored virtual * machine. */ public long totalMemory() { //PENDING return 0; } /** * Suspends all threads in the virtual machine as described in * {@link ThreadInfo#suspend()}. */ public void suspendThreads() { //PENDING try { iprof.suspendVM(); } catch (COMMUN_Exception e) { throw new VMDisconnectedException(); } } /** * Invalidates this virtual machine mirror. The communication channel to the * target VM is closed, and the target VM prepares to accept another * subsequent connection from this profiler or another profiler, including * the following tasks: All threads suspended by {@link ThreadInfo#suspend()} * are resumed. Garbage collection is re-enabled. Any current method * invocations executing in the target VM are continued after * the disconnection. Resources originating in this <code>VirtualMachine</code> * (<code>ClassInfo</code>, <code>ThreadInfo</code>, etc.) will become invalid. */ public void dispose() { //PENDING iprof.stop(); } /** * Returns a list of the currently running threads. For each running thread * in the target VM, a {@link ThreadInfo} that holds information about it * is placed in the list. The returned list contains threads created through * <code>Thread</code>, all native threads attached to the target * VM through JNI, and system threads created by the target VM. * <p>Thread objects that have not yet been started * (through <code>Thread.start()</code>) and thread objects that * have completed their execution are not included in the returned list. * * @return a <code>List</code> of {@link ThreadInfo} objects, one for each * running thread in the mirrored VM. */ public List threads() { //PENDING return null; } /** * Performes monitor dump of the mirrored virtual machine. * A {@link MonitorInfo} object is included for all monitors * existing in the mirrored virtual machine. * * @return a <code>List</code> of {@link MonitorInfo} objects representing * monitors in the mirrored virtual machine. */ public List dumpMonitors() { //PENDING return null; } /** * Resumes all threads in the virtual machine as described in * {@link ThreadInfo#resume()}. */ public void resumeThreads() { //PENDING try { iprof.resumeVM(); } catch (COMMUN_Exception e) { throw new VMDisconnectedException(); } } /** * Returns size (in bytes) of free memory in the mirrored virtual machine. * * @return size (in bytes) of free memory in the mirrored virtual machine. */ public long freeMemory() { //PENDING return 0; } /** * Returns <code>index</code>-th loaded type by the mirrored virtual machine. * * @param index index of some loaded type by the mirrored virtual machine. * @return a {@link ReferenceType} object representing <code>index</code>-th * loaded type by the mirrored virtual machine. */ public ReferenceType getClass(int index) { //PENDING return null; } /** * Returns the event queue for this virtual machine. A virtual machine has * only one {@link net.sourceforge.javaprofiler.jpi.event.EventQueue} object, * this method will return the same instance each time it is invoked. * * @return the {@link net.sourceforge.javaprofiler.jpi.event.EventQueue} * for this virtual machine. */ public EventQueue eventQueue() { //PENDING return null; } /** * Performes the garbage collection in the mirrored virtual machine. */ public void gc() { //PENDING } /** * Returns number of currently running threads in the mirrored virtual machine. * * @return number of currently running threads in the mirrored virtual machine. */ public int getThreadCount() { //PENDING return 0; } /** * Returns all loaded types. For each loaded type in the target VM * a {@link ReferenceType} will be placed in the returned list. The list * will include <code>ReferenceTypes</code> which mirror classes, interfaces, * and array types. * * @return a <code>List</code> of {@link ReferenceType} objects, each * mirroring a loaded type in the target VM. */ public List classes() { //PENDING return null; } } /* * $Log: VirtualMachineImpl.java,v $ * Revision 1.1 2001/11/17 12:02:17 stolis * First version of VirtualMachineImpl. * */ |
From: Jan S. <st...@us...> - 2001-10-14 22:18:18
|
Update of /cvsroot/javaprofiler/module In directory usw-pr-cvs1:/tmp/cvs-serv27132 Log Message: The very first version of profiler module. Status: Vendor Tag: avendor Release Tags: arelease N module/javaprofiler.jarContent N module/net/sourceforge/javaprofiler/module/ProfilerExecutorBeanInfo.java N module/net/sourceforge/javaprofiler/module/Bundle.properties N module/net/sourceforge/javaprofiler/module/ProfilerExecutor.java N module/net/sourceforge/javaprofiler/module/ProfilerSettings.java N module/net/sourceforge/javaprofiler/module/ProfilerSettingsBeanInfo.java N module/net/sourceforge/javaprofiler/module/ProfilerModule.java N module/net/sourceforge/javaprofiler/module/resources/ProfilerExecutorIcon32.gif N module/net/sourceforge/javaprofiler/module/resources/mf-layer.xml N module/net/sourceforge/javaprofiler/module/resources/AttachActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/ProfilerExecutorIcon.gif N module/net/sourceforge/javaprofiler/module/resources/ProfilerSettingsIcon.gif N module/net/sourceforge/javaprofiler/module/resources/ProfilerSettingsIcon32.gif N module/net/sourceforge/javaprofiler/module/resources/SessionsNodeIcon.gif N module/net/sourceforge/javaprofiler/module/resources/ProfilerWindowActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/SessionsNodeIcon32.gif N module/net/sourceforge/javaprofiler/module/resources/ProfilerNodeIcon.gif N module/net/sourceforge/javaprofiler/module/resources/ProfilerNodeIcon32.gif N module/net/sourceforge/javaprofiler/module/resources/SessionNodeIcon.gif N module/net/sourceforge/javaprofiler/module/resources/SessionNodeIcon32.gif N module/net/sourceforge/javaprofiler/module/resources/SuspendSessionActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/MakeCurrentSessionActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/ResumeSessionActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/PauseActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/DestroySessionActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/ContinueActionIcon.gif N module/net/sourceforge/javaprofiler/module/resources/FinishActionIcon.gif N module/net/sourceforge/javaprofiler/module/actions/AttachAction.java N module/net/sourceforge/javaprofiler/module/actions/Bundle.properties N module/net/sourceforge/javaprofiler/module/actions/AttachPanel.java N module/net/sourceforge/javaprofiler/module/actions/ProfilerWindowAction.java N module/net/sourceforge/javaprofiler/module/actions/SessionCookie.java N module/net/sourceforge/javaprofiler/module/actions/SuspendSessionAction.java N module/net/sourceforge/javaprofiler/module/actions/ResumeSessionAction.java N module/net/sourceforge/javaprofiler/module/actions/DestroySessionAction.java N module/net/sourceforge/javaprofiler/module/actions/MakeCurrentSessionAction.java N module/net/sourceforge/javaprofiler/module/actions/PauseAction.java N module/net/sourceforge/javaprofiler/module/actions/ContinueAction.java N module/net/sourceforge/javaprofiler/module/actions/FinishAction.java N module/net/sourceforge/javaprofiler/module/editors/AllocLevelPropertyEditor.java N module/net/sourceforge/javaprofiler/module/editors/CPULevelPropertyEditor.java N module/net/sourceforge/javaprofiler/module/editors/CPUMethodPropertyEditor.java N module/net/sourceforge/javaprofiler/module/editors/CommunTypePropertyEditor.java N module/net/sourceforge/javaprofiler/module/editors/ModePropertyEditor.java N module/net/sourceforge/javaprofiler/module/editors/WorkspaceEditor.java N module/net/sourceforge/javaprofiler/module/nodes/ProfilerView.java N module/net/sourceforge/javaprofiler/module/nodes/Bundle.properties N module/net/sourceforge/javaprofiler/module/nodes/SessionsNode.java N module/net/sourceforge/javaprofiler/module/nodes/ProfilerNode.java N module/net/sourceforge/javaprofiler/module/nodes/SessionNode.java N module/net/sourceforge/javaprofiler/module/data/ProfilerData.java N module/net/sourceforge/javaprofiler/module/data/Session.java No conflicts created by this import ***** Bogus filespec: - ***** Bogus filespec: Imported ***** Bogus filespec: sources |
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv25507 Added Files: BAD_COMMAND_Exception.java BAD_DATA_TYPE_Exception.java BAD_INFO_ID_Exception.java BAD_INFO_TYPE_Exception.java BAD_OBJ_ID_Exception.java Buffer.java Commun.java COMMUN_Exception.java CommunSetup.java CommunSetupShMem.java CommunSetupSocket.java CommunShMem.java CommunSocket.java IProf.java IProfException.java UNKNOWN_Exception.java Log Message: Content of src2 directory moved into the new location. --- NEW FILE: BAD_COMMAND_Exception.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Bad command exception. This exception is raised when a request for ** specified objID is not possible (eg. when you try (in one call to ** getAll() or getChanged()) to gain threads where concrete method was ** called and you have method's objId only). ** ** @author Marek Przeczek */ public class BAD_COMMAND_Exception extends IProfException {}; /* * $Log: BAD_COMMAND_Exception.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: BAD_DATA_TYPE_Exception.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Bad objID type exception. This exception is raised when used ID is ** of different type than specified (eg. when an object has statistic ** data about memory profiling only and someone tries to gain cpu ** profiling data from it). ** ** @see BAD_INFO_TYPE_Exception ** ** @author Marek Przeczek */ public class BAD_DATA_TYPE_Exception extends IProfException {}; /* * $Log: BAD_DATA_TYPE_Exception.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: BAD_INFO_ID_Exception.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Bad infoID exception. This exception is raised when used ID is not ** an infoID of an object (eg. when objID is used as an infoID, this ** exception can be raised). ** ** @see BAD_OBJ_ID_Exception ** ** @author Marek Przeczek */ public class BAD_INFO_ID_Exception extends IProfException {}; /* * $Log: BAD_INFO_ID_Exception.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: BAD_INFO_TYPE_Exception.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Bad infoID type exception. This exception is raised when type of ** infoID is bad (eg. infoID exists but is of different type than ** specified). ** ** An example: when trying to gain information about method (eg. with ** infoId = 1), getInfo( 1, METHOD_INFO) must be called. METHOD_INFO ** specifies the type of information, in this case information about ** method. If another info type is specified, BAD_INFO_TYPE_Exception ** will be raised. ** ** @see BAD_DATA_TYPE_Exception ** ** @author Marek Przeczek */ public class BAD_INFO_TYPE_Exception extends IProfException {}; /* * $Log: BAD_INFO_TYPE_Exception.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: BAD_OBJ_ID_Exception.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Bad objectID exception. This exception is raised when used ID is not ** an objID of an object (eg. when an ID to which no object exists is ** used, this exception is raised). ** ** @see BAD_INFO_ID_Exception ** ** @author Marek Przeczek */ public class BAD_OBJ_ID_Exception extends IProfException {}; /* * $Log: BAD_OBJ_ID_Exception.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: Buffer.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** I/O buffer. This class implements an input/output buffer ** needed during communication between profiler dynamic library ** and Java. Same class (of the same name and functionality) exists ** in the dynamic library side - but it is more complicated and flexible ** than this one. ** ** @see Commun ** ** @author Marek Przeczek */ public class Buffer { /// internal buffer private byte[] _buf; /// size of buffer private int _size; /// Default constructor. public Buffer() { _size = 0; _buf = null; } /** Constructor. This constructor constructs Buffer object using data ** from another buffer. The data are copied to this newly created ** Buffer object. ** ** @param buf buffer (an array of bytes) ** @param size size of buffer 'buf' */ public Buffer( byte[] buf, int size) { _size = size; _buf = new byte[_size]; copyBuffer( _buf, buf, _size); } /** Use existing buffer. This method replaces internal buffer by ** the given one. No copy is created, the buffer 'buf' is used as ** an internal buffer. ** ** @param buf buffer (an array of bytes) ** @param size size of buffer 'buf' */ public Buffer useBuffer( byte[] buf, int size) { _size = size; _buf = buf; return this; } /** Get buffer. This method returns a reference ** to buffer data. ** ** @return reference to buffer */ public byte[] getBuffer() { return _buf;} /** Get size of data. This method returns size ** of data stored in buffer. ** ** @return size of data */ public int getSize() { return _size;} /** Clear buffer. It truncates buffer to zero length, ** everything stored in the buffer will be lost. */ public void clear() { _size = 0; _buf = null; } /** Put integer into buffer. By this method you can insert Java ** integer into buffer (of bytes). ** ** @param c integer ** ** @return this Buffer object ** ** @see getInt(), getLong(), getString() */ public Buffer putInt( int c) { _buf = copyBuffer( new byte[_size+4], _buf, _size); _size = _size+4; for( int i = 0; i < 4; i++) { _buf[_size-1-i] = (byte)(c & 0x000000FF); c >>= 8; } return this; } /** Get integer from buffer. This method grabs Java integer located ** at position 'offset' from the buffer. ** ** @param offset position in the buffer ** ** @return grabbed integer ** ** @see putInt(), getLong(), getString() */ public int getInt( int offset) { int c = 0; for( int i = 0; i < 4; i++) { c <<= 8; int cc = _buf[offset+i]; c += cc; if( cc < 0) c += 256; } return c; } /** Get long integer from buffer. This method grabs Java long ** integer located at position 'offset' from the buffer. ** ** @param offset position in the buffer ** ** @return grabbed long integer ** ** @see putInt(), getInt(), getString() */ public long getLong( int offset) { long hi = getInt( offset); int lo = getInt( offset+4); return (hi << 32)+lo; } /** Get string from buffer. This method grabs Java string located ** at position 'offset' from the buffer. In the buffer string is ** stored as C string (text + terminating null). ** ** @param offset position in the buffer ** ** @return grabbed string ** ** @see putInt(), getInt(), getLong() */ public String getString( int offset) { int pos = offset; while( _buf[pos] != 0) pos++; return new String( _buf, offset, pos-offset); } /** Copy buffer. It only copies source buffer to destination one. ** Destination buffer must be of sufficient size, no check is ** done. ** ** @param dest destination ** @param src source ** @param sz size of source buffer ** ** @return reference to destination buffer */ private byte[] copyBuffer( byte[] dest, byte[] src, int sz) { if( src != null) System.arraycopy( src, 0, dest, 0, sz); return dest; } }; /* * $Log: Buffer.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: Commun.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Communication. This is a standard interface for all communication ** classes. Whole communication is done thru an instance of this ** interface implementation. ** ** @see CommunSocket, CommunShMem ** ** @author Marek Przeczek */ public interface Commun { /** Initialization of communication. This method should ** initialize the communication, it means to make a connection ** with opposite side. ** ** @return false (failed); ** true (ok, initialized) */ public boolean initialize(); /** Read data. This method is used to read data ** from communication channel (socket, shmem etc.) to buffer. ** ** @param b reference to Buffer object ** ** @return reference to this Commun object ** ** @see write() */ public Commun read( Buffer b); /** Write data. This method is used to write data ** from buffer to communication channel (socket, shmem etc.). ** ** @param b reference to Buffer object ** ** @return reference to this Commun object ** ** @see read() */ public Commun write( Buffer b); /** Failure indication. Use this method if you want to know ** the last operation was successful or not. ** ** @return false (last operation was successful); ** true (last operation failed) */ public boolean hasFailed(); /** Stop communication. Is stops communication and closes ** communication channel. */ public void stopCommun(); }; /* * $Log: Commun.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: COMMUN_Exception.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Exception. This exception is raised when a communication failed ** (eg. when server falls down during communication). ** ** @author Marek Przeczek */ public class COMMUN_Exception extends IProfException {}; /* * $Log: COMMUN_Exception.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: CommunSetup.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Communication setup. Other classes holding setup data are inherited ** from this abstract class. ** ** @see CommunSetupSocket, CommunSetupShMem ** ** @author Marek Przeczek */ public abstract class CommunSetup { /// type of communication - sockets public static final int COMMUN_SOCKET = 0; /// type of communication - shared memory public static final int COMMUN_SHMEM = 1; /// type of communication public int communType; /** Default constructor. Socket communication is used by default. */ public CommunSetup() { this( COMMUN_SOCKET); } /** Constructor. It sets type of communication. ** 'communType' argument can take one of the following values: ** #COMMUN_SOCKET or #COMMUN_SHMEM. ** ** @param communType type of communication */ public CommunSetup( int communType) { this.communType = communType; } }; /* * $Log: CommunSetup.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: CommunSetupShMem.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Shared memory communication setup. This class contains setup data ** for shared memory communication. ** ** @see CommunSetup, CommunSetupSocket ** ** @author Marek Przeczek */ public class CommunSetupShMem extends CommunSetup { /// shared memory name (identifier) - 3 characters public String shmemId = new String( "com"); /// shared memory size - in bytes public int shmemSize = 256*1024; /// Default constructor. public CommunSetupShMem() { super( COMMUN_SHMEM); } /** Constructor. It takes setup from given parameters. ** ** @param shmemId shared memory name (identifier) - 3 chars only ! ** @param shmemSize shared memory size - in bytes */ public CommunSetupShMem( String shmemId, int shmemSize) { super( COMMUN_SHMEM); this.shmemId = new String( shmemId); this.shmemSize = shmemSize; } }; /* * $Log: CommunSetupShMem.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: CommunSetupSocket.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Socket communication setup. This class contains setup data ** for socket communication. ** ** @see CommunSetup, CommunSetupShMem */ public class CommunSetupSocket extends CommunSetup { /// connect mode - server public static final int SERVER_MODE = 0; /// connect mode - client public static final int CLIENT_MODE = 1; /// connect mode (client by default) public int connectMode = CLIENT_MODE; /// hostname (used when connect mode is set to 'client') public String hostname = new String( "127.0.0.1"); /// TCP port (where server should listen or where client should connect to) public int port = 25595; /// Default constructor. public CommunSetupSocket() { super( COMMUN_SOCKET); } /** 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 ** @param hostname hostname ** @param port port */ public CommunSetupSocket( int connectMode, String hostname, int port) { super( COMMUN_SOCKET); this.connectMode = connectMode; this.hostname = new String( hostname); this.port = port; } }; /* * $Log: CommunSetupSocket.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: CommunShMem.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Shared memory communication. This class implements shared memory ** communication and offers the user of this class the standard ** communication interface. Implementation is system dependent ** (so it is different on WIN32 and UNIX systems). It should be ** faster then using sockets. Because Java has no support for shared ** memory, JNI is used. ** ** @see CommunSocket, Commun ** ** @author Marek Przeczek */ public class CommunShMem implements Commun { /// 8 bytes long pointer to data private long data = 0; /** Constructor. Creates shared memory block and ** needed semaphores for communication. If semaphores ** or shared memory block already exist, they are used. ** ** @param shmemId shared memory identifier (3 characters long only) ** @param shmemSize shared memory size ** ** @see construct() */ public CommunShMem( String shmemId, int shmemSize) { construct( shmemId, shmemSize);} /** Constructor. Because JNI does not allow native constructors, ** this native method picks constructor's function over. ** ** @param shmemId shared memory identifier (3 characters long only) ** @param shmemSize shared memory size ** ** @see CommunShMem() */ private native void construct( String shmemId, int shmemSize); /** Finalize. It deattaches and destroys shared memory, destroys ** semaphores. See Java Language Reference for more information. */ protected native void finalize(); /** Initialization of communication. This method does nothing, ** it always returns true. ** ** @return true (ok, initialized) */ public boolean initialize() { return true;} /** Read data. This method is used to read data ** from communication channel (shmem) to buffer. ** ** @param b reference to Buffer object ** ** @return reference to this Commun object ** ** @see write() */ public native Commun read( Buffer b); /** Write data. This method is used to write data ** from buffer to communication channel (shmem). ** ** @param b reference to Buffer object ** ** @return reference to this Commun object ** ** @see write() */ public native Commun write( Buffer b); /** Failure indication. Use this method if you want to know ** the last operation was successful or not. ** ** @return false (last operation was successful); ** true (last operation failed) */ public native boolean hasFailed(); /** Stop shared memory communication. It stops communication, ** locks/unlocks semaphores and leaves them in consistent state. */ public native void stopCommun(); /** Static initializer. It loads native class (stored in dynamic ** library) to the memory. */ static { System.loadLibrary( "CommunShMem"); } }; /* * $Log: CommunShMem.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: CommunSocket.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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.io.*; import java.lang.*; import java.net.*; /** Socket communication. This class implements TCP/IP socket ** communication and offers the user of this class the standard ** communication interface.This class stands a server or client out. ** ** @see CommunShMem, Commun ** ** @author Marek Przeczek */ public class CommunSocket implements Commun { /// connect mode (0 = server, 1 = client) private int _connectMode; /** Hostname. It is used only when connectMode is set ** to 'client' (1); it contains target host's name. */ private String _host; /** Port number. When connectMode is set to 'server' (0), ** it contains port number, where server listens for new ** connections; when connectMode is set to 'client' (1), ** it contains target host's port number. */ private int _port; /// failure indicator private boolean _failed = false; /// socket private Socket _sock; /// input stream private BufferedInputStream _in; /// output stream private BufferedOutputStream _out; /// internal buffer for binary data private Buffer _buf = (new Buffer()).useBuffer( new byte[4], 4); /** Constructor. It initializes server for listening ** on given port (if connectMode is set to 'server'). ** If connectMode is set to 'client', this class connects ** to the target specified by 'host' and 'port' arguments. ** ** @param connectMode mode (0 = as server, 1 = as client) ** @param host target host (if connectMode is set to 'client') ** @param port port number */ public CommunSocket( int connectMode, String host, int port) { _connectMode = connectMode; _host = new String( host); _port = port; } /** Initialization of communication. This method initializes ** socket communication - waits for client and makes a connection. ** Once a client is connected to this server, another client ** has no possibility to connect. If used in client mode, it tries ** to connect to server. ** ** @return false (failed); ** true (ok, client connected) */ public boolean initialize() { try { if( _connectMode == 0) { // server ServerSocket sock = new ServerSocket( _port); sock.setSoTimeout( 0); _sock = sock.accept(); sock.close(); } else _sock = new Socket( _host, _port); _in = new BufferedInputStream( _sock.getInputStream()); _out = new BufferedOutputStream( _sock.getOutputStream()); } catch( Exception e) { return _failed = true; } return true; } /** Read data. This method is used to read data ** from communication channel (socket) to buffer. ** ** @param b reference to Buffer object ** ** @return reference to this Commun object ** ** @see write() */ public Commun read( Buffer b) { try { int rc = _in.read( _buf.getBuffer(), 0, 4); if( _failed = (rc < 4)) return this; int size = _buf.getInt( 0); if( size == 0) { b.clear(); return this; } byte[] nbuf = new byte[size]; int pos = 0; while( size != 0) { rc = _in.read( nbuf, pos, size); if( _failed = (rc < 0)) return this; pos += rc; size -= rc; } b.useBuffer( nbuf, pos); } catch( Exception e) { _failed = true; } return this; } /** Write data. This method is used to write data ** from buffer to communication channel (socket). ** ** @param b reference to Buffer object ** ** @return reference to this Commun object ** ** @see read() */ public Commun write( Buffer b) { _buf.clear(); _buf.putInt( b.getSize()); try { _out.write( _buf.getBuffer(), 0, 4); _out.write( b.getBuffer(), 0, b.getSize()); _out.flush(); } catch( Exception e) { _failed = true; } return this; } /** Failure indication. Use this method if you want to know ** the last operation was successful or not. ** ** @return false (last operation was successful); ** true (last operation failed) */ public boolean hasFailed() { return _failed;} /** Stop socket communication. It stops socket communication - ** closes input/output streams and socket. */ public void stopCommun() { try { _in .close(); _out.close(); _sock.close(); } catch( Exception e) { _failed = true; } } }; /* * $Log: CommunSocket.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: IProf.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. [...1209 lines suppressed...] ** ** @see getInfo(), getData(), getAll() */ public synchronized LinkedList getChanged( int objId, int seqType) throws COMMUN_Exception, BAD_OBJ_ID_Exception, BAD_COMMAND_Exception, UNKNOWN_Exception { return getChangedOrAll( F_GET_CHANGED, objId, seqType); } }; /* * $Log: IProf.java,v $ * Revision 1.1 2001/10/14 22:08:56 stolis * Content of src2 directory moved into the new location. * */ --- NEW FILE: IProfException.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Exception. All custom exceptions raised by IProf class should be ** inherited from this class, so it should be very easy to catch ** exceptions belonging to IProf class. ** ** @see BAD_COMMAND_Exception, BAD_DATA_TYPE_Exception, ** BAD_INFO_ID_Exception, BAD_INFO_TYPE_Exception, ** BAD_OBJ_ID_Exception, COMMUN_Exception, UNKNOWN_Exception ** ** @author Marek Przeczek */ public class IProfException extends Exception {}; --- NEW FILE: UNKNOWN_Exception.java --- package net.sourceforge.javaprofiler.jpiimpl.commun; /* * 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. */ /** Unknown exception. This exception is raised when a failure cannot ** be recognised, the only thing we know is that it happened in IProf ** class. ** ** @author Marek Przeczek */ public class UNKNOWN_Exception extends IProfException {}; |
From: Jan S. <st...@us...> - 2001-10-14 22:05:29
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv24927/commun Log Message: Directory /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun added to the repository |
From: Jan S. <st...@us...> - 2001-10-14 21:56:34
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect In directory usw-pr-cvs1:/tmp/cvs-serv23334 Modified Files: LaunchConnector.java ShmemAttachConnector.java ShmemLaunchConnector.java ShmemListenConnector.java ShmemTransport.java SocketAttachConnector.java SocketLaunchConnector.java SocketListenConnector.java SocketTransport.java Log Message: Connectors updated. Index: LaunchConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/LaunchConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** LaunchConnector.java 2001/09/29 21:01:33 1.2 --- LaunchConnector.java 2001/10/14 21:56:31 1.3 *************** *** 72,116 **** arg.setValue("\""); args.put(arg.name(), arg); - //profiling args - List choices=new ArrayList(4); - choices.add("off"); - choices.add("object"); - choices.add("method"); - choices.add("trace"); - arg=new SelectedArgumentImpl(false, bundle.getString("AllocLevel"), - bundle.getString("AllocLevelDesc"), "allocLevel", choices); - arg.setValue("trace"); - args.put(arg.name(), arg); - arg=new BooleanArgumentImpl(false, bundle.getString("AllocThread"), - bundle.getString("AllocThreadDesc"), "allocThread"); - ((Connector.BooleanArgument)arg).setValue(true); - args.put(arg.name(), arg); - arg=new IntegerArgumentImpl(false, bundle.getString("AllocThraceDepth"), - bundle.getString("AllocTraceDepthDesc"), "allocTraceDepth", 1, 100); - ((Connector.IntegerArgument)arg).setValue(2); - args.put(arg.name(), arg); - choices=new ArrayList(3); - choices.add("off"); - choices.add("method"); - choices.add("trace"); - arg=new SelectedArgumentImpl(false, bundle.getString("CPULevel"), - bundle.getString("CPULevelDesc"), "cpuLevel", choices); - arg.setValue("trace"); - args.put(arg.name(), arg); - arg=new BooleanArgumentImpl(false, bundle.getString("CPUThread"), - bundle.getString("CPUThreadDesc"), "cpuThread"); - ((Connector.BooleanArgument)arg).setValue(true); - args.put(arg.name(), arg); - arg=new IntegerArgumentImpl(false, bundle.getString("CPUTraceDepth"), - bundle.getString("CPUTraceDepthDesc"), "cpuTraceDepth", 1, 100); - ((Connector.IntegerArgument)arg).setValue(2); - args.put(arg.name(), arg); - choices=new ArrayList(2); - choices.add("exact"); - choices.add("sampling"); - arg=new SelectedArgumentImpl(false, bundle.getString("CPUMethod"), - bundle.getString("CPUMethodDesc"), "cpuMethod", choices); - arg.setValue("sampling"); - args.put(arg.name(), arg); return args; } --- 72,75 ---- *************** *** 119,122 **** --- 78,84 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemAttachConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemAttachConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemAttachConnector.java 2001/09/29 21:01:33 1.2 --- ShmemAttachConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,26 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupShMem; import java.util.Map; import java.util.HashMap; --- 21,24 ---- *************** *** 29,32 **** --- 27,32 ---- import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.VirtualMachineImpl; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 41,50 **** * Attaches to VM using shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { ! ((ShmemTransport)transport()).initialize(); String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("address".equals(arg.name())) { String val=arg.value(); --- 41,49 ---- * Attaches to VM using shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("address".equals(arg.name())) { String val=arg.value(); *************** *** 54,64 **** } } ! if (address!=null) { throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! IProf prof=new IProf(new CommunSetupShMem(address, 256*1024)); ! prof.runClient(); ! //PENDING ! return null; } --- 53,65 ---- } } ! if (address==null) { throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! IProf iprof=new IProf(new CommunSetupShMem(address, 256*1024)); ! if (iprof.run()) { ! return new VirtualMachineImpl(iprof); ! } else { ! throw new ConnectingException("Unable to connect to the profiled process."); ! } } *************** *** 126,129 **** --- 127,133 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemLaunchConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemLaunchConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemLaunchConnector.java 2001/09/29 21:01:33 1.2 --- ShmemLaunchConnector.java 2001/10/14 21:56:31 1.3 *************** *** 38,43 **** * Launches the VM and connects to it through shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { ! ((ShmemTransport)transport()).initialize(); //PENDING return null; --- 38,42 ---- * Launches the VM and connects to it through shared memory. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { //PENDING return null; *************** *** 53,75 **** return ShmemTransport.getDefault(); } ! ! /** ! * Returns the arguments accepted by this Connector and their default values. ! * The keys of the returned map are string argument names. The values are ! * {@link Connector.Argument} containing information about the argument ! * and its default value. ! * ! * @return the map associating argument names with argument information ! * and default value. ! */ ! public Map defaultArguments() { ! Map args=super.defaultArguments(); ! Connector.Argument arg=new StringArgumentImpl(false, bundle.getString("Address"), ! bundle.getString("LaunchAddress"), "address"); ! arg.setValue(""); ! args.put(arg.name(), arg); ! return args; ! } ! /** * Returns a type of this connector. Three currently supported types are --- 52,56 ---- return ShmemTransport.getDefault(); } ! /** * Returns a type of this connector. Three currently supported types are *************** *** 107,110 **** --- 88,94 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemListenConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemListenConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemListenConnector.java 2001/09/29 21:01:33 1.2 --- ShmemListenConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,26 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupShMem; import java.util.Map; import java.util.HashMap; --- 21,24 ---- *************** *** 29,32 **** --- 27,31 ---- import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 41,50 **** * Listens for connections initiated by other VMs. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { ! ((ShmemTransport)transport()).initialize(); String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("address".equals(arg.name())) { String val=arg.value(); --- 40,48 ---- * Listens for connections initiated by other VMs. */ ! public VirtualMachine connect(Map arguments) throws IllegalConnectorArgumentsException, ConnectingException { String address=null; Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("address".equals(arg.name())) { String val=arg.value(); *************** *** 57,62 **** throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! IProf prof=new IProf(new CommunSetupShMem(address, 256*1024)); ! prof.runClient(); //PENDING return null; --- 55,60 ---- throw new IllegalConnectorArgumentsException("Wrong or missing shared memory area address.", "address"); } ! //IProf prof=new IProf(new CommunSetupShMem(address, 256*1024)); ! //prof.runClient(); //PENDING return null; *************** *** 126,129 **** --- 124,130 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: ShmemTransport.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/ShmemTransport.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ShmemTransport.java 2001/09/29 21:01:33 1.2 --- ShmemTransport.java 2001/10/14 21:56:31 1.3 *************** *** 21,24 **** --- 21,26 ---- package net.sourceforge.javaprofiler.jpiimpl.connect; + import java.util.ResourceBundle; + import net.sourceforge.javaprofiler.jpi.connect.Transport; *************** *** 42,53 **** /** - * Initializes this transport. Loads the <code>pt_shmem</code> shared library - * (<code>pt_shmem.dll</code> or <code>libpt_shmem.so</code>). - */ - protected void initialize() { - System.loadLibrary("pt_shmem"); - } - - /** * Returns singleton instance of this class. * --- 44,47 ---- *************** *** 73,79 **** --- 67,85 ---- } + /** + * Returns short human-readable description of this transport. + * + * @return short human-readable description of this transport. + */ + public String label() { + return ResourceBundle.getBundle("net.sourceforge.javaprofiler.jpiimpl.bundle").getString("ShmemTransport"); + } + } /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketAttachConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketAttachConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketAttachConnector.java 2001/09/29 21:01:33 1.2 --- SocketAttachConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,32 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupSocket; import java.util.Map; ! import java.util.HashMap; import java.util.Iterator; import java.util.ResourceBundle; import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; /** --- 21,32 ---- package net.sourceforge.javaprofiler.jpiimpl.connect; import java.util.Map; ! import java.util.TreeMap; import java.util.Iterator; import java.util.ResourceBundle; import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.VirtualMachineImpl; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 47,51 **** Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { --- 47,51 ---- Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { *************** *** 63,70 **** throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! IProf prof=new IProf(new CommunSetupSocket(CommunSetupSocket.CLIENT_MODE, host, port)); ! prof.runClient(); ! //PENDING ! return null; } --- 63,72 ---- throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! IProf iprof=new IProf(new CommunSetupSocket(CommunSetupSocket.CLIENT_MODE, host, port)); ! if (iprof.run()) { ! return new VirtualMachineImpl(iprof); ! } else { ! throw new ConnectingException("Unable to connect to the profiled process."); ! } } *************** *** 89,93 **** */ public Map defaultArguments() { ! Map args=new HashMap(2); Connector.Argument arg=new StringArgumentImpl(false, bundle.getString("Host"), bundle.getString("AttachHost"), "host"); --- 91,95 ---- */ public Map defaultArguments() { ! Map args=new TreeMap(); Connector.Argument arg=new StringArgumentImpl(false, bundle.getString("Host"), bundle.getString("AttachHost"), "host"); *************** *** 136,139 **** --- 138,144 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketLaunchConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketLaunchConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketLaunchConnector.java 2001/09/29 21:01:33 1.2 --- SocketLaunchConnector.java 2001/10/14 21:56:31 1.3 *************** *** 52,74 **** return SocketTransport.getDefault(); } ! ! /** ! * Returns the arguments accepted by this Connector and their default values. ! * The keys of the returned map are string argument names. The values are ! * {@link Connector.Argument} containing information about the argument ! * and its default value. ! * ! * @return the map associating argument names with argument information ! * and default value. ! */ ! public Map defaultArguments() { ! Map args=super.defaultArguments(); ! Connector.IntegerArgument arg=new IntegerArgumentImpl(false, bundle.getString("Port"), ! bundle.getString("LaunchPort"), "port", 0, 65535); ! arg.setValue(0); ! args.put(arg.name(), arg); ! return args; ! } ! /** * Returns a type of this connector. Three currently supported types are --- 52,56 ---- return SocketTransport.getDefault(); } ! /** * Returns a type of this connector. Three currently supported types are *************** *** 106,109 **** --- 88,94 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketListenConnector.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketListenConnector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketListenConnector.java 2001/09/29 21:01:33 1.2 --- SocketListenConnector.java 2001/10/14 21:56:31 1.3 *************** *** 21,26 **** package net.sourceforge.javaprofiler.jpiimpl.connect; - import IProf; - import CommunSetupSocket; import java.util.Map; import java.util.HashMap; --- 21,24 ---- *************** *** 29,32 **** --- 27,31 ---- import net.sourceforge.javaprofiler.jpi.VirtualMachine; import net.sourceforge.javaprofiler.jpi.connect.*; + import net.sourceforge.javaprofiler.jpiimpl.commun.*; /** *************** *** 46,50 **** Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)iter.next(); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { --- 45,49 ---- Iterator iter=arguments.keySet().iterator(); while (iter.hasNext()) { ! Connector.Argument arg=(Connector.Argument)arguments.get(iter.next()); if ("port".equals(arg.name())) { if (arg.isValid(arg.value())) { *************** *** 56,61 **** throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! IProf prof=new IProf(new CommunSetupSocket(CommunSetupSocket.SERVER_MODE, "localhost", port)); ! prof.runClient(); //PENDING return null; --- 55,60 ---- throw new IllegalConnectorArgumentsException("Wrong or missing port number.", "port"); } ! //IProf prof=new IProf(new CommunSetupSocket(CommunSetupSocket.SERVER_MODE, "localhost", port)); ! //prof.runClient(); //PENDING return null; *************** *** 125,128 **** --- 124,130 ---- /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. Index: SocketTransport.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/connect/SocketTransport.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** SocketTransport.java 2001/09/29 21:01:33 1.2 --- SocketTransport.java 2001/10/14 21:56:31 1.3 *************** *** 21,24 **** --- 21,26 ---- package net.sourceforge.javaprofiler.jpiimpl.connect; + import java.util.ResourceBundle; + import net.sourceforge.javaprofiler.jpi.connect.Transport; *************** *** 64,71 **** --- 66,85 ---- return name; } + + /** + * Returns short human-readable description of this transport. + * + * @return short human-readable description of this transport. + */ + public String label() { + return ResourceBundle.getBundle("net.sourceforge.javaprofiler.jpiimpl.bundle").getString("SocketTransport"); + } } /* * $Log$ + * Revision 1.3 2001/10/14 21:56:31 stolis + * Connectors updated. + * * Revision 1.2 2001/09/29 21:01:33 stolis * Plural added in licenses. |
From: Jan S. <st...@us...> - 2001-10-14 21:55:08
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv23102 Modified Files: bundle.properties Log Message: Licence added. Index: bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/bundle.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** bundle.properties 2001/08/22 13:27:35 1.1 --- bundle.properties 2001/10/14 21:55:06 1.2 *************** *** 1,6 **** SocketLaunchDesc=Connector that launches target VM using command line and attaches to it through shared memory. ShmemAttachDesc=Connector that attaches by shared memory to other VM. - Port=Port - Address=Address ListenPort=Port number at which to listen for VM connection. OptionsDesc=Launched VM options. --- 1,24 ---- + ## + ## 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. + ## SocketLaunchDesc=Connector that launches target VM using command line and attaches to it through shared memory. ShmemAttachDesc=Connector that attaches by shared memory to other VM. ListenPort=Port number at which to listen for VM connection. OptionsDesc=Launched VM options. *************** *** 15,20 **** ShmemLaunchDesc=Connector that launches target VM using command line and attaches to it through socket. ShmemListenDesc=Connector that accepts shared memory connections initiated by other VMs. ! LaunchPort=Port number to used for the communication. ! LaunchAddress=Name of the shared memory area to use for the communication. QuoteDesc=Character used to combine space-delimited text into a single command line argument. Quote=Quote --- 33,40 ---- ShmemLaunchDesc=Connector that launches target VM using command line and attaches to it through socket. ShmemListenDesc=Connector that accepts shared memory connections initiated by other VMs. ! ShmemTransport=Shared Memory Transport ! SocketTransport=Socket Transport ! Port=Port ! Address=Address QuoteDesc=Character used to combine space-delimited text into a single command line argument. Quote=Quote |