[jboss-cvs] jboss-profiler/jvmpi-lib/src ...

Clebert Suconic csuconic at jboss.com
Thu Jul 27 12:16:54 EDT 2006


  User: csuconic
  Date: 06/07/27 12:16:54

  Modified:    jvmpi-lib/src  jbossInspector.cc
  Log:
  fixing CC-solaris compilation
  
  Revision  Changes    Path
  1.5       +39 -39    jboss-profiler/jvmpi-lib/src/jbossInspector.cc
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: jbossInspector.cc
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-profiler/jvmpi-lib/src/jbossInspector.cc,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- jbossInspector.cc	3 Mar 2006 18:10:42 -0000	1.4
  +++ jbossInspector.cc	27 Jul 2006 16:16:54 -0000	1.5
  @@ -32,7 +32,7 @@
   // E-mail of author now is clebert.suconic at jboss.com
   // 11-apr-2003
   
  -// $Id: jbossInspector.cc,v 1.4 2006/03/03 18:10:42 csuconic Exp $
  +// $Id: jbossInspector.cc,v 1.5 2006/07/27 16:16:54 csuconic Exp $
   
   
   
  @@ -184,7 +184,7 @@
   JVMPI_RawMonitor profileChangeLock;
   void changeProfiller();
   
  -static FILE * log = NULL;
  +static FILE * logfile = NULL;
   static jlong pid = 0;
   static char parametroSocket[255];
   static int usingSockets=0;
  @@ -274,10 +274,10 @@
   		}
   	}
   
  -	for (int i=0;i<ignoreListSize;i++) fprintf (log,"IgnoreList[%d]=%s\n",i,ignoreList[i]);
  -	for (int i=0;i<startListSize;i++) fprintf (log,"StartList[%d]=%s\n",i,startList[i]);
  -	for (int i=0;i<includeListSize;i++) fprintf (log,"IncludeList[%d]=%s(%d)\n",i,includeList[i],strLenOnIncludeList[i]);
  -	fflush(log);
  +	for (int i=0;i<ignoreListSize;i++) fprintf (logfile,"IgnoreList[%d]=%s\n",i,ignoreList[i]);
  +	for (int i=0;i<startListSize;i++) fprintf (logfile,"StartList[%d]=%s\n",i,startList[i]);
  +	for (int i=0;i<includeListSize;i++) fprintf (logfile,"IncludeList[%d]=%s(%d)\n",i,includeList[i],strLenOnIncludeList[i]);
  +	fflush(logfile);
   }
   
   
  @@ -341,13 +341,13 @@
   inline int gzwritelocal (gzFile file,voidp buf, unsigned len, const char * msg)
   {
   	if (gzwritelock) {
  -		//fprintf (log,"\n\n\n\n*******************************************************\nRealizando uma chamada a gzwrite quando nao deveria em %s\n\n\n\n",msg);
  -		fflush(log);
  +		//fprintf (logfile,"\n\n\n\n*******************************************************\nRealizando uma chamada a gzwrite quando nao deveria em %s\n\n\n\n",msg);
  +		fflush(logfile);
   		return Z_OK;
   	}
   	int retValue = gzwrite(file,buf,len);
   	if (retValue==0) {
  -		fflush(log);
  +		fflush(logfile);
   	}
   
   	return retValue;
  @@ -364,17 +364,17 @@
   void debugFiles() {
      std::vector<void *>::iterator p;
   
  -   fprintf (log,"**************** files debug information *********************\n");
  +   fprintf (logfile,"**************** files debug information *********************\n");
      for (p=linkedListFiles.begin();p!=linkedListFiles.end();p++) {
           FilesInfo* fileInfo = (FilesInfo *) *p;
   	if (fileInfo->fileHandler!=NULL) {
  -		fprintf (log,"File %s (not closed yet)\n",fileInfo->nomeArquivo);
  +		fprintf (logfile,"File %s (not closed yet)\n",fileInfo->nomeArquivo);
   	} else {
  -		fprintf (log,"File %s (already closed)\n",fileInfo->nomeArquivo);
  +		fprintf (logfile,"File %s (already closed)\n",fileInfo->nomeArquivo);
   	}
      }
  -   fprintf (log,"**************** end files debug information report*********************\n");
  -    fflush(log);
  +   fprintf (logfile,"**************** end files debug information report*********************\n");
  +    fflush(logfile);
   
   }
   
  @@ -592,7 +592,7 @@
   		(*handler)->fileHandler = fopen ((*handler)->strFileName,"wb");
   #endif
   		if ((*handler)->fileHandler==NULL) {
  -			fprintf (log,"JBossProfiler Error: Cannot open file %s\n",(*handler)->strFileName);
  +			fprintf (logfile,"JBossProfiler Error: Cannot open file %s\n",(*handler)->strFileName);
   			fprintf (stderr,"********************************************************");
   			fprintf (stderr,"JBossProfiler ERROR: Cannot open file %s\n",(*handler)->strFileName);
   			fprintf (stderr,"********************************************************");
  @@ -627,7 +627,7 @@
   	fwrite (clockCpu,sizeof(jlong),1,outFile);
   #endif
   	//fwrite (&elapsedClock,sizeof(jint),1,outFile);
  -	//fprintf (log,"clockCPU=%I64d\n",*clockCpu);
  +	//fprintf (logfile,"clockCPU=%I64d\n",*clockCpu);
   }
   
   /*
  @@ -642,7 +642,7 @@
   	fwrite (time,sizeof(jlong),1,outFile);
   	fwrite (clockCpu,sizeof(jlong),1,outFile);
   	//fwrite (&elapsedClock,sizeof(jint),1,outFile);
  -	//fprintf (log,"clockCPU=%I64d\n",*clockCpu);
  +	//fprintf (logfile,"clockCPU=%I64d\n",*clockCpu);
   }
   
   
  @@ -801,7 +801,7 @@
   	}
   
   	/*if (!lookupObj(linkedListThreads, threadId)) {
  -		fprintf (log,"Requesting thread %ld <from objectAlloc>\n",threadId);
  +		fprintf (logfile,"Requesting thread %ld <from objectAlloc>\n",threadId);
   		jint ret = CALL(RequestEvent(JVMPI_EVENT_THREAD_START,threadId));
   	}*/
   
  @@ -876,7 +876,7 @@
    */
   void inline threadStart(JNIEnv *env_id,jobjectID thread_id, char * thread_name ) {
   #ifdef DEBUG
  -    fprintf (log,"Thread Start %ld\n",thread_id);
  +    fprintf (logfile,"Thread Start %ld\n",thread_id);
   #endif
   	ThreadHandler * threadHandler;
   	jshort i=0; // general purpose variable
  @@ -914,7 +914,7 @@
   	// remover as 2 proximas linhas
           jobjectID threadId = CALL(GetThreadObject(env_id));
   #ifdef DEBUG
  -        fprintf (log,"ThreadEnd %ld\n",threadId);
  +        fprintf (logfile,"ThreadEnd %ld\n",threadId);
   #endif
   
   	ThreadHandler * threadHandler;
  @@ -941,13 +941,13 @@
                           /*int cderro=0;
   			cderro=gzflush(threadHandler->fileHandler,Z_FINISH);
   			if (cderro!=Z_OK) {
  -				fprintf (log,"Error during gzflush operation - %d\n",cderro);
  +				fprintf (logfile,"Error during gzflush operation - %d\n",cderro);
   			}
   			cderro=gzclose(threadHandler->fileHandler);
   			if (cderro) {
  -				//fprintf (log,"Error during gzflush operation - %ld\n",gzerror(threadHandler->fileHandler,&cderro));
  -				fprintf (log,"Error during gzclose operation - %ld\n",cderro);
  -			        fflush(log);
  +				//fprintf (logfile,"Error during gzflush operation - %ld\n",gzerror(threadHandler->fileHandler,&cderro));
  +				fprintf (logfile,"Error during gzclose operation - %ld\n",cderro);
  +			        fflush(logfile);
   			}
                           ((FilesInfo*)(threadHandler->fileObjNode))->fileHandler=NULL;
   			*/
  @@ -1376,7 +1376,7 @@
   #endif
      std::vector<void *>::iterator p;
   
  -   fprintf (log,"**************** files debug information *********************\n");
  +   fprintf (logfile,"**************** files debug information *********************\n");
      for (p=linkedListFiles.begin();p!=linkedListFiles.end();p++) {
           FilesInfo* fileInfo = (FilesInfo*)(*p);
   	if (fileInfo->fileHandler!=NULL) {
  @@ -1385,8 +1385,8 @@
                           int cderro=0;
   			cderro=gzclose(threadFile);
   			if (cderro) {
  -				fprintf (log,"Error during gzclose operation(flushAllFiles) - %s\n",gzerror(threadFile,&cderro));
  -				fflush(log);
  +				fprintf (logfile,"Error during gzclose operation(flushAllFiles) - %s\n",gzerror(threadFile,&cderro));
  +				fflush(logfile);
   			}
   
   #else
  @@ -1395,7 +1395,7 @@
   #endif
   	}
       }
  -    fflush(log);
  +    fflush(logfile);
       fflush(out);
   }
   
  @@ -1404,7 +1404,7 @@
             CALL(RunGC)();
        }
        profilerRunning=-1;
  -     fprintf (log,"Stopping DataGathering\n");
  +     fprintf (logfile,"Stopping DataGathering\n");
        fprintf (stderr,"Stopping DataGathering\n");
       // enabling class load event notification
       jvmpi_interface->DisableEvent(JVMPI_EVENT_CLASS_LOAD, NULL);
  @@ -1455,8 +1455,8 @@
   
   
   void pauseProfiler() {
  -     fprintf (log,"JBossProfiler: Pausing DataGathering\n");
  -     fflush(log);
  +     fprintf (logfile,"JBossProfiler: Pausing DataGathering\n");
  +     fflush(logfile);
        fprintf (stderr,"JBossProfiler: Pausing DataGathering\n");
       // enabling class load event notification
       jvmpi_interface->DisableEvent(JVMPI_EVENT_CLASS_LOAD, NULL);
  @@ -1491,8 +1491,8 @@
   void initProfiler() {
        profilerRunning=1;
   
  -     fprintf (log,"Initializing DataGathering\n");
  -     fflush(log);
  +     fprintf (logfile,"Initializing DataGathering\n");
  +     fflush(logfile);
        fprintf (stderr,"JBossProfiler: Initializing DataGathering\n");
       // enabling class load event notification
       jvmpi_interface->EnableEvent(JVMPI_EVENT_CLASS_LOAD, NULL);
  @@ -1552,7 +1552,7 @@
   #ifdef COUNT_METHODS
     static int cont=0;
     if ((cont++)%1000==0) {
  -     fprintf (log,"Enter = %ld Exit=%ld\n",enterMethods,exitMethods);
  +     fprintf (logfile,"Enter = %ld Exit=%ld\n",enterMethods,exitMethods);
     }
   #endif
     switch(event->event_type) {
  @@ -1657,11 +1657,11 @@
   	  }
   	  break;
     default:
  -     fprintf (log,"JBossProfiler: Invalid Event in the switch -> %d\n",event->event_type);
  +     fprintf (logfile,"JBossProfiler: Invalid Event in the switch -> %d\n",event->event_type);
     }
   
     if (profilerRunning==-1) {
  -      fflush(log);
  +      fflush(logfile);
     }
   
   #ifdef _FLUSH
  @@ -1864,8 +1864,8 @@
       sprintf (strFileLog,"%slog_spyserver_%lld.txt",logFileDirectory,pid);
   #endif
   
  -    log = fopen(strFileLog,"wb");
  -    if (log==NULL) {
  +    logfile = fopen(strFileLog,"wb");
  +    if (logfile==NULL) {
   	    fprintf (stderr,"Cannot open file %s. Please check you directory name\n",strFileLog);
   	    exit(-1);
       }
  @@ -1884,7 +1884,7 @@
   
       //addFileOnLinkedList(mainLogFileName,out);
       if (out==NULL) {
  -	    fprintf (log,"Isn't possible open file %s\n",mainLogFileName);
  +	    fprintf (logfile,"Isn't possible open file %s\n",mainLogFileName);
   	    jvmpi_interface->ProfilerExit(-2);
       }
   
  
  
  



More information about the jboss-cvs-commits mailing list