Update of /cvsroot/javaprofiler/library/src2 In directory usw-pr-cvs1:/tmp/cvs-serv12170/src2 Modified Files: CommunShMem.cpp Makefile.rules dir.info Added Files: README Removed 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: some parts completely rewritten; changes in communication interface to make it faster; ported to linux --- NEW FILE: README --- CONTENTS 0. Introduction 1. Download the newest code from CVS 2. Copy communication interface sources 3. The end 0. Introduction Since this version, sources of communication interface to dynamic profiler library are stored in CVS module called "jpiimpl". Please download and copy Java source code of communication interface to this directory. Else you will not be able to compile sources of dynamic library properly. 1. Download the newest code from CVS $ cvs -d:pserver:ano...@cv...:\ /cvsroot/javaprofiler login $ cvs -z3 -d:pserver:ano...@cv...:\ /cvsroot/javaprofiler co jpiimpl 2. Copy communication interface sources After downloading the newest CVS version of communication interface sources, new "jpiimpl" directory was created. In "jpiimpl/net/sourceforge/javaprofiler /jpiimpl/commun/" subdirectory there are sources which you need to copy to this "src2/net/" subdirectory. $ cp <where_you_have_it>/jpiimpl/net/sourceforge/javaprofiler/jpiimpl\ /commun/*.java net/sourceforge/javaprofiler/jpiimpl/commun/. 3. The end Now it should compile with no failures. During successful compilation, IProf.jar and libCommunShMem.so (or CommunShMem.dll on Win32) will be created in this directory. Index: CommunShMem.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src2/CommunShMem.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** CommunShMem.cpp 2001/09/02 20:14:22 1.3 --- CommunShMem.cpp 2001/11/21 22:31:40 1.4 *************** *** 34,38 **** #include "CommunShMem.h" ! #include "../src/main/includes.h" /** JNI implementation of shared memory communication. This class is --- 34,39 ---- #include "CommunShMem.h" ! #include "../src/commun3/semaphore.h" ! #include "../src/commun3/sharedMemory.h" /** JNI implementation of shared memory communication. This class is *************** *** 208,212 **** jclass clazz = env->GetObjectClass( b); ! mId = env->GetMethodID( clazz, "useBuffer", "([BI)LBuffer;"); } --- 209,213 ---- jclass clazz = env->GetObjectClass( b); ! mId = env->GetMethodID( clazz, "useBuffer", "([BI)Lnet/sourceforge/javaprofiler/jpiimpl/commun/Buffer;"); } *************** *** 240,249 **** /* ! * Class: CommunShMem * Method: construct * Signature: (Ljava/lang/String;I)V */ ! JNIEXPORT void JNICALL Java_CommunShMem_construct ( JNIEnv* env, jobject obj, jstring shmemId, jint shmemSize) { --- 241,250 ---- /* ! * Class: net.sourceforge.javaprofiler.jpiimpl.commun.CommunShMem * Method: construct * Signature: (Ljava/lang/String;I)V */ ! JNIEXPORT void JNICALL Java_net_0002fsourceforge_0002fjavaprofiler_0002fjpiimpl_0002fcommun_0002fCommunShMem_construct ( JNIEnv* env, jobject obj, jstring shmemId, jint shmemSize) { *************** *** 276,290 **** /* ! * Class: CommunShMem * Method: finalize * Signature: ()V */ ! ! JNIEXPORT void JNICALL Java_CommunShMem_finalize (JNIEnv* env, jobject obj) { NativeCommunShMem* n = NativeCommunShMem::get( env, obj); - if( !n->communStopped) Java_CommunShMem_stopCommun( env, obj); if( n) delete n; } --- 277,292 ---- /* ! * Class: net.sourceforge.javaprofiler.jpiimpl.commun.CommunShMem * Method: finalize * Signature: ()V */ ! JNIEXPORT void JNICALL Java_net_0002fsourceforge_0002fjavaprofiler_0002fjpiimpl_0002fcommun_0002fCommunShMem_finalize (JNIEnv* env, jobject obj) { NativeCommunShMem* n = NativeCommunShMem::get( env, obj); + + if( !n->communStopped) + Java_net_0002fsourceforge_0002fjavaprofiler_0002fjpiimpl_0002fcommun_0002fCommunShMem_stopCommun( env, obj); if( n) delete n; } *************** *** 304,313 **** /* ! * Class: CommunShMem * Method: read ! * Signature: (LBuffer;)LCommun; */ ! JNIEXPORT jobject JNICALL Java_CommunShMem_read ( JNIEnv* env, jobject obj, jobject b) { --- 306,315 ---- /* ! * Class: net.sourceforge.javaprofiler.jpiimpl.commun.CommunShMem * Method: read ! * Signature: (Lnet/sourceforge/javaprofiler/jpiimpl/commun/Buffer;)Lnet/sourceforge/javaprofiler/jpiimpl/commun/Commun; */ ! JNIEXPORT jobject JNICALL Java_net_0002fsourceforge_0002fjavaprofiler_0002fjpiimpl_0002fcommun_0002fCommunShMem_read ( JNIEnv* env, jobject obj, jobject b) { *************** *** 321,325 **** int shmemSize = n->shmem.getSize(); ! jint size = ntohl( *(jint*)p); if( size < 0) { --- 323,327 ---- int shmemSize = n->shmem.getSize(); ! jint size = (signed)ntohl( *(jint*)p); if( size < 0) { *************** *** 383,392 **** /* ! * Class: CommunShMem * Method: write ! * Signature: (LBuffer;)LCommun; */ ! JNIEXPORT jobject JNICALL Java_CommunShMem_write ( JNIEnv* env, jobject obj, jobject b) { --- 385,394 ---- /* ! * Class: net.sourceforge.javaprofiler.jpiimpl.commun.CommunShMem * Method: write ! * Signature: (Lnet/sourceforge/javaprofiler/jpiimpl/commun/Buffer;)Lnet/sourceforge/javaprofiler/jpiimpl/commun/Commun; */ ! JNIEXPORT jobject JNICALL Java_net_0002fsourceforge_0002fjavaprofiler_0002fjpiimpl_0002fcommun_0002fCommunShMem_write ( JNIEnv* env, jobject obj, jobject b) { *************** *** 399,403 **** int shmemSize = n->shmem.getSize(); ! if( ntohl( *(jint*)p) < 0) { n->failed = JNI_TRUE; --- 401,405 ---- int shmemSize = n->shmem.getSize(); ! if( (signed)ntohl( *(jint*)p) < 0) { n->failed = JNI_TRUE; *************** *** 462,471 **** /* ! * Class: CommunShMem * Method: hasFailed * Signature: ()Z */ ! JNIEXPORT jboolean JNICALL Java_CommunShMem_hasFailed ( JNIEnv* env, jobject obj) { --- 464,473 ---- /* ! * Class: net.sourceforge.javaprofiler.jpiimpl.commun.CommunShMem * Method: hasFailed * Signature: ()Z */ ! JNIEXPORT jboolean JNICALL Java_net_0002fsourceforge_0002fjavaprofiler_0002fjpiimpl_0002fcommun_0002fCommunShMem_hasFailed ( JNIEnv* env, jobject obj) { *************** *** 486,495 **** /* ! * Class: CommunShMem * Method: stopCommun * Signature: ()V */ ! ! JNIEXPORT void JNICALL Java_CommunShMem_stopCommun ( JNIEnv* env, jobject obj) { --- 488,496 ---- /* ! * Class: net.sourceforge.javaprofiler.jpiimpl.commun.CommunShMem * Method: stopCommun * Signature: ()V */ ! JNIEXPORT void JNICALL Java_net_0002fsourceforge_0002fjavaprofiler_0002fjpiimpl_0002fcommun_0002fCommunShMem_stopCommun ( JNIEnv* env, jobject obj) { *************** *** 498,502 **** n->isem.wait(); ! *(jint*)n->shmem.getAddress() = htonl( -1); n->communStopped = 1; n->isem.release(); --- 499,503 ---- n->isem.wait(); ! *(jint*)n->shmem.getAddress() = htonl( (unsigned)-1); n->communStopped = 1; n->isem.release(); *************** *** 506,507 **** --- 507,509 ---- } #endif + Index: Makefile.rules =================================================================== RCS file: /cvsroot/javaprofiler/library/src2/Makefile.rules,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Makefile.rules 2001/09/02 15:23:00 1.4 --- Makefile.rules 2001/11/21 22:31:40 1.5 *************** *** 1,13 **** java.o \ ! java.obj: *.java ! $(JAVAC) $(JAVACFLAGS) *.java CommunShMem.o \ CommunShMem.obj: CommunShMem.cpp ../src/main/includes.h ! $(JAVAH) CommunShMem $(CCC) $(CPPFLAGS) CommunShMem.cpp do_link.o \ do_link.obj: ! $(JAR) cf $(PROF_JAVA_INTERF_PACKAGE) *.class $(LD) $(LDFLAGS2) $(OBJ_FILES) $(LDLIBS2) --- 1,13 ---- java.o \ ! java.obj: $(JPIIMPL)/*.java ! $(JAVAC) $(JAVACFLAGS) $(JPIIMPL)/*.java CommunShMem.o \ CommunShMem.obj: CommunShMem.cpp ../src/main/includes.h ! $(JAVAH) -o CommunShMem.h $(JPIIMPL)/CommunShMem $(CCC) $(CPPFLAGS) CommunShMem.cpp do_link.o \ do_link.obj: ! $(JAR) cf $(PROF_JAVA_INTERF_PACKAGE) $(JPIIMPL)/*.class $(LD) $(LDFLAGS2) $(OBJ_FILES) $(LDLIBS2) Index: dir.info =================================================================== RCS file: /cvsroot/javaprofiler/library/src2/dir.info,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dir.info 2001/08/25 23:27:43 1.4 --- dir.info 2001/11/21 22:31:40 1.5 *************** *** 1,5 **** FILES = java CommunShMem do_link ! CLEAN_FILES = *.class *.jar *.h *.dll *.so *.obj *.o *.pdb *.lib *.exp *.tds - OBJ_FILES = *.o* ../src/string/*.o* --- 1,10 ---- + JPIIMPL = net/sourceforge/javaprofiler/jpiimpl/commun + FILES = java CommunShMem do_link + + CLEAN_FILES = $(JPIIMPL)/*.class *.jar *.h *.dll *.so *.obj *.o \ + *.pdb *.lib *.exp *.tds ! OBJ_FILES = *.o* ../src/string/string.o* ../src/commun3/semaphore.o* \ ! ../src/commun3/sharedMemory.o* --- BAD_COMMAND_Exception.java DELETED --- --- BAD_DATA_TYPE_Exception.java DELETED --- --- BAD_INFO_ID_Exception.java DELETED --- --- BAD_INFO_TYPE_Exception.java DELETED --- --- BAD_OBJ_ID_Exception.java DELETED --- --- Buffer.java DELETED --- --- COMMUN_Exception.java DELETED --- --- Commun.java DELETED --- --- CommunSetup.java DELETED --- --- CommunSetupShMem.java DELETED --- --- CommunSetupSocket.java DELETED --- --- CommunShMem.java DELETED --- --- CommunSocket.java DELETED --- --- IProf.java DELETED --- --- IProfException.java DELETED --- --- UNKNOWN_Exception.java DELETED --- |