Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 62142 Details for
Bug 121658
Complete new AC solution on Linux EM64T
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Final patch for building AC without RAC SDK
patch14_final.txt (text/plain), 1.66 MB, created by
Samson Wai
on 2007-03-27 15:10:09 EDT
(
hide
)
Description:
Final patch for building AC without RAC SDK
Filename:
MIME Type:
Creator:
Samson Wai
Created:
2007-03-27 15:10:09 EDT
Size:
1.66 MB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.agentcontroller >Index: src-native-new/src/transport/transportSupport/TransportSupport.mak64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/TransportSupport.mak64,v >retrieving revision 1.7 >diff -u -r1.7 TransportSupport.mak64 >--- src-native-new/src/transport/transportSupport/TransportSupport.mak64 21 Mar 2007 20:56:04 -0000 1.7 >+++ src-native-new/src/transport/transportSupport/TransportSupport.mak64 26 Mar 2007 18:35:11 -0000 >@@ -72,10 +72,10 @@ > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" > >-CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "../RACommon" /I "../RASocket" /I "../RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -87,8 +87,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" >+ "..\..\..\lib\hcclco.lib" \ >+ "..\..\..\lib\hcclsm.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >@@ -139,10 +139,10 @@ > "$(INTDIR)" : > if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" > >-CPP_PROJ=/nologo /MD /W3 /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+CPP_PROJ=/nologo /MD /W3 /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "../RACommon" /I "../RASocket" /I "../RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:IA64 >+LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -154,8 +154,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" >+ "..\..\..\lib\hcclsm.lib" \ >+ "..\..\..\lib\hcclco.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >@@ -205,10 +205,10 @@ > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" > >-CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "../RACommon" /I "../RASocket" /I "../RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:AMD64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /debug /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -220,8 +220,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" >+ "..\..\..\lib\hcclco.lib" \ >+ "..\..\..\lib\hcclsm.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >@@ -272,10 +272,10 @@ > "$(INTDIR)" : > if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" > >-CPP_PROJ=/nologo /MD /W3 /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "$(RAC_SDK_HOME)/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+CPP_PROJ=/nologo /MD /W3 /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /I "../../../include" /I "../RACommon" /I "../RASocket" /I "../RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\TransportSupport.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib hcclco.lib hcclsm.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /libpath:"$(RAC_SDK_HOME)/lib" /machine:AMD64 >+LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\TransportSupport.pdb" /def:".\TransportSupport.def" /out:"$(OUTDIR)\TransportSupport.dll" /implib:"../../../lib/transportSupport.lib" /libpath:"../../../lib" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\TransportOSCalls_linux.obj" \ > "$(INTDIR)\TransportOSCalls_win.obj" \ >@@ -287,8 +287,8 @@ > "$(INTDIR)\TransportSupportSharedMemExt.obj" \ > "$(INTDIR)\TransportSupportSocket.obj" \ > "..\..\..\lib\tptpUtils.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >- "$(RAC_SDK_HOME)\lib\hcclco.lib" >+ "..\..\..\lib\hcclsm.lib" \ >+ "..\..\..\lib\hcclco.lib" > > "$(OUTDIR)\TransportSupport.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) > $(LINK32) @<< >Index: src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp,v >retrieving revision 1.4 >diff -u -r1.4 NoRAtransportSupport.dsp >--- src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp 19 Mar 2007 03:14:38 -0000 1.4 >+++ src-native-new/src/transport/transportSupport/NoRAtransportSupport.dsp 26 Mar 2007 18:35:11 -0000 >@@ -43,7 +43,7 @@ > # PROP Ignore_Export_Lib 0 > # PROP Target_Dir "" > # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /YX /FD /c >-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../RACommon" /I "../RASharedMemory" /I "../RASocket" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../RACommon" /I "../RASocket" /I "../RASharedMemory" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /c > # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 > # ADD BASE RSC /l 0x409 /d "NDEBUG" >@@ -70,7 +70,7 @@ > # PROP Ignore_Export_Lib 0 > # PROP Target_Dir "" > # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /YX /FD /GZ /c >-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../RACommon" /I "../RASharedMemory" /I "../RASocket" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../RACommon" /I "../RASocket" /I "../RASharedMemory" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TRANSPORTSUPPORT_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /GZ /c > # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 > # ADD BASE RSC /l 0x409 /d "_DEBUG" >Index: src-native-new/src/transport/RACommon/RACommon.mak64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RACommon.mak64,v >retrieving revision 1.3 >diff -u -r1.3 RACommon.mak64 >--- src-native-new/src/transport/RACommon/RACommon.mak64 20 May 2006 18:26:53 -0000 1.3 >+++ src-native-new/src/transport/RACommon/RACommon.mak64 26 Mar 2007 18:35:11 -0000 >@@ -1,20 +1,22 @@ >-# Microsoft Developer Studio based NMAKE File, derived from RACommon.dsp >+# Microsoft Developer Studio Generated NMAKE File, Based on RACommon.dsp > !IF "$(CFG)" == "" >-CFG=RACommon - IA64 Release >-!MESSAGE No configuration specified. Defaulting to RACommon - IA64 Release. >+CFG=RACommon - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to RACommon - IA64 Debug. > !ENDIF > >-!IF "$(CFG)" != "RACommon - IA64 Debug" && "$(CFG)" != "RACommon - IA64 Release" >+!IF "$(CFG)" != "RACommon - IA64 Release" && "$(CFG)" != "RACommon - IA64 Debug" && "$(CFG)" != "RACommon - X64 Release" && "$(CFG)" != "RACommon - X64 Debug" > !MESSAGE Invalid configuration "$(CFG)" specified. > !MESSAGE You can specify a configuration when running NMAKE > !MESSAGE by defining the macro CFG on the command line. For example: > !MESSAGE >-!MESSAGE NMAKE /f "RACommon.mak64" CFG="RACommon - IA64 Release" >+!MESSAGE NMAKE /f "RACommon.mak64" CFG="RACommon - IA64 Debug" > !MESSAGE > !MESSAGE Possible choices for configuration are: > !MESSAGE >-!MESSAGE "RACommon - IA64 Debug" > !MESSAGE "RACommon - IA64 Release" >+!MESSAGE "RACommon - IA64 Debug" >+!MESSAGE "RACommon - X64 Release" >+!MESSAGE "RACommon - X64 Debug" > !MESSAGE > !ERROR An invalid configuration is specified. > !ENDIF >@@ -25,64 +27,180 @@ > NULL=nul > !ENDIF > >+!IF "$(CFG)" == "RACommon - IA64 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcclco.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcclco.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcclco.dll" >+ -@erase "$(OUTDIR)\..\lib\hcclco.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclco.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ > CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RACOMMON_EXPORTS" /Fp"$(INTDIR)\RACommon.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 > RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclco.res" /d "NDEBUG" > >-!IF "$(CFG)" == "RACommon - IA64 Debug" >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:".\RACommon.def" /out:"$(OUTDIR)\hcclco.dll" /implib:"$(OUTDIR)\..\lib\hcclco.lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" \ >+ "$(INTDIR)\hcclco.res" >+ >+"$(OUTDIR)\hcclco.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< > >-OUTDIR=.\RACommon___IA64Debug >-INTDIR=.\RACommon___IA64Debug >+!ELSEIF "$(CFG)" == "RACommon - IA64 Debug" > >-ALL : "..\..\..\bin\hcclco.dll" >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcclco.dll" > > > CLEAN : >+ -@erase "$(INTDIR)\hcclco.res" >+ -@erase "$(INTDIR)\java.obj" > -@erase "$(INTDIR)\RAComm.obj" > -@erase "$(INTDIR)\vc60.idb" > -@erase "$(INTDIR)\vc60.pdb" >- -@erase "$(OUTDIR)\hcclco.pdb" >- -@erase "..\..\..\bin\hcclco.dll" >- -@erase "..\..\..\bin\hcclco.ilk" >- -@erase "..\..\..\lib\hcclco.exp" >- -@erase "..\..\..\lib\hcclco.lib" >- -@erase "$(OUTDIR)\hcclco.res" >+ -@erase "$(OUTDIR)\hcclco.dll" >+ -@erase "$(OUTDIR)\..\lib\hcclco.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclco.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcclco.lib" >+ -@erase "$(OUTDIR)\..\lib\hcclco.pdb" > > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" > >-CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RACOMMON_EXPORTS" /Fp"$(INTDIR)\RACommon.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >-RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/hcclco.res" /i "../../../include" /d "_DEBUG" >- >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RACOMMON_EXPORTS" /Fp"$(INTDIR)\RACommon.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclco.res" /d "_DEBUG" >+ > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclco.pdb" /debug /def:".\RACommon.def" /out:"../../../bin/hcclco.dll" /implib:"../../../lib/hcclco.lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclco.pdb" /debug /def:".\RACommon.def" /out:"$(OUTDIR)\hcclco.dll" /implib:"$(OUTDIR)\..\lib\hcclco.lib" /machine:IA64 > LINK32_OBJS= \ >+ "$(INTDIR)\java.obj" \ > "$(INTDIR)\RAComm.obj" \ >- "$(OUTDIR)\hcclco.res" >+ "$(INTDIR)\hcclco.res" > >-"..\..\..\bin\hcclco.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+"$(OUTDIR)\hcclco.dll" : "$(OUTDIR)" $(LINK32_OBJS) > $(LINK32) @<< > $(LINK32_FLAGS) $(LINK32_OBJS) > << > >-!ELSEIF "$(CFG)" == "RACommon - IA64 Release" >+!ELSEIF "$(CFG)" == "RACommon - X64 Release" > >-OUTDIR=.\../../../bin >-INTDIR=.\RACommon___IA64Release >+OUTDIR=..\..\..\bin >+INTDIR=.\Release > # Begin Custom Macros >-OutDir=.\../../../bin >+OutDir=..\..\..\bin > # End Custom Macros > > ALL : "$(OUTDIR)\hcclco.dll" > > > CLEAN : >+ -@erase "$(INTDIR)\hcclco.res" >+ -@erase "$(INTDIR)\java.obj" > -@erase "$(INTDIR)\RAComm.obj" > -@erase "$(INTDIR)\vc60.idb" > -@erase "$(OUTDIR)\hcclco.dll" >- -@erase "$(OUTDIR)\hcclco.ilk" >- -@erase "..\..\..\lib\hcclco.exp" >- -@erase "..\..\..\lib\hcclco.lib" >- -@erase "$(OUTDIR)\hcclco.res" >+ -@erase "$(OUTDIR)\..\lib\hcclco.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclco.lib" > > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >@@ -90,21 +208,87 @@ > "$(INTDIR)" : > if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" > >-CPP_PROJ=/nologo /MD /W3 /O2 /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RACOMMON_EXPORTS" /Fp"$(INTDIR)\RACommon.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >-RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/hcclco.res" /i "../../../include" /d "_DEBUG" >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RACOMMON_EXPORTS" /Fp"$(INTDIR)\RACommon.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclco.res" /d "NDEBUG" > > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib Uuid.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclco.pdb" /def:".\RACommon.def" /out:"$(OUTDIR)\hcclco.dll" /implib:"../../../lib/hcclco.lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:".\RACommon.def" /out:"$(OUTDIR)\hcclco.dll" /implib:"$(OUTDIR)\..\lib\hcclco.lib" /machine:AMD64 > LINK32_OBJS= \ >+ "$(INTDIR)\java.obj" \ > "$(INTDIR)\RAComm.obj" \ >- "$(OUTDIR)\hcclco.res" >+ "$(INTDIR)\hcclco.res" > >-"$(OUTDIR)\hcclco.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+"$(OUTDIR)\hcclco.dll" : "$(OUTDIR)" $(LINK32_OBJS) > $(LINK32) @<< > $(LINK32_FLAGS) $(LINK32_OBJS) > << > >-!ENDIF >+!ELSEIF "$(CFG)" == "RACommon - X64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcclco.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcclco.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcclco.dll" >+ -@erase "$(OUTDIR)\..\lib\hcclco.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclco.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcclco.lib" >+ -@erase "$(OUTDIR)\..\lib\hcclco.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RACOMMON_EXPORTS" /Fp"$(INTDIR)\RACommon.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > .c{$(INTDIR)}.obj:: > $(CPP) @<< >@@ -121,14 +305,86 @@ > $(CPP_PROJ) $< > << > >-!IF "$(CFG)" == "RACommon - IA64 Debug" || "$(CFG)" == "RACommon - IA64 Release" >-SOURCE=..\RACommon\RAComm.c >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclco.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclco.pdb" /debug /def:".\RACommon.def" /out:"$(OUTDIR)\hcclco.dll" /implib:"$(OUTDIR)\..\lib\hcclco.lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" \ >+ "$(INTDIR)\hcclco.res" >+ >+"$(OUTDIR)\hcclco.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "RACommon - IA64 Release" || "$(CFG)" == "RACommon - IA64 Debug" || "$(CFG)" == "RACommon - X64 Release" || "$(CFG)" == "RACommon - X64 Debug" >+SOURCE=.\java.c >+ >+"$(INTDIR)\java.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=.\RAComm.c > > "$(INTDIR)\RAComm.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=.\version.rc >+ >+!IF "$(CFG)" == "RACommon - IA64 Release" >+ >+ >+"$(INTDIR)\hcclco.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclco.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RACommon - IA64 Debug" >+ > >+"$(INTDIR)\hcclco.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclco.res" /d "_DEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RACommon - X64 Release" >+ >+ >+"$(INTDIR)\hcclco.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclco.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RACommon - X64 Debug" >+ >+ >+"$(INTDIR)\hcclco.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclco.res" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF > >-SOURCE=..\RACommon\version.rc > >-"$(OUTDIR)\hcclco.res" : $(SOURCE) "$(INTDIR)" >- $(RSC) $(RSC_PROJ) $(SOURCE) > !ENDIF >+ >Index: src-native-new/src/transport/RACommon/version.rc >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/version.rc,v >retrieving revision 1.2 >diff -u -r1.2 version.rc >--- src-native-new/src/transport/RACommon/version.rc 24 Jul 2005 08:32:09 -0000 1.2 >+++ src-native-new/src/transport/RACommon/version.rc 26 Mar 2007 18:35:11 -0000 >@@ -1,4 +1,4 @@ >-#include "tptp/version.h" >+#include "../../../include/tptp/version.h" > //Microsoft Developer Studio generated resource script. > // > >Index: src-native-new/src/transport/RACommon/RACommon.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/RACommon.make,v >retrieving revision 1.6 >diff -u -r1.6 RACommon.make >--- src-native-new/src/transport/RACommon/RACommon.make 19 Mar 2007 03:14:37 -0000 1.6 >+++ src-native-new/src/transport/RACommon/RACommon.make 26 Mar 2007 18:35:11 -0000 >@@ -44,7 +44,7 @@ > # list of additional libraries to be linked with > # (separated by blanks) > #----------------------------------- >-LIBS := dl >+LIBS := dl pthread > > #----------------------------------- > # list of additional library directories to search from >Index: src-native-new/build/BuildAll.mak64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/BuildAll.mak64,v >retrieving revision 1.3 >diff -u -r1.3 BuildAll.mak64 >--- src-native-new/build/BuildAll.mak64 15 May 2006 20:01:44 -0000 1.3 >+++ src-native-new/build/BuildAll.mak64 26 Mar 2007 18:35:11 -0000 >@@ -38,7 +38,11 @@ > > !ELSE > >-ALL : "TPTPLogUtils - IA64 Debug" \ >+ALL : "RACommon - IA64 Debug" \ >+ "RASocket - IA64 Debug" \ >+ "RASharedMemory - IA64 Debug" \ >+ "RADataTransfer - IA64 Debug" \ >+ "TPTPLogUtils - IA64 Debug" \ > "TPTPUtil - IA64 Debug" \ > "tptpConfig - IA64 Debug" \ > "processControlUtil - IA64 Debug" \ >@@ -62,7 +66,11 @@ > !ENDIF > > !IF "$(RECURSE)" == "1" >-CLEAN : "TPTPLogUtils - IA64 DebugCLEAN" \ >+CLEAN : "RACommon - IA64 DebugCLEAN" \ >+ "RASocket - IA64 DebugCLEAN" \ >+ "RASharedMemory - IA64 DebugCLEAN" \ >+ "RADataTransfer - IA64 DebugCLEAN" \ >+ "TPTPLogUtils - IA64 DebugCLEAN" \ > "TPTPUtil - IA64 DebugCLEAN" \ > "tptpConfig - IA64 DebugCLEAN" \ > "processControlUtil - IA64 DebugCLEAN" \ >@@ -96,7 +104,11 @@ > > !ELSE > >-ALL : "TPTPLogUtils - IA64 Release" \ >+ALL : "RACommon - IA64 Release" \ >+ "RASocket - IA64 Release" \ >+ "RASharedMemory - IA64 Release" \ >+ "RADataTransfer - IA64 Release" \ >+ "TPTPLogUtils - IA64 Release" \ > "TPTPUtil - IA64 Release" \ > "tptpConfig - IA64 Release" \ > "processControlUtil - IA64 Release" \ >@@ -120,7 +132,11 @@ > !ENDIF > > !IF "$(RECURSE)" == "1" >-CLEAN : "TPTPLogUtils - IA64 ReleaseCLEAN" \ >+CLEAN : "RACommon - IA64 ReleaseCLEAN" \ >+ "RASocket - IA64 ReleaseCLEAN" \ >+ "RASharedMemory - IA64 ReleaseCLEAN" \ >+ "RADataTransfer - IA64 ReleaseCLEAN" \ >+ "TPTPLogUtils - IA64 ReleaseCLEAN" \ > "TPTPUtil - IA64 ReleaseCLEAN" \ > "tptpConfig - IA64 ReleaseCLEAN" \ > "processControlUtil - IA64 ReleaseCLEAN" \ >@@ -153,7 +169,11 @@ > > !ELSE > >-ALL : "TPTPLogUtils - X64 Debug" \ >+ALL : "RACommon - X64 Debug" \ >+ "RASocket - X64 Debug" \ >+ "RASharedMemory - X64 Debug" \ >+ "RADataTransfer - X64 Debug" \ >+ "TPTPLogUtils - X64 Debug" \ > "TPTPUtil - X64 Debug" \ > "tptpConfig - X64 Debug" \ > "processControlUtil - X64 Debug" \ >@@ -177,7 +197,11 @@ > !ENDIF > > !IF "$(RECURSE)" == "1" >-CLEAN : "TPTPLogUtils - X64 DebugCLEAN" \ >+CLEAN : "RACommon - X64 DebugCLEAN" \ >+ "RASocket - X64 DebugCLEAN" \ >+ "RASharedMemory - X64 DebugCLEAN" \ >+ "RADataTransfer - X64 DebugCLEAN" \ >+ "TPTPLogUtils - X64 DebugCLEAN" \ > "TPTPUtil - X64 DebugCLEAN" \ > "tptpConfig - X64 DebugCLEAN" \ > "processControlUtil - X64 DebugCLEAN" \ >@@ -211,7 +235,11 @@ > > !ELSE > >-ALL : "TPTPLogUtils - X64 Release" \ >+ALL : "RACommon - X64 Release" \ >+ "RASocket - X64 Release" \ >+ "RASharedMemory - X64 Release" \ >+ "RADataTransfer - X64 Release" \ >+ "TPTPLogUtils - X64 Release" \ > "TPTPUtil - X64 Release" \ > "tptpConfig - X64 Release" \ > "processControlUtil - X64 Release" \ >@@ -235,7 +263,11 @@ > !ENDIF > > !IF "$(RECURSE)" == "1" >-CLEAN : "TPTPLogUtils - X64 ReleaseCLEAN" \ >+CLEAN : "RACommon - X64 ReleaseCLEAN" \ >+ "RASocket - X64 ReleaseCLEAN" \ >+ "RASharedMemory - X64 ReleaseCLEAN" \ >+ "RADataTransfer - X64 ReleaseCLEAN" \ >+ "TPTPLogUtils - X64 ReleaseCLEAN" \ > "TPTPUtil - X64 ReleaseCLEAN" \ > "tptpConfig - X64 ReleaseCLEAN" \ > "processControlUtil - X64 ReleaseCLEAN" \ >@@ -269,6 +301,177 @@ > > !IF "$(CFG)" == "BuildAll - IA64 Debug" > >+"RACommon - IA64 Debug" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Debug" >+ cd "..\..\..\build" >+ >+"RACommon - IA64 DebugCLEAN" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASocket - IA64 Debug" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Debug" >+ cd "..\..\..\build" >+ >+"RASocket - IA64 DebugCLEAN" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASharedMemory - IA64 Debug" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Debug" >+ cd "..\..\..\build" >+ >+"RASharedMemory - IA64 DebugCLEAN" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RADataTransfer - IA64 Debug" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - IA64 Debug" >+ cd "..\..\..\build" >+ >+"RADataTransfer - IA64 DebugCLEAN" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - IA64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+!ELSEIF "$(CFG)" == "BuildAll - IA64 Release" >+ >+"RACommon - IA64 Release" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" >+ cd "..\..\..\build" >+ >+"RACommon - IA64 ReleaseCLEAN" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASocket - IA64 Release" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" >+ cd "..\..\..\build" >+ >+"RASocket - IA64 ReleaseCLEAN" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASharedMemory - IA64 Release" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Release" >+ cd "..\..\..\build" >+ >+"RASharedMemory - IA64 ReleaseCLEAN" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RADataTransfer - IA64 Release" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - IA64 Release" >+ cd "..\..\..\build" >+ >+"RADataTransfer - IA64 ReleaseCLEAN" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - IA64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+!ELSEIF "$(CFG)" == "BuildAll - X64 Debug" >+ >+"RACommon - X64 Debug" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" >+ cd "..\..\..\build" >+ >+"RACommon - X64 DebugCLEAN" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASocket - X64 Debug" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Debug" >+ cd "..\..\..\build" >+ >+"RASocket - X64 DebugCLEAN" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASharedMemory - X64 Debug" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Debug" >+ cd "..\..\..\build" >+ >+"RASharedMemory - X64 DebugCLEAN" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RADataTransfer - X64 Debug" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - X64 Debug" >+ cd "..\..\..\build" >+ >+"RADataTransfer - X64 DebugCLEAN" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - X64 Debug" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+!ELSEIF "$(CFG)" == "BuildAll - X64 Release" >+ >+"RACommon - X64 Release" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" >+ cd "..\..\..\build" >+ >+"RACommon - X64 ReleaseCLEAN" : >+ cd "..\src\transport\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASocket - X64 Release" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Release" >+ cd "..\..\..\build" >+ >+"RASocket - X64 ReleaseCLEAN" : >+ cd "..\src\transport\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RASharedMemory - X64 Release" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Release" >+ cd "..\..\..\build" >+ >+"RASharedMemory - X64 ReleaseCLEAN" : >+ cd "..\src\transport\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+"RADataTransfer - X64 Release" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - X64 Release" >+ cd "..\..\..\build" >+ >+"RADataTransfer - X64 ReleaseCLEAN" : >+ cd "..\src\transport\RADataTransfer" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RADataTransfer.mak64" CFG="RADataTransfer - X64 Release" RECURSE=1 CLEAN >+ cd "..\..\..\build" >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "BuildAll - IA64 Debug" >+ > "agentBase - IA64 Debug" : > cd "..\src\agents\agentBase" > $(MAKE) /$(MAKEFLAGS) /F ".\AgentBase.mak64" CFG="agentBase - IA64 Debug" >Index: src-native-new/build/build_tptp_ac.script >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/build_tptp_ac.script,v >retrieving revision 1.24 >diff -u -r1.24 build_tptp_ac.script >--- src-native-new/build/build_tptp_ac.script 19 Mar 2007 03:14:38 -0000 1.24 >+++ src-native-new/build/build_tptp_ac.script 26 Mar 2007 18:35:11 -0000 >@@ -17,7 +17,7 @@ > > > if [ x$VERSIONNUM = x ]; then export VERSIONNUM=4; fi >-if [ x$MINORNUM = x ]; then export MINORNUM=3; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=4; fi > if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi > > if [ x$XERCESC_HOME = x ]; then export XERCESC_HOME=`pwd`/../../../depends/xerces-c-src_2_6_0; fi >@@ -62,6 +62,10 @@ > > echo "----------------------------------------------" > >+make -C ../src/transport/RADataTransfer -f RADataTransfer.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nRADataTransfer" >+ >+echo "----------------------------------------------" >+ > make -C ../src/transport/transportSupport -f TransportSupport.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\ntransportSupport" > > echo "----------------------------------------------" >@@ -122,6 +126,38 @@ > > echo "----------------------------------------------" > >+make -C ../src/agents/RABindings -f RABindings.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nRABindings" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/java -f hcjbnd.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nhcjbnd" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/native/java_profiler -f java_profiler.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\njava_profiler" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/perfmon/resutils -f resutils.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nresutils" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/perfmon/rac -f rac.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nrac" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/perfmon/perflin -f perflin.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nperflin" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/perfmon/PerfmonAgent -f PerfmonAgent.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nPerfmonAgent" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/thread -f hcthread.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nhcthread" >+ >+echo "----------------------------------------------" >+ > if [ "$NUM_FAILURES" = "0" ]; then > echo "No failures -- build successful" > else >Index: src-native-new/build/build_tptp_ac.script64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/build_tptp_ac.script64,v >retrieving revision 1.8 >diff -u -r1.8 build_tptp_ac.script64 >--- src-native-new/build/build_tptp_ac.script64 19 Mar 2007 15:35:24 -0000 1.8 >+++ src-native-new/build/build_tptp_ac.script64 26 Mar 2007 18:35:11 -0000 >@@ -17,7 +17,7 @@ > > > if [ x$VERSIONNUM = x ]; then export VERSIONNUM=4; fi >-if [ x$MINORNUM = x ]; then export MINORNUM=3; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=4; fi > if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi > > if [ x$XERCESC_HOME = x ]; then export XERCESC_HOME=`pwd`/../../../depends/xerces-c-src_2_6_0; fi >@@ -71,6 +71,10 @@ > > echo "----------------------------------------------" > >+make -C ../src/transport/RADataTransfer -f RADataTransfer.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nRADataTransfer" >+ >+echo "----------------------------------------------" >+ > make -C ../src/transport/transportSupport -f TransportSupport.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\ntransportSupport" > > echo "----------------------------------------------" >@@ -131,6 +135,38 @@ > > echo "----------------------------------------------" > >+make -C ../src/agents/RABindings -f RABindings.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nRABindings" >+ >+echo "----------------------------------------------" >+ >+make -C ../src/agents/java -f hcjbnd.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nhcjbnd" >+ >+echo "----------------------------------------------" >+ >+#make -C ../src/agents/native/java_profiler -f java_profiler.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\njava_profiler" >+# >+#echo "----------------------------------------------" >+ >+#make -C ../src/agents/perfmon/resutils -f resutils.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nresutils" >+# >+#echo "----------------------------------------------" >+ >+#make -C ../src/agents/perfmon/rac -f rac.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nrac" >+# >+#echo "----------------------------------------------" >+ >+#make -C ../src/agents/perfmon/perflin -f perflin.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nperflin" >+# >+#echo "----------------------------------------------" >+ >+#make -C ../src/agents/perfmon/PerfmonAgent -f PerfmonAgent.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nPerfmonAgent" >+# >+#echo "----------------------------------------------" >+ >+make -C ../src/agents/thread -f hcthread.make $1 || NUM_FAILURES=`expr $NUM_FAILURES + 1` FAILURES="$FAILURES\nhcthread" >+ >+echo "----------------------------------------------" >+ > if [ "$NUM_FAILURES" != "0" ]; then > echo "***************************************************" > echo "***** $NUM_FAILURES components failed to build correctly! *****" >Index: src-native-new/build/tptp_ac.dsw >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/build/tptp_ac.dsw,v >retrieving revision 1.29 >diff -u -r1.29 tptp_ac.dsw >--- src-native-new/build/tptp_ac.dsw 19 Mar 2007 03:14:38 -0000 1.29 >+++ src-native-new/build/tptp_ac.dsw 26 Mar 2007 18:35:11 -0000 >@@ -3,7 +3,7 @@ > > ############################################################################### > >-Project: "ACService"="..\src\ACService\ACService.dsp" - Package Owner=<4> >+Project: "ACService"=..\src\ACService\ACService.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -15,7 +15,7 @@ > > ############################################################################### > >-Project: "AgentController"="..\src\agentController\AgentController.dsp" - Package Owner=<4> >+Project: "AgentController"=..\src\agentController\AgentController.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -51,7 +51,7 @@ > > ############################################################################### > >-Project: "BaseTransport"="..\src\transport\BaseTransport\BaseTransport.dsp" - Package Owner=<4> >+Project: "BaseTransport"=..\src\transport\BaseTransport\BaseTransport.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -72,7 +72,7 @@ > > ############################################################################### > >-Project: "BuildAll"=".\BuildAll.dsp" - Package Owner=<4> >+Project: "BuildAll"=.\BuildAll.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -149,11 +149,14 @@ > Begin Project Dependency > Project_Dep_Name InstService > End Project Dependency >+ Begin Project Dependency >+ Project_Dep_Name RADataTransfer >+ End Project Dependency > }}} > > ############################################################################### > >-Project: "BuildMost"=".\BuildMost.dsp" - Package Owner=<4> >+Project: "BuildMost"=.\BuildMost.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -221,11 +224,23 @@ > Begin Project Dependency > Project_Dep_Name NoRAtransportSupport > End Project Dependency >+ Begin Project Dependency >+ Project_Dep_Name RACommon >+ End Project Dependency >+ Begin Project Dependency >+ Project_Dep_Name RADataTransfer >+ End Project Dependency >+ Begin Project Dependency >+ Project_Dep_Name RASharedMemory >+ End Project Dependency >+ Begin Project Dependency >+ Project_Dep_Name RASocket >+ End Project Dependency > }}} > > ############################################################################### > >-Project: "CmdExtractor"="..\src\CmdExtractor\CmdExtractor.dsp" - Package Owner=<4> >+Project: "CmdExtractor"=..\src\CmdExtractor\CmdExtractor.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -237,7 +252,7 @@ > > ############################################################################### > >-Project: "CompSupport"="..\src\transport\CompSupport\CompSupport.dsp" - Package Owner=<4> >+Project: "CompSupport"=..\src\transport\CompSupport\CompSupport.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -249,7 +264,7 @@ > > ############################################################################### > >-Project: "FileTransferAgent"="..\SRC\AGENTS\FileTransferAgent\FileTransferAgent.dsp" - Package Owner=<4> >+Project: "FileTransferAgent"=..\SRC\AGENTS\FileTransferAgent\FileTransferAgent.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -261,7 +276,7 @@ > > ############################################################################### > >-Project: "InstService"="..\src\InstService\InstService.dsp" - Package Owner=<4> >+Project: "InstService"=..\src\InstService\InstService.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -273,7 +288,7 @@ > > ############################################################################### > >-Project: "NoRAtransportSupport"="..\src\transport\transportSupport\NoRAtransportSupport.dsp" - Package Owner=<4> >+Project: "NoRAtransportSupport"=..\src\transport\transportSupport\NoRAtransportSupport.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -291,7 +306,19 @@ > > ############################################################################### > >-Project: "RACommon"="..\src\transport\RACommon\RACommon.dsp" - Package Owner=<4> >+Project: "RACommon"=..\src\transport\RACommon\RACommon.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Project: "RADataTransfer"=..\src\transport\RADataTransfer\RADataTransfer.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -303,7 +330,7 @@ > > ############################################################################### > >-Project: "RASharedMemory"="..\src\transport\RASharedMemory\RASharedMemory.dsp" - Package Owner=<4> >+Project: "RASharedMemory"=..\src\transport\RASharedMemory\RASharedMemory.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -321,7 +348,7 @@ > > ############################################################################### > >-Project: "RASocket"="..\src\transport\RASocket\RASocket.dsp" - Package Owner=<4> >+Project: "RASocket"=..\src\transport\RASocket\RASocket.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -336,7 +363,7 @@ > > ############################################################################### > >-Project: "TPTPAgentCompTL"="..\src\transport\TPTPAgentCompTL\TPTPAgentCompTL.dsp" - Package Owner=<4> >+Project: "TPTPAgentCompTL"=..\src\transport\TPTPAgentCompTL\TPTPAgentCompTL.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -366,7 +393,7 @@ > > ############################################################################### > >-Project: "TPTPClientCompTL"="..\src\transport\TPTPClientCompTL\TPTPClientCompTL.dsp" - Package Owner=<4> >+Project: "TPTPClientCompTL"=..\src\transport\TPTPClientCompTL\TPTPClientCompTL.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -384,7 +411,7 @@ > > ############################################################################### > >-Project: "TPTPLogUtils"="..\src\shared\TPTPLogUtils\TPTPLogUtils.dsp" - Package Owner=<4> >+Project: "TPTPLogUtils"=..\src\shared\TPTPLogUtils\TPTPLogUtils.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -399,7 +426,7 @@ > > ############################################################################### > >-Project: "TPTPUtil"="..\src\shared\TPTPUtil\TPTPUtil.dsp" - Package Owner=<4> >+Project: "TPTPUtil"=..\src\shared\TPTPUtil\TPTPUtil.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -411,7 +438,7 @@ > > ############################################################################### > >-Project: "agentBase"="..\src\agents\agentBase\AgentBase.dsp" - Package Owner=<4> >+Project: "agentBase"=..\src\agents\agentBase\AgentBase.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -438,7 +465,7 @@ > > ############################################################################### > >-Project: "client"="..\src\client\Client.dsp" - Package Owner=<4> >+Project: "client"=..\src\client\Client.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -453,7 +480,7 @@ > > ############################################################################### > >-Project: "namedPipeTL"="..\src\transport\namedPipeTL\NamedPipeTL.dsp" - Package Owner=<4> >+Project: "namedPipeTL"=..\src\transport\namedPipeTL\NamedPipeTL.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -471,7 +498,7 @@ > > ############################################################################### > >-Project: "processControlUtil"="..\src\shared\processControlUtil\ProcessControlUtil.dsp" - Package Owner=<4> >+Project: "processControlUtil"=..\src\shared\processControlUtil\ProcessControlUtil.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -486,7 +513,7 @@ > > ############################################################################### > >-Project: "sharedMemTL"="..\SRC\TRANSPORT\sharedMemTL\SharedMemTL.dsp" - Package Owner=<4> >+Project: "sharedMemTL"=..\SRC\TRANSPORT\sharedMemTL\SharedMemTL.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -501,7 +528,7 @@ > > ############################################################################### > >-Project: "socketTL"="..\src\transport\socketTL\SocketTL.dsp" - Package Owner=<4> >+Project: "socketTL"=..\src\transport\socketTL\SocketTL.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -519,7 +546,7 @@ > > ############################################################################### > >-Project: "tptpConfig"="..\src\shared\tptpConfig\tptpConfig.dsp" - Package Owner=<4> >+Project: "tptpConfig"=..\src\shared\tptpConfig\tptpConfig.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -537,7 +564,7 @@ > > ############################################################################### > >-Project: "tptpProcessController"="..\src\agents\tptpProcessController\TPTPProcessController.dsp" - Package Owner=<4> >+Project: "tptpProcessController"=..\src\agents\tptpProcessController\TPTPProcessController.dsp - Package Owner=<4> > > Package=<5> > {{{ >@@ -558,7 +585,7 @@ > > ############################################################################### > >-Project: "transportSupport"="..\src\transport\transportSupport\TransportSupport.dsp" - Package Owner=<4> >+Project: "transportSupport"=..\src\transport\transportSupport\TransportSupport.dsp - Package Owner=<4> > > Package=<5> > {{{ >Index: src-native-new/makefile.win_ipf >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makefile.win_ipf,v >retrieving revision 1.16 >diff -u -r1.16 makefile.win_ipf >--- src-native-new/makefile.win_ipf 23 Mar 2007 13:47:37 -0000 1.16 >+++ src-native-new/makefile.win_ipf 26 Mar 2007 18:35:11 -0000 >@@ -1,6 +1,9 @@ > all: agentController > > agentController: >+ set INCLUDE=$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(XERCESC_HOME)\include;$(INCLUDE) >+ set LIB=$(JAVA_HOME)\lib;$(XERCESC_HOME)\lib;$(LIB) >+ > if not exist lib md lib > cd build > nmake -f BuildAll.mak64 CFG="BuildAll - IA64 Release" >@@ -12,6 +15,35 @@ > nmake -f javaBaseAgent.mak64 CFG="javaBaseAgent - IA64 Release" > cd ..\.. > >+ cd src\HCLauncher\WinBuild >+ nmake -f HCLauncher.mak64 CFG="HCLaunch - IA64 Release" >+ cd ..\..\.. >+ >+ cd src\agents\RABindings\WinBuild >+ nmake -f RABindings.mak64 CFG="RABinding - IA64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\java\WinBuild >+ nmake -f log_agent.mak64 CFG="log_agent - IA64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\native\WinBuild >+ nmake -f heapsnapshots.mak64 CFG="heapsnapshots - IA64 Release" >+ nmake -f java_profiler.mak64 CFG="java_profiler - IA64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\perfmon\WinBuild >+ nmake -f resutils.mak64 CFG="resutils - IA64 Release" >+ nmake -f rac.mak64 CFG="rac - IA64 Release" >+ nmake -f sysperf.mak64 CFG="sysperf - IA64 Release" >+ nmake -f PerfmonAgent.mak64 CFG="PerfmonAgent - IA64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\thread\WinBuild >+ nmake -f hcthread.mak64 CFG="hcthread - IA64 Release" >+ cd ..\..\..\.. >+ >+ > package: > if exist packaging rm -rf packaging > md packaging\bin >@@ -22,12 +54,10 @@ > > if exist $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll copy /y $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll packaging\bin > copy /y bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.exe packaging\bin > copy /y bin\readme.txt packaging\bin >- if exist $(XERCESC_HOME)\bin\xerces-c_2_6.dll copy /y $(XERCESC_HOME)\bin\xerces-c_2_6.dll packaging\bin > if exist $(TEMP_LICENSE_HOME)\epl-v10.html copy /y $(TEMP_LICENSE_HOME)\epl-v10.html packaging > if exist $(TEMP_LICENSE_HOME)\notice.html copy /y $(TEMP_LICENSE_HOME)\notice.html packaging >+ if exist $(XERCESC_HOME)\bin\xerces-c_2_6.dll copy /y $(XERCESC_HOME)\bin\xerces-c_2_6.dll packaging\bin > xcopy /y /E config packaging\config > xcopy /y /E agents packaging\agents > copy /y about.win.html packaging\about.html >@@ -42,6 +72,8 @@ > md packaging\bin > > copy /y bin\*.exe packaging\bin >+ copy /y bin\ACServer.exe packaging\bin\RAServer.exe >+ copy /y bin\ACWinService.exe packaging\bin\RAService.exe > > if exist agntctrl.win_ipf.zip rm -f agntctrl.win_ipf.zip > copy /y agntctrl.base.win_ipf.zip agntctrl.win_ipf.zip >Index: src-native-new/makefile.win_em64t >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makefile.win_em64t,v >retrieving revision 1.14 >diff -u -r1.14 makefile.win_em64t >--- src-native-new/makefile.win_em64t 23 Mar 2007 13:47:37 -0000 1.14 >+++ src-native-new/makefile.win_em64t 26 Mar 2007 18:35:11 -0000 >@@ -1,6 +1,9 @@ > all: agentController > > agentController: >+ set INCLUDE=$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(XERCESC_HOME)\include;$(INCLUDE) >+ set LIB=$(JAVA_HOME)\lib;$(XERCESC_HOME)\lib;$(LIB) >+ > if not exist lib md lib > cd build > nmake -f BuildAll.mak64 CFG="BuildAll - X64 Release" >@@ -12,6 +15,35 @@ > nmake -f javaBaseAgent.mak64 CFG="javaBaseAgent - X64 Release" > cd ..\.. > >+ cd src\HCLauncher\WinBuild >+ nmake -f HCLauncher.mak64 CFG="HCLaunch - X64 Release" >+ cd ..\..\.. >+ >+ cd src\agents\RABindings\WinBuild >+ nmake -f RABindings.mak64 CFG="RABinding - X64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\java\WinBuild >+ nmake -f log_agent.mak64 CFG="log_agent - X64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\native\WinBuild >+ nmake -f heapsnapshots.mak64 CFG="heapsnapshots - X64 Release" >+ nmake -f java_profiler.mak64 CFG="java_profiler - X64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\perfmon\WinBuild >+ nmake -f resutils.mak64 CFG="resutils - X64 Release" >+ nmake -f rac.mak64 CFG="rac - X64 Release" >+ nmake -f sysperf.mak64 CFG="sysperf - X64 Release" >+ nmake -f PerfmonAgent.mak64 CFG="PerfmonAgent - X64 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\thread\WinBuild >+ nmake -f hcthread.mak64 CFG="hcthread - X64 Release" >+ cd ..\..\..\.. >+ >+ > package: > if exist packaging rm -rf packaging > md packaging\bin >@@ -22,8 +54,6 @@ > > if exist $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll copy /y $(CBE_SDK_HOME)\lib\CommonBaseEvent.dll packaging\bin > copy /y bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.dll packaging\bin >- copy /y $(RAC_SDK_HOME)\bin\*.exe packaging\bin > copy /y bin\readme.txt packaging\bin > if exist $(TEMP_LICENSE_HOME)\epl-v10.html copy /y $(TEMP_LICENSE_HOME)\epl-v10.html packaging > if exist $(TEMP_LICENSE_HOME)\notice.html copy /y $(TEMP_LICENSE_HOME)\notice.html packaging >@@ -42,6 +72,8 @@ > md packaging\bin > > copy /y bin\*.exe packaging\bin >+ copy /y bin\ACServer.exe packaging\bin\RAServer.exe >+ copy /y bin\ACWinService.exe packaging\bin\RAService.exe > > if exist agntctrl.win_em64t.zip rm -f agntctrl.win_em64t.zip > copy /y agntctrl.base.win_em64t.zip agntctrl.win_em64t.zip >Index: src-native-new/makefile.win_ia32 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makefile.win_ia32,v >retrieving revision 1.27 >diff -u -r1.27 makefile.win_ia32 >--- src-native-new/makefile.win_ia32 7 Jul 2006 22:11:24 -0000 1.27 >+++ src-native-new/makefile.win_ia32 26 Mar 2007 18:35:11 -0000 >@@ -8,9 +8,37 @@ > msdev tptp_javaagent.dsw /MAKE "JavaBaseAgent - Win32 Release" > cd .. > >+ cd src\HCLauncher\WinBuild >+ msdev HCLauncher.dsw /MAKE "HCLaunch - Win32 Release" >+ cd ..\..\.. >+ >+ cd src\agents\RABindings\WinBuild >+ msdev RABindings.dsw /MAKE "RABinding - Win32 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\java\WinBuild >+ msdev WinBuild.dsw /MAKE "log_agent - Win32 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\native\WinBuild >+ msdev WinBuild.dsw /MAKE "java_profiler - Win32 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\perfmon\WinBuild >+ msdev WinBuild.dsw /MAKE "resutils - Win32 Release" >+ msdev WinBuild.dsw /MAKE "rac - Win32 Release" >+ msdev WinBuild.dsw /MAKE "sysperf - Win32 Release" >+ msdev WinBuild.dsw /MAKE "PerfmonAgent - Win32 Release" >+ cd ..\..\..\.. >+ >+ cd src\agents\thread\WinBuild >+ msdev hcthread.dsw /MAKE "hcthread - Win32 Release" >+ cd ..\..\..\.. >+ > package: > if exist packaging rm -rf packaging > md packaging\bin >+ md packaging\lib > md packaging\config > md packaging\agents > md packaging\about_files >@@ -35,6 +63,8 @@ > md packaging\bin > > copy /y bin\*.exe packaging\bin >+ copy /y bin\ACServer.exe packaging\bin\RAServer.exe >+ copy /y bin\ACWinService.exe packaging\bin\RAService.exe > > if exist agntctrl.win_ia32.zip rm -f agntctrl.win_ia32.zip > copy /y agntctrl.base.win_ia32.zip agntctrl.win_ia32.zip >Index: src-native-new/makefile >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/makefile,v >retrieving revision 1.48 >diff -u -r1.48 makefile >--- src-native-new/makefile 19 Mar 2007 03:14:38 -0000 1.48 >+++ src-native-new/makefile 26 Mar 2007 18:35:11 -0000 >@@ -61,6 +61,10 @@ > cp -r config packaging > cp -r agents packaging > >+ if [ -e packaging/lib/libresutils.a ]; then rm -f packaging/lib/libresutils.a; fi; >+ if [ -e packaging/lib/libperflin.so ]; then rm -f packaging/lib/libperflin.*; fi; >+ if [ -e packaging/lib/librac.so ]; then rm -f packaging/lib/librac.*; fi; >+ > rm -f agntctrl.base.$(BUILD_PLATFORM).zip > cd packaging; \ > zip -r9y ../agntctrl.base.$(BUILD_PLATFORM).zip *; \ >@@ -71,6 +75,11 @@ > > cp -d bin/SampleClient bin/TimeCollector bin/tptp* bin/AC* packaging/bin > cp -d bin/ChkPass packaging/bin >+ if [ -e bin/LinuxAgent ]; then mkdir -p packaging/plugins/org.eclipse.hyades.perfmon.linux/bin; fi; >+ if [ -e bin/LinuxAgent ]; then mkdir -p packaging/plugins/org.eclipse.hyades.perfmon.linux/lib; fi; >+ if [ -e bin/LinuxAgent ]; then cp bin/LinuxAgent packaging/plugins/org.eclipse.hyades.perfmon.linux/bin; fi; >+ if [ -e lib/libperflin.so ]; then cp lib/libperflin.* packaging/plugins/org.eclipse.hyades.perfmon.linux/lib; fi; >+ if [ -e lib/librac.so ]; then cp lib/librac.* packaging/plugins/org.eclipse.hyades.perfmon.linux/lib; fi; > > cp agntctrl.base.$(BUILD_PLATFORM).zip agntctrl.$(BUILD_PLATFORM).zip > cd packaging; \ >Index: src-native-new/src/transport/sharedMemTL/SharedMemTL.mak64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/sharedMemTL/SharedMemTL.mak64,v >retrieving revision 1.4 >diff -u -r1.4 SharedMemTL.mak64 >--- src-native-new/src/transport/sharedMemTL/SharedMemTL.mak64 22 Mar 2007 19:33:44 -0000 1.4 >+++ src-native-new/src/transport/sharedMemTL/SharedMemTL.mak64 26 Mar 2007 18:35:11 -0000 >@@ -68,11 +68,11 @@ > CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHAREDMEMTL_EXPORTS" /Fp"$(INTDIR)\SharedMemTL.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib transportSupport.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /debug /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /debug /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\sharedMemListener.obj" \ > "$(INTDIR)\sharedMemTL.obj" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >+ "..\..\..\lib\hcclsm.lib" \ > "..\..\..\lib\tptpUtils.lib" \ > "..\..\..\lib\transportSupport.lib" > >@@ -121,11 +121,11 @@ > CPP_PROJ=/nologo /MD /W3 /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHAREDMEMTL_EXPORTS" /Fp"$(INTDIR)\SharedMemTL.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib uuid.lib transportSupport.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:IA64 >+LINK32_FLAGS=advapi32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\sharedMemListener.obj" \ > "$(INTDIR)\sharedMemTL.obj" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >+ "..\..\..\lib\hcclsm.lib" \ > "..\..\..\lib\tptpUtils.lib" \ > "..\..\..\lib\transportSupport.lib" > >@@ -173,11 +173,11 @@ > CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHAREDMEMTL_EXPORTS" /Fp"$(INTDIR)\SharedMemTL.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib transportSupport.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /debug /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:AMD64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /debug /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\sharedMemListener.obj" \ > "$(INTDIR)\sharedMemTL.obj" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >+ "..\..\..\lib\hcclsm.lib" \ > "..\..\..\lib\tptpUtils.lib" \ > "..\..\..\lib\transportSupport.lib" > >@@ -226,11 +226,11 @@ > CPP_PROJ=/nologo /MD /W3 /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHAREDMEMTL_EXPORTS" /Fp"$(INTDIR)\SharedMemTL.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib uuid.lib transportSupport.lib tptpUtils.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:AMD64 >+LINK32_FLAGS=advapi32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\SharedMemTL.pdb" /def:".\sharedMemTL.def" /out:"$(OUTDIR)\SharedMemTL.dll" /implib:"../../../lib/sharedMemTL.lib" /libpath:"../../../lib" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\sharedMemListener.obj" \ > "$(INTDIR)\sharedMemTL.obj" \ >- "$(RAC_SDK_HOME)\lib\hcclsm.lib" \ >+ "..\..\..\lib\hcclsm.lib" \ > "..\..\..\lib\tptpUtils.lib" \ > "..\..\..\lib\transportSupport.lib" > >Index: src-native-new/src/transport/RASocket/RASocket.mak64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/RASocket.mak64,v >retrieving revision 1.3 >diff -u -r1.3 RASocket.mak64 >--- src-native-new/src/transport/RASocket/RASocket.mak64 20 May 2006 18:26:49 -0000 1.3 >+++ src-native-new/src/transport/RASocket/RASocket.mak64 26 Mar 2007 18:35:11 -0000 >@@ -1,20 +1,22 @@ >-# Microsoft Developer Studio based NMAKE File, derived from RASocket.dsp >+# Microsoft Developer Studio Generated NMAKE File, Based on RASocket.dsp > !IF "$(CFG)" == "" >-CFG=RASocket - IA64 Release >-!MESSAGE No configuration specified. Defaulting to RASocket - IA64 Release. >+CFG=RASocket - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to RASocket - IA64 Debug. > !ENDIF > >-!IF "$(CFG)" != "RASocket - IA64 Debug" && "$(CFG)" != "RASocket - IA64 Release" >+!IF "$(CFG)" != "RASocket - IA64 Release" && "$(CFG)" != "RASocket - IA64 Debug" && "$(CFG)" != "RASocket - X64 Release" && "$(CFG)" != "RASocket - X64 Debug" > !MESSAGE Invalid configuration "$(CFG)" specified. > !MESSAGE You can specify a configuration when running NMAKE > !MESSAGE by defining the macro CFG on the command line. For example: > !MESSAGE >-!MESSAGE NMAKE /f "RASocket.mak64" CFG="RASocket - IA64 Release" >+!MESSAGE NMAKE /f "RASocket.mak64" CFG="RASocket - IA64 Debug" > !MESSAGE > !MESSAGE Possible choices for configuration are: > !MESSAGE >-!MESSAGE "RASocket - IA64 Debug" > !MESSAGE "RASocket - IA64 Release" >+!MESSAGE "RASocket - IA64 Debug" >+!MESSAGE "RASocket - X64 Release" >+!MESSAGE "RASocket - X64 Debug" > !MESSAGE > !ERROR An invalid configuration is specified. > !ENDIF >@@ -25,21 +27,107 @@ > NULL=nul > !ENDIF > >+!IF "$(CFG)" == "RASocket - IA64 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hccls.dll" >+ >+!ELSE >+ >+ALL : "RACommon - IA64 Release" "$(OUTDIR)\hccls.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - IA64 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hccls.res" >+ -@erase "$(INTDIR)\RASocket.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hccls.dll" >+ -@erase "$(OUTDIR)\..\lib\hccls.exp" >+ -@erase "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ > CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\RACommon" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASOCKET_EXPORTS" /Fp"$(INTDIR)\RASocket.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 > RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccls.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RASocket\RASocket.def" /out:"$(OUTDIR)\hccls.dll" /implib:"$(OUTDIR)\..\lib\hccls.lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\RASocket.obj" \ >+ "$(INTDIR)\hccls.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" > >-!IF "$(CFG)" == "RASocket - IA64 Debug" >+"$(OUTDIR)\hccls.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< > >-OUTDIR=.\RASocket___IA64Debug >-INTDIR=.\RASocket___IA64Debug >+!ELSEIF "$(CFG)" == "RASocket - IA64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros > > !IF "$(RECURSE)" == "0" > >-ALL : "..\..\..\bin\hccls.dll" >+ALL : "$(OUTDIR)\hccls.dll" > > !ELSE > >-ALL : "RACommon - IA64 Debug" "..\..\..\bin\hccls.dll" >+ALL : "RACommon - IA64 Debug" "$(OUTDIR)\hccls.dll" > > !ENDIF > >@@ -48,40 +136,78 @@ > !ELSE > CLEAN : > !ENDIF >+ -@erase "$(INTDIR)\hccls.res" > -@erase "$(INTDIR)\RASocket.obj" > -@erase "$(INTDIR)\vc60.idb" > -@erase "$(INTDIR)\vc60.pdb" >- -@erase "$(OUTDIR)\hccls.pdb" >- -@erase "..\..\..\bin\hccls.dll" >- -@erase "..\..\..\bin\hccls.ilk" >- -@erase "..\..\..\lib\hccls.exp" >- -@erase "..\..\..\lib\hccls.lib" >- -@erase "$(OUTDIR)\hccls.res" >+ -@erase "$(OUTDIR)\hccls.dll" >+ -@erase "$(OUTDIR)\..\lib\hccls.exp" >+ -@erase "$(OUTDIR)\..\lib\hccls.ilk" >+ -@erase "$(OUTDIR)\..\lib\hccls.lib" >+ -@erase "$(OUTDIR)\..\lib\hccls.pdb" > > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" > >-CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASOCKET_EXPORTS" /Fp"$(INTDIR)\RASocket.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >-RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/hccls.res" /i "../../../include" /d "_DEBUG" >- >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASOCKET_EXPORTS" /Fp"$(INTDIR)\RASocket.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccls.res" /d "_DEBUG" >+ > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib hcclco.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hccls.pdb" /debug /def:".\RASocket.def" /out:"../../../bin/hccls.dll" /implib:"../../../lib/hccls.lib" /libpath:"../../../lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hccls.pdb" /debug /def:"..\RASocket\RASocket.def" /out:"$(OUTDIR)\hccls.dll" /implib:"$(OUTDIR)\..\lib\hccls.lib" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\RASocket.obj" \ >- "$(OUTDIR)\hccls.res" \ >- "..\..\..\lib\hcclco.lib" >+ "$(INTDIR)\hccls.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" > >-"..\..\..\bin\hccls.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+"$(OUTDIR)\hccls.dll" : "$(OUTDIR)" $(LINK32_OBJS) > $(LINK32) @<< > $(LINK32_FLAGS) $(LINK32_OBJS) > << > >-!ELSEIF "$(CFG)" == "RASocket - IA64 Release" >+!ELSEIF "$(CFG)" == "RASocket - X64 Release" > >-OUTDIR=.\../../../bin >-INTDIR=.\RASocket___IA64Release >+OUTDIR=..\..\..\bin >+INTDIR=.\Release > # Begin Custom Macros >-OutDir=.\../../../bin >+OutDir=..\..\..\bin > # End Custom Macros > > !IF "$(RECURSE)" == "0" >@@ -90,22 +216,21 @@ > > !ELSE > >-ALL : "RACommon - IA64 Release" "$(OUTDIR)\hccls.dll" >+ALL : "RACommon - X64 Release" "$(OUTDIR)\hccls.dll" > > !ENDIF > > !IF "$(RECURSE)" == "1" >-CLEAN :"RACommon - IA64 ReleaseCLEAN" >+CLEAN :"RACommon - X64 ReleaseCLEAN" > !ELSE > CLEAN : > !ENDIF >+ -@erase "$(INTDIR)\hccls.res" > -@erase "$(INTDIR)\RASocket.obj" > -@erase "$(INTDIR)\vc60.idb" > -@erase "$(OUTDIR)\hccls.dll" >- -@erase "$(OUTDIR)\hccls.ilk" >- -@erase "..\..\..\lib\hccls.exp" >- -@erase "..\..\..\lib\hccls.lib" >- -@erase "$(OUTDIR)\hccls.res" >+ -@erase "$(OUTDIR)\..\lib\hccls.exp" >+ -@erase "$(OUTDIR)\..\lib\hccls.lib" > > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >@@ -113,23 +238,98 @@ > "$(INTDIR)" : > if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" > >-CPP_PROJ=/nologo /MD /W3 /O2 /I "..\RACommon" /I "$(JAVA_HOME)/include" /I "$(JAVA_HOME)/include/win32" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASOCKET_EXPORTS" /Fp"$(INTDIR)\RASocket.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >-RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/hccls.res" /i "../../../include" /d "_DEBUG" >- >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\RACommon" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASOCKET_EXPORTS" /Fp"$(INTDIR)\RASocket.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccls.res" /d "NDEBUG" >+ > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib Uuid.lib rpcrt4.lib ws2_32.lib hcclco.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hccls.pdb" /def:".\RASocket.def" /out:"$(OUTDIR)\hccls.dll" /implib:"../../../lib/hccls.lib" /libpath:"../../../lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RASocket\RASocket.def" /out:"$(OUTDIR)\hccls.dll" /implib:"$(OUTDIR)\..\lib\hccls.lib" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\RASocket.obj" \ >- "$(OUTDIR)\hccls.res" \ >- "..\..\..\lib\hcclco.lib" >+ "$(INTDIR)\hccls.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" > >-"$(OUTDIR)\hccls.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+"$(OUTDIR)\hccls.dll" : "$(OUTDIR)" $(LINK32_OBJS) > $(LINK32) @<< > $(LINK32_FLAGS) $(LINK32_OBJS) > << > >+!ELSEIF "$(CFG)" == "RASocket - X64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hccls.dll" >+ >+!ELSE >+ >+ALL : "RACommon - X64 Debug" "$(OUTDIR)\hccls.dll" >+ > !ENDIF > >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - X64 DebugCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hccls.res" >+ -@erase "$(INTDIR)\RASocket.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hccls.dll" >+ -@erase "$(OUTDIR)\..\lib\hccls.exp" >+ -@erase "$(OUTDIR)\..\lib\hccls.ilk" >+ -@erase "$(OUTDIR)\..\lib\hccls.lib" >+ -@erase "$(OUTDIR)\..\lib\hccls.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASOCKET_EXPORTS" /Fp"$(INTDIR)\RASocket.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ > .c{$(INTDIR)}.obj:: > $(CPP) @<< > $(CPP_PROJ) $< >@@ -145,18 +345,93 @@ > $(CPP_PROJ) $< > << > >-!IF "$(CFG)" == "RASocket - IA64 Debug" || "$(CFG)" == "RASocket - IA64 Release" >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccls.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hccls.pdb" /debug /def:"..\RASocket\RASocket.def" /out:"$(OUTDIR)\hccls.dll" /implib:"$(OUTDIR)\..\lib\hccls.lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\RASocket.obj" \ >+ "$(INTDIR)\hccls.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" >+ >+"$(OUTDIR)\hccls.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "RASocket - IA64 Release" || "$(CFG)" == "RASocket - IA64 Debug" || "$(CFG)" == "RASocket - X64 Release" || "$(CFG)" == "RASocket - X64 Debug" > SOURCE=..\RASocket\RASocket.c > > "$(INTDIR)\RASocket.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASocket\version.rc > >-"$(OUTDIR)\hccls.res" : $(SOURCE) "$(INTDIR)" >- $(RSC) $(RSC_PROJ) $(SOURCE) >+!IF "$(CFG)" == "RASocket - IA64 Release" >+ >+ >+"$(INTDIR)\hccls.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccls.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASocket" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RASocket - IA64 Debug" >+ >+ >+"$(INTDIR)\hccls.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccls.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASocket" /d "_DEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RASocket - X64 Release" >+ >+ >+"$(INTDIR)\hccls.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccls.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASocket" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RASocket - X64 Debug" > >-!IF "$(CFG)" == "RASocket - IA64 Debug" >+ >+"$(INTDIR)\hccls.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccls.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASocket" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+!IF "$(CFG)" == "RASocket - IA64 Release" >+ >+"RACommon - IA64 Release" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" >+ cd "..\RASocket" >+ >+"RACommon - IA64 ReleaseCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" RECURSE=1 CLEAN >+ cd "..\RASocket" >+ >+!ELSEIF "$(CFG)" == "RASocket - IA64 Debug" > > "RACommon - IA64 Debug" : > cd "..\RACommon" >@@ -168,18 +443,32 @@ > $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Debug" RECURSE=1 CLEAN > cd "..\RASocket" > >-!ELSEIF "$(CFG)" == "RASocket - IA64 Release" >+!ELSEIF "$(CFG)" == "RASocket - X64 Release" > >-"RACommon - IA64 Release" : >+"RACommon - X64 Release" : > cd "..\RACommon" >- $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" > cd "..\RASocket" > >-"RACommon - IA64 ReleaseCLEAN" : >+"RACommon - X64 ReleaseCLEAN" : > cd "..\RACommon" >- $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" RECURSE=1 CLEAN >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" RECURSE=1 CLEAN >+ cd "..\RASocket" >+ >+!ELSEIF "$(CFG)" == "RASocket - X64 Debug" >+ >+"RACommon - X64 Debug" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" >+ cd "..\RASocket" >+ >+"RACommon - X64 DebugCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" RECURSE=1 CLEAN > cd "..\RASocket" > > !ENDIF > >+ > !ENDIF >+ >Index: src-native-new/src/transport/RASocket/version.rc >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/version.rc,v >retrieving revision 1.2 >diff -u -r1.2 version.rc >--- src-native-new/src/transport/RASocket/version.rc 24 Jul 2005 08:33:48 -0000 1.2 >+++ src-native-new/src/transport/RASocket/version.rc 26 Mar 2007 18:35:11 -0000 >@@ -1,4 +1,4 @@ >-#include "tptp/version.h" >+#include "../../../include/tptp/version.h" > //Microsoft Developer Studio generated resource script. > // > #include "resource.h" >Index: src-native-new/src/transport/RASocket/RASocket.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/RASocket.make,v >retrieving revision 1.5 >diff -u -r1.5 RASocket.make >--- src-native-new/src/transport/RASocket/RASocket.make 19 Mar 2007 03:14:37 -0000 1.5 >+++ src-native-new/src/transport/RASocket/RASocket.make 26 Mar 2007 18:35:11 -0000 >@@ -44,7 +44,7 @@ > # list of additional libraries to be linked with > # (separated by blanks) > #----------------------------------- >-LIBS := dl hcclco >+LIBS := dl hcclco pthread > > #----------------------------------- > # list of additional library directories to search from >Index: src-native-new/src/transport/RASharedMemory/RASharedMemory.mak64 >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/RASharedMemory.mak64,v >retrieving revision 1.2 >diff -u -r1.2 RASharedMemory.mak64 >--- src-native-new/src/transport/RASharedMemory/RASharedMemory.mak64 20 May 2006 18:26:46 -0000 1.2 >+++ src-native-new/src/transport/RASharedMemory/RASharedMemory.mak64 26 Mar 2007 18:35:11 -0000 >@@ -1,20 +1,22 @@ >-# Microsoft Developer Studio based NMAKE File, derived from RASharedMemory.dsp >+# Microsoft Developer Studio Generated NMAKE File, Based on RASharedMemory.dsp > !IF "$(CFG)" == "" >-CFG=RASharedMemory - IA64 Release >-!MESSAGE No configuration specified. Defaulting to RASharedMemory - IA64 Release. >+CFG=RASharedMemory - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to RASharedMemory - IA64 Debug. > !ENDIF > >-!IF "$(CFG)" != "RASharedMemory - IA64 Debug" && "$(CFG)" != "RASharedMemory - IA64 Release" >+!IF "$(CFG)" != "RASharedMemory - IA64 Release" && "$(CFG)" != "RASharedMemory - IA64 Debug" && "$(CFG)" != "RASharedMemory - X64 Release" && "$(CFG)" != "RASharedMemory - X64 Debug" > !MESSAGE Invalid configuration "$(CFG)" specified. > !MESSAGE You can specify a configuration when running NMAKE > !MESSAGE by defining the macro CFG on the command line. For example: > !MESSAGE >-!MESSAGE NMAKE /f "RASharedMemory.mak64" CFG="RASharedMemory - IA64 Release" >+!MESSAGE NMAKE /f "RASharedMemory.mak64" CFG="RASharedMemory - IA64 Debug" > !MESSAGE > !MESSAGE Possible choices for configuration are: > !MESSAGE >-!MESSAGE "RASharedMemory - IA64 Debug" > !MESSAGE "RASharedMemory - IA64 Release" >+!MESSAGE "RASharedMemory - IA64 Debug" >+!MESSAGE "RASharedMemory - X64 Release" >+!MESSAGE "RASharedMemory - X64 Debug" > !MESSAGE > !ERROR An invalid configuration is specified. > !ENDIF >@@ -25,21 +27,120 @@ > NULL=nul > !ENDIF > >+!IF "$(CFG)" == "RASharedMemory - IA64 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcclsm.dll" >+ >+!ELSE >+ >+ALL : "RASocket - IA64 Release" "RACommon - IA64 Release" "$(OUTDIR)\hcclsm.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - IA64 ReleaseCLEAN" "RASocket - IA64 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hcclsm.res" >+ -@erase "$(INTDIR)\ossdebug.obj" >+ -@erase "$(INTDIR)\ossipc.obj" >+ -@erase "$(INTDIR)\ossipcmemory.obj" >+ -@erase "$(INTDIR)\ossmemory.obj" >+ -@erase "$(INTDIR)\ossrambo.obj" >+ -@erase "$(INTDIR)\ossramboflush.obj" >+ -@erase "$(INTDIR)\osstime.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcclsm.dll" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ > CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\RACommon" /I "..\RASocket" /I "..\RADataTransfer" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASHAREDMEMORY_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RASharedMemory.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 > RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclsm.res" /d "NDEBUG" > >-!IF "$(CFG)" == "RASharedMemory - IA64 Debug" >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RASharedMemory\RASharedMemory.def" /out:"$(OUTDIR)\hcclsm.dll" /implib:"$(OUTDIR)\..\lib\hcclsm.lib" /libpath:".\bin" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\ossdebug.obj" \ >+ "$(INTDIR)\ossipc.obj" \ >+ "$(INTDIR)\ossipcmemory.obj" \ >+ "$(INTDIR)\ossmemory.obj" \ >+ "$(INTDIR)\ossrambo.obj" \ >+ "$(INTDIR)\ossramboflush.obj" \ >+ "$(INTDIR)\osstime.obj" \ >+ "$(INTDIR)\hcclsm.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hcclsm.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - IA64 Debug" > >-OUTDIR=.\RASharedMemory___IA64Debug >-INTDIR=.\RASharedMemory___IA64Debug >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros > > !IF "$(RECURSE)" == "0" > >-ALL : "..\..\..\bin\hcclsm.dll" >+ALL : "$(OUTDIR)\hcclsm.dll" > > !ELSE > >-ALL : "RASocket - IA64 Debug" "RACommon - IA64 Debug" "..\..\..\bin\hcclsm.dll" >+ALL : "RASocket - IA64 Debug" "RACommon - IA64 Debug" "$(OUTDIR)\hcclsm.dll" > > !ENDIF > >@@ -48,6 +149,7 @@ > !ELSE > CLEAN : > !ENDIF >+ -@erase "$(INTDIR)\hcclsm.res" > -@erase "$(INTDIR)\ossdebug.obj" > -@erase "$(INTDIR)\ossipc.obj" > -@erase "$(INTDIR)\ossipcmemory.obj" >@@ -57,21 +159,58 @@ > -@erase "$(INTDIR)\osstime.obj" > -@erase "$(INTDIR)\vc60.idb" > -@erase "$(INTDIR)\vc60.pdb" >- -@erase "$(OUTDIR)\hcclsm.pdb" >- -@erase "..\..\..\bin\hcclsm.dll" >- -@erase "..\..\..\bin\hcclsm.ilk" >- -@erase "..\..\..\lib\hcclsm.exp" >- -@erase "..\..\..\lib\hcclsm.lib" >- -@erase "$(OUTDIR)\hcclsm.res" >+ -@erase "$(OUTDIR)\hcclsm.dll" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.lib" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.pdb" > > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" > >-CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /I "..\RASocket" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASHAREDMEMORY_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RASharedMemory.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >-RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/hcclsm.res" /i "../../../include" /d "_DEBUG" >- >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /I "..\RASocket" /I "..\RADataTransfer" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASHAREDMEMORY_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RASharedMemory.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclsm.res" /d "_DEBUG" >+ > LINK32=link.exe >-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib hcclco.lib hccls.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclsm.pdb" /debug /def:".\RASharedMemory.def" /out:"../../../bin/hcclsm.dll" /implib:"../../../lib/hcclsm.lib" /libpath:"../../../lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclsm.pdb" /debug /def:"..\RASharedMemory\RASharedMemory.def" /out:"$(OUTDIR)\hcclsm.dll" /implib:"$(OUTDIR)\..\lib\hcclsm.lib" /libpath:".\bin" /machine:IA64 > LINK32_OBJS= \ > "$(INTDIR)\ossdebug.obj" \ > "$(INTDIR)\ossipc.obj" \ >@@ -80,21 +219,21 @@ > "$(INTDIR)\ossrambo.obj" \ > "$(INTDIR)\ossramboflush.obj" \ > "$(INTDIR)\osstime.obj" \ >- "$(OUTDIR)\hcclsm.res" \ >- "..\..\..\lib\hcclco.lib" \ >- "..\..\..\lib\hccls.lib" >+ "$(INTDIR)\hcclsm.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" > >-"..\..\..\bin\hcclsm.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+"$(OUTDIR)\hcclsm.dll" : "$(OUTDIR)" $(LINK32_OBJS) > $(LINK32) @<< > $(LINK32_FLAGS) $(LINK32_OBJS) > << > >-!ELSEIF "$(CFG)" == "RASharedMemory - IA64 Release" >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Release" > >-OUTDIR=.\../../../bin >-INTDIR=.\RASharedMemory___IA64Release >+OUTDIR=..\..\..\bin >+INTDIR=.\Release > # Begin Custom Macros >-OutDir=.\../../../bin >+OutDir=..\..\..\bin > # End Custom Macros > > !IF "$(RECURSE)" == "0" >@@ -103,15 +242,16 @@ > > !ELSE > >-ALL : "RASocket - IA64 Release" "RACommon - IA64 Release" "$(OUTDIR)\hcclsm.dll" >+ALL : "RASocket - X64 Release" "RACommon - X64 Release" "$(OUTDIR)\hcclsm.dll" > > !ENDIF > > !IF "$(RECURSE)" == "1" >-CLEAN :"RACommon - IA64 ReleaseCLEAN" "RASocket - IA64 ReleaseCLEAN" >+CLEAN :"RACommon - X64 ReleaseCLEAN" "RASocket - X64 ReleaseCLEAN" > !ELSE > CLEAN : > !ENDIF >+ -@erase "$(INTDIR)\hcclsm.res" > -@erase "$(INTDIR)\ossdebug.obj" > -@erase "$(INTDIR)\ossipc.obj" > -@erase "$(INTDIR)\ossipcmemory.obj" >@@ -121,10 +261,8 @@ > -@erase "$(INTDIR)\osstime.obj" > -@erase "$(INTDIR)\vc60.idb" > -@erase "$(OUTDIR)\hcclsm.dll" >- -@erase "$(OUTDIR)\hcclsm.ilk" >- -@erase "..\..\..\lib\hcclsm.exp" >- -@erase "..\..\..\lib\hcclsm.lib" >- -@erase "$(OUTDIR)\hcclsm.res" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.lib" > > "$(OUTDIR)" : > if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >@@ -132,11 +270,46 @@ > "$(INTDIR)" : > if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" > >-CPP_PROJ=/nologo /MD /W3 /O2 /I "..\RACommon" /I "..\RASocket" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASHAREDMEMORY_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RASharedMemory.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >-RSC_PROJ=/l 0x409 /fo"$(OUTDIR)/hcclsm.res" /i "../../../include" /d "_DEBUG" >- >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\RACommon" /I "..\RASocket" /I "..\RADataTransfer" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASHAREDMEMORY_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RASharedMemory.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclsm.res" /d "NDEBUG" >+ > LINK32=link.exe >-LINK32_FLAGS=advapi32.lib uuid.lib ws2_32.lib hcclco.lib hccls.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclsm.pdb" /def:".\RASharedMemory.def" /out:"$(OUTDIR)\hcclsm.dll" /implib:"../../../lib/hcclsm.lib" /libpath:"../../../lib" /machine:IA64 >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RASharedMemory\RASharedMemory.def" /out:"$(OUTDIR)\hcclsm.dll" /implib:"$(OUTDIR)\..\lib\hcclsm.lib" /libpath:".\bin" /machine:AMD64 > LINK32_OBJS= \ > "$(INTDIR)\ossdebug.obj" \ > "$(INTDIR)\ossipc.obj" \ >@@ -145,16 +318,62 @@ > "$(INTDIR)\ossrambo.obj" \ > "$(INTDIR)\ossramboflush.obj" \ > "$(INTDIR)\osstime.obj" \ >- "$(OUTDIR)\hcclsm.res" \ >- "..\..\..\lib\hcclco.lib" \ >- "..\..\..\lib\hccls.lib" >+ "$(INTDIR)\hcclsm.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" > >-"$(OUTDIR)\hcclsm.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+"$(OUTDIR)\hcclsm.dll" : "$(OUTDIR)" $(LINK32_OBJS) > $(LINK32) @<< > $(LINK32_FLAGS) $(LINK32_OBJS) > << > >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcclsm.dll" >+ >+!ELSE >+ >+ALL : "RASocket - X64 Debug" "RACommon - X64 Debug" "$(OUTDIR)\hcclsm.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - X64 DebugCLEAN" "RASocket - X64 DebugCLEAN" >+!ELSE >+CLEAN : > !ENDIF >+ -@erase "$(INTDIR)\hcclsm.res" >+ -@erase "$(INTDIR)\ossdebug.obj" >+ -@erase "$(INTDIR)\ossipc.obj" >+ -@erase "$(INTDIR)\ossipcmemory.obj" >+ -@erase "$(INTDIR)\ossmemory.obj" >+ -@erase "$(INTDIR)\ossrambo.obj" >+ -@erase "$(INTDIR)\ossramboflush.obj" >+ -@erase "$(INTDIR)\osstime.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcclsm.dll" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.exp" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.lib" >+ -@erase "$(OUTDIR)\..\lib\hcclsm.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /I "..\RASocket" /I "..\RADataTransfer" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RASHAREDMEMORY_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RASharedMemory.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c > > .c{$(INTDIR)}.obj:: > $(CPP) @<< >@@ -171,48 +390,136 @@ > $(CPP_PROJ) $< > << > >-!IF "$(CFG)" == "RASharedMemory - IA64 Debug" || "$(CFG)" == "RASharedMemory - IA64 Release" >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcclsm.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcclsm.pdb" /debug /def:"..\RASharedMemory\RASharedMemory.def" /out:"$(OUTDIR)\hcclsm.dll" /implib:"$(OUTDIR)\..\lib\hcclsm.lib" /libpath:".\bin" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\ossdebug.obj" \ >+ "$(INTDIR)\ossipc.obj" \ >+ "$(INTDIR)\ossipcmemory.obj" \ >+ "$(INTDIR)\ossmemory.obj" \ >+ "$(INTDIR)\ossrambo.obj" \ >+ "$(INTDIR)\ossramboflush.obj" \ >+ "$(INTDIR)\osstime.obj" \ >+ "$(INTDIR)\hcclsm.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hcclsm.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "RASharedMemory - IA64 Release" || "$(CFG)" == "RASharedMemory - IA64 Debug" || "$(CFG)" == "RASharedMemory - X64 Release" || "$(CFG)" == "RASharedMemory - X64 Debug" > SOURCE=..\RASharedMemory\ossdebug.cpp > > "$(INTDIR)\ossdebug.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASharedMemory\ossipc.cpp > > "$(INTDIR)\ossipc.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASharedMemory\ossipcmemory.cpp > > "$(INTDIR)\ossipcmemory.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASharedMemory\ossmemory.cpp > > "$(INTDIR)\ossmemory.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASharedMemory\ossrambo.cpp > > "$(INTDIR)\ossrambo.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASharedMemory\ossramboflush.cpp > > "$(INTDIR)\ossramboflush.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASharedMemory\osstime.cpp > > "$(INTDIR)\osstime.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) > > > SOURCE=..\RASharedMemory\version.rc > >-"$(OUTDIR)\hcclsm.res" : $(SOURCE) "$(INTDIR)" >- $(RSC) $(RSC_PROJ) $(SOURCE) >+!IF "$(CFG)" == "RASharedMemory - IA64 Release" >+ >+ >+"$(INTDIR)\hcclsm.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclsm.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASharedMemory" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - IA64 Debug" >+ >+ >+"$(INTDIR)\hcclsm.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclsm.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASharedMemory" /d "_DEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Release" >+ >+ >+"$(INTDIR)\hcclsm.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclsm.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASharedMemory" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Debug" > >-!IF "$(CFG)" == "RASharedMemory - IA64 Debug" >+ >+"$(INTDIR)\hcclsm.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcclsm.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RASharedMemory" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+!IF "$(CFG)" == "RASharedMemory - IA64 Release" >+ >+"RACommon - IA64 Release" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" >+ cd "..\RASharedMemory" >+ >+"RACommon - IA64 ReleaseCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" RECURSE=1 CLEAN >+ cd "..\RASharedMemory" >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - IA64 Debug" > > "RACommon - IA64 Debug" : > cd "..\RACommon" >@@ -224,21 +531,45 @@ > $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Debug" RECURSE=1 CLEAN > cd "..\RASharedMemory" > >-!ELSEIF "$(CFG)" == "RASharedMemory - IA64 Release" >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Release" > >-"RACommon - IA64 Release" : >+"RACommon - X64 Release" : > cd "..\RACommon" >- $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" > cd "..\RASharedMemory" > >-"RACommon - IA64 ReleaseCLEAN" : >+"RACommon - X64 ReleaseCLEAN" : > cd "..\RACommon" >- $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" RECURSE=1 CLEAN >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" RECURSE=1 CLEAN >+ cd "..\RASharedMemory" >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Debug" >+ >+"RACommon - X64 Debug" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" >+ cd "..\RASharedMemory" >+ >+"RACommon - X64 DebugCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" RECURSE=1 CLEAN > cd "..\RASharedMemory" > > !ENDIF > >-!IF "$(CFG)" == "RASharedMemory - IA64 Debug" >+!IF "$(CFG)" == "RASharedMemory - IA64 Release" >+ >+"RASocket - IA64 Release" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" >+ cd "..\RASharedMemory" >+ >+"RASocket - IA64 ReleaseCLEAN" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" RECURSE=1 CLEAN >+ cd "..\RASharedMemory" >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - IA64 Debug" > > "RASocket - IA64 Debug" : > cd "..\RASocket" >@@ -250,18 +581,32 @@ > $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Debug" RECURSE=1 CLEAN > cd "..\RASharedMemory" > >-!ELSEIF "$(CFG)" == "RASharedMemory - IA64 Release" >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Release" > >-"RASocket - IA64 Release" : >+"RASocket - X64 Release" : > cd "..\RASocket" >- $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Release" > cd "..\RASharedMemory" > >-"RASocket - IA64 ReleaseCLEAN" : >+"RASocket - X64 ReleaseCLEAN" : > cd "..\RASocket" >- $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" RECURSE=1 CLEAN >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Release" RECURSE=1 CLEAN >+ cd "..\RASharedMemory" >+ >+!ELSEIF "$(CFG)" == "RASharedMemory - X64 Debug" >+ >+"RASocket - X64 Debug" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Debug" >+ cd "..\RASharedMemory" >+ >+"RASocket - X64 DebugCLEAN" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Debug" RECURSE=1 CLEAN > cd "..\RASharedMemory" > > !ENDIF > >+ > !ENDIF >+ >Index: src-native-new/src/transport/RASharedMemory/version.rc >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/version.rc,v >retrieving revision 1.3 >diff -u -r1.3 version.rc >--- src-native-new/src/transport/RASharedMemory/version.rc 8 Aug 2005 19:32:00 -0000 1.3 >+++ src-native-new/src/transport/RASharedMemory/version.rc 26 Mar 2007 18:35:11 -0000 >@@ -1,4 +1,4 @@ >-#include "tptp/version.h" >+#include "../../../include/tptp/version.h" > //Microsoft Developer Studio generated resource script. > // > #include "resource.h" >Index: src-native-new/src/transport/RASharedMemory/RASharedMemory.make >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASharedMemory/RASharedMemory.make,v >retrieving revision 1.6 >diff -u -r1.6 RASharedMemory.make >--- src-native-new/src/transport/RASharedMemory/RASharedMemory.make 19 Mar 2007 03:14:37 -0000 1.6 >+++ src-native-new/src/transport/RASharedMemory/RASharedMemory.make 26 Mar 2007 18:35:11 -0000 >@@ -44,7 +44,7 @@ > # list of additional libraries to be linked with > # (separated by blanks) > #----------------------------------- >-LIBS := dl hcclco hccls >+LIBS := dl hcclco hccls pthread > > #----------------------------------- > # list of additional library directories to search from >Index: src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.h >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.h >diff -N src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,35 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: AbstractHeapSnapshotManager.h,v 1.3 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef ABSTRACT_HEAP_SNAPSHOT_MANAGER_H >+#define ABSTRACT_HEAP_SNAPSHOT_MANAGER_H >+ >+#include <jvmpi.h> >+#include "HeapSnapshotManager.h" >+#include "SnapshotAgentInterface.h" >+#include "SnapshotFiller.h" >+ >+class AbstractHeapSnapshotManager : public HeapSnapshotManager { >+ public: >+ AbstractHeapSnapshotManager(SnapshotFiller* filler, SnapshotAgentInterface* agent, JVMPI_Interface* jvmpi); >+ protected: >+ SnapshotFiller& filler() const; >+ SnapshotAgentInterface& agent() const; >+ JVMPI_Interface& jvmpi() const; >+ >+ private: >+ SnapshotFiller* _filler; >+ SnapshotAgentInterface* _agent; >+ JVMPI_Interface* _jvmpi; >+}; >+ >+#endif /* ABSTRACT_HEAP_SNAPSHOT_MANAGER_H */ >Index: src-native-new/src/agents/perfmon/PerfmonAgent/resource.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/PerfmonAgent/resource.h >diff -N src-native-new/src/agents/perfmon/PerfmonAgent/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/PerfmonAgent/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/agents/native/java_profiler/hash.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/hash.h >diff -N src-native-new/src/agents/native/java_profiler/hash.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/hash.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,441 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hash.h,v 1.8 2006/04/06 15:48:10 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __HASH_H__ >+#define __HASH_H__ 1 >+ >+#ifdef __linux__ >+ #define _inline inline >+#endif >+ >+#include <jvmpi.h> >+#include "performance.h" >+#include "segmentedValue.h" >+#include "stack.h" >+#include "RABindings.h" >+#include "filters.h" >+ >+ >+#ifdef __cplusplus >+ extern "C" { >+#endif >+ >+/****************************** >+ * Symbol table types and methods >+ ******************************/ >+#define CLASS_HASH_TABLE_SIZE 4999 /* The number of 1st level entries in the CLASS hashtable */ >+#define METHOD_HASH_TABLE_SIZE 10007 /* The number of 1st level entries in the METHOD hashtable */ >+#define OBJECT_HASH_TABLE_SIZE 20011 /* The number of 1st level entries in the OBJECT Thashtable */ >+#define THREAD_HASH_TABLE_SIZE 101 /* The number of 1st level entries in the THREAD hashtable */ >+#define HEAP_HASH_TABLE_SIZE 20011 >+ >+#define ThreadLocalStorage ThreadPrivateStorage >+ >+/* Macros to access the data variants of the symbol table */ >+#define CLASS_ENTRY(hashEntry) ((ClassEntry *)hashEntry->entry) >+#define METHOD_ENTRY(hashEntry) ((MethodEntry *)hashEntry->entry) >+#define OBJECT_ENTRY(hashEntry) ((ObjectEntry *)hashEntry->entry) >+#define THREAD_ENTRY(hashEntry) ((ThreadLocalStorage *)hashEntry->entry) >+#define HEAP_ENTRY(hashEntry) ((HeapEntry *)hashEntry->entry) >+ >+/* The various types that will be stored in the various hashtables */ >+enum EntryType {Class_t, Method_t, Object_t, Thread_t, Heap_t}; >+ >+ >+/* these are the various types of keys that can be used in the hash tables */ >+typedef struct objectHashKey { >+ jobjectID id; >+} ObjectHashKey; >+ >+typedef ObjectHashKey ClassHashKey; >+ >+typedef struct methodHashKey { >+ jmethodID id; >+} MethodHashKey; >+ >+typedef struct threadHashKey { >+ JNIEnv *id; >+} ThreadHashKey; >+ >+ >+/* an entry in the hash table */ >+typedef struct hashEntry >+{ >+ void* id; /* The hash key (ObjectHashKey*, MethodHashKey*, ThreadHashKey* */ >+ unsigned int printed:1; /* Indicates that this symbol has been referenced */ >+ unsigned int deleted:1; /* Indicates that this symbol is deleted */ >+ volatile unsigned int toBeFreed; /* Indicates that this symbol is pending deletion */ >+ void *entry; /* A pointer to the actual entry data */ >+ volatile struct hashEntry *next; /* Hash table collision chain pointer */ >+ struct hashEntry *free; >+} HashEntry; >+ >+/* RKD: Added HashBucket to implement lockless hashtable */ >+typedef struct hashBucket >+{ >+ volatile int count; /* Use count for the chain */ >+ volatile HashEntry *activeQ; /* First HashEntry in the active chain */ >+ volatile HashEntry *deleteQ; /* First HashEntry in the delete chain */ >+}HashBucket; >+ >+/* The original depth of the local stack that mirrors the JVM stack */ >+#define ORIGINAL_STACK_SIZE 40 >+ >+/* Increment the local stack by this amount to avoid stack overflow */ >+#define STACK_INCREMENT_SIZE 20 >+ >+/* The size of the ThreadLocalStorage buffer for IO */ >+#define ORIGINAL_MESSAGE_BUFFER_SIZE 1024 >+ >+/* For pre-aggregation: A stack frame to accumulate time-data along unique call chains */ >+typedef struct _StackFrame >+{ >+ HashEntry *methodHashEntry; >+ >+ timestamp_t baseTime; >+ timestamp_t baseCPUTime; >+ timestamp_t minTime; >+ timestamp_t maxTime; >+ >+ timestamp_t filteredMethodsBaseTime; >+ timestamp_t filteredMethodsBaseCPUTime; >+ >+ struct _StackFrame * calledList; >+ struct _StackFrame * next; >+ struct _StackFrame * caller; >+ unsigned int numCalls; >+} StackFrame; >+ >+/* A single entry on the stack */ >+typedef struct >+{ >+ SegmentedValue_t ticket; >+ HashEntry *objectHashEntry; >+ Uint64 cpuTime; >+ timestamp_t timestamp; >+ HashEntry *methodHashEntry; >+ unsigned int currentBoundaryDepth; >+ unsigned int printed:1; /* Whether this entry was printed */ >+ unsigned int trigger:1; /* Whether this entry was a trigger */ >+ unsigned int entryEventSeen:1; /* Whether this stack frame is the begining of the trace */ >+ unsigned int realFrame:1; /* pre-agg: a flag, true when this is a "real" frame, false when it represents a filtered-out function */ >+ struct ThreadPrivateStorage *tps; >+ Uint64 cumulative_overhead; /* the total tracing overhead of this invocation */ >+ Uint64 cumulative_cpu_overhead; /* the total tracing overhead of this invocation (cpu time) */ >+ StackFrame* stackFrame; /* pre-agg: the frame in the unique call chain database for this active frame */ >+ timestamp_t baseTime; /* pre-agg: time so far in this active frame */ >+ timestamp_t cumulativeTime; /* pre-agg: time so far in this active frame plus its children */ >+ timestamp_t lastEntryTime; /* pre-agg: the last time this frame was entered, e.g. when the last call to a child returned. */ >+ timestamp_t baseCPUTime; /* pre-agg: CPU time so far in this active frame */ >+ timestamp_t lastEntryCPUTime; /* pre-agg: the last CPU time this frame was entered, e.g. when the last call to a child returned. */ >+} StackEntry; >+ >+typedef int (*HashIteratorFunction)(HashEntry * hashEntry, void *parm); >+ >+typedef struct hashtable >+{ >+#ifdef _DEBUG /* Various hashtable metrics for debugging */ >+ unsigned long findSymbolCount; >+ unsigned long findSymbolFound; >+ unsigned long findSymbolNotFound; >+ unsigned long hashHitCount; >+ unsigned long hashMissCount; >+ unsigned long hashMissLength; >+ unsigned long createCount; >+ unsigned long deleteCount; >+ unsigned long moveCount; >+#endif >+ unsigned long size; >+ unsigned long entryCount; >+ enum EntryType type; >+ HashBucket *entries; >+ int (*compare)(void *, void *); /* compares two hash keys in a hash entry; return 0 iff keys are equal */ >+ unsigned long (*hash)(void *); /* hash a key */ >+ void (*assign)(void *,void*); /* assign the value of the second key to the first */ >+} Hashtable; >+ >+ >+typedef struct ThreadPrivateStorage >+{ >+ unsigned int threadStartEventSeen : 1; /* Whether this thread recieved a THREAD_START or was synthetically created - 170752 - long not supported on 390 */ >+ unsigned int threadStackKnown : 1; /* Whether the stack has been materialized previously */ >+ unsigned int scrubbingHeap:1; >+ unsigned int disableEventsForThisThread:1; /* Disables events for this thread */ >+ unsigned int mode:1; /* Determines the behaviour of the event handlers. (i.e. A handler may behave differently depending on the mode of this thread) */ >+ jobjectID threadId; /* The thread ID */ >+ unsigned long staticThreadId; /* The thread static ID */ >+ unsigned long currentStackSize; /* The size of the stack memory segment */ >+ unsigned long tos; /* The current depth of the stack */ >+ unsigned int boundaryDepth; /* The current boundary depth for this thread */ >+ SegmentedValue_t ticket; /* The ticket counter for this thread */ >+ char *buffer; /* The storage buffer pointer */ >+#ifdef __OS400__ >+ char *buffer2; /* buffer for etoa scratch space on as400 */ >+#endif >+ char *threadName; /* The name of the thread */ >+ char *groupName; /* The name of the thread group */ >+ char *parentName; /* The nmae of the parent thread */ >+ JNIEnv *env; >+ StackEntry *stackEntry; >+ SegmentedValue_t collation; >+ jobjectID monitorObj; /* used when performing monitor dumps */ >+ unsigned long ownerThread; /* used when performing monitor dumps */ >+ void *agent_extension_slot; /* a void* usable by an agent extension */ >+ StackFrame* calledList; /* pre-aggregation: the list of top-level frames called from this thread */ >+ timestamp_t last_cpu_timestamp; /* pre-aggregation: the CPU time of the most recent event on this thread */ >+} ThreadPrivateStorage; >+ >+ >+typedef struct { >+ char *field_name; /* name of field */ >+ char *field_signature; /* signature of field */ >+ unsigned long fieldId; >+} PI_Field; >+ >+ >+typedef struct classEntry >+{ >+ unsigned int traceFlag:1; /* Indicates whether this entry has passed the filter tests */ >+ unsigned int arrayClass:1; /* Indicates whether this class represents a primitive array */ >+ jobjectID classId; /* The class ID */ >+ unsigned long static_id; /* an id that does not change wrt class unloads */ >+ jint numInterfaces; /* Number of interfaces this class implements */ >+ jint numMethods; /* Number of methods this class contains */ >+ jint numStaticFields; /* The number of static fields in this class */ >+ jint numInstanceFields; /* The number of fields that each instance has */ >+ HashEntry *classObject; /* Pointer to the object which is the class object for this class */ >+ HashEntry *superClassEntry; /* Ptr to superclass class hash tbl entry, if any */ >+ char * className; /* The class name */ >+ char * sourceName; /* The source file name */ >+ char *classLoaderName; /* The name of the class loader */ >+ char *superClassName; /* The name of the super class */ >+ char *nameOfInterfaces; /* The name of interfaces implemented (separated by a comma). */ >+ PI_Field *statics; /* Array of statics */ >+ PI_Field *instances; /* Array of instances */ >+ JVMPI_Method *methods; /* Array of methods */ >+ timestamp_t timestamp; /* capture the time of the class_load event */ >+ SegmentedValue_t collation; /* capture the collation value of the class_load event */ >+} ClassEntry; >+ >+ >+typedef struct methodEntry >+{ >+ unsigned int traceFlag:1; /* Indicates whether this method is being traced (TraceModeStartFilter) */ >+ unsigned int trigger:1; /* Indicates whether this method is a trigger (TraceModeStartTrigger) */ >+ unsigned int detailsComplete:1;/* Indicates if the following fields are filled */ >+ unsigned int isNative:1; >+ unsigned int isAbstract:1; >+ unsigned int isStatic:1; >+ unsigned int isSynchronized:1; >+ unsigned int isPublic:1; >+ unsigned int isPrivate:1; >+ unsigned int isProtected:1; >+ unsigned long static_id; /* The un-changing id for this method */ >+ unsigned long methodCount; /* A counter for coverage purposes */ >+ HashEntry * classHashEntry; /* A pointer back to the hashtable entry for the containing class */ >+ char *exceptions; >+ JVMPI_Method methodData; /* A copy of the JVMPI method data structure */ >+ SegmentedValue_t collation; /* capture the collation value of the event */ >+} MethodEntry; >+ >+ >+typedef struct objectEntry >+{ >+ unsigned int traceFlag:1; /* Indicates whether this object is being traced */ >+ unsigned int foundInHeap:1; /* Indicates whether this object was found in the heap while scrubbing */ >+ unsigned int notFoundInHeap:4; /* Indicates number of times object was not found in heap */ >+ unsigned int classObject:1; /* Is this object a class object? */ >+ unsigned int allocationSeen:1; /* Was the allocation event seen for this object */ >+ unsigned int heapDumpIndex:8; /* The heap dump where this object was first seen at (256 posibilities)*/ >+ unsigned int is_array:1; /* JVMPI_NORMAL_OBJECT, ... (up to 16 posibilities) */ >+ unsigned int unusedBits:15; /* UNUSED BITS */ >+ HashEntry *classHashEntry; /* The class definition for this object */ >+ HashEntry *classHashEntry2; /* The class definition for which this is a class object (only if classObject==1) */ >+ jsize size; /* size in number of bytes */ /* fix 89008: change from jint */ >+ unsigned long static_id; /* an id that does not change wrt garbage collection */ >+ SegmentedValue_t collation; /* capture the collation value of the OBJ_ALLOC event */ >+} ObjectEntry; >+ >+ >+/** INITIALIZE_SYMBOL_TABLE *************************************************** >+ * Setup the hashtables. Since the buckets are statically declared, they will >+ * already be null-ed. >+ */ >+void jvmpiAgent_InitializeSymbolTable(); >+ >+void jvmpiAgent_SetTracingFlagsOnPrimitives(); >+ >+ >+/** FIND_SYMBOL ************************************************************** >+ * Find an entry in the symbol table based upon its Id. >+ * @param id - the id provided by the JVMPI_Event >+ * @param entryType - the type to look up be it Class/Method/Object/Thread >+ * @returns - the address of a HashEntry struct containing the result >+ * of the lookup >+ */ >+HashEntry * jvmpiAgent_FindObjectSymbolFast(jobjectID id); >+HashEntry * jvmpiAgent_FindObjectSymbol(jobjectID id); >+HashEntry * jvmpiAgent_FindThreadSymbol(JNIEnv * id); >+HashEntry * jvmpiAgent_FindClassSymbol(jobjectID id); >+HashEntry * jvmpiAgent_FindMethodSymbol(jmethodID id); >+ >+/* Bug Number 73480 */ >+#ifdef __OS400__ >+void insertClassOptSymbol(HashEntry *hashEntry) ; >+#endif >+ >+/** FindObjectSymbolWithAllocateAndPrint >+ * >+ * Look up object in the VM if it doesn't exist in the hash table and make sure it is printed >+ * to the trace. >+ * >+ * args - >+ * env_id - thread which to associate with the object allocation (if it has yet to be printed) >+ * object_id - the object we are looking for >+ * >+ * returns - >+ * the hash entry corresponding to the given object >+ */ >+HashEntry* >+jvmpiAgent_FindObjectSymbolWithAllocateAndPrint(JNIEnv *env_id, jobjectID object_id); >+ >+/** FIND_OBJECT_SYMBOL_WITH_ALLOCATE ************************************** >+ * Find a symbol in Object hashtable and create an entry if it does not exist. >+ */ >+HashEntry * jvmpiAgent_FindObjectSymbolWithAllocate(jobjectID id, >+ JNIEnv *env_id); >+ >+/** DELETE_SYMBOL ************************************************************** >+ * Remove an entry in the symbol table and free the memory associated with the >+ * entry. >+ * @param hashEntry - the entry in the table to delete. >+ */ >+void jvmpiAgent_DeleteSymbol(HashEntry *hashEntry, >+ enum EntryType type); >+ >+/** MOVE_SYMBOL **************************************************************** >+ * Change the id of an element in the symbol table. >+ * @param hashEntry - the current entry in the table. >+ * @param id - the current symbol id >+ * @param newId - the new symbol Id. >+ */ >+void jvmpiAgent_MoveSymbol(HashEntry *hashEntry, >+ enum EntryType type, >+ void *id, void* newId); >+ >+/** CREATE_THREAD_SYMBOL ***************************************************** >+ * >+ */ >+HashEntry * jvmpiAgent_CreateThreadSymbol(JNIEnv* id); >+ >+/** CREATE_CLASS_SYMBOL ****************************************************** >+ * >+ */ >+HashEntry * jvmpiAgent_CreateClassSymbol(JVMPI_Event *event, ThreadLocalStorage *tps, Filter *filterInfo); >+ >+/** CREATE_OBJECT_SYMBOL ***************************************************** >+ * >+ */ >+HashEntry * jvmpiAgent_CreateObjectSymbol(JVMPI_Event *event, >+ BOOL allocatedOnTracedStackframe, >+ BOOL allocationEventSeen); >+ >+void jvmpiAgent_clearAllPrintFlags(); >+ >+void jvmpiAgent_resetTraceFlags(); >+ >+void jvmpiAgent_analyseHeap(JVMPI_Event *event, char* heapDefName); >+ >+/* unsigned long jvmpiAgent_analyseMonitorDump(JVMPI_Event *event, jobjectID monitorObj) >+ >+ Determines the owner thread of the monitor represented >+ by monitorObj by analysing the monitor dump. >+ >+ args - >+ event - the monitor dump event as reported by JVMPI >+ monitorObj - the monitor for which we wish to determine the owner thread >+ >+ returns >+ the id of the thread that owns the given monitor >+*/ >+ >+unsigned long jvmpiAgent_analyseMonitorDump(JVMPI_Event *event, jobjectID monitorObj); >+ >+void jvmpiAgent_markHeap(JVMPI_Event *event); >+ >+HashEntry *jvmpiAgent_getPrimativeClassEntry(jint arrayType); >+ >+ >+void jvmpiAgent_ForAll(enum EntryType type, HashIteratorFunction fn, void *parm); >+ >+/** CREATE_STACK ************************************************************* >+ * >+ */ >+HashEntry * jvmpiAgent_CreateStack(JNIEnv * env_id); >+ >+/** DESTROY_STACK ************************************************************ >+ * >+ */ >+void jvmpiAgent_DestroyStack(JNIEnv *env_id); >+ >+/** PUSH ********************************************************************* >+ */ >+StackEntry * jvmpiAgent_Push(ThreadPrivateStorage *tps, >+ JNIEnv *env_id, >+ HashEntry *methodHashEntry, >+ HashEntry *objectHashEntry, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp); >+ >+/** POP ********************************************************************** >+ * >+ */ >+void jvmpiAgent_Pop(ThreadPrivateStorage *tps); >+ >+/** PEEK ********************************************************************* >+ * >+ */ >+StackEntry * jvmpiAgent_Peek(ThreadPrivateStorage *tps, >+ int offset); >+ >+ >+/* Pre-Aggregation: Create a stack frame */ >+void jvmpiAgent_CreateStackFrame(ThreadPrivateStorage * tps, >+ HashEntry *methodHashEntry, >+ StackEntry* caller); >+ >+/* Pre-Aggregation: Adjust a filtered-out method's stack frame to the parent */ >+void jvmpiAgent_AdjustStackFrame(ThreadPrivateStorage * tps); >+ >+/* Pre-Aggregation: Roll up a stack entry's data into its frame and its caller */ >+void jvmpiAgent_agPop(StackEntry* entry); >+ >+unsigned long jvmpiAgent_TOS(ThreadPrivateStorage *tps); >+ >+unsigned long jvmpiAgent_StackDepth(ThreadPrivateStorage *tps); >+ >+/** createPrimitiveTypes() >+ * >+ * Used to generate the primitive types in the hashtable. >+ */ >+void createPrimitiveTypes(); >+ >+#ifdef _DEBUG >+ unsigned int jvmpiAgent_getHashTableEntryCount(enum EntryType entryType); >+ void jvmpiAgent_DumpHashTableStatistics(); >+#endif >+ >+#ifdef __cplusplus >+ } >+#endif >+ >+#endif >Index: src-native-new/src/agents/native/java_profiler/resource.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/resource.h >diff -N src-native-new/src/agents/native/java_profiler/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,22 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+/* Next default values for new objects */ >+ >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/agents/native/WinBuild/java_profiler.mak64 >=================================================================== >RCS file: src-native-new/src/agents/native/WinBuild/java_profiler.mak64 >diff -N src-native-new/src/agents/native/WinBuild/java_profiler.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/WinBuild/java_profiler.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,842 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on java_profiler.dsp >+!IF "$(CFG)" == "" >+CFG=java_profiler - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to java_profiler - IA64 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "java_profiler - IA64 Release" && "$(CFG)" != "java_profiler - IA64 Debug" && "$(CFG)" != "java_profiler - X64 Release" && "$(CFG)" != "java_profiler - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "java_profiler.mak64" CFG="java_profiler - IA64 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "java_profiler - IA64 Release" >+!MESSAGE "java_profiler - IA64 Debug" >+!MESSAGE "java_profiler - X64 Release" >+!MESSAGE "java_profiler - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\piAgent.dll" >+ >+!ELSE >+ >+ALL : "heapsnapshots - IA64 Release" "$(OUTDIR)\piAgent.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"heapsnapshots - IA64 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\agentDebug.obj" >+ -@erase "$(INTDIR)\filters.obj" >+ -@erase "$(INTDIR)\hash.obj" >+ -@erase "$(INTDIR)\JvmpiWriter.obj" >+ -@erase "$(INTDIR)\options.obj" >+ -@erase "$(INTDIR)\performance.obj" >+ -@erase "$(INTDIR)\piagent.res" >+ -@erase "$(INTDIR)\print.obj" >+ -@erase "$(INTDIR)\segmentedValue.obj" >+ -@erase "$(INTDIR)\stack.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" >+ -@erase "$(INTDIR)\utility.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\piAgent.dll" >+ -@erase "$(OUTDIR)\..\lib\piAgent.exp" >+ -@erase "$(OUTDIR)\..\lib\piAgent.lib" >+ -@erase ".\Release\piAgent.map" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP_PROJ=/nologo /MT /W3 /O2 /Ob2 /I "$(JAVA_HOME)\include" /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /I "..\..\..\transport\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /Fp"$(INTDIR)\java_profiler.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\piagent.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /map:"$(INTDIR)\piAgent.map" /out:"$(OUTDIR)\piAgent.dll" /implib:"$(OUTDIR)\..\lib\piAgent.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\agentDebug.obj" \ >+ "$(INTDIR)\filters.obj" \ >+ "$(INTDIR)\hash.obj" \ >+ "$(INTDIR)\JvmpiWriter.obj" \ >+ "$(INTDIR)\options.obj" \ >+ "$(INTDIR)\performance.obj" \ >+ "$(INTDIR)\print.obj" \ >+ "$(INTDIR)\segmentedValue.obj" \ >+ "$(INTDIR)\stack.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" \ >+ "$(INTDIR)\utility.obj" \ >+ "$(INTDIR)\piagent.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\heapsnapshots.lib" >+ >+"$(OUTDIR)\piAgent.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\piAgent.dll" >+ >+!ELSE >+ >+ALL : "heapsnapshots - IA64 Debug" "$(OUTDIR)\piAgent.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"heapsnapshots - IA64 DebugCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\agentDebug.obj" >+ -@erase "$(INTDIR)\agentDebug.sbr" >+ -@erase "$(INTDIR)\filters.obj" >+ -@erase "$(INTDIR)\filters.sbr" >+ -@erase "$(INTDIR)\hash.obj" >+ -@erase "$(INTDIR)\hash.sbr" >+ -@erase "$(INTDIR)\JvmpiWriter.obj" >+ -@erase "$(INTDIR)\JvmpiWriter.sbr" >+ -@erase "$(INTDIR)\options.obj" >+ -@erase "$(INTDIR)\options.sbr" >+ -@erase "$(INTDIR)\performance.obj" >+ -@erase "$(INTDIR)\performance.sbr" >+ -@erase "$(INTDIR)\piagent.res" >+ -@erase "$(INTDIR)\print.obj" >+ -@erase "$(INTDIR)\print.sbr" >+ -@erase "$(INTDIR)\segmentedValue.obj" >+ -@erase "$(INTDIR)\segmentedValue.sbr" >+ -@erase "$(INTDIR)\stack.obj" >+ -@erase "$(INTDIR)\stack.sbr" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.sbr" >+ -@erase "$(INTDIR)\utility.obj" >+ -@erase "$(INTDIR)\utility.sbr" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\piAgent.dll" >+ -@erase "$(OUTDIR)\..\lib\piAgent.exp" >+ -@erase "$(OUTDIR)\..\lib\piAgent.ilk" >+ -@erase "$(OUTDIR)\..\lib\piAgent.lib" >+ -@erase "$(OUTDIR)\..\lib\piAgent.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP_PROJ=/nologo /MTd /W3 /Gm /Zi /Od /I "$(JAVA_HOME)\include" /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /I "..\..\..\transport\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\java_profiler.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\piagent.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\piAgent.pdb" /debug /out:"$(OUTDIR)\piAgent.dll" /implib:"$(OUTDIR)\..\lib\piAgent.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\agentDebug.obj" \ >+ "$(INTDIR)\filters.obj" \ >+ "$(INTDIR)\hash.obj" \ >+ "$(INTDIR)\JvmpiWriter.obj" \ >+ "$(INTDIR)\options.obj" \ >+ "$(INTDIR)\performance.obj" \ >+ "$(INTDIR)\print.obj" \ >+ "$(INTDIR)\segmentedValue.obj" \ >+ "$(INTDIR)\stack.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" \ >+ "$(INTDIR)\utility.obj" \ >+ "$(INTDIR)\piagent.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\heapsnapshots.lib" >+ >+"$(OUTDIR)\piAgent.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\piAgent.dll" >+ >+!ELSE >+ >+ALL : "heapsnapshots - X64 Release" "$(OUTDIR)\piAgent.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"heapsnapshots - X64 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\agentDebug.obj" >+ -@erase "$(INTDIR)\filters.obj" >+ -@erase "$(INTDIR)\hash.obj" >+ -@erase "$(INTDIR)\JvmpiWriter.obj" >+ -@erase "$(INTDIR)\options.obj" >+ -@erase "$(INTDIR)\performance.obj" >+ -@erase "$(INTDIR)\piagent.res" >+ -@erase "$(INTDIR)\print.obj" >+ -@erase "$(INTDIR)\segmentedValue.obj" >+ -@erase "$(INTDIR)\stack.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" >+ -@erase "$(INTDIR)\utility.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\piAgent.dll" >+ -@erase "$(OUTDIR)\..\lib\piAgent.exp" >+ -@erase "$(OUTDIR)\..\lib\piAgent.lib" >+ -@erase ".\Release\piAgent.map" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP_PROJ=/nologo /MT /W3 /O2 /Ob2 /I "$(JAVA_HOME)\include" /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /I "..\..\..\transport\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /Fp"$(INTDIR)\java_profiler.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\piagent.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /map:"$(INTDIR)\piAgent.map" /out:"$(OUTDIR)\piAgent.dll" /implib:"$(OUTDIR)\..\lib\piAgent.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\agentDebug.obj" \ >+ "$(INTDIR)\filters.obj" \ >+ "$(INTDIR)\hash.obj" \ >+ "$(INTDIR)\JvmpiWriter.obj" \ >+ "$(INTDIR)\options.obj" \ >+ "$(INTDIR)\performance.obj" \ >+ "$(INTDIR)\print.obj" \ >+ "$(INTDIR)\segmentedValue.obj" \ >+ "$(INTDIR)\stack.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" \ >+ "$(INTDIR)\utility.obj" \ >+ "$(INTDIR)\piagent.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\heapsnapshots.lib" >+ >+"$(OUTDIR)\piAgent.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\piAgent.dll" >+ >+!ELSE >+ >+ALL : "heapsnapshots - X64 Debug" "$(OUTDIR)\piAgent.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"heapsnapshots - X64 DebugCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\agentDebug.obj" >+ -@erase "$(INTDIR)\agentDebug.sbr" >+ -@erase "$(INTDIR)\filters.obj" >+ -@erase "$(INTDIR)\filters.sbr" >+ -@erase "$(INTDIR)\hash.obj" >+ -@erase "$(INTDIR)\hash.sbr" >+ -@erase "$(INTDIR)\JvmpiWriter.obj" >+ -@erase "$(INTDIR)\JvmpiWriter.sbr" >+ -@erase "$(INTDIR)\options.obj" >+ -@erase "$(INTDIR)\options.sbr" >+ -@erase "$(INTDIR)\performance.obj" >+ -@erase "$(INTDIR)\performance.sbr" >+ -@erase "$(INTDIR)\piagent.res" >+ -@erase "$(INTDIR)\print.obj" >+ -@erase "$(INTDIR)\print.sbr" >+ -@erase "$(INTDIR)\segmentedValue.obj" >+ -@erase "$(INTDIR)\segmentedValue.sbr" >+ -@erase "$(INTDIR)\stack.obj" >+ -@erase "$(INTDIR)\stack.sbr" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.sbr" >+ -@erase "$(INTDIR)\utility.obj" >+ -@erase "$(INTDIR)\utility.sbr" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\piAgent.dll" >+ -@erase "$(OUTDIR)\..\lib\piAgent.exp" >+ -@erase "$(OUTDIR)\..\lib\piAgent.ilk" >+ -@erase "$(OUTDIR)\..\lib\piAgent.lib" >+ -@erase "$(OUTDIR)\..\lib\piAgent.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP_PROJ=/nologo /MTd /W3 /Gm /Zi /Od /I "$(JAVA_HOME)\include" /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /I "..\..\..\transport\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\java_profiler.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\piagent.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\piAgent.pdb" /debug /out:"$(OUTDIR)\piAgent.dll" /implib:"$(OUTDIR)\..\lib\piAgent.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\agentDebug.obj" \ >+ "$(INTDIR)\filters.obj" \ >+ "$(INTDIR)\hash.obj" \ >+ "$(INTDIR)\JvmpiWriter.obj" \ >+ "$(INTDIR)\options.obj" \ >+ "$(INTDIR)\performance.obj" \ >+ "$(INTDIR)\print.obj" \ >+ "$(INTDIR)\segmentedValue.obj" \ >+ "$(INTDIR)\stack.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" \ >+ "$(INTDIR)\utility.obj" \ >+ "$(INTDIR)\piagent.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\heapsnapshots.lib" >+ >+"$(OUTDIR)\piAgent.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" || "$(CFG)" == "java_profiler - IA64 Debug" || "$(CFG)" == "java_profiler - X64 Release" || "$(CFG)" == "java_profiler - X64 Debug" >+SOURCE=..\java_profiler\agentDebug.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\agentDebug.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\agentDebug.obj" "$(INTDIR)\agentDebug.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\agentDebug.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\agentDebug.obj" "$(INTDIR)\agentDebug.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\filters.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\filters.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\filters.obj" "$(INTDIR)\filters.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\filters.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\filters.obj" "$(INTDIR)\filters.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\hash.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\JvmpiWriter.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\JvmpiWriter.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\JvmpiWriter.obj" "$(INTDIR)\JvmpiWriter.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\JvmpiWriter.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\JvmpiWriter.obj" "$(INTDIR)\JvmpiWriter.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\options.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\options.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\options.obj" "$(INTDIR)\options.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\options.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\options.obj" "$(INTDIR)\options.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\performance.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\performance.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\performance.obj" "$(INTDIR)\performance.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\performance.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\performance.obj" "$(INTDIR)\performance.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\print.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\print.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\print.obj" "$(INTDIR)\print.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\print.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\print.obj" "$(INTDIR)\print.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\segmentedValue.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\segmentedValue.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\segmentedValue.obj" "$(INTDIR)\segmentedValue.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\segmentedValue.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\segmentedValue.obj" "$(INTDIR)\segmentedValue.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\stack.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\stack.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\stack.obj" "$(INTDIR)\stack.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\stack.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\stack.obj" "$(INTDIR)\stack.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\StatelessHeapSnapshotManager_C.cpp >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\StatelessHeapSnapshotManager_C.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\StatelessHeapSnapshotManager_C.obj" "$(INTDIR)\StatelessHeapSnapshotManager_C.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\StatelessHeapSnapshotManager_C.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\StatelessHeapSnapshotManager_C.obj" "$(INTDIR)\StatelessHeapSnapshotManager_C.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\utility.c >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\utility.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\utility.obj" "$(INTDIR)\utility.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\utility.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\utility.obj" "$(INTDIR)\utility.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\version.rc >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+ >+"$(INTDIR)\piagent.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\piagent.res" /i "..\java_profiler" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+ >+"$(INTDIR)\piagent.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\piagent.res" /i "..\java_profiler" /d "_DEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+ >+"$(INTDIR)\piagent.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\piagent.res" /i "..\java_profiler" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+ >+"$(INTDIR)\piagent.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\piagent.res" /i "..\java_profiler" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+!IF "$(CFG)" == "java_profiler - IA64 Release" >+ >+"heapsnapshots - IA64 Release" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - IA64 Release" >+ cd "." >+ >+"heapsnapshots - IA64 ReleaseCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - IA64 Release" RECURSE=1 CLEAN >+ cd "." >+ >+!ELSEIF "$(CFG)" == "java_profiler - IA64 Debug" >+ >+"heapsnapshots - IA64 Debug" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - IA64 Debug" >+ cd "." >+ >+"heapsnapshots - IA64 DebugCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - IA64 Debug" RECURSE=1 CLEAN >+ cd "." >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Release" >+ >+"heapsnapshots - X64 Release" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - X64 Release" >+ cd "." >+ >+"heapsnapshots - X64 ReleaseCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - X64 Release" RECURSE=1 CLEAN >+ cd "." >+ >+!ELSEIF "$(CFG)" == "java_profiler - X64 Debug" >+ >+"heapsnapshots - X64 Debug" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - X64 Debug" >+ cd "." >+ >+"heapsnapshots - X64 DebugCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak64 CFG="heapsnapshots - X64 Debug" RECURSE=1 CLEAN >+ cd "." >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/sysperf/resource.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/sysperf/resource.h >diff -N src-native-new/src/agents/perfmon/sysperf/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/sysperf/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/agents/native/java_profiler/hash.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/hash.c >diff -N src-native-new/src/agents/native/java_profiler/hash.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/hash.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3017 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hash.c,v 1.6 2006/05/16 18:50:16 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <stdlib.h> >+#include <string.h> >+#include <assert.h> >+#ifdef __OS400__ >+ /* no malloc.h needed */ >+#elif MVS >+ /* no malloc.h needed */ >+#else >+ #include <malloc.h> >+#endif >+#include "hash.h" >+#include "RADataTransfer.h" >+#include "RAComm.h" >+#include "JvmpiWriter.h" >+#include "print.h" >+#include "options.h" >+#include "utility.h" >+ >+#if defined(__OS400__) || defined(__powerpc64__) || defined(_WIN64) /*ts. bug 120479*/ >+static ra_critsec_t _lock; /* 232010 */ >+#endif >+ >+/* The Hashtables for each of the types */ >+static Hashtable _classHashtable; >+static Hashtable _methodHashtable; >+static Hashtable _objectHashtable; >+static Hashtable _threadHashtable; >+ >+/* The Hashtable entries */ >+static HashBucket _classEntries[CLASS_HASH_TABLE_SIZE]; >+static HashBucket _methodEntries[METHOD_HASH_TABLE_SIZE]; >+static HashBucket _objectEntries[OBJECT_HASH_TABLE_SIZE]; >+static HashBucket _threadEntries[THREAD_HASH_TABLE_SIZE]; >+ >+/* The classhashEntries for each of the primatives */ >+static HashEntry *_booleanClass; >+static HashEntry *_byteClass; >+static HashEntry *_charClass; >+static HashEntry *_shortClass; >+static HashEntry *_intClass; >+static HashEntry *_longClass; >+static HashEntry *_floatClass; >+static HashEntry *_doubleClass; >+ >+ >+static unsigned long _staticIdCount = 1; >+static unsigned long _fieldIdCount = 0; >+extern GenerationInfo_t _heapDumpInfo; >+ >+#define DUMP_READ(buf, current, size) memcpy(buf, *current, size); *current+= size >+ >+#define SIZEOF_U1 1 >+#define SIZEOF_U2 2 >+#define SIZEOF_U4 4 >+ >+/* The following variables are constantly used when class/method detail option is set. Therefore their values are cached. */ >+static jclass javaClass, methodClass, modifierClass; >+static jmethodID forNameID, getDeclaredMethodID, getModifiersID, isPublicID, isProtectedID, isPrivateID; >+static jmethodID isStaticID, isNativeID, isSynchronizedID, isAbstractID, getExceptionTypesID, getNameID; >+static jmethodID getClassLoaderID, getClassID, getSuperclassID, getInterfacesID; >+ >+static int isCachedVarsSet = 0; >+unsigned const int MAX_EXCEPTION_LENGTH = 250, MAX_PARAM = 40, MAX_PARAM_NAME = 200; >+char *exceptionNames, *parameters, *tmpStorage, **param; >+ >+int _requestClassObj = 0; /* used to flag when a object_alloc is being performed on a class object */ >+ >+ >+jobjectArray findParamType(JVMPI_Event *event, char *methodSignature, int *exceptionOccurred); >+void swapDelimiters (char *name); >+ >+ >+ >+/** HASH_FUNCTION ************************************************************* >+ * Find the bucket this id will belong in. >+ */ >+static _inline unsigned long hash_function(Hashtable *table, jint id) >+{ >+ return (unsigned long)id % table->size; >+} >+ >+static _inline unsigned long object_hash_function(void *id) >+{ >+ return ((unsigned long)((ObjectHashKey*) id)->id) % OBJECT_HASH_TABLE_SIZE; >+} >+static _inline unsigned long class_hash_function(void *id) >+{ >+ return ((unsigned long)((ClassHashKey*) id)->id) % CLASS_HASH_TABLE_SIZE; >+} >+static _inline unsigned long method_hash_function(void *id) >+{ >+ return ((unsigned long)((MethodHashKey*) id)->id) % METHOD_HASH_TABLE_SIZE; >+} >+static _inline unsigned long thread_hash_function(void *id) >+{ >+ return ((unsigned long)((ThreadHashKey *) id)->id) % THREAD_HASH_TABLE_SIZE; >+} >+ >+int objectKeyCompare(void *id1, void *id2) { >+ ObjectHashKey *k1; >+ ObjectHashKey *k2; >+ k1 = (ObjectHashKey *) id1; >+ k2 = (ObjectHashKey *) id2; >+ return !(k1->id == k2->id); /* return 0 iff keys equal */ >+} >+ >+int classKeyCompare(void *id1, void *id2) { >+ return objectKeyCompare(id1,id2); /* class keys are just object keys */ >+} >+ >+int methodKeyCompare(void *id1, void *id2) { >+ MethodHashKey *k1; >+ MethodHashKey *k2; >+ k1 = (MethodHashKey *) id1; >+ k2 = (MethodHashKey *) id2; >+ return !(k1->id == k2->id); /* return 0 iff keys equal */ >+} >+ >+int threadKeyCompare(void *id1, void *id2) { >+ ThreadHashKey *k1; >+ ThreadHashKey *k2; >+ k1 = (ThreadHashKey *) id1; >+ k2 = (ThreadHashKey *) id2; >+ return !(k1->id == k2->id); /* return 0 iff keys equal */ >+} >+ >+void threadKeyAssign(void *id1, void *id2) { >+ ((ThreadHashKey *)id1)->id = ((ThreadHashKey *)id2)->id; >+} >+ >+void objectKeyAssign(void *id1, void *id2) { >+ ((ObjectHashKey *)id1)->id = ((ObjectHashKey *)id2)->id; >+} >+ >+void classKeyAssign(void *id1, void *id2) { >+ ((ClassHashKey *)id1)->id = ((ClassHashKey *)id2)->id; >+} >+ >+void methodKeyAssign(void *id1, void *id2) { >+ ((MethodHashKey *)id1)->id = ((MethodHashKey *)id2)->id; >+} >+ >+/** CREATE_SYMBOL ************************************************************* >+ * >+ */ >+static HashEntry * jvmpiAgent_CreateSymbol(void *id) >+{ >+ /* Create a new hash entry and then insert it into the hash table */ >+ HashEntry * hashEntry = (HashEntry *)jvmpiAgent_Calloc(sizeof(HashEntry)); >+ hashEntry->id=id; >+ hashEntry->printed=0; >+ hashEntry->deleted= 0; >+ hashEntry->toBeFreed=0; >+ hashEntry->next=NULL; >+ return hashEntry; >+} >+ >+ >+/** FREE_SYMBOL *************************************************************** >+ * >+ */ >+void freeSymbol(HashEntry *hashEntry, enum EntryType entryType) >+{ >+ /* Free up all the fields */ >+ switch(entryType) >+ { >+ int i; >+ case Class_t: >+ >+ if(CLASS_ENTRY(hashEntry)->className) free(CLASS_ENTRY(hashEntry)->className); >+ if(CLASS_ENTRY(hashEntry)->sourceName) free(CLASS_ENTRY(hashEntry)->sourceName); >+ if(CLASS_ENTRY(hashEntry)->methods) free(CLASS_ENTRY(hashEntry)->methods); >+ /* Free PR */ >+ if (CLASS_ENTRY(hashEntry)->statics) >+ { >+ /*clean up static array */ >+ for (i=0; i<CLASS_ENTRY(hashEntry)->numStaticFields; i++) >+ { >+ if (CLASS_ENTRY(hashEntry)->statics[i].field_name) >+ { >+ free(CLASS_ENTRY(hashEntry)->statics[i].field_name); >+ CLASS_ENTRY(hashEntry)->statics[i].field_name = NULL; >+ } >+ if (CLASS_ENTRY(hashEntry)->statics[i].field_signature) >+ { >+ free(CLASS_ENTRY(hashEntry)->statics[i].field_signature); >+ CLASS_ENTRY(hashEntry)->statics[i].field_signature = NULL; >+ } >+ } >+ free(CLASS_ENTRY(hashEntry)->statics); >+ CLASS_ENTRY(hashEntry)->statics = NULL; >+ } >+ >+ if (CLASS_ENTRY(hashEntry)->instances) >+ { >+ /* clean up instance array */ >+ for (i=0; i<CLASS_ENTRY(hashEntry)->numInstanceFields; i++) >+ { >+ if (CLASS_ENTRY(hashEntry)->instances[i].field_name) >+ { >+ free(CLASS_ENTRY(hashEntry)->instances[i].field_name); >+ CLASS_ENTRY(hashEntry)->instances[i].field_name = NULL; >+ } >+ if (CLASS_ENTRY(hashEntry)->instances[i].field_signature) >+ { >+ free(CLASS_ENTRY(hashEntry)->instances[i].field_signature); >+ CLASS_ENTRY(hashEntry)->instances[i].field_signature = NULL; >+ } >+ } >+ free(CLASS_ENTRY(hashEntry)->instances); >+ CLASS_ENTRY(hashEntry)->instances = NULL; >+ } >+ /* free PR */ >+ break; >+ case Object_t: >+ /* 46046 RJD - object may be a class object, in which case we need to null >+ the classObject entry in the corresponding classHashEntry. */ >+ if (OBJECT_ENTRY(hashEntry)->classObject == 1) { >+ if (OBJECT_ENTRY(hashEntry)->classHashEntry2 != NULL) { >+ CLASS_ENTRY(OBJECT_ENTRY(hashEntry)->classHashEntry2)->classObject = NULL; >+ } >+ } >+ break; >+ case Method_t: >+ case Thread_t: >+ case Heap_t: >+ break; >+ default: >+ return; >+ } >+ free(hashEntry->id); >+ free(hashEntry->entry); >+ hashEntry->entry=NULL; >+ free(hashEntry); >+ hashEntry=NULL; >+} >+ >+ >+/** GET_BUCKET **************************************************************** >+ * Find the bucket in the table that this id belongs in. Increment the use >+ * count of this bucket by 1. >+ */ >+HashBucket *getBucket(Hashtable *table, void* id, int* idx ) { >+ HashBucket* bucket; >+ int oldCnt; >+ *idx=table->hash(id); >+ bucket= &table->entries[*idx]; >+ oldCnt = bucket->count; >+ >+ while(!ra_atomicCAS((int*)&bucket->count, (int*)&oldCnt, (int)(oldCnt+1))); >+ return bucket; >+} >+ >+static _inline HashBucket *getObjectBucket(jobjectID id) { >+ ObjectHashKey k; >+ int idx; >+ k.id = id; >+ idx=_objectHashtable.hash((void *)&k); >+ return &_objectHashtable.entries[idx]; >+} >+static _inline HashBucket *getMethodBucket(jmethodID id) { >+ MethodHashKey k; >+ int idx; >+ k.id = id; >+ idx=_methodHashtable.hash((void*)&k); >+ return &_methodHashtable.entries[idx]; >+} >+static _inline HashBucket *getClassBucket(jobjectID id) { >+ ClassHashKey k; >+ int idx; >+ k.id = id; >+ idx=_classHashtable.hash((void*)&k); >+ return &_classHashtable.entries[idx]; >+} >+static _inline HashBucket *getThreadBucket(JNIEnv* id) { >+ ThreadHashKey k; >+ int idx; >+ k.id = id; >+ idx=_threadHashtable.hash((void*)&k); >+ return &_threadHashtable.entries[idx]; >+} >+ >+HashBucket* getBucketAtIndex(Hashtable *table, int idx) { >+ int oldCnt; >+ HashBucket *bucket; >+ bucket= &table->entries[idx]; >+ oldCnt = bucket->count; >+ while(!ra_atomicCAS((int*)&bucket->count, (int*)&oldCnt, (int)(oldCnt+1))); >+ return bucket; >+} >+ >+ >+/** RELEASE_BUCKET ************************************************************ >+ * If the current count of this bucket is 1, walk the deleteQ chain and remove >+ * the buckets. Decrement the use count of this bucket by 1. >+ */ >+void releaseBucket(Hashtable *table, HashBucket *bucket, int idx, BOOL freeMemory) { >+ volatile HashEntry *scanQ = NULL; >+ int newCnt, oldCnt = bucket->count; >+ do { >+ newCnt = oldCnt - 1; >+ if ( newCnt == 0 ) { >+ /* cut-off deleteQ: >+ * instantiate the deleteQ and make sure that activeQ anchor >+ * is not a part of the instantiated deleteQ. Then deleteQ >+ * can be safely cut-off >+ */ >+ HashEntry *old_del_q = (HashEntry *)bucket->deleteQ; >+ while ( old_del_q != NULL ) { >+ /* make sure anchor pointer is not part of the logically >+ * deleted chain and it will point to valid element >+ */ >+ for ( scanQ = (HashEntry*)bucket->activeQ; ((scanQ != NULL) && scanQ->toBeFreed); scanQ = (HashEntry*)bucket->activeQ) { >+ /* if csmac failed, somebody else added a new element >+ * Either element is valid or it modified deleteQ anchor >+ */ >+#if defined(__OS400__) || defined(__powerpc64__) || defined(_WIN64) /*ts. bug 120479*/ >+ ra_mutexEnter(&_lock); >+ if (bucket->activeQ == scanQ) { >+ bucket->activeQ = scanQ->next; >+ } else { >+ scanQ = bucket->activeQ; >+ ra_mutexExit(&_lock); >+ break; >+ } >+ ra_mutexExit(&_lock); >+#else >+ if ( !ra_atomicCAS( (int *)&bucket->activeQ, (int *)&scanQ, (int)scanQ->next) ) { >+ break; >+ } >+#endif >+ } >+ >+ /* todo: jy: may be we should save away the scanQ then >+ * assign to endq after for loop , then for loop >+ * can check for scanNext==endq. initially endq can >+ * be NULL :: performance issue >+ */ >+ >+ /* traverse the activeQ from the element next to the scanQ >+ * until the end of the chain is reached, and cut-off the >+ * logically deleted elements from the active chain >+ */ >+ if (scanQ != NULL) { >+ volatile HashEntry *scanNext; >+ for (scanNext = scanQ->next; scanNext != NULL; scanNext = scanQ->next) { >+ if (scanNext->toBeFreed) { >+ scanQ->next = scanNext->next; >+ } >+ else { >+ scanQ = scanNext; >+ } >+ } >+ } >+ >+ /* cut-off the delete chain */ >+#if defined(__OS400__) || defined(__powerpc64__) || defined(_WIN64) /*ts. bug 120479*/ >+ ra_mutexEnter(&_lock); >+ if (bucket->deleteQ == old_del_q) { >+ bucket->deleteQ = 0; >+ ra_mutexExit(&_lock); >+ break; >+ } else { >+ old_del_q = bucket->deleteQ; >+ } >+ >+ ra_mutexExit(&_lock); >+#else >+ if ( ra_atomicCAS((int*)&bucket->deleteQ, (int *)&old_del_q, 0) ) { >+ break; >+ } >+#endif >+ } /* end of cut-off delete chain */ >+ >+ /* if deleteQ is cut-off successfully, >+ * scanQ = safe element to start traversing >+ * any elements previous to this element does not belong to cut-off delete chain >+ * all elements on the cut-off chain is guaranteed not accessed by anybody >+ * old_del_q = anchor of cut-off delete chain >+ */ >+ >+ /* free the hash elements on the cut-off chain */ >+ while(old_del_q != NULL) { >+ scanQ = old_del_q; >+ old_del_q = scanQ->free; >+ if(freeMemory) { >+ freeSymbol((HashEntry*)scanQ, table->type); >+ } >+ } /* end of processing */ >+ } /* end of if ( newCnt == 0 ) */ >+ >+ }while( !ra_atomicCAS((int*)&bucket->count, (int*)&oldCnt, (int)newCnt)); >+} >+ >+HashEntry *createPrimativeHashEntry(jint type) { >+ ClassEntry *entry; >+ Filter *tracing; >+ ObjectHashKey *k; >+ HashEntry *hashEntry; >+ >+ k = (ObjectHashKey *)jvmpiAgent_Calloc(sizeof(ObjectHashKey)); >+ k->id = (jobjectID)type; >+ >+ /* Create a new hash entry and then insert it into the hash table */ >+ hashEntry = jvmpiAgent_CreateSymbol((void*)k); >+ >+ /* Allocate and copy the event data into the symbol table structure */ >+ hashEntry->entry = (ClassEntry*)jvmpiAgent_Calloc(sizeof(ClassEntry)); >+ entry = CLASS_ENTRY(hashEntry); >+ >+ /* The class_id is zero */ >+ entry->classId=0; >+ >+ /* We don't trace primative classes */ >+ entry->traceFlag = 0; >+ >+ /* This is an array class */ >+ entry->arrayClass = 0; >+ >+#ifdef __OS400__ /* 239987 starts */ >+#pragma convert(819) >+#endif >+ switch(type) { /* 235601 - change strdup to STRDUP */ >+ case JVMPI_BOOLEAN: STRDUP(entry->className, "boolean"); tracing=jvmpiAgent_getFilter("boolean", ""); break; >+ case JVMPI_BYTE: STRDUP(entry->className, "byte"); tracing=jvmpiAgent_getFilter("byte", ""); break; >+ case JVMPI_CHAR: STRDUP(entry->className, "char"); tracing=jvmpiAgent_getFilter("char", ""); break; >+ case JVMPI_SHORT: STRDUP(entry->className, "short"); tracing=jvmpiAgent_getFilter("short", ""); break; >+ case JVMPI_INT: STRDUP(entry->className, "int"); tracing=jvmpiAgent_getFilter("int", ""); break; >+ case JVMPI_LONG: STRDUP(entry->className, "long"); tracing=jvmpiAgent_getFilter("long", ""); break; >+ case JVMPI_FLOAT: STRDUP(entry->className, "float"); tracing=jvmpiAgent_getFilter("float", ""); break; >+ case JVMPI_DOUBLE: STRDUP(entry->className, "double"); tracing=jvmpiAgent_getFilter("double", ""); break; >+ } >+#ifdef __OS400__ >+#pragma convert(0) >+#endif /* 239987 ends */ >+ entry->static_id=_staticIdCount++; >+ >+ STRDUP(entry->sourceName, ""); /* 235601 */ >+ entry->numInterfaces=0; >+ entry->numMethods=0; >+ entry->numStaticFields=0; >+ entry->superClassEntry=NULL; >+ >+ entry->classObject=NULL; >+ entry->arrayClass=1; >+ >+ /* Set the class detail fields */ >+ entry->classLoaderName= ""; >+ entry->superClassName = ""; >+ entry->nameOfInterfaces = ""; >+ >+ /* Indicate whether we are tracing this type */ >+ entry -> traceFlag = jvmpiAgent_getClassFilterMode(tracing); >+ >+ TIMESTAMP_ZERO(&entry->timestamp); >+ >+ /*##MW There is a race condition between the increment and the copy that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ jvmpiAgent_copySegmentedValue(&entry->collation, &_jvmpiAgent_collation); >+ return hashEntry; >+} >+ >+ >+HashEntry *jvmpiAgent_getPrimativeClassEntry(jint arrayType) { >+ switch(arrayType) { >+ case JVMPI_BOOLEAN: return _booleanClass; >+ case JVMPI_BYTE: return _byteClass; >+ case JVMPI_CHAR: return _charClass; >+ case JVMPI_SHORT: return _shortClass; >+ case JVMPI_INT: return _intClass; >+ case JVMPI_LONG: return _longClass; >+ case JVMPI_FLOAT: return _floatClass; >+ case JVMPI_DOUBLE: return _doubleClass; >+ } >+ return NULL; >+} >+ >+/** INITIALIZE_SYMBOL_TABLE *************************************************** >+ * Setup the hashtables. Since the buckets are statically declared, they will >+ * already be null-ed. >+ */ >+void jvmpiAgent_InitializeSymbolTable() >+{ >+#if defined(__OS400__) || defined(__powerpc64__) || defined(_WIN64) /*ts. bug 120479*/ >+ ra_mutexCreate(&_lock); /* 232010 */ >+#endif >+ >+ _classHashtable.size=CLASS_HASH_TABLE_SIZE; >+ _classHashtable.entries = _classEntries; >+ _classHashtable.entryCount=0; >+ _classHashtable.type=Class_t; >+ _classHashtable.hash = class_hash_function; >+ _classHashtable.compare = classKeyCompare; >+ _classHashtable.assign = classKeyAssign; >+ _methodHashtable.size=METHOD_HASH_TABLE_SIZE; >+ _methodHashtable.entries = _methodEntries; >+ _methodHashtable.entryCount=0; >+ _methodHashtable.type=Method_t; >+ _methodHashtable.hash = method_hash_function; >+ _methodHashtable.compare = methodKeyCompare; >+ _methodHashtable.assign = methodKeyAssign; >+ _objectHashtable.size=OBJECT_HASH_TABLE_SIZE; >+ _objectHashtable.entries = _objectEntries; >+ _objectHashtable.entryCount=0; >+ _objectHashtable.type=Object_t; >+ _objectHashtable.hash = object_hash_function; >+ _objectHashtable.compare = objectKeyCompare; >+ _objectHashtable.assign = objectKeyAssign; >+ _threadHashtable.size=THREAD_HASH_TABLE_SIZE; >+ _threadHashtable.entries = _threadEntries; >+ _threadHashtable.entryCount=0; >+ _threadHashtable.type=Thread_t; >+ _threadHashtable.hash = thread_hash_function; >+ _threadHashtable.compare = threadKeyCompare; >+ _threadHashtable.assign = threadKeyAssign; >+ >+ createPrimitiveTypes(); >+} >+ >+ >+void createPrimitiveTypes() { >+ >+ /* Create the primative types as classes */ >+ _booleanClass=createPrimativeHashEntry(JVMPI_BOOLEAN); >+ _byteClass=createPrimativeHashEntry(JVMPI_BYTE); >+ _charClass=createPrimativeHashEntry(JVMPI_CHAR); >+ _shortClass=createPrimativeHashEntry(JVMPI_SHORT); >+ _intClass=createPrimativeHashEntry(JVMPI_INT); >+ _longClass=createPrimativeHashEntry(JVMPI_LONG); >+ _floatClass=createPrimativeHashEntry(JVMPI_FLOAT); >+ _doubleClass=createPrimativeHashEntry(JVMPI_DOUBLE); >+ >+} >+ >+ >+/** SET_TRACING_FLAGS_ON_PRIMITIVES *************************************************** >+ * After the filter process, set the tracing flags on the primitive class entries >+ * >+ * Prerequisite: Must be invoked after the primitive arrays are created >+ */ >+void jvmpiAgent_SetTracingFlagsOnPrimitives() { >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ >+ Filter *tracing = 0; >+ tracing = jvmpiAgent_getFilter("boolean", ""); CLASS_ENTRY(_booleanClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+ tracing = jvmpiAgent_getFilter("byte", ""); CLASS_ENTRY(_byteClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+ tracing = jvmpiAgent_getFilter("char", ""); CLASS_ENTRY(_charClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+ tracing = jvmpiAgent_getFilter("short", ""); CLASS_ENTRY(_shortClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+ tracing = jvmpiAgent_getFilter("int", ""); CLASS_ENTRY(_intClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+ tracing = jvmpiAgent_getFilter("long", ""); CLASS_ENTRY(_longClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+ tracing = jvmpiAgent_getFilter("float", ""); CLASS_ENTRY(_floatClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+ tracing = jvmpiAgent_getFilter("double", ""); CLASS_ENTRY(_doubleClass)->traceFlag=jvmpiAgent_getClassFilterMode(tracing); >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ >+} >+ >+ >+/** INSERT_SYMBOL ************************************************************ >+ * >+ */ >+static HashEntry * insertSymbol(Hashtable *table, >+ HashEntry * hashEntry) { >+ int index; >+ HashBucket *bucket=getBucket(table, hashEntry->id, &index); >+ >+ /* Add the cell to the start of the chain */ >+ HashEntry *oldEntry = (HashEntry *)bucket->activeQ; >+ hashEntry->next = oldEntry; >+#if defined(__OS400__) || defined(__powerpc64__) || defined(_WIN64) /*ts. bug 120479*/ >+ ra_mutexEnter(&_lock); >+ bucket->activeQ = hashEntry; /* 232010 */ >+ ra_mutexExit(&_lock); >+#else >+ while (!ra_atomicCAS( (int *)&bucket->activeQ, (int *)&oldEntry, (int)hashEntry)) { >+ hashEntry->next = oldEntry; >+ } >+#endif >+ >+ table->entryCount++; >+#ifdef _DEBUG >+ table->createCount++; >+#endif >+ releaseBucket(table, bucket, index, TRUE); >+ return hashEntry; >+} >+ >+ >+/** REMOVE_SYMBOL ************************************************************** >+ * Do the actual work of setting hash pointers when a deletion is taking place. >+ * @param hashEntry - the entry in the table to delete. >+ */ >+static void removeSymbol(Hashtable *table, HashEntry *hashEntry, BOOL freeMemory) { >+ int index; >+ HashBucket *bucket=getBucket(table, hashEntry->id, &index); >+ int oldStatus = 0; >+ >+ if(ra_atomicCAS((int *)&(hashEntry->toBeFreed), (int *)&oldStatus, 1)) { >+ /* Add the cell to the delete chain */ >+ HashEntry* oldEntry = (HashEntry*)bucket->deleteQ; >+ >+ hashEntry->free = oldEntry; >+#if defined(__OS400__) || defined(__powerpc64__) || defined(_WIN64) /*ts. bug 120479*/ >+ ra_mutexEnter(&_lock); >+ bucket->deleteQ = hashEntry; /* 232010 */ >+ ra_mutexExit(&_lock); >+#else >+ while(!ra_atomicCAS((int*)&bucket->deleteQ, (int*)&oldEntry, (int)hashEntry)) { >+ hashEntry->free = oldEntry; >+ } >+#endif >+ } >+#ifdef _DEBUG >+ table->deleteCount++; >+#endif >+ table->entryCount--; >+ releaseBucket(table, bucket, index, freeMemory); >+} >+ >+ >+static int resetPrintedFlag(HashEntry *hashEntry, void * parm) >+{ >+ hashEntry->printed = 0; >+ return 0; >+} >+ >+ >+/** RESET_CLASS_TRACE_FLAG **************************************************** >+ * >+ */ >+static int resetClassTraceFlag(HashEntry *hashEntry, void * parm) { >+ int i; >+ Filter *filterInfo; >+ ClassEntry *classEntry=CLASS_ENTRY(hashEntry); >+ >+ filterInfo=jvmpiAgent_getFilter(classEntry->className, ""); >+ classEntry -> traceFlag = jvmpiAgent_getClassFilterMode(filterInfo); >+ >+ >+ /* Iterate through the methods and set the filter as well. */ >+ for(i=0; i<classEntry->numMethods; i++) { >+ MethodEntry *methodEntry=METHOD_ENTRY(((HashEntry**)(classEntry->methods))[i]); >+ >+ filterInfo=jvmpiAgent_getFilter(classEntry->className, methodEntry->methodData.method_name); >+ methodEntry->traceFlag=jvmpiAgent_checkMethodFilters(methodEntry->methodData.method_name, filterInfo); >+ methodEntry->trigger=jvmpiAgent_checkTrigger(classEntry->className, methodEntry->methodData.method_name); >+ } >+ return 0; >+} >+ >+ >+/** RESET_OBJECT_TRACE_FLAG *************************************************** >+ * >+ */ >+static int resetObjectTraceFlag(HashEntry *hashEntry, void * parm) { >+ ObjectEntry *objectEntry=OBJECT_ENTRY(hashEntry); >+ >+ if(objectEntry->classHashEntry) { >+ objectEntry->traceFlag=CLASS_ENTRY(objectEntry->classHashEntry)->traceFlag; >+ } >+ return 0; >+} >+ >+ >+/** CREATE_METHOD_SYMBOL ****************************************************** >+ * Allocates an entry in the symbol table for the method and sets the entry data >+ * to point to the owning class. >+ */ >+static HashEntry * jvmpiAgent_CreateMethodSymbol(JVMPI_Method *method, HashEntry *classHashEntry) { >+ HashEntry *methodHashEntry; >+ MethodEntry *methodEntry; >+ MethodHashKey *k; >+ k = (MethodHashKey *)jvmpiAgent_Calloc(sizeof(MethodHashKey)); >+ k->id=method->method_id; >+ methodHashEntry = jvmpiAgent_CreateSymbol((void *)k); >+ >+ /* Allocate and copy the event data into the symbol table structure */ >+ methodHashEntry->entry = (MethodEntry*)(jvmpiAgent_Calloc(sizeof(MethodEntry))); >+ methodEntry = METHOD_ENTRY(methodHashEntry); >+ methodEntry->classHashEntry = classHashEntry; /* Set a pointer back to the containing class */ >+ methodEntry->methodCount = 0; >+ methodEntry->static_id = ++_staticIdCount; >+ >+ /* Is this method a trigger */ >+ methodEntry->trigger=jvmpiAgent_checkTrigger(CLASS_ENTRY(classHashEntry)->className, method->method_name); >+ >+ /*##MW There is a race condition between the increment and the copy that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ jvmpiAgent_copySegmentedValue(&methodEntry->collation, &_jvmpiAgent_collation); >+ >+ { >+ JVMPI_Method * methodData = &methodEntry->methodData; >+ STRDUP(methodData->method_name, method->method_name); /* 235601 */ >+ STRDUP(methodData->method_signature, method->method_signature); /* 235601 */ >+ methodData->start_lineno = method->start_lineno; >+ methodData->end_lineno = method->end_lineno; >+ methodData->method_id = method->method_id; >+ } >+ >+ /* Is this method being traced? */ >+ methodEntry->traceFlag=jvmpiAgent_checkMethodFilters(method->method_name, jvmpiAgent_getFilter(CLASS_ENTRY(classHashEntry)->className, method->method_name)); >+ insertSymbol(&_methodHashtable, methodHashEntry); >+ return methodHashEntry; >+} >+ >+ >+ >+ >+ >+/** CLEAR_ALL_REFERENCES ****************************************************** >+ * Walk all the hashtables and set the printed bit to 0. >+*/ >+void jvmpiAgent_clearAllPrintFlags() { >+ jvmpiAgent_ForAll(Class_t, resetPrintedFlag, 0); >+ jvmpiAgent_ForAll(Object_t, resetPrintedFlag, 0); >+ jvmpiAgent_ForAll(Method_t, resetPrintedFlag, 0); >+ jvmpiAgent_ForAll(Thread_t, resetPrintedFlag, 0); >+} >+ >+ >+/** RESET_TRACE_FLAGS ********************************************************* >+ * Walks through the hashtables and sets the traceFlag on each of the elements. >+ */ >+void jvmpiAgent_resetTraceFlags() { >+ /* RKD: First we walk the class hashtable as this will set the traceflags for >+ the classes and the methods within the classes based upon the filter >+ criteria. Next we walk the object hashtable and set the object trace >+ flag based upon the class traceflag. >+ */ >+ jvmpiAgent_ForAll(Class_t, resetClassTraceFlag, 0); >+ jvmpiAgent_ForAll(Object_t, resetObjectTraceFlag, 0); >+} >+ >+void jvmpiAgent_ForAll(enum EntryType entryType, HashIteratorFunction fn, void *parm) { >+ unsigned int i; >+ Hashtable *table; >+ switch(entryType) { >+ case Class_t: table=&_classHashtable; break; >+ case Method_t: table=&_methodHashtable; break; >+ case Object_t: table=&_objectHashtable; break; >+ case Thread_t: table=&_threadHashtable; break; >+ default: return; >+ } >+ >+ /* Iterate through the table */ >+ for (i = 0; i < table->size; i++) { >+ volatile HashEntry *p, *next; >+ HashBucket *bucket; >+ >+ /* grab the current bucket */ >+ bucket=getBucketAtIndex(table, i); >+ >+ /* Walk through the collision chain */ >+ for (p = bucket->activeQ; p != NULL; p = next) { >+ next=p->next; >+ if (fn((HashEntry*)p,parm)) { >+ return; /* Quit if the user function returns true */ >+ } >+ } >+ /* release the bucket */ >+ releaseBucket(table, bucket, i, TRUE); >+ } >+} >+ >+/** FindObjectSymbolWithAllocateAndPrint >+ * >+ * Look up object in the VM if it doesn't exist in the hash table and make sure it is printed >+ * to the trace. >+ * >+ * args - >+ * env_id - thread which to associate with the object allocation (if it has yet to be printed) >+ * object_id - the object we are looking for >+ * >+ * returns - >+ * the hash entry corresponding to the given object >+ */ >+ >+HashEntry* >+jvmpiAgent_FindObjectSymbolWithAllocateAndPrint(JNIEnv *env_id, jobjectID object_id) { >+ >+ HashEntry *hashEntry = 0; >+ >+ hashEntry = jvmpiAgent_FindObjectSymbol(object_id); >+ >+ /* if the hash entry for the object exists, make sure it is printed */ >+ if (hashEntry) >+ { >+ if (!hashEntry->printed) >+ { >+ jvmpiAgent_printObjAllocElement(hashEntry, env_id, 0); >+ } >+ >+ } >+ /* otherwise, lookup the object in the VM, and then ensure that it is printed */ >+ else { >+ _jvmpiAgent_jvmpiInterface->DisableGC(); >+ REQUEST_EVENT2(JVMPI_EVENT_OBJECT_ALLOC, object_id); >+ _jvmpiAgent_jvmpiInterface->EnableGC(); >+ hashEntry = jvmpiAgent_FindObjectSymbol(object_id); >+ if (hashEntry) { >+ if (!hashEntry->printed) >+ { >+ jvmpiAgent_printObjAllocElement(hashEntry, env_id, 0); >+ } >+ } >+ >+ } >+ >+ >+ return hashEntry; >+ >+} >+ >+ >+/** FIND_OBJECT_SYMBOL_WITHOUT_LOCKING ************************************** >+ * Find a symbol in Object hashtable and create an entry if it does not exist. >+ * YOU MUST ALREADY HOLD THE LOCK ON THE HASHTABLE. >+ */ >+HashEntry* >+jvmpiAgent_FindObjectSymbolWithAllocate(jobjectID id, >+ JNIEnv *env_id) >+{ >+ HashEntry *hashEntry = jvmpiAgent_FindObjectSymbol(id); >+ if (hashEntry) >+ { >+ if (!hashEntry->printed) >+ { >+ jvmpiAgent_printObjAllocElement(hashEntry, env_id, 0); >+ } >+ } >+ return hashEntry; >+} >+ >+ >+/** FIND_SYMBOL ************************************************************** >+ * Find an entry in a hashtable based upon its id. >+ * @param id - the id provided by the JVMPI_Event >+ * @param entryType - the type to look up be it Class/Method/Object/Thread >+ * @returns >0 - the address of a HashEntry struct containing the result >+ * of the lookup. >+ * 0 - id is not in the table. >+ */ >+static _inline HashEntry * jvmpiAgent_FindSymbol(void* id, Hashtable* table, HashBucket* bucket) { >+ volatile HashEntry *p; >+#ifdef _DEBUG >+ unsigned long pathLength = 1; >+#endif >+ >+ /* Try to locate the entry in the hash bucket chain */ >+#ifdef _DEBUG >+ table->findSymbolCount++; >+#endif >+ for(p = bucket->activeQ; p != NULL; p = p->next) { >+ if (table->compare(p->id,id)==0 && !p->deleted && !p->toBeFreed) { >+#ifdef _DEBUG >+ table->findSymbolFound++; >+ if (pathLength == 1) { >+ table->hashHitCount++; >+ } >+ else { >+ table->hashMissCount++; >+ table->hashMissLength += pathLength; >+ } >+#endif >+ return (HashEntry*)p; >+ } >+#ifdef _DEBUG >+ pathLength++; >+#endif >+ } >+ /* Entry not found */ >+#ifdef _DEBUG >+ table->findSymbolNotFound++; >+#endif >+ return 0; >+} >+ >+HashEntry * jvmpiAgent_FindObjectSymbolFast(jobjectID id) { >+ if (id == 0) { >+ /* Only a thread can have a 0 id value so there is no point >+ looking up 0 id values in the other hash tables >+ */ >+ return NULL; >+ } >+ else { >+ ObjectHashKey k; >+ HashBucket* bucket=getObjectBucket(id); >+ k.id = id; >+ return jvmpiAgent_FindSymbol((void*)&k, &_objectHashtable, bucket); >+ } >+} >+HashEntry * jvmpiAgent_FindObjectSymbol(jobjectID id) { >+ if (id == 0) { >+ /* Only a thread can have a 0 id value so there is no point >+ looking up 0 id values in the other hash tables >+ */ >+ return NULL; >+ } >+ else { >+ ObjectHashKey k; >+ HashEntry* entry; >+ HashBucket* bucket; >+ int index; >+ k.id=id; >+ bucket=getBucket(&_objectHashtable, (void*)&k, &index); >+ entry = jvmpiAgent_FindSymbol((void*)&k, &_objectHashtable, bucket); >+ releaseBucket(&_objectHashtable, bucket, index, TRUE); >+ return entry; >+ } >+} >+HashEntry * jvmpiAgent_FindThreadSymbol(JNIEnv *id) { >+ ThreadHashKey k; >+ HashBucket* bucket=getThreadBucket(id); >+ k.id = id; >+ return jvmpiAgent_FindSymbol((void*)&k, &_threadHashtable, bucket); >+} >+HashEntry * jvmpiAgent_FindClassSymbol(jobjectID id) { >+ if (id == 0) { >+ /* Only a thread can have a 0 id value so there is no point >+ looking up 0 id values in the other hash tables >+ */ >+ return NULL; >+ } >+ else { >+ ClassHashKey k; >+ HashBucket* bucket=getClassBucket(id); >+ k.id=id; >+ return jvmpiAgent_FindSymbol((void*)&k, &_classHashtable, bucket); >+ } >+} >+HashEntry * jvmpiAgent_FindMethodSymbol(jmethodID id) { >+ if (id == 0) { >+ /* Only a thread can have a 0 id value so there is no point >+ looking up 0 id values in the other hash tables >+ */ >+ return NULL; >+ } >+ else { >+ MethodHashKey k; >+ HashBucket* bucket=getMethodBucket(id); >+ k.id=id; >+ return jvmpiAgent_FindSymbol((void *)&k, &_methodHashtable, bucket); >+ } >+} >+ >+/* Bug Number 73480 */ >+#ifdef __OS400__ >+void insertClassOptSymbol(HashEntry *hashEntry) >+{ >+ insertSymbol(&_classHashtable, hashEntry); >+} >+#endif >+ >+/** MOVE_SYMBOL **************************************************************** >+ * Change the id of an element in the symbol table. >+ * @param hashEntry - the current entry in the table. >+ * @param id - the old hashEntry->id >+ * @param newId - the new symbol Id. >+ */ >+void jvmpiAgent_MoveSymbol(HashEntry *hashEntry, enum EntryType entryType, void* id, >+ void* newId) { >+ unsigned long oldIndex; >+ unsigned long newIndex; >+ Hashtable *table; >+ >+ switch(entryType) { >+ case Class_t: table=&_classHashtable; break; >+ case Method_t: table=&_methodHashtable; break; >+ case Object_t: table=&_objectHashtable; break; >+ case Thread_t: table=&_threadHashtable; break; >+ default: return; >+ } >+ >+ oldIndex = table->hash(id); >+ newIndex = table->hash(newId); >+#ifdef _DEBUG >+ table->moveCount++; >+#endif >+ if (oldIndex != newIndex) { >+ removeSymbol(table, hashEntry, FALSE); >+ table->assign(id,newId); >+ hashEntry->toBeFreed=0; /* 8735 */ >+ hashEntry->next=NULL; /* 8735 */ >+ insertSymbol(table, hashEntry); >+ } >+ else { >+ table->assign(id,newId); >+ } >+} >+ >+ >+ >+ >+ >+/** DELETE_SYMBOL ************************************************************** >+ * Remove an entry in the symbol table and free the memory associated with the >+ * entry. >+ * @param hashEntry - the entry in the table to delete. >+ */ >+void jvmpiAgent_DeleteSymbol(HashEntry *hashEntry, enum EntryType entryType) >+{ >+ if(!hashEntry) >+ { >+ return; >+ } >+ switch(entryType) >+ { >+ case Class_t: >+ removeSymbol(&_classHashtable, hashEntry, TRUE); >+ break; >+ case Method_t: >+ removeSymbol(&_methodHashtable, hashEntry, TRUE); >+ break; >+ case Object_t: >+ removeSymbol(&_objectHashtable, hashEntry, TRUE); >+ /* Remove the duplicate copy of the object in the heap hashtable */ >+ { >+ /* RKD: We need to save the id for later >+ HashEntry *heapEntry=jvmpiAgent_FindSymbol(hashEntry->id, Heap_t); >+ jvmpiAgent_DeleteSymbol(heapEntry, Heap_t); >+ */ >+ >+ } >+ break; >+ case Thread_t: >+ removeSymbol(&_threadHashtable, hashEntry, TRUE); >+ break; >+ default: >+ return; >+ } >+} >+ >+/** CREAT_THREAD_SYMBOL ******************************************************* >+ * >+ */ >+HashEntry * jvmpiAgent_CreateThreadSymbol(JNIEnv *id) >+{ >+ ThreadHashKey *k; >+ HashEntry *entry; >+ k = (ThreadHashKey *)jvmpiAgent_Calloc(sizeof(ThreadHashKey)); >+ k->id = id; >+ entry=jvmpiAgent_CreateSymbol((void *)k); >+ insertSymbol(&_threadHashtable,entry); >+ return entry; >+ >+} >+ >+/*************************************************************************************/ >+/* PR Heap Dump walk through */ >+ >+/* CR: Is this really needed..If there isn't a function that already does this there should be */ >+HashEntry * dumpGetObject(jobjectID object_id) >+{ >+ HashEntry *objectHashEntry = 0; >+ >+ /* RKD: We always look in the object table for our class object first. */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbol(object_id); >+ if (!objectHashEntry && object_id != 0) { >+ REQUEST_EVENT2(JVMPI_EVENT_OBJECT_ALLOC, object_id); /* 232010 */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbol(object_id); >+ } >+ return objectHashEntry; >+} >+ >+ >+unsigned char prof_dump_read_u1(unsigned char **current) >+{ >+ unsigned char u1; >+ DUMP_READ(&u1, current, 1); >+ return u1; >+} >+ >+unsigned short prof_dump_read_u2(unsigned char **current) >+{ >+ unsigned short u2; >+ DUMP_READ(&u2, current, 2); >+ return ntohs(u2); >+} >+ >+unsigned long prof_dump_read_u4(unsigned char **current) >+{ >+ jint u4; >+ DUMP_READ(&u4, current, 4); >+ return ntohl(u4); >+} >+ >+jobject prof_dump_read_ref(unsigned char **current) >+{ >+ jobject ref; >+ DUMP_READ(&ref,current,sizeof(jobject)); >+ return ref; >+} >+ >+ >+jobjectID prof_dump_read_id(unsigned char **current) >+{ >+ jobjectID p; >+ DUMP_READ(&p, current, sizeof(jobjectID)); >+ return p; >+} >+ >+void *prof_dump_read_ptr(unsigned char **current) >+{ >+ void *p; >+#ifdef __OS400__ >+/* On AS/400 pointers are 16-byte aligned within the buffer. >+ Forward to the next 16 byte boundary if we currently aren't on one */ >+ unsigned int i = (unsigned int) *current; >+ i &= 0x0000000f; /* grab lowest 4 bits of i */ >+ if (i > 0) { >+ *current = *current + (16 - i); /* align the pointer */ >+ } >+#endif >+ DUMP_READ(&p, current, sizeof(void *)); >+ return p; >+} >+ >+void outputObjReference(ThreadLocalStorage *tps, >+ HashEntry *objectHashEntry, >+ HashEntry *referencedObjectHashEntry, >+ HashEntry *currentFieldClass, >+ int fieldIndex, >+ BOOL isArray) { >+ >+ HashEntry *referencedClassHashEntry, *classHashEntry; >+ >+ >+ referencedClassHashEntry = OBJECT_ENTRY(referencedObjectHashEntry)->classHashEntry; >+ classHashEntry=OBJECT_ENTRY(objectHashEntry)->classHashEntry; >+ >+ /* If we don't know the class at either end of the reference we will abandon outputing the >+ reference. This may result in missing information. If need be, we can output it by >+ default by just placing the checks for filters inside this test. >+ */ >+ if(!referencedClassHashEntry || !classHashEntry) { >+ return; >+ } >+ >+ /* ## REMOVE */ >+ _jvmpiAgent_Options.objRefMode = Filter4Owner; >+ >+ >+ /* If the object reference mode if "RespectFilter" we only print the reference >+ is we are tracing both ends of the refernce >+ */ >+ if (_jvmpiAgent_Options.objRefMode == RespectFilter) >+ { >+ if (!(CLASS_ENTRY(referencedClassHashEntry)->traceFlag && CLASS_ENTRY(classHashEntry)->traceFlag)) >+ { >+ return; >+ } >+ } >+ /* If the object reference mode if "Filter4Owner", we print the reference if we >+ are tracing either end. This provides a "one deep" reference graph for all >+ traced classes. >+ */ >+ else if (_jvmpiAgent_Options.objRefMode == Filter4Owner) >+ { >+ if (!(CLASS_ENTRY(classHashEntry)->traceFlag || CLASS_ENTRY(referencedClassHashEntry)->traceFlag)) >+ { >+ return; >+ } >+ } >+ >+ /* If either end is not already printed do so */ >+ if(!referencedObjectHashEntry->printed) >+ { >+ jvmpiAgent_printObjAllocElement(referencedObjectHashEntry, tps->env, 0); >+ } >+ if(!objectHashEntry->printed) >+ { >+ jvmpiAgent_printObjAllocElement(objectHashEntry, tps->env, 0); >+ >+ } >+ >+ /* If either end is a class object ensure the defining class is printed */ >+ if(OBJECT_ENTRY(referencedObjectHashEntry)->classObject) >+ { >+ jvmpiAgent_outputClassDeclaration(OBJECT_ENTRY(referencedObjectHashEntry)->classHashEntry2, tps); >+ } >+ if(OBJECT_ENTRY(objectHashEntry)->classObject) >+ { >+ jvmpiAgent_outputClassDeclaration(OBJECT_ENTRY(objectHashEntry)->classHashEntry2, tps); >+ >+ } >+ >+ if(isArray) >+ { >+ jvmpiAgent_printObjectArrayReferenceElement(tps, OBJECT_ENTRY(objectHashEntry)->static_id, fieldIndex, OBJECT_ENTRY(referencedObjectHashEntry)->static_id, OBJECT_ENTRY(referencedObjectHashEntry)->heapDumpIndex); >+ } >+ else >+ { >+ jvmpiAgent_printObjectInstanceReferenceElement(tps, OBJECT_ENTRY(objectHashEntry)->static_id, fieldIndex, OBJECT_ENTRY(referencedObjectHashEntry)->static_id, OBJECT_ENTRY(referencedObjectHashEntry)->heapDumpIndex, CLASS_ENTRY(currentFieldClass)->instances[fieldIndex].fieldId); >+ } >+ >+ >+} >+ >+void outputPrimativeArray(ThreadLocalStorage *tps, >+ HashEntry *objectHashEntry) { >+ >+ >+ /* If the array is not already printed do so */ >+ if(!objectHashEntry->printed) >+ { >+ jvmpiAgent_printObjAllocElement(objectHashEntry, tps->env, 0); >+ } >+} >+ >+ >+ >+void outputStaticObjReference(ThreadLocalStorage *tps, >+ HashEntry *objectHashEntry, >+ HashEntry *referencedObjectHashEntry, >+ HashEntry *staticReferenceClass, >+ int fieldIndex, >+ BOOL isArray) { >+ HashEntry *referencedClassHashEntry; >+ >+ referencedClassHashEntry = OBJECT_ENTRY(referencedObjectHashEntry)->classHashEntry; >+ >+ /* ## REMOVE */ >+ _jvmpiAgent_Options.objRefMode = Filter4Owner; >+ >+ >+ /* If the object reference mode if "RespectFilter" we only print the reference >+ is we are tracing both ends of the refernce >+ */ >+ if (_jvmpiAgent_Options.objRefMode == RespectFilter) >+ { >+ if (!(CLASS_ENTRY(referencedClassHashEntry)->traceFlag && CLASS_ENTRY(staticReferenceClass)->traceFlag)) >+ { >+ return; >+ } >+ } >+ /* If the object reference mode if "Filter4Owner", we print the reference if we >+ are tracing either end. This provides a "one deep" reference graph for all >+ traced classes. >+ */ >+ else if (_jvmpiAgent_Options.objRefMode == Filter4Owner) >+ { >+ if (!(CLASS_ENTRY(staticReferenceClass)->traceFlag || CLASS_ENTRY(referencedClassHashEntry)->traceFlag)) >+ { >+ return; >+ } >+ } >+ >+ /* If either end is not already printed do so */ >+ if(!referencedObjectHashEntry->printed) >+ { >+ jvmpiAgent_printObjAllocElement(referencedObjectHashEntry, tps->env,0); >+ } >+ if(OBJECT_ENTRY(referencedObjectHashEntry)->classObject) >+ { >+ jvmpiAgent_outputClassDeclaration(OBJECT_ENTRY(referencedObjectHashEntry)->classHashEntry2, tps); >+ } >+ >+ if(!staticReferenceClass->printed) { >+ jvmpiAgent_outputClassDeclaration(staticReferenceClass, tps); >+ } >+ >+ jvmpiAgent_printObjectInstanceReferenceElement(tps, OBJECT_ENTRY(objectHashEntry)->static_id, fieldIndex, OBJECT_ENTRY(referencedObjectHashEntry)->static_id, OBJECT_ENTRY(referencedObjectHashEntry)->heapDumpIndex, CLASS_ENTRY(staticReferenceClass)->statics[fieldIndex].fieldId); >+ >+} >+ >+ >+static int scrubObject(HashEntry *hashEntry, void * parm) { >+ ObjectEntry *objectEntry=OBJECT_ENTRY(hashEntry); >+ if(!objectEntry->foundInHeap) { >+ >+ /* RJD We need to count the number of times an object has not been found in the heap. >+ This problem arises from the fact that when doing a heap dump, after the VM has >+ created the heap dump and reported it to the profiler, other VM threads >+ may continue running. That is, we can potentially be scrubbing the heap concurrently >+ while objects are being created. This results in a situation where we may find a >+ particular object in the hash table, but not in the heap (because it was created >+ after the heap dump had been constructed by the VM). Removing the object just >+ because it wasn't found in the heap may be premature. During a second heap dump, >+ however, the object should be present in the heap. Hence, it should be safe to >+ free objects that have not been found in the heap twice. bugzilla_57475 */ >+ >+ objectEntry->notFoundInHeap++; >+ >+ if (objectEntry->notFoundInHeap > 1) { >+ >+ /* We will only print object free for objects which we have already declared >+ within the trace and if we have been asked to print object free's >+ */ >+ if (hashEntry->printed && _jvmpiAgent_Options.gc!=GcNone) { >+ jvmpiAgent_printObjFreeElement((ThreadPrivateStorage*)(parm), hashEntry); >+ } >+ >+ /* Remove the object from the object hashtable */ >+ jvmpiAgent_DeleteSymbol(hashEntry, Object_t); >+ } >+ } >+ else { >+ objectEntry->foundInHeap=0; >+ } >+ return 0; >+} >+ >+ >+/* This function is used dump Level 0 to store all the object and type in the Heap Hash table for comparition >+*/ >+void jvmpiAgent_markHeap(JVMPI_Event *event) { >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ unsigned char* cursor = (unsigned char*)event->u.heap_dump.begin; >+ unsigned char type; >+ jobjectID oid; >+ >+ /* It appears some JVM's may give us a NULL start address. Starting walking memory >+ at NULL wouldn't be good >+ */ >+ if(!cursor) { >+ return; >+ } >+ >+ while (cursor < (unsigned char*)event->u.heap_dump.end) { >+ HashEntry *objectHashEntry = 0; >+ >+ type = prof_dump_read_u1(&cursor); >+ oid = prof_dump_read_id(&cursor); >+ >+ /* If this is a normal mark of the heap we behave one way, if this is a scrub of the heap due to a >+ runGC request we do it another way. >+ */ >+ if(!tps->scrubbingHeap) { >+ objectHashEntry = dumpGetObject(oid); >+ if(objectHashEntry) /* The defect number is 175135. */ { >+ OBJECT_ENTRY(objectHashEntry)->heapDumpIndex=_heapDumpInfo.index; >+ } >+ } >+ else { >+ HashEntry *objectHashEntry=jvmpiAgent_FindObjectSymbol(oid); >+ if(objectHashEntry) { >+ OBJECT_ENTRY(objectHashEntry)->foundInHeap = 1; >+ } >+ } >+ >+ } /* end while */ >+ >+ >+ /* If we are scrubbing we should generate all the necessary free events before returning to the JVM */ >+ if(tps->scrubbingHeap) { >+ /* Iterate through the object table and find objects which we didn't get free's for */ >+ jvmpiAgent_ForAll(Object_t, scrubObject, tps); >+ } >+ >+} >+ >+/* unsigned long jvmpiAgent_analyseMonitorDump(JVMPI_Event *event, jobjectID monitorObj) >+ >+ Determines the owner thread of the monitor represented >+ by monitorObj by analysing the monitor dump. >+ >+ args - >+ event - the monitor dump event as reported by JVMPI >+ monitorObj - the monitor for which we wish to determine the owner thread >+ >+ returns >+ the id of the thread that owns the given monitor >+*/ >+ >+unsigned long jvmpiAgent_analyseMonitorDump(JVMPI_Event *event, jobjectID monitorObj) { >+ >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(event->env_id); >+ unsigned char *current; >+ JNIEnv *ownerThread = 0; /* owner thread */ >+ >+ current=(unsigned char*)event->u.monitor_dump.begin; >+ >+ if (current == 0) { >+ /* bad data from the JVM */ >+ return 0; >+ } >+ >+ while (current < (unsigned char*)event->u.monitor_dump.end) { >+ unsigned char tag = prof_dump_read_u1(¤t); >+ switch (tag) >+ { >+ case JVMPI_MONITOR_JAVA: >+ /* >+ jobjectID object ID >+ JNIEnv * owner thread >+ u4 entry count >+ u4 number of threads waiting to enter >+ [JNIEnv *]* threads waiting to enter >+ u4 number of threads waiting to be notified >+ [JNIEnv *]* threads waiting to be notified >+ */ >+ { >+ jobjectID obj_id; >+ unsigned int numThreads; >+ JNIEnv *thread_env; >+ >+ obj_id = prof_dump_read_id(¤t); /* object ID */ >+ thread_env = (JNIEnv *)prof_dump_read_ptr(¤t); /* owner thread */ >+ >+ if (obj_id == monitorObj) { >+ ownerThread = thread_env; >+ /* we found the owner thread; no need to walk the rest of the dump */ /* <- this is no longer true */ >+ /*goto END_MONITORS_ANALYSE;*/ >+ } >+ >+ if (thread_env==tps->env) { >+ HashEntry *objectHashEntry; >+ /* lookup monitor object, ensuring that it exists in the trace */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocateAndPrint(event->env_id,obj_id); >+ if (objectHashEntry) { >+ jvmpiAgent_printMonitorStillOwnedElement(objectHashEntry,event); >+ } >+ } >+ >+ /* we don't care what's in the rest of this record */ >+ current += SIZEOF_U4; /* entry count */ >+ numThreads = prof_dump_read_u4(¤t); /* number of threads waiting to enter */ >+ current += numThreads * sizeof(void *); /* threads waiting to enter */ >+ numThreads = prof_dump_read_u4(¤t); /* number of threads waiting to be notified */ >+ current += numThreads * sizeof(void *); /* threads waiting to be notified */ >+ >+ break; >+ } >+ case JVMPI_MONITOR_RAW: >+ /* char * raw monitor name >+ JVMPI_RawMonitor raw monitor ID >+ JNIEnv * owner thread >+ u4 entry count >+ u4 number of threads waiting to enter >+ [JNIEnv *]* threads waiting to enter >+ u4 number of threads waiting to be notified >+ [JNIEnv *]* threads waiting to be notified >+ */ >+ { >+ unsigned int numThreads; >+ >+ prof_dump_read_ptr(¤t); /* raw monitor name */ >+ prof_dump_read_id(¤t); /* raw monitor ID */ >+ prof_dump_read_ptr(¤t); /* owner thread */ >+ current += SIZEOF_U4; /* entry count */ >+ numThreads = prof_dump_read_u4(¤t); /* number of threads waiting to enter */ >+ current += numThreads * sizeof(void *); /* threads waiting to enter */ >+ numThreads = prof_dump_read_u4(¤t); /* number of threads waiting to be notified */ >+ current += numThreads * sizeof(void *); /* threads waiting to be notified */ >+ >+ break; >+ } >+ >+ default: >+ break; >+ } >+ } >+/*END_MONITORS_ANALYSE:*/ >+ >+ if (ownerThread != 0) { >+ /* We found the owner thread. Now translate the JNIEnv * to the id printed >+ the trace. */ >+ HashEntry *entry = jvmpiAgent_FindThreadSymbol(ownerThread); >+ if (entry != 0) { >+ if (jvmpiAgent_isPrintStaticId()) { >+ return THREAD_ENTRY(entry)->staticThreadId; >+ } >+ else { >+ return (unsigned long)ownerThread; >+ } >+ } >+ } >+ return 0; >+} >+ >+ >+ >+/* This function is used to store all the new object and there references into the heap hash table >+*/ >+/* RKD: I am disabling the optimizer for this function as it causes the heapdump to blow >+ up on windows. This appears to only occur with my compiler, remove when checking >+ in V5 code >+*/ >+#ifdef _WIN32 >+#pragma optimize ( "", off ) >+#endif >+void jvmpiAgent_analyseHeap(JVMPI_Event *event, char* heapDefName) >+{ >+ unsigned char *current; >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ jvmpiAgent_printHDStartElement(tps, heapDefName); >+ current=(unsigned char*)event->u.heap_dump.begin; >+ >+ /* RKD: Cannot process heap if we get bad info. We need to tell the user this is bad. */ >+ if(current == 0 || (unsigned char*)event->u.heap_dump.end == 0) { >+ sendErrorMessage(RA_SEVERE,"0","Heap dump failed because bad data passed from JVM."); >+ return; >+ } >+ >+ while (current < (unsigned char*)event->u.heap_dump.end) >+ { >+ HashEntry *tmpHash; /* For GC_ROOT */ >+ unsigned long id; /* For GC_ROOT */ >+ >+ int size = 0; >+ unsigned char tag; >+ int in; >+ int out; >+ >+ tag = prof_dump_read_u1(¤t); >+ size += sizeof(unsigned char); >+ >+START_SWITCH: >+ switch (tag) >+ { >+ case JVMPI_GC_ROOT_UNKNOWN : >+ {/* jobjectID object */ >+ jobjectID obj_id = prof_dump_read_id(¤t);/* object */ >+ >+ tmpHash = jvmpiAgent_FindObjectSymbol(obj_id); >+ if(tmpHash != NULL) >+ { >+ id = OBJECT_ENTRY(tmpHash)->static_id; >+ >+ if (!tmpHash->printed) { >+ jvmpiAgent_printObjAllocElement(tmpHash,tps->env,0); >+ } >+ >+ jvmpiAgent_printGcRootElement(event, id, "UNKNOWN"); >+ >+ } >+ break; >+ } >+ case JVMPI_GC_ROOT_JNI_GLOBAL: >+ {/*jobjectID object >+ jobject JNI global reference */ >+ jobjectID obj_id = prof_dump_read_id(¤t); /* object */ >+ prof_dump_read_ref(¤t);/* JNI global reference */ >+ >+ tmpHash = jvmpiAgent_FindObjectSymbol(obj_id); >+ if(tmpHash != NULL) >+ { >+ id = OBJECT_ENTRY(tmpHash)->static_id; >+ >+ if (!tmpHash->printed) { >+ jvmpiAgent_printObjAllocElement(tmpHash,tps->env,0); >+ } >+ jvmpiAgent_printGcRootElement(event, id, "JNI_GLOBAL"); >+ } >+ break; >+ } >+ case JVMPI_GC_ROOT_JNI_LOCAL: >+ {/*jobjectID object >+ JNIEnv * thread >+ u4 frame # in stack trace (-1 for empty) */ >+ jobjectID obj_id = prof_dump_read_id(¤t); >+ JNIEnv *env = (JNIEnv *)prof_dump_read_ptr(¤t); >+ int depth = prof_dump_read_u4(¤t); >+ >+ tmpHash = jvmpiAgent_FindObjectSymbol(obj_id); >+ if(tmpHash != NULL) >+ { >+ id = OBJECT_ENTRY(tmpHash)->static_id; >+ >+ if (!tmpHash->printed) { >+ jvmpiAgent_printObjAllocElement(tmpHash,tps->env,0); >+ } >+ jvmpiAgent_printGcRootElement(event, id, "JNI_LOCAL"); >+ } >+ break; >+ } >+ case JVMPI_GC_ROOT_JAVA_FRAME: >+ {/*jobjectID object >+ JNIEnv * thread >+ u4 frame # in stack trace (-1 for empty) */ >+ jobjectID obj_id = prof_dump_read_id(¤t); >+ JNIEnv *env = (JNIEnv *)prof_dump_read_ptr(¤t); >+ int depth = prof_dump_read_u4(¤t); >+ >+ tmpHash = jvmpiAgent_FindObjectSymbol(obj_id); >+ if(tmpHash != NULL) >+ { >+ id = OBJECT_ENTRY(tmpHash)->static_id; >+ >+ if (!tmpHash->printed) { >+ jvmpiAgent_printObjAllocElement(tmpHash,tps->env,0); >+ } >+ jvmpiAgent_printGcRootElement(event, id, "JAVA_FRAME"); >+ } >+ break; >+ } >+ case JVMPI_GC_ROOT_NATIVE_STACK : >+ {/*jobjectID object >+ JNIEnv * thread */ >+ jobjectID obj_id; >+ JNIEnv *JNIEnvPtr; >+ obj_id = prof_dump_read_id(¤t);/* object */ >+ JNIEnvPtr = (JNIEnv *) prof_dump_read_ptr(¤t);/* thread*/ >+ >+ tmpHash = jvmpiAgent_FindObjectSymbol(obj_id); >+ if(tmpHash != NULL) >+ { >+ id = OBJECT_ENTRY(tmpHash)->static_id; >+ >+ if (!tmpHash->printed) { >+ jvmpiAgent_printObjAllocElement(tmpHash,tps->env,0); >+ } >+ jvmpiAgent_printGcRootElement(event, id, "NATIVE_STACK"); >+ } >+ break; >+ } >+ case JVMPI_GC_ROOT_STICKY_CLASS : >+ {/*jobjectID class object */ >+ jobjectID class_id = prof_dump_read_id(¤t);/* class object */ >+ >+ tmpHash = jvmpiAgent_FindClassSymbol(class_id); >+ if(tmpHash != NULL) >+ { >+ id = CLASS_ENTRY(tmpHash)->static_id; >+ if (!tmpHash->printed) { >+ jvmpiAgent_outputClassDeclaration(tmpHash,tps); >+ } >+ jvmpiAgent_printGcRootElement(event, id, "STICKY_CLASS"); >+ } >+ break; >+ } >+ case JVMPI_GC_ROOT_THREAD_BLOCK: >+ {/*jobjectID thread object >+ JNIEnv * thread */ >+ jobjectID h_ID = prof_dump_read_id(¤t);/* thread object */ >+ JNIEnv *env_ID = (JNIEnv *)prof_dump_read_ptr(¤t);/* thread */ >+ /* Thread blocks are commented out in the corresponding print.c code >+ Hence, commenting out here as well. >+ tmpHash = jvmpiAgent_FindThreadSymbol(env_ID); >+ if(tmpHash != NULL) >+ { >+ id = THREAD_ENTRY(tmpHash)->staticThreadId; >+ >+ jvmpiAgent_printGcRootElement(event, id, "THREAD_BLOCK"); >+ } */ >+ break; >+ } >+ case JVMPI_GC_ROOT_MONITOR_USED: >+ {/* jobjectID object */ >+ jobjectID obj_Id = prof_dump_read_id(¤t);/* object */ >+ >+ tmpHash = jvmpiAgent_FindObjectSymbol(obj_Id); >+ if(tmpHash != NULL) >+ { >+ id = OBJECT_ENTRY(tmpHash)->static_id; >+ >+ if (!tmpHash->printed) { >+ jvmpiAgent_printObjAllocElement(tmpHash,tps->env,0); >+ } >+ jvmpiAgent_printGcRootElement(event, id, "MONITOR_USED"); >+ } >+ break; >+ } >+ case JVMPI_GC_CLASS_DUMP : >+ {/*jobjectID class >+ jobjectID super >+ jobjectID class loader >+ jobjectID signers >+ jobjectID protection domain >+ jobjectID class name (a String object, may be NULL) >+ void * reserved >+ u4 instance size (in bytes) >+ [jobjectID]* interfaces >+ u2 size of constant pool >+ [u2, constant pool index, >+ ty, type, >+ vl]* value >+ [vl]* static field values */ >+ /*jint ty; */ >+ int i; >+ jobjectID class_name; >+ void *resv2; >+ unsigned int size; >+ jobjectID class_id; >+ jobjectID loader_id; >+ jobjectID signers_id; >+ jobjectID domain_id; >+ unsigned short size_of_constant_pool; >+ HashEntry *classHashEntry, *objectHashEntry; >+ class_id = prof_dump_read_id(¤t); /* class */ >+ >+ /* Resolve the class object */ >+ _requestClassObj = 1; /* specify that we're requesting a class object */ >+ objectHashEntry = dumpGetObject(class_id); >+ _requestClassObj = 0; >+ >+ /* If we found the class object and we don't have the class it represents yet we better resolve it */ >+ if(objectHashEntry) { >+ classHashEntry=OBJECT_ENTRY(objectHashEntry)->classHashEntry2; >+ >+ if(!classHashEntry && class_id != 0) { >+ REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, class_id); >+ OBJECT_ENTRY(objectHashEntry)->classHashEntry2 = jvmpiAgent_FindClassSymbol(class_id); >+ OBJECT_ENTRY(objectHashEntry)->classObject = 1; >+ } >+ >+ } >+ >+ /* It does occasionally happen that sun's JDK will assign a class id of zero >+ * to a normal object. This will cause objectHashEntry to be NULL. >+ This block of code handles this case. Note that we cannot recover from this >+ error since walking the rest of the heap dump correctly requires that >+ we know the details of the class. */ >+ >+ if (!objectHashEntry) { >+ sendErrorMessage(RA_SEVERE,"0","Heap dump failed because an unknown class could not be resolved."); >+ return; >+ } >+ >+ classHashEntry=OBJECT_ENTRY(objectHashEntry)->classHashEntry2; >+ >+ >+ /* Store ref to superclass to use on obj instance dumps. >+ * You cannot just store the superclass id and defer the class >+ * load because later move events can invalidate the association >+ * between this class id and it's class object. */ >+ { >+ jobjectID super_id; >+ HashEntry *superclassHashEntry; >+ >+ super_id = prof_dump_read_id(¤t); >+ superclassHashEntry = jvmpiAgent_FindClassSymbol(super_id); >+ /* RJD: make sure that we're not requesting a class load event >+ for a null id */ >+ if (!superclassHashEntry && super_id != 0) { >+ REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, super_id); /*232010 */ >+ superclassHashEntry = jvmpiAgent_FindClassSymbol(super_id); >+ } >+ CLASS_ENTRY(classHashEntry)->superClassEntry = superclassHashEntry; >+ } >+ >+ loader_id = prof_dump_read_id(¤t); /*class loader */ >+ >+ >+ signers_id = prof_dump_read_id(¤t); /*signers */ >+ domain_id = prof_dump_read_id(¤t); /*protection domain */ >+ class_name = prof_dump_read_id(¤t); /*class name (a String object, may be NULL) */ >+ >+ resv2 = prof_dump_read_ptr(¤t); /* reserved */ >+ size = prof_dump_read_u4(¤t); /*instance size (in bytes) */ >+ >+ for (i=0; i<CLASS_ENTRY(classHashEntry)->numInterfaces; i++) >+ { >+ jobjectID iref = prof_dump_read_id(¤t); /*walk through the the interface */ >+ } >+ >+ size_of_constant_pool = prof_dump_read_u2(¤t); /*size of constant pool */ >+ >+ for (i = 0; i < size_of_constant_pool; i++) >+ { >+ unsigned short index; >+ unsigned char ty; >+ index = prof_dump_read_u2(¤t);/* constant pool index */ >+ ty = prof_dump_read_u1(¤t);/* type */ >+ >+ switch(ty) >+ { >+ case JVMPI_CLASS: >+ case JVMPI_NORMAL_OBJECT: >+ prof_dump_read_id(¤t); >+ break; >+ case JVMPI_BOOLEAN: >+ case JVMPI_BYTE: >+ prof_dump_read_u1(¤t); >+ break; >+ case JVMPI_CHAR: >+ case JVMPI_SHORT: >+ prof_dump_read_u2(¤t); >+ break; >+ case JVMPI_INT: >+ case JVMPI_FLOAT: >+ prof_dump_read_u4(¤t); >+ break; >+ case JVMPI_LONG: >+ case JVMPI_DOUBLE: >+ prof_dump_read_u4(¤t); >+ prof_dump_read_u4(¤t); >+ break; >+ default: >+ printf("Wrong type\n"); >+ fflush(stdout); >+ } >+ >+ >+ } >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ for(i = 0; i<CLASS_ENTRY(classHashEntry)->numStaticFields; i++) /* walk through static field values */ >+ { >+ jobjectID instanceFieldValue; >+ char prim = CLASS_ENTRY(classHashEntry)->statics[i].field_signature[0]; >+ if(event->u.heap_dump.dump_level==JVMPI_DUMP_LEVEL_2) >+ { >+ switch(prim) >+ { >+ case 'Z': >+ case 'B': >+ prof_dump_read_u1(¤t); >+ break; >+ case 'C': >+ case 'S': >+ prof_dump_read_u2(¤t); >+ break; >+ case 'I': >+ case 'F': >+ prof_dump_read_u4(¤t); >+ break; >+ case 'J': >+ case 'D': >+ prof_dump_read_u4(¤t); >+ prof_dump_read_u4(¤t); >+ break; >+ case 'L': >+ case '[': >+ instanceFieldValue=prof_dump_read_id(¤t); >+ } >+ } >+ else >+ { >+ if(prim=='L' || prim=='[') >+ { >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ instanceFieldValue=prof_dump_read_id(¤t); >+ >+ /* RKD: Static fields */ >+ if (instanceFieldValue) >+ { >+ HashEntry *objectHashEntry4Ref; >+ >+ >+ objectHashEntry4Ref = dumpGetObject(instanceFieldValue); >+ if(!objectHashEntry4Ref) >+ { >+ continue; /* The defect number is 174350.*/ >+ } >+ >+ /* Is this the first heap dump that we saw this object in? */ >+/* Changed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex < _heapDumpInfo.index) { >+*/ >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex == 0) { >+ OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex = _heapDumpInfo.index; >+ } >+ >+ /* Forward this reference to be printed if either end of the >+ reference is new for this analysis >+ */ >+/* Added for bug 46787 */ >+ outputStaticObjReference(tps, CLASS_ENTRY(classHashEntry)->classObject, objectHashEntry4Ref, classHashEntry, i, FALSE); >+/* Removed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex==_heapDumpInfo.index) >+ { >+ outputStaticObjReference(tps, CLASS_ENTRY(classHashEntry)->classObject, objectHashEntry4Ref, classHashEntry, i, FALSE); >+ } >+*/ >+ } >+ } >+ } >+ }/* for */ >+ break; >+ } >+ >+ case JVMPI_GC_INSTANCE_DUMP: >+ {/*jobjectID object >+ jobjectID class >+ u4 number of bytes that follow >+ [vl]* instance field values (class, followed by super, super's super ...)*/ >+ >+ HashEntry *debugClassHashEntry=0, *classHashEntry = 0; >+ HashEntry *objectHashEntry = 0; >+ unsigned int i; >+ jobjectID obj_id = prof_dump_read_id(¤t); >+ jobjectID class_id = prof_dump_read_id(¤t); >+ int superClass = 0; >+ unsigned long valbytes = prof_dump_read_u4(¤t); >+ HashEntry *heapHashEntry = 0; >+ >+ /* Determine where the end of this instance is in case we need to >+ panic we can recover >+ */ >+ unsigned char* endAddr=current+valbytes; >+ >+ /* RKD: Moved the find for the objecthashEntry up here as this should >+ resolve the classHashEntry simutaneously. >+ */ >+ >+ /* Force the class to be resolved */ >+ _requestClassObj = 1; /* specify that we're requesting a class object */ >+ objectHashEntry=dumpGetObject(class_id); >+ _requestClassObj = 0; >+ >+ /* If we found the class object and we don't have the class it represents yet we better resolve it */ >+ if(objectHashEntry) { >+ classHashEntry=OBJECT_ENTRY(objectHashEntry)->classHashEntry2; >+ if(!classHashEntry && class_id != 0) { >+ REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, class_id); /* 232010 */ >+ OBJECT_ENTRY(objectHashEntry)->classHashEntry2 = jvmpiAgent_FindClassSymbol (class_id); >+ OBJECT_ENTRY(objectHashEntry)->classObject = 1; >+ } >+ } >+ >+ /* Find the object in the object allocation table */ >+ objectHashEntry = dumpGetObject(obj_id); >+ >+ /* If we can't find this object abort finding it's references */ >+ if(!objectHashEntry) { >+ current=endAddr; >+ break; >+ } >+ >+ /* RKD: Idealy we would use the reference already established but >+ this causes problems as the array types we established >+ are not as detailed as the contents in the heap. For >+ example if a class_id is zero when requested the class >+ will not be in the heap >+ */ >+ classHashEntry=OBJECT_ENTRY(objectHashEntry)->classHashEntry; >+ >+ if(!classHashEntry) { >+ current=endAddr; >+ break; >+ } >+ >+ >+/* Changed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry)->heapDumpIndex < _heapDumpInfo.index) { >+*/ >+ if(OBJECT_ENTRY(objectHashEntry)->heapDumpIndex == 0) { >+ OBJECT_ENTRY(objectHashEntry)->heapDumpIndex = _heapDumpInfo.index; >+ } >+ >+ while (classHashEntry) >+ { >+ for (i=0; i< (unsigned int)CLASS_ENTRY(classHashEntry)->numInstanceFields; i++) >+ { >+ jobjectID instanceFieldValue; >+ char prim = CLASS_ENTRY(classHashEntry)->instances[i].field_signature[0]; >+ /* Grab this instance */ >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ if(event->u.heap_dump.dump_level==JVMPI_DUMP_LEVEL_2) >+ { >+ switch(prim) { >+ case 'Z': >+ case 'B': >+ prof_dump_read_u1(¤t); >+ break; >+ case 'C': >+ case 'S': >+ prof_dump_read_u2(¤t); >+ break; >+ case 'I': >+ case 'F': >+ prof_dump_read_u4(¤t); >+ break; >+ case 'J': >+ case 'D': >+ prof_dump_read_u4(¤t); >+ prof_dump_read_u4(¤t); >+ break; >+ case 'L': >+ case '[': >+ instanceFieldValue=prof_dump_read_id(¤t); >+ } >+ } >+ else >+ { >+ if(prim=='L' || prim=='[') >+ { >+ instanceFieldValue=prof_dump_read_id(¤t); >+ } >+ } >+ >+ if (prim == 'L' || prim == '[') >+ { >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ if (instanceFieldValue) >+ { >+ >+ HashEntry *objectHashEntry4Ref; >+ >+ objectHashEntry4Ref = dumpGetObject(instanceFieldValue); >+ if(!objectHashEntry4Ref) >+ { >+ continue; /* The defect number is 174350.*/ >+ } >+ >+/* Changed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex < _heapDumpInfo.index) { >+*/ >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex == 0) { >+ OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex = _heapDumpInfo.index; >+ } >+ >+ /* Forward this reference to be printed if either end of the >+ reference is new for this analysis >+ */ >+/* Added for bug 46787 */ >+ outputObjReference(tps, objectHashEntry, objectHashEntry4Ref, classHashEntry, i, FALSE); >+/* Removed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex==_heapDumpInfo.index || OBJECT_ENTRY(objectHashEntry)->heapDumpIndex==_heapDumpInfo.index) >+ { >+ outputObjReference(tps, objectHashEntry, objectHashEntry4Ref, classHashEntry, i, FALSE); >+ } >+*/ >+ } >+ } >+ >+ } /* for */ >+ classHashEntry = CLASS_ENTRY(classHashEntry)->superClassEntry; >+ } /* while */ >+ >+ current=endAddr; >+ break; >+ } >+ >+ case JVMPI_GC_OBJ_ARRAY_DUMP : >+ {/*jobjectID array object >+ u4 number of elements >+ jobjectID element class ID (may be NULL in the Java 2 SDK) >+ [jobjectID]* elements */ >+ unsigned int i; >+ jobjectID objRef = 0; >+ HashEntry *objectHashEntry = 0; >+ >+ HashEntry *classHashEntry=NULL; >+ HashEntry *heapHashEntry=NULL; >+ >+ jobjectID objArray_id = prof_dump_read_id(¤t); >+ unsigned long num_elements = prof_dump_read_u4(¤t); >+ jobjectID class_id = prof_dump_read_id(¤t); >+ >+ >+ /* RKD: Moved the locate object up here and then use the objects type first >+ we will ignore the class_id in the dump. By rights, locating the >+ object will also locate the class object as well. >+ */ >+ >+ /* Locate the array object */ >+ objectHashEntry = dumpGetObject(objArray_id); >+ >+ >+ >+ /* If we can't find the array object just skip this object array */ >+ if(!objectHashEntry) { >+ current+=num_elements * sizeof(jobjectID); >+ break; >+ } >+ >+ classHashEntry=OBJECT_ENTRY(objectHashEntry)->classHashEntry; >+ >+ /* If we have no type information just skip this object array */ >+ if(!classHashEntry) { >+ current+=num_elements * sizeof(jobjectID); >+ break; >+ } >+ >+/* Changed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry)->heapDumpIndex < _heapDumpInfo.index) { >+*/ >+ if(OBJECT_ENTRY(objectHashEntry)->heapDumpIndex == 0) { >+ OBJECT_ENTRY(objectHashEntry)->heapDumpIndex = _heapDumpInfo.index; >+ } >+ >+ /* Load all the array element pointers into the heap table */ >+ for (i = 0; i < num_elements; i++) >+ { >+ >+ /* Get the array element */ >+ objRef = prof_dump_read_id(¤t); >+ >+ /* RKD: We could save all the references to determine if they change >+ between heap analysis but this is not the present goal. >+ heapEntry->objRef_id[i] = 0; >+ */ >+ >+ >+ /* Inspect the array element (ie. ensure non-NULL)*/ >+ >+ if(objRef) >+ { >+ HashEntry *objectHashEntry4Ref = 0; >+/* Removed for bug 46787 >+ HashEntry *referencedObjectHeapEntry = 0; >+*/ >+ >+ /* Lookup/Load the endpoint of this reference into the object Hashtable*/ >+ objectHashEntry4Ref = dumpGetObject(objRef); >+ >+ /* If we don't have the endpoint abort this reference */ >+ if(!objectHashEntry4Ref) >+ { >+ continue; >+ } >+ >+/* Removed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex < _heapDumpInfo.index) { >+*/ >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex == 0) { >+ OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex = _heapDumpInfo.index; >+ } >+ >+ /* Forward this reference to be printed if either end of the >+ reference is new for this analysis >+ */ >+ >+/* Added for bug 46787 */ >+ outputObjReference(tps, objectHashEntry, objectHashEntry4Ref, classHashEntry, i, TRUE); >+/* Removed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry4Ref)->heapDumpIndex==_heapDumpInfo.index || OBJECT_ENTRY(referencedObjectHeapEntry)->heapDumpIndex==_heapDumpInfo.index) >+ { >+ outputObjReference(tps, objectHashEntry, objectHashEntry4Ref, classHashEntry, i, TRUE); >+ } >+*/ >+ } >+ }/* for */ >+ break; >+ } >+ case JVMPI_GC_PRIM_ARRAY_DUMP: >+ {/*jobjectID array object >+ u4 number of elements >+ ty element type >+ [vl]* elements */ >+ unsigned int num_elements; >+ unsigned char ty; >+ HashEntry *objectHashEntry=NULL; >+ HashEntry *classHashEntry=NULL; >+ jobjectID obj_id = prof_dump_read_id(¤t); >+ >+ in = sizeof(void *); >+ out = sizeof(void *) + sizeof(unsigned long); >+ size += out; >+ num_elements = prof_dump_read_u4(¤t); /* number of elements */ >+ size += sizeof(unsigned long); >+ ty = prof_dump_read_u1(¤t);/* element type */ >+ size += sizeof(unsigned char); >+ >+ objectHashEntry = dumpGetObject(obj_id); >+ >+ if(objectHashEntry) { >+/* Removed for bug 46787 >+ if(OBJECT_ENTRY(objectHashEntry)->heapDumpIndex < _heapDumpInfo.index) { >+*/ >+ if(OBJECT_ENTRY(objectHashEntry)->heapDumpIndex == 0) { >+ OBJECT_ENTRY(objectHashEntry)->heapDumpIndex = _heapDumpInfo.index; >+ } >+ >+ outputPrimativeArray(tps, objectHashEntry); >+ } >+ >+ >+ if(event->u.heap_dump.dump_level == JVMPI_DUMP_LEVEL_2) /* elements */ >+ { >+ switch (ty) >+ { >+ case JVMPI_BYTE: >+ case JVMPI_BOOLEAN: >+ in = num_elements * 1; >+ out = in; >+ size += out; >+ current+=in; >+ break; >+ case JVMPI_SHORT: >+ case JVMPI_CHAR: >+ in = num_elements * 2; >+ out = in; >+ size += out; >+ current+=in; >+ break; >+ case JVMPI_FLOAT: >+ case JVMPI_INT: >+ in = num_elements * 4; >+ out = in; >+ size += out; >+ current+=in; >+ break; >+ case JVMPI_DOUBLE: >+ case JVMPI_LONG: >+ in = num_elements * 8; >+ out = in; >+ size += out; >+ current+=in; >+ break; >+ } >+ } >+ break; >+ } >+ default: >+ { >+ break; >+ } >+ } >+ } >+ >+} >+#ifdef _WIN32 >+#pragma optimize ( "", on ) >+#endif >+/* PR */ >+/*************************************************************************************/ >+ >+ >+/* Allocates an entry in the symbol table for the object >+ ##RKD: Must hold the write lock before invoking >+*/ >+HashEntry * jvmpiAgent_CreateObjectSymbol(JVMPI_Event *event, >+ BOOL allocatedOnTracedStackframe, >+ BOOL allocationEventSeen) >+{ >+ HashEntry *classHashEntry; >+ HashEntry *objectHashEntry; >+ ObjectEntry *objectEntry; >+ ObjectHashKey *k; >+ >+ /* ##RKD: We know these when we are called, should hand as params. Also >+ if the class_id is zero this is an array object and we dont set >+ the classHashEntry pointer as we don't know the class type. >+ */ >+ if(event->u.obj_alloc.class_id) { >+ classHashEntry=jvmpiAgent_FindClassSymbol(event->u.obj_alloc.class_id); >+ } >+ else { >+ classHashEntry=jvmpiAgent_getPrimativeClassEntry(event->u.obj_alloc.is_array); >+ } >+ >+ k = (ObjectHashKey *)jvmpiAgent_Calloc(sizeof(ObjectHashKey)); >+ k->id = event->u.obj_alloc.obj_id; >+ objectHashEntry = jvmpiAgent_CreateSymbol((void*)k); >+ >+ /* Allocate and copy the event data into the symbol table structure */ >+ objectHashEntry->entry = (ObjectEntry*)jvmpiAgent_Calloc(sizeof(ObjectEntry)); >+ objectEntry = OBJECT_ENTRY(objectHashEntry); >+ >+ /* RKD: Indicate if this object is being traced or not based upon it's class object. We don't >+ trace arrays. >+ */ >+ if(classHashEntry) { >+ objectEntry->traceFlag=CLASS_ENTRY(classHashEntry)->traceFlag; >+ } >+ >+ /* Initially this class is not a class object, the classLoad event may change these later */ >+ objectEntry->classObject=0; >+ objectEntry->classHashEntry2=NULL; >+ >+ objectEntry->heapDumpIndex=0; >+ >+ objectEntry->classHashEntry = classHashEntry; /* Set a pointer back to the containing class */ >+ objectEntry->is_array = (event->u.obj_alloc.is_array==JVMPI_NORMAL_OBJECT?0:1) ; /* JVMPI_NORMAL_OBJECT, ... */ >+ objectEntry->size = event->u.obj_alloc.size; /* size in number of bytes */ >+ objectEntry->static_id = ++_staticIdCount; >+ >+ /*##MW There is a race condition between the increment and the copy that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ jvmpiAgent_copySegmentedValue(&objectEntry->collation, &_jvmpiAgent_collation); >+ >+ insertSymbol(&_objectHashtable, objectHashEntry); >+ >+ return objectHashEntry; >+} >+ >+ >+/* Allocates an entry in the symbol table for the class */ >+HashEntry * jvmpiAgent_CreateClassSymbol(JVMPI_Event *event, ThreadLocalStorage *tps, Filter *filterInfo) { >+ int i, exceptionOccurred=0; >+ HashEntry *hashEntry; >+ ClassEntry *classEntry; >+ HashEntry *classObjectEntry; >+ ClassHashKey *k; >+ >+ jstring currClassName; >+ jobject currentClass; >+ jclass javaClazz; >+ >+ >+ /* RKD: Look for our class object. This should always be there except with java.lang.Class */ >+ classObjectEntry=jvmpiAgent_FindObjectSymbol(event->u.class_load.class_id); >+ >+ /* AM: This block of code will ensure that a class symbol is not created more than once for the same class */ >+ if (hashEntry = jvmpiAgent_FindClassSymbol (event->u.class_load.class_id)) >+ { >+ /* In case the stored class symbol did not have a resolved classObjectEntry, then try to >+ * resolve now */ >+ >+ if (!CLASS_ENTRY(hashEntry)->classObject) >+ { >+ if (classObjectEntry) >+ { CLASS_ENTRY(hashEntry)->classObject = classObjectEntry; } >+ else >+ { >+ /* Try and request our class object */ >+ REQUEST_EVENT2(JVMPI_EVENT_OBJECT_ALLOC, event->u.class_load.class_id); /* 232010 */ >+ CLASS_ENTRY(hashEntry)->classObject = jvmpiAgent_FindObjectSymbol(event->u.class_load.class_id); >+ } >+ } >+ >+ return hashEntry; >+ } >+ >+ k = (ClassHashKey *)jvmpiAgent_Calloc(sizeof(ClassHashKey)); >+ k->id=event->u.class_load.class_id; >+ hashEntry = jvmpiAgent_CreateSymbol((void *)k); >+ >+ /* Allocate and copy the event data into the symbol table structure */ >+ hashEntry->entry = (ClassEntry*)jvmpiAgent_Calloc(sizeof(ClassEntry)); >+ classEntry = CLASS_ENTRY(hashEntry); >+ >+ >+ /* Lookup the filter information for this class */ >+ classEntry->traceFlag = jvmpiAgent_getClassFilterMode(filterInfo); >+ >+ /* This is not a primitive array class */ >+ classEntry->arrayClass = 0; >+ >+ /* 235601 begins */ >+ classEntry->className = ""; >+ classEntry->sourceName = ""; >+ classEntry->classLoaderName = ""; >+ classEntry->nameOfInterfaces = ""; >+ if(event->u.class_load.class_name) { >+ STRDUP(classEntry->className, event->u.class_load.class_name); >+ } >+ if(event->u.class_load.source_name) { >+ STRDUP(classEntry->sourceName, event->u.class_load.source_name); >+ } >+ else { >+ /* create blank source name */ >+ STRDUP(classEntry->sourceName, ""); >+ } >+ /* 235601 ends */ >+ >+ classEntry->numInterfaces = event->u.class_load.num_interfaces; >+ classEntry->numMethods = event->u.class_load.num_methods; >+ classEntry->numStaticFields = event->u.class_load.num_static_fields; >+ >+ if (classEntry->numStaticFields > 0) { >+ /* Create and fill the static field array */ >+ classEntry->statics = (PI_Field *) jvmpiAgent_Calloc(sizeof(PI_Field) * classEntry->numStaticFields); >+ for (i=0; i<classEntry->numStaticFields; i++) { >+ STRDUP(classEntry->statics[i].field_name , event->u.class_load.statics[i].field_name); >+ STRDUP(classEntry->statics[i].field_signature, event->u.class_load.statics[i].field_signature); >+ classEntry->statics[i].fieldId = ++_fieldIdCount; >+ } >+ } >+ >+ classEntry->numInstanceFields = event->u.class_load.num_instance_fields; >+ if (classEntry->numInstanceFields > 0) { >+ /* Create and fill the instance field array */ >+ classEntry->instances = (PI_Field *) jvmpiAgent_Calloc(sizeof(PI_Field) * classEntry->numInstanceFields); >+ for (i=0; i<classEntry->numInstanceFields; i++) { >+ STRDUP(classEntry->instances[i].field_name, event->u.class_load.instances[i].field_name); >+ STRDUP(classEntry->instances[i].field_signature, event->u.class_load.instances[i].field_signature); >+ classEntry->instances[i].fieldId = ++_fieldIdCount; >+ } >+ } >+ >+ classEntry->classId = event->u.class_load.class_id; >+ >+ /*##MW There is a race condition between the increment and the copy that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ jvmpiAgent_copySegmentedValue(&classEntry->collation, &_jvmpiAgent_collation); >+ >+ >+ /* Get the class object of the current class only if the proper option is set */ >+ if (_jvmpiAgent_Options.classLoadDetails || _jvmpiAgent_Options.methodDetails) >+ { >+ char *clazzName = classEntry->className; >+ >+ /* Disable events on the current thread */ >+ tps->disableEventsForThisThread=1; >+ >+ /* Change the delimiter if IBMs JDK is being used */ >+ if (_setPathDelimiter == '/') >+ { swapDelimiters(clazzName); } >+ >+ /* Clear any previous exceptions that may have occurred previously */ >+ CLEAR_EXCEPTIONS(event->env_id); >+ >+ currClassName = CREATE_JSTRING(event->env_id, classEntry->className); >+ currentClass = 0; >+ >+ >+ /* Set the required variables that will need to be cached */ >+ if (!isCachedVarsSet) >+ { >+ isCachedVarsSet = 1; >+ >+ /* Variables common to both class and method detail */ >+ if (javaClazz = FIND_CLASS(event->env_id, "java/lang/Class")) { >+ javaClass = (jclass)(ENV(event->env_id)->NewGlobalRef(ENVPARM(event->env_id) javaClazz)); >+ forNameID = GET_SMETHODID(event->env_id, javaClass, "forName", "(Ljava/lang/String;)Ljava/lang/Class;"); >+ getNameID = GET_METHODID(event->env_id, javaClass, "getName", "()Ljava/lang/String;"); >+ } >+ >+ /* Variables specific to method detail */ >+ if (_jvmpiAgent_Options.methodDetails && javaClass) >+ { >+ >+ if (javaClazz = (jclass)FIND_CLASS(event->env_id, "java/lang/reflect/Method")) >+ { >+ methodClass = (jclass)(ENV(event->env_id)->NewGlobalRef(ENVPARM(event->env_id) javaClazz)); >+ getModifiersID = GET_METHODID(event->env_id, methodClass, "getModifiers", "()I"); >+ getExceptionTypesID = GET_METHODID(event->env_id, methodClass, "getExceptionTypes", "()[Ljava/lang/Class;"); >+ } >+ >+ getDeclaredMethodID = GET_METHODID(event->env_id, javaClass, "getDeclaredMethod", "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); >+ exceptionNames = (char *) malloc (MAX_EXCEPTION_LENGTH); >+ parameters = (char *) malloc (MAX_PARAM_NAME); >+ tmpStorage = (char *) malloc (MAX_PARAM_NAME); >+ param = (char **) malloc (sizeof (char *) * MAX_PARAM); >+ >+ if (javaClazz = (jclass)FIND_CLASS(event->env_id, "java/lang/reflect/Modifier")) >+ { >+ modifierClass = (jclass)(ENV(event->env_id)->NewGlobalRef(ENVPARM(event->env_id) javaClazz)); >+ isPublicID = GET_SMETHODID(event->env_id, modifierClass, "isPublic", "(I)Z"); >+ isProtectedID = GET_SMETHODID(event->env_id, modifierClass, "isProtected", "(I)Z"); >+ isPrivateID = GET_SMETHODID(event->env_id, modifierClass, "isPrivate", "(I)Z"); >+ isAbstractID = GET_SMETHODID(event->env_id, modifierClass, "isAbstract", "(I)Z"); >+ isNativeID = GET_SMETHODID(event->env_id, modifierClass, "isNative", "(I)Z"); >+ isSynchronizedID = GET_SMETHODID(event->env_id, modifierClass, "isSynchronized", "(I)Z"); >+ isStaticID = GET_SMETHODID(event->env_id, modifierClass, "isStatic", "(I)Z"); >+ } >+ } >+ >+ /* Variables specific to the class detail */ >+ if (_jvmpiAgent_Options.classLoadDetails && javaClass) >+ { >+ getClassLoaderID = GET_METHODID(event->env_id, javaClass, "getClassLoader", "()Ljava/lang/ClassLoader;"); >+ getClassID = GET_METHODID(event->env_id, javaClass, "getClass", "()Ljava/lang/Class;"); >+ getSuperclassID = GET_METHODID(event->env_id, javaClass, "getSuperclass", "()Ljava/lang/Class;"); >+ getInterfacesID = GET_METHODID(event->env_id, javaClass, "getInterfaces", "()[Ljava/lang/Class;"); >+ } >+ >+ >+ /* Set isCachedVarsSet to 2 if any one of the required variables were not successfully initialized */ >+ if (!javaClass || !forNameID || !getNameID || (_jvmpiAgent_Options.methodDetails && (!methodClass || !getDeclaredMethodID || !getModifiersID || !modifierClass || >+ !isPublicID || !isProtectedID || !isPrivateID || !isAbstractID || !getExceptionTypesID)) || (_jvmpiAgent_Options.classLoadDetails && (!getClassLoaderID || !getClassID || !getSuperclassID || !getInterfacesID))) >+ { isCachedVarsSet = 2; } >+ } >+ >+ >+ /* Make sure that javaClass and foNameMethodID were retrieved properly */ >+ /* NOTE: This section of the code needs to be fixed. Because if the default class loader is changed, then some classes will not be found */ >+ if (isCachedVarsSet) { >+ currentClass = CALL_OBJ_SMETHOD1(event->env_id, javaClass, forNameID, currClassName); >+ } >+ >+ /* Enable events on the current thread */ >+ tps->disableEventsForThisThread=0; >+ >+ } >+ >+ /* For each method, create a new hash entry and add it to the method array. */ >+ if(event->u.class_load.num_methods>0) { >+ JVMPI_Method *methods; >+ HashEntry **methodEntry; >+ int i; >+ classEntry->methods = (JVMPI_Method*)jvmpiAgent_Calloc(event->u.class_load.num_methods * sizeof(HashEntry *)); >+ methods = event->u.class_load.methods; >+ methodEntry = (HashEntry **)classEntry->methods; >+ for (i=0; i < event->u.class_load.num_methods; i++) { >+ methodEntry[i] = jvmpiAgent_CreateMethodSymbol(methods, hashEntry); >+ >+ >+ /* A.M: Find out the detailed properties of the method if the proper option is set. >+ * The properties: visibility, isNative, isAbstract, isStatic, isSynchronized, and the >+ * possible exceptions that can be thrown by the method. */ >+ if (_jvmpiAgent_Options.methodDetails) >+ { >+ jobject jcurrentMethod = 0; >+ jstring jmethodName = 0; >+ jobjectArray jparamType = 0; >+ >+ jint jmethodModifier = 0; >+ >+ jobject jmethodExceptions, currentException; >+ jobjectArray methodExceptions; >+ jsize arrayLength, counter; >+ jstring jexceptionName; >+ char *exceptionName; >+ >+ /* Disable events on the current thread */ >+ tps->disableEventsForThisThread=1; >+ >+ >+ /* Initialize the desired fields of the method detail */ >+ METHOD_ENTRY(methodEntry[i])->isNative = 0; >+ METHOD_ENTRY(methodEntry[i])->isAbstract = 0; >+ METHOD_ENTRY(methodEntry[i])->isStatic = 0; >+ METHOD_ENTRY(methodEntry[i])->isSynchronized = 0; >+ METHOD_ENTRY(methodEntry[i])->isPrivate = 0; >+ METHOD_ENTRY(methodEntry[i])->isProtected = 0; >+ METHOD_ENTRY(methodEntry[i])->isPublic = 0; >+ METHOD_ENTRY(methodEntry[i])->exceptions = NULL; >+ >+ >+ /* Skip the method detail if in case the current class could not be found, the required variables were not cached or the class name starts with '<' */ >+ if (!currentClass || !isCachedVarsSet || isCachedVarsSet == 2 || METHOD_ENTRY(methodEntry[i])->methodData.method_name[0] == '<') >+ { goto SKIP_METHOD_DETAIL; } >+ >+ >+ /* Allocate Space */ >+ exceptionNames[0] = '\0'; >+ >+ /* Get the java representation of the method name for the current method */ >+ jmethodName = CREATE_JSTRING(event->env_id, METHOD_ENTRY(methodEntry[i])->methodData.method_name); >+ >+ /* Find the parameter type of the current method */ >+ jparamType = findParamType (event, METHOD_ENTRY(methodEntry[i])->methodData.method_signature, &exceptionOccurred); >+ >+ /* An Exception has occured while attempting to get the param type of the current method */ >+ if (jparamType == (int)NULL && exceptionOccurred) { >+ CLEAR_EXCEPTIONS(event->env_id); >+ goto SKIP_METHOD_DETAIL; >+ } >+ >+ if (jmethodName) >+ { jcurrentMethod = CALL_OBJ_METHOD2(event->env_id, currentClass, getDeclaredMethodID, jmethodName, jparamType); } >+ >+ if (CHECK_EXCEPTION(event->env_id)) { >+ CLEAR_EXCEPTIONS(event->env_id); >+ goto SKIP_METHOD_DETAIL; >+ } >+ >+ >+ /* Get the method modifier */ >+ if (jcurrentMethod) >+ { jmethodModifier = ENV(event->env_id)->CallIntMethod(ENVPARM(event->env_id) jcurrentMethod, getModifiersID); } >+ >+ >+ /* Note: The following seven JNI calls can be avoided by analyzing the modifier using the 'log' function >+ * with base two */ >+ >+ /* Find the visibility of the method */ >+ if (jmethodModifier) >+ { >+ if(ENV(event->env_id)->CallStaticBooleanMethod(ENVPARM(event->env_id) modifierClass, isPublicID, jmethodModifier)) >+ { METHOD_ENTRY(methodEntry[i])->isPublic=1;} >+ else if(ENV(event->env_id)->CallStaticBooleanMethod(ENVPARM(event->env_id) modifierClass, isPrivateID, jmethodModifier)) >+ { METHOD_ENTRY(methodEntry[i])->isPrivate=1; } >+ else if (ENV(event->env_id)->CallStaticBooleanMethod(ENVPARM(event->env_id) modifierClass, isProtectedID, jmethodModifier)) >+ { METHOD_ENTRY(methodEntry[i])->isProtected=1; } >+ } >+ >+ >+ /* Attempt to find if the method is native, abstract, static and/or synchronized */ >+ METHOD_ENTRY(methodEntry[i])->isNative = (ENV(event->env_id)->CallStaticBooleanMethod(ENVPARM(event->env_id) modifierClass, isNativeID, jmethodModifier) ? 1 : 0); >+ METHOD_ENTRY(methodEntry[i])->isAbstract = (ENV(event->env_id)->CallStaticBooleanMethod(ENVPARM(event->env_id) modifierClass, isAbstractID, jmethodModifier) ? 1 : 0); >+ METHOD_ENTRY(methodEntry[i])->isStatic = (ENV(event->env_id)->CallStaticBooleanMethod(ENVPARM(event->env_id) modifierClass, isStaticID, jmethodModifier) ? 1 : 0); >+ METHOD_ENTRY(methodEntry[i])->isSynchronized = (ENV(event->env_id)->CallStaticBooleanMethod(ENVPARM(event->env_id) modifierClass, isSynchronizedID, jmethodModifier) ? 1 : 0); >+ >+ >+ /* Find the possible exceptions that the method can throw */ >+ if (jcurrentMethod) >+ { >+ jmethodExceptions = CALL_OBJ_METHOD0(event->env_id, jcurrentMethod, getExceptionTypesID); >+ if (jmethodExceptions) >+ { >+ methodExceptions = (jobjectArray) jmethodExceptions; >+ arrayLength = GET_ARRAY_SIZE(event->env_id, methodExceptions); >+ >+ /* Step through the exceptions */ >+ for (counter = 0; counter < arrayLength; counter++) >+ { >+ currentException = GET_ARRAY_ELEM(event->env_id, methodExceptions, counter); >+ >+ jexceptionName = CALL_OBJ_METHOD0(event->env_id, currentException, getNameID); >+ exceptionName = (char*)CONVERT_TO_UTF(event->env_id, jexceptionName); >+ if (strlen(exceptionNames) + strlen(exceptionName) >= MAX_EXCEPTION_LENGTH) >+ break; >+ if (strlen(exceptionNames) != 0) >+ strcat (exceptionNames, ","); >+ strcat (exceptionNames, exceptionName); >+ RELEASE_UTF_CHARS(event->env_id, jexceptionName, exceptionName); >+ } >+ STRDUP(METHOD_ENTRY(methodEntry[i])->exceptions, exceptionNames); >+ } >+ } >+ } >+ >+SKIP_METHOD_DETAIL: >+ /* Enable events on the current thread */ >+ tps->disableEventsForThisThread=0; >+ methods++; /* Skip to the next method */ >+ } >+ } >+ else { >+ classEntry->methods=NULL; >+ } >+ classEntry->static_id = ++_staticIdCount; >+ jvmpiAgent_getCurrentTime(&classEntry->timestamp); >+ >+ insertSymbol(&_classHashtable, hashEntry); >+ >+ if(!classObjectEntry) { >+ /* Try and request our class object */ >+ REQUEST_EVENT2(JVMPI_EVENT_OBJECT_ALLOC, event->u.class_load.class_id); /* 232010 */ >+ classObjectEntry=jvmpiAgent_FindObjectSymbol(event->u.class_load.class_id); >+ } >+ >+ /* If there is a class obejct for this class we need to make sure it knows it is a class object and >+ set the bidirectional reference between the two. >+ */ >+ if(classObjectEntry) { >+ classEntry->classObject=classObjectEntry; >+ OBJECT_ENTRY(classObjectEntry)->classObject=1; >+ OBJECT_ENTRY(classObjectEntry)->classHashEntry2=hashEntry; >+ } >+ else { >+ classEntry->classObject=0; >+ } >+ >+ >+ /* A.M: If the class load detail option is set, then find the class loader, the >+ * super class, and the interfaces implemented by this class entry. >+ * Note: This should be the last block of code (Because 'return' is used in case that >+ * an exception occurs) */ >+ if (_jvmpiAgent_Options.classLoadDetails) >+ { >+ char *className, *classLoaderName, *currInterface, *interfaceNames; >+ jobject jclassLoader = (int)NULL, jSuperClass, jsuperClassName, jinterfaceName, obj = (int)NULL; >+ jobjectArray interfacesArray; >+ jsize count, index; >+ unsigned const int MAX_CHARS = 250; >+ int currLength = 0, counter = 0; >+ >+ >+ /* Disable events on the current thread */ >+ tps->disableEventsForThisThread=1; >+ >+ /* Initialize the appropriate fields */ >+ classEntry->classLoaderName = ""; >+ classEntry->superClassName = ""; >+ classEntry->nameOfInterfaces = ""; >+ >+ >+ /* Skip class detail if the required variables could not be initialized or the currentClass was set properly */ >+ if (!isCachedVarsSet || isCachedVarsSet == 2 || !currentClass) >+ { goto SKIP_CLASS_DETAIL; } >+ >+ /* Allocate 250 characters for all the interface names */ >+ interfaceNames = (char *) calloc(MAX_CHARS, 1); >+ className = classEntry->className; >+ >+ /* Get the class loader of this class entry (Equivalent to this.getClassLoader().getClass().getName()) */ >+ jclassLoader = CALL_OBJ_METHOD0(event->env_id, currentClass, getClassLoaderID); >+ >+ /* Get the name of the class loader */ >+ if (jclassLoader && !CHECK_EXCEPTION(event->env_id)) >+ { >+ obj = CALL_OBJ_METHOD0(event->env_id, jclassLoader, getClassID); >+ >+ if (obj) >+ { >+ jobject tempObj; >+ tempObj = CALL_OBJ_METHOD0(event->env_id, obj, getNameID); >+ classLoaderName = (char*)CONVERT_TO_UTF(event->env_id, tempObj); >+ classEntry->classLoaderName = classLoaderName; >+ } >+ >+ } >+ /* The previous JNI call may throw a SecurityException */ >+ else if (CHECK_EXCEPTION(event->env_id)) >+ { CLEAR_EXCEPTIONS(event->env_id); } >+ >+ >+ >+ /* Get the super class */ >+ jSuperClass = CALL_OBJ_METHOD0(event->env_id, currentClass, getSuperclassID); >+ >+ if (jSuperClass) >+ { >+ if (jsuperClassName = CALL_OBJ_METHOD0(event->env_id, jSuperClass, getNameID)) >+ { classEntry->superClassName = (char*)CONVERT_TO_UTF(event->env_id, jsuperClassName); } >+ } >+ >+ >+ /* Get the implemented interfaces */ >+ interfacesArray = (jobjectArray)CALL_OBJ_METHOD0(event->env_id, currentClass, getInterfacesID); >+ >+ if (interfacesArray) >+ { >+ count = GET_ARRAY_SIZE(event->env_id, interfacesArray); >+ for (index = 0; index < count; index++) >+ { >+ /* Retreive the name of each element */ >+ if (obj = GET_ARRAY_ELEM(event->env_id, interfacesArray, index)) >+ { >+ jinterfaceName = CALL_OBJ_METHOD0(event->env_id, obj, getNameID); >+ >+ /* Convert to UTF-8, and print the string. Flush the buffer afterwards */ >+ currInterface = (char*)CONVERT_TO_UTF(event->env_id, jinterfaceName); >+ >+ if ((currLength + strlen(currInterface) + 2) > MAX_CHARS) >+ { break; } >+ else >+ { >+ if (strlen(interfaceNames) != 0) >+ strcat (interfaceNames, ","); >+ strcat (interfaceNames, currInterface); >+ } >+ RELEASE_UTF_CHARS(event->env_id, jinterfaceName, currInterface); >+ } >+ classEntry->nameOfInterfaces = interfaceNames; >+ } >+ } >+ } >+ >+SKIP_CLASS_DETAIL: >+ /* Enable events on the current thread */ >+ tps->disableEventsForThisThread=0; >+ >+ return hashEntry; >+} >+ >+/** >+ * The following helper function is used to determine the parameter types of a method based on >+ * its specified signature. >+ * >+ * Prerequisite: 'methodSignature' is a valid string (i.e. It contains a null terminator). >+ * 'methodSignature' is in the expected form of a method signature (i.e. (param)return). >+ * >+ * @param methodSignature - The signature of the method >+ * @param event - The event leading to the invokation of this function >+ * @param exceptionOccured- Nonzero if an exception did occured while attempting to find the parameter type >+ * @return jobject - A Class[] representing the parameter types of the method >+ */ >+ >+jobjectArray findParamType(JVMPI_Event *event, char *methodSignature, int *exceptionOccurred) >+{ >+ char successiveChar; >+ unsigned int index, paramIndex, tmpStorageIndex, counter; >+ >+ jobjectArray jlangClassArray; >+ jstring currClassName; >+ jobject current_Class; >+ >+ >+ /* Extract the prameter from the signature */ >+ for (index = 0; methodSignature[index] != ')' && index < strlen(methodSignature); index++); >+ >+ strncpy (parameters, methodSignature + 1, index); >+ parameters[index - 1] = '\0'; >+ >+ >+ /* Store the individual parameters in the string array 'param' */ >+ if (!parameters || strlen(parameters) == 0) >+ { >+ return (int)NULL; >+ } >+ >+ >+ index = 0, paramIndex = 0, tmpStorageIndex = 0, counter = 0; >+ >+ >+ while (parameters[index] != '\0') >+ { >+ param[paramIndex] = (char *) malloc (MAX_PARAM_NAME); >+ switch (parameters[index]) >+ { >+ /* Boolean */ >+ case 'Z': >+ param[paramIndex] = ">java/lang/Boolean"; >+ paramIndex++; >+ break; >+ /* Byte */ >+ case 'B': >+ param[paramIndex] = ">java/lang/Byte"; >+ paramIndex++; >+ break; >+ /* Char */ >+ case 'C': >+ param[paramIndex] = ">java/lang/Character"; >+ paramIndex++; >+ break; >+ /* Short */ >+ case 'S': >+ param[paramIndex] = ">java/lang/Short"; >+ paramIndex++; >+ break; >+ /* Int */ >+ case 'I': >+ param[paramIndex] = ">java/lang/Integer"; >+ paramIndex++; >+ break; >+ /* Long */ >+ case 'J': >+ param[paramIndex] = ">java/lang/Long"; >+ paramIndex++; >+ break; >+ /* Float */ >+ case 'F': >+ param[paramIndex] = ">java/lang/Float"; >+ paramIndex++; >+ break; >+ /* Double */ >+ case 'D': >+ param[paramIndex] = ">java/lang/Double"; >+ paramIndex++; >+ break; >+ /* Complex Object */ >+ case 'L': >+ counter = 0; >+ for (tmpStorageIndex = ++index; parameters[tmpStorageIndex] != ';'; tmpStorageIndex++) >+ { >+ /* Change the delimiter */ >+ if (parameters[tmpStorageIndex] == '/') >+ tmpStorage[counter] = '.'; >+ else >+ tmpStorage[counter] = parameters[tmpStorageIndex]; >+ counter++; >+ index++; >+ } >+ tmpStorage[counter] = '\0'; >+ strcpy (param[paramIndex], tmpStorage); >+ paramIndex++; >+ break; >+ /* Arrays */ >+ case '[': >+ >+ /* Multi-dimensional array */ >+ counter = 0; >+ while (parameters[index] == '[') >+ { >+ tmpStorage[counter] = parameters[index]; >+ index++; counter++; >+ } >+ >+ >+ successiveChar = parameters[index]; >+ >+ /* Primitive Array */ >+ if (successiveChar == 'Z' || successiveChar == 'B' || successiveChar == 'C' || successiveChar == 'S' || >+ successiveChar == 'I' || successiveChar == 'J' || successiveChar == 'F' || successiveChar == 'D') >+ { >+ tmpStorage[counter] = successiveChar; tmpStorage[counter + 1] = '\0'; >+ } >+ /* Complex Array */ >+ else >+ { >+ for (tmpStorageIndex = index; parameters[tmpStorageIndex] != ';'; tmpStorageIndex++) >+ { >+ /* Change the delimiter */ >+ if (parameters[tmpStorageIndex] == '/') >+ tmpStorage[counter] = '.'; >+ else >+ tmpStorage[counter] = parameters[tmpStorageIndex]; >+ >+ counter++; >+ index++; >+ } >+ tmpStorage[counter] = parameters[tmpStorageIndex]; >+ tmpStorage[counter + 1] = '\0'; >+ } >+ >+ strcpy (param[paramIndex], tmpStorage); >+ paramIndex++; >+ } >+ index++; >+ >+ } >+ >+ /* Create the java class array and its elements */ >+ jlangClassArray = NEW_ARRAY(event->env_id, paramIndex, javaClass, (int)NULL); >+ >+ /* Begin Creating the classes and adding them to the jlangClassArray */ >+ for (index = 0; index < paramIndex; index++) >+ { >+ current_Class = 0; >+ >+ /* If the parameter name begins with '>', then it is a primitive type */ >+ if (param[index][0] == '>') >+ { >+ jclass currClass; >+ jfieldID fieldID; >+ >+ if (currClass = FIND_CLASS(event->env_id, param[index] + 1)) >+ if (fieldID = GET_SFIELDID(event->env_id, currClass, "TYPE", "Ljava/lang/Class;")) >+ current_Class = GET_SFIELD(event->env_id, currClass, fieldID); >+ >+ } >+ >+ /* The parameter is a complex type */ >+ else >+ { >+ /* Get the class representation of the current parameter */ >+ currClassName = CREATE_JSTRING(event->env_id, param[index]); >+ current_Class = CALL_OBJ_SMETHOD1(event->env_id, javaClass, forNameID, currClassName); >+ } >+ >+ /* Add the found class representation to the class array */ >+ if (current_Class) >+ { ADD_TO_ARRAY(event->env_id, jlangClassArray, index, current_Class); } >+ else >+ { /* Something has gone wrong. Abort */ >+ *exceptionOccurred = 1; jlangClassArray = 0; break; >+ } >+ } >+ >+ >+ return jlangClassArray; >+ >+} >+ >+ >+/* Used to swap the delimiter of 'name' from '.' to '\' or vice-versa */ >+void swapDelimiters (char *name) >+{ >+ int i; >+ for (i = 0; i < (int)strlen (name); i++) >+ { >+ if (name[i] == '.') >+ name[i] = '/'; >+ else if (name[i] == '/') >+ name[i] = '.'; >+ } >+} >+ >+ >+#ifdef _DEBUG >+ >+unsigned int jvmpiAgent_getHashTableEntryCount(enum EntryType entryType) >+{ >+ switch(entryType) >+ { >+ case Class_t: return _classHashtable.entryCount; break; >+ case Method_t: return _methodHashtable.entryCount; break; >+ case Object_t: return _objectHashtable.entryCount; break; >+ case Thread_t: return _threadHashtable.entryCount; break; >+ default: return 0; >+ } >+ >+} >+ >+void jvmpiAgent_DumpHashTableStatistics() >+{ >+ >+ int j; >+ FILE * f; >+ f = fopen("heapStatistics.txt", "w"); >+ for(j=0; j<4; j++) >+ { >+ unsigned int i; >+ Hashtable *table; >+ int emptyChains = 0; >+ int totalEntries = 0; >+ int longestChain = 0; >+ int averageChain = 0; >+ switch(j) >+ { >+ case 0:table=&_classHashtable; fprintf(f,"\nCLASS "); break; >+ case 1:table=&_methodHashtable; fprintf(f,"\nMETHOD "); break; >+ case 2:table=&_objectHashtable; fprintf(f,"\nOBJECT "); break; >+ case 3:table=&_threadHashtable; fprintf(f,"\nTHREAD "); break; >+ } >+ for (i = 0; i < table->size; i++) >+ { >+ if (table->entries[i].activeQ == NULL) >+ { >+ emptyChains++; >+ } >+ else >+ { >+ int depth = 0; >+ volatile HashEntry *p; >+ for (p = table->entries[i].activeQ; p != NULL; p = p->next) >+ { >+ depth++; >+ totalEntries++; >+ } >+ if (depth > longestChain) >+ { >+ longestChain = depth; >+ } >+ } >+ } >+ fprintf(f,"Hash Table Statistics\n\n"); >+ fprintf(f,"Hash Table Size = %d\n", table->size); >+ fprintf(f,"Empty chains = %d\n", emptyChains); >+ fprintf(f,"Total entries = %d\n", totalEntries); >+ fprintf(f,"Average chain depth = %f\n", totalEntries/(double)table->size); >+ fprintf(f,"Longest chain depth = %d\n", longestChain); >+ fprintf(f,"Total number of Symbol Lookups = %d\n", table->findSymbolCount); >+ fprintf(f,"Number of successful symbol lookups = %d\n", table->findSymbolFound); >+ fprintf(f,"Number of unsuccessful symbol lookups = %d\n", table->findSymbolNotFound); >+ fprintf(f,"Number of hash hits = %d (%f%%)\n", table->hashHitCount, table->hashHitCount/(double)table->findSymbolCount * 100); >+ fprintf(f,"Number of hash misses = %d (%f%%)\n", table->hashMissCount, table->hashMissCount/(double)table->findSymbolCount * 100); >+ fprintf(f,"Average miss length = %f\n", (table)->hashMissCount ? table->hashMissLength/(double)table->hashMissCount: (double)0); >+ fprintf(f,"Total Created Symbols = %d\n", table->createCount); >+ fprintf(f,"Total Deleted Symbols = %d\n", table->deleteCount); >+ fprintf(f,"Total Moved Symbols = %d\n", table->moveCount); >+ fprintf(f,"\n\n"); >+ } >+ fclose(f); >+} >+#endif >+ >Index: src-native-new/src/agents/thread/hcthread.def >=================================================================== >RCS file: src-native-new/src/agents/thread/hcthread.def >diff -N src-native-new/src/agents/thread/hcthread.def >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/hcthread.def 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,9 @@ >+LIBRARY hcthread >+DESCRIPTION "Externalized Thread Analyzer API" >+EXPORTS >+ Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_init0 @1 >+ Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_dumpThreads0 @2 >+ Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_deregister0 @3 >+ init @4 >+ dump @5 >+ deregister @6 >Index: src-native-new/src/agents/java/WinBuild/log_agent.mak64 >=================================================================== >RCS file: src-native-new/src/agents/java/WinBuild/log_agent.mak64 >diff -N src-native-new/src/agents/java/WinBuild/log_agent.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/WinBuild/log_agent.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,396 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on log_agent.dsp >+!IF "$(CFG)" == "" >+CFG=log_agent - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to log_agent - IA64 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "log_agent - IA64 Release" && "$(CFG)" != "log_agent - IA64 Debug" && "$(CFG)" != "log_agent - X64 Release" && "$(CFG)" != "log_agent - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "log_agent.mak64" CFG="log_agent - IA64 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "log_agent - IA64 Release" >+!MESSAGE "log_agent - IA64 Debug" >+!MESSAGE "log_agent - X64 Release" >+!MESSAGE "log_agent - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "log_agent - IA64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcjbnd.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcjbnd.obj" >+ -@erase "$(INTDIR)\hcjbnd.res" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcjbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.lib" >+ -@erase ".\Release\hcjbnd.map" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /Fp"$(INTDIR)\log_agent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /version:0.1 /dll /incremental:no /pdb:"$(OUTDIR)\hcjbnd.pdb" /map:"$(INTDIR)\hcjbnd.map" /def:"..\hcjbnd.def" /out:"$(OUTDIR)\hcjbnd.dll" /implib:"$(OUTDIR)\..\lib\hcjbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(INTDIR)\hcjbnd.obj" \ >+ "$(INTDIR)\hcjbnd.res" >+ >+"$(OUTDIR)\hcjbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "log_agent - IA64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcjbnd.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcjbnd.obj" >+ -@erase "$(INTDIR)\hcjbnd.res" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcjbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.lib" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /Fp"$(INTDIR)\log_agent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcjbnd.pdb" /debug /def:"..\hcjbnd.def" /out:"$(OUTDIR)\hcjbnd.dll" /implib:"$(OUTDIR)\..\lib\hcjbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(INTDIR)\hcjbnd.obj" \ >+ "$(INTDIR)\hcjbnd.res" >+ >+"$(OUTDIR)\hcjbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "log_agent - X64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcjbnd.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcjbnd.obj" >+ -@erase "$(INTDIR)\hcjbnd.res" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcjbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.lib" >+ -@erase ".\Release\hcjbnd.map" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /Fp"$(INTDIR)\log_agent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /version:0.1 /dll /incremental:no /pdb:"$(OUTDIR)\hcjbnd.pdb" /map:"$(INTDIR)\hcjbnd.map" /def:"..\hcjbnd.def" /out:"$(OUTDIR)\hcjbnd.dll" /implib:"$(OUTDIR)\..\lib\hcjbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(INTDIR)\hcjbnd.obj" \ >+ "$(INTDIR)\hcjbnd.res" >+ >+"$(OUTDIR)\hcjbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "log_agent - X64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcjbnd.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcjbnd.obj" >+ -@erase "$(INTDIR)\hcjbnd.res" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcjbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.lib" >+ -@erase "$(OUTDIR)\..\lib\hcjbnd.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /Fp"$(INTDIR)\log_agent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcjbnd.pdb" /debug /def:"..\hcjbnd.def" /out:"$(OUTDIR)\hcjbnd.dll" /implib:"$(OUTDIR)\..\lib\hcjbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" \ >+ "$(INTDIR)\hcjbnd.obj" \ >+ "$(INTDIR)\hcjbnd.res" >+ >+"$(OUTDIR)\hcjbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "log_agent - IA64 Release" || "$(CFG)" == "log_agent - IA64 Debug" || "$(CFG)" == "log_agent - X64 Release" || "$(CFG)" == "log_agent - X64 Debug" >+SOURCE=..\hcjbnd.c >+ >+"$(INTDIR)\hcjbnd.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\version.rc >+ >+!IF "$(CFG)" == "log_agent - IA64 Release" >+ >+ >+"$(INTDIR)\hcjbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "log_agent - IA64 Debug" >+ >+ >+"$(INTDIR)\hcjbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "_DEBUG" $(SOURCE) >+!ELSEIF "$(CFG)" == "log_agent - X64 Release" >+ >+ >+"$(INTDIR)\hcjbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "log_agent - X64 Debug" >+ >+ >+"$(INTDIR)\hcjbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/thread/WinBuild/hcthread.mak >=================================================================== >RCS file: src-native-new/src/agents/thread/WinBuild/hcthread.mak >diff -N src-native-new/src/agents/thread/WinBuild/hcthread.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/WinBuild/hcthread.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,203 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on hcthread.dsp >+!IF "$(CFG)" == "" >+CFG=hcthread - Win32 Debug >+!MESSAGE No configuration specified. Defaulting to hcthread - Win32 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "hcthread - Win32 Release" && "$(CFG)" != "hcthread - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "hcthread.mak" CFG="hcthread - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "hcthread - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "hcthread - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "hcthread - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcthread.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcthread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcthread.dll" >+ -@erase "$(OUTDIR)\hcthread.exp" >+ -@erase "$(OUTDIR)\hcthread.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "..\..\framework\RABindings" /I "..\..\framework\RACommon" /I "..\..\framework\RASocket" /I "..\..\framework\RADataTransfer" /I "..\..\framework\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\hcthread.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcbnd.lib hcclco.lib hccldt.lib hcclsm.lib hccls.lib jvm.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\hcthread.pdb" /machine:I386 /def:".\hcthread.def" /out:"$(OUTDIR)\hcthread.dll" /implib:"$(OUTDIR)\hcthread.lib" /libpath:"..\..\framework\WinBuild\bin" >+DEF_FILE= \ >+ ".\hcthread.def" >+LINK32_OBJS= \ >+ "$(INTDIR)\hcthread.obj" >+ >+"$(OUTDIR)\hcthread.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "hcthread - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcthread.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcthread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcthread.dll" >+ -@erase "$(OUTDIR)\hcthread.exp" >+ -@erase "$(OUTDIR)\hcthread.ilk" >+ -@erase "$(OUTDIR)\hcthread.lib" >+ -@erase "$(OUTDIR)\hcthread.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\framework\RABindings" /I "..\..\framework\RACommon" /I "..\..\framework\RASocket" /I "..\..\framework\RADataTransfer" /I "..\..\framework\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\hcthread.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcbnd.lib hcclco.lib hccldt.lib hcclsm.lib hccls.lib jvm.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcthread.pdb" /debug /machine:I386 /def:".\hcthread.def" /out:"$(OUTDIR)\hcthread.dll" /implib:"$(OUTDIR)\hcthread.lib" /pdbtype:sept /libpath:"..\..\framework\WinBuild\bin" >+DEF_FILE= \ >+ ".\hcthread.def" >+LINK32_OBJS= \ >+ "$(INTDIR)\hcthread.obj" >+ >+"$(OUTDIR)\hcthread.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("hcthread.dep") >+!INCLUDE "hcthread.dep" >+!ELSE >+!MESSAGE Warning: cannot find "hcthread.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "hcthread - Win32 Release" || "$(CFG)" == "hcthread - Win32 Debug" >+SOURCE=.\hcthread.c >+ >+"$(INTDIR)\hcthread.obj" : $(SOURCE) "$(INTDIR)" >+ >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/thread/WinBuild/hcthread.mak64 >=================================================================== >RCS file: src-native-new/src/agents/thread/WinBuild/hcthread.mak64 >diff -N src-native-new/src/agents/thread/WinBuild/hcthread.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/WinBuild/hcthread.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,349 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on hcthread.dsp >+!IF "$(CFG)" == "" >+CFG=hcthread - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to hcthread - IA64 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "hcthread - IA64 Release" && "$(CFG)" != "hcthread - IA64 Debug" && "$(CFG)" != "hcthread - X64 Release" && "$(CFG)" != "hcthread - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "hcthread.mak64" CFG="hcthread - IA64 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "hcthread - IA64 Release" >+!MESSAGE "hcthread - IA64 Debug" >+!MESSAGE "hcthread - X64 Release" >+!MESSAGE "hcthread - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "hcthread - IA64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcthread.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcthread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcthread.dll" >+ -@erase "$(OUTDIR)\..\lib\hcthread.exp" >+ -@erase "$(OUTDIR)\..\lib\hcthread.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\hcthread.pdb" /def:"..\hcthread.def" /out:"$(OUTDIR)\hcthread.dll" /implib:"$(OUTDIR)\..\lib\hcthread.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\hcthread.obj" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" >+ >+"$(OUTDIR)\hcthread.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "hcthread - IA64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcthread.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcthread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcthread.dll" >+ -@erase "$(OUTDIR)\..\lib\hcthread.exp" >+ -@erase "$(OUTDIR)\..\lib\hcthread.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcthread.lib" >+ -@erase "$(OUTDIR)\..\lib\hcthread.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcthread.pdb" /debug /def:"..\hcthread.def" /out:"$(OUTDIR)\hcthread.dll" /implib:"$(OUTDIR)\..\lib\hcthread.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\hcthread.obj" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" >+ >+"$(OUTDIR)\hcthread.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "hcthread - X64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcthread.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcthread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcthread.dll" >+ -@erase "$(OUTDIR)\..\lib\hcthread.exp" >+ -@erase "$(OUTDIR)\..\lib\hcthread.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\hcthread.pdb" /def:"..\hcthread.def" /out:"$(OUTDIR)\hcthread.dll" /implib:"$(OUTDIR)\..\lib\hcthread.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\hcthread.obj" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" >+ >+"$(OUTDIR)\hcthread.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "hcthread - X64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcthread.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcthread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcthread.dll" >+ -@erase "$(OUTDIR)\..\lib\hcthread.exp" >+ -@erase "$(OUTDIR)\..\lib\hcthread.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcthread.lib" >+ -@erase "$(OUTDIR)\..\lib\hcthread.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcthread.pdb" /debug /def:"..\hcthread.def" /out:"$(OUTDIR)\hcthread.dll" /implib:"$(OUTDIR)\..\lib\hcthread.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\hcthread.obj" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccldt.lib" \ >+ "$(OUTDIR)\..\lib\hcbnd.lib" >+ >+"$(OUTDIR)\hcthread.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "hcthread - IA64 Release" || "$(CFG)" == "hcthread - IA64 Debug" || "$(CFG)" == "hcthread - X64 Release" || "$(CFG)" == "hcthread - X64 Debug" >+SOURCE=..\hcthread.c >+ >+"$(INTDIR)\hcthread.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+!ENDIF >Index: src-native-new/src/HCLauncher/launcher_md.h >=================================================================== >RCS file: src-native-new/src/HCLauncher/launcher_md.h >diff -N src-native-new/src/HCLauncher/launcher_md.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/launcher_md.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,68 @@ >+/********************************************************************** >+Copyright (c) 2005, 2006 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: launcher_md.h,v 1.3 2006/04/24 13:29:37 samwai Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+ >+ >+/* MACRO's to simplify the JNI code. */ >+#if defined __cplusplus && defined _HPUX >+ #define ENV(e) e >+ #define ENVPARM(e) >+#else >+ #define ENV(e) (*e) >+ #define ENVPARM(e) e, >+#endif >+ >+ >+#ifdef _WIN32 >+ #include <winsock2.h> /* Bug 134924 */ >+ #include <windows.h> >+ #include <io.h> >+ #include <process.h> >+#else >+ #ifdef __OS400__ >+ #include "launcher_os400.h" >+ #endif >+ #include <errno.h> >+ #include <signal.h> >+ #include <unistd.h> >+ #include <sys/wait.h> >+ extern char **environ; >+#endif >+ >+ >+/* >+ * Platform-dependent functions >+ */ >+#ifdef _WIN32 >+PID hc_launchProcess_WIN32(char *exe, char *args, char *location, char *env, RA_HANDLE consoleChild[]); >+ >+#elif MVS >+PID hc_launchProcess_MVS(char *exe, char *args, char *location, char *env, RA_HANDLE consoleChild[]); >+ >+#elif __OS400__ >+PID hc_launchProcess_OS400(char *exe, char *args, char *location, char *env, RA_HANDLE consoleChild[]); >+ >+#else >+PID hc_launchProcess_UNIX(char *exe, char *args, char *location, char *env, RA_HANDLE consoleChild[]); >+ >+#endif >+ >+ >+/* >+ * Common functions >+ */ >+void* hc_getEnvironment(); >+int hc_getEnvironmentVariable(void *env, int offset, char **name, char **value ); >+int hc_getProcessStatus(PID pid); >+void hc_killProcess(int pid); >+PID hc_launchProcess(char *exe, char *args, char *location, char *env, RA_HANDLE consoleChild[]); >+int hc_readFile(RA_HANDLE fd, char* buffer, int count); >+int hc_writeFileChar(RA_HANDLE fd, char c); >Index: src-native-new/src/agents/perfmon/resutils/mutex.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/mutex.c >diff -N src-native-new/src/agents/perfmon/resutils/mutex.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/mutex.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,172 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: mutex.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+/*********************************************************************** >+ * >+ * File: Mutex.c >+ * Overview: The following code provides a wrapper to the Win32 >+ * API routines for mutex operations. Implicit in the >+ * routines is that the Mutex struct has been allocated. >+ * This is to ensure data is thread specific, and not >+ * simply local to functions. >+ ***********************************************************************/ >+ >+#include "system.h" >+ >+/*********************************************************************** >+ * Function: XMutexCreate >+ * Purpose: Creates a mutex variable. The user sees the mutex >+ * as a pointer to a Mutex structure. The function calls >+ * the O/S and initialises the Mutex structure. >+ * Parameters: Mutex *, a pointer to Mutex struct. Defined in >+ * Mutex.h. >+ * Returns: int, MUTEX_SUCCESS on successful creation, >+ * MUTEX_FAILURE otherwise. >+ ***********************************************************************/ >+int XMutexCreate(XMutex *mutex) >+{ >+#ifdef WIN32 >+#ifdef MUTEX_HANDLE >+ mutex->handle = CreateMutex(NULL, FALSE, NULL); /* default security, not claimed, no name */ >+ >+ if (! mutex->handle) >+ { >+ return XMUTEX_ERROR_CREATE; >+ } >+#else >+ InitializeCriticalSection(&mutex->cs); >+#endif >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ if (pthread_mutex_init(&mutex->mutex, NULL) != 0) >+ { >+ return FAILURE; >+ } >+#endif >+ >+ return SUCCESS; >+} >+ >+ >+/*********************************************************************** >+ * Function: XMutexClaim >+ * Purpose: This function attempts to exclusively claim the mutex >+ * if it is not sucessful it will block the calling thread. Once >+ * the mutex is available again this thread may be scheduled >+ * and hence allowed to claim it. >+ * Parameters: Mutex *, a pointer to a Mutex struct. >+ * Returns: int, MUTEX_SUCCESS on successful claim, >+ * MUTEX_FAILURE on otherwise. >+ ***********************************************************************/ >+int XMutexClaim(XMutex *mutex) >+{ >+#ifdef WIN32 >+#ifdef MUTEX_HANDLE >+ DWORD result; >+ >+ result = WaitForSingleObject(mutex->handle, INFINITE); /* no timed wait */ >+ >+ if (result != WAIT_OBJECT_0) >+ { >+ return XMUTEX_ERROR_CLAIM; >+ } >+#else >+ EnterCriticalSection(&mutex->cs); >+#endif >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ if (pthread_mutex_lock(&mutex->mutex) != 0) >+ { >+ return FAILURE; >+ } >+#endif >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XMutexRelease >+ * Purpose: Allows the thread that has claimed a mutex to release >+ * it. The thread must have successfully called MutexClaim >+ * before calling this function. >+ * Parameters: Mutex *, pointer to a Mutex struct. >+ * Returns: int, MUTEX_SUCCESS is successful release, >+ * MUTEX_FAILURE otherwise. >+ ***********************************************************************/ >+int XMutexRelease(XMutex *mutex) >+{ >+#ifdef WIN32 >+#ifdef MUTEX_HANDLE >+ BOOL released; >+ >+ released = ReleaseMutex(mutex->handle); /* release the mutex */ >+ >+ if (released != TRUE) >+ { >+ return XMUTEX_ERROR_RELEASE; >+ } >+#else >+ LeaveCriticalSection(&mutex->cs); >+#endif >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ if (pthread_mutex_unlock(&mutex->mutex) != 0) >+ { >+ return FAILURE; >+ } >+#endif >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XMutexDelete >+ * Purpose: Notifies the O/S that the thread is no longer using >+ * the mutex. Note that all threads using this mutex >+ * must call this routine before the O/S deallocates >+ * the associated resources. Once called this routine >+ * will set event.deleted to TRUE. >+ * Parameters: Mutex *, pointer to a Mutex struct. >+ * Returns: int, MUTEX_SUCCESS if successful deletion, >+ * MUTEX_FAILURE otherwise. >+ ***********************************************************************/ >+int XMutexDelete(XMutex *mutex) >+{ >+#ifdef WIN32 >+#ifdef MUTEX_HANDLE >+ BOOL closed; >+ >+ /* decrement the number of references to kernel object, >+ * and free mutex struct, setting mutex to NULL */ >+ >+ closed = CloseHandle(mutex->handle); >+ >+ if (! closed) >+ { >+ return XMUTEX_ERROR_DELETE; >+ } >+#else >+ DeleteCriticalSection(&mutex->cs); >+#endif >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ if (pthread_mutex_destroy(&mutex->mutex) != 0) >+ { >+ return FAILURE; >+ } >+#endif >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * EOF >+ ***********************************************************************/ >Index: src-native-new/src/agents/RABindings/resource.h >=================================================================== >RCS file: src-native-new/src/agents/RABindings/resource.h >diff -N src-native-new/src/agents/RABindings/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.4 2006/04/06 15:48:14 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+//{{NO_DEPENDENCIES}} >+// Microsoft Developer Studio generated include file. >+// Used by version.rc >+// >+ >+ >+// Next default values for new objects >+// >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/transport/RADataTransfer/RADataTransfer.def >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/RADataTransfer.def >diff -N src-native-new/src/transport/RADataTransfer/RADataTransfer.def >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/RADataTransfer.def 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,8 @@ >+LIBRARY hccldt >+DESCRIPTION "Enriched transport for all IBM Remote Agent Architecture communication layer services." >+EXPORTS >+ ra_allocateMessageBlock @1 >+ ra_freeMessageBlock @2 >+ ra_writeMessageBlock @3 >+ >+ >Index: src-native-new/src/HCLauncher/launcher_md.c >=================================================================== >RCS file: src-native-new/src/HCLauncher/launcher_md.c >diff -N src-native-new/src/HCLauncher/launcher_md.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/launcher_md.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,703 @@ >+/********************************************************************** >+Copyright (c) 2005, 2007 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: launcher_md.c,v 1.5 2007/02/28 16:24:39 samwai Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+#ifdef MVS >+#define _SHR_ENVIRON 1 >+#endif >+#include "launcher_common.h" >+ >+#ifdef _DEBUG >+extern FILE *trcFile; >+#endif >+ >+/* >+ * Generic launch function >+ */ >+PID hc_launchProcess(char *exe, char *args, char *location, char *env, RA_HANDLE consoleChild[]) { >+ int i; /* loop counter */ >+ PID pid; /* process ID of the launched process */ >+ >+ if((exe == NULL) /*|| (location == NULL)*/) >+ return -1; >+ >+#ifdef _WIN32 >+ pid = hc_launchProcess_WIN32(exe, args, location, env, consoleChild); >+#elif MVS >+ pid = hc_launchProcess_MVS(exe, args, location, env, consoleChild); >+#elif __OS400__ >+ pid = hc_launchProcess_OS400(exe, args, location, env, consoleChild); >+#else >+ pid = hc_launchProcess_UNIX(exe, args, location, env, consoleChild); >+#endif >+ >+ /* Close all the handles we no longer need in this address space */ >+ for(i = 0; i < 3; i++) { >+ if(consoleChild[i]) { >+ CLOSE_RA_HANDLE(consoleChild[i]); >+ } >+ } >+ return pid; >+} >+ >+ >+/* >+ * Windows launcher >+ */ >+#ifdef _WIN32 >+PID hc_launchProcess_WIN32(char *exe, char *cmdline, char *location, char *env, RA_HANDLE consoleChild[]) { >+ STARTUPINFO si; >+ PROCESS_INFORMATION pi; >+ DWORD error; >+ >+ /* Setup the STARTUP_INFO struct */ >+ ZeroMemory(&si,sizeof(si)); >+ si.cb=sizeof(si); >+ if(consoleChild[0]) { >+ si.dwFlags=STARTF_USESTDHANDLES; >+ si.hStdInput=consoleChild[0]; >+ } >+ if((consoleChild[1])) { >+ si.dwFlags=STARTF_USESTDHANDLES; >+ si.hStdOutput=consoleChild[1]; >+ } >+ if(consoleChild[2]) { >+ si.dwFlags=STARTF_USESTDHANDLES; >+ si.hStdError=consoleChild[2]; >+ } >+ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_WARNING, "Attempting to launch process : %s %s in location %s", exe->data, args->data, launchLocation); >+ if(CreateProcess(exe, /* Application to run */ >+ cmdline, /* The command line args */ >+ NULL, /* Default process security */ >+ NULL, /* Default thread security */ >+ TRUE, /* Inherit handles between children */ >+ (consoleChild[0] || consoleChild[1] || consoleChild[2]) ? DETACHED_PROCESS|CREATE_NEW_PROCESS_GROUP|CREATE_SEPARATE_WOW_VDM : CREATE_NEW_CONSOLE, >+ env, /* Environment */ >+ location, /* Where to run the child */ >+ &si, /* Startup info */ >+ &pi)==0) { /* Process info */ >+ >+ error=GetLastError(); >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_SEVERE, "Launching process failed, platform specific error is %d. Path=%s Process command line = %s", error, application->path.data, cmdline); >+ /* Set the process id to be zero as the process did not launch */ >+ pi.dwProcessId = -1; >+ return pi.dwProcessId; >+ } >+ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_WARNING, "Process launched: PID=%d", pi.dwProcessId); >+ CloseHandle(pi.hThread); >+ CloseHandle(pi.hProcess); >+ ra_free(cmdline); /* Bug 103601 */ >+ >+ return (PID)pi.dwProcessId; >+} >+#endif >+ >+ >+/* >+ * MVS launcher >+ */ >+#ifdef MVS >+PID hc_launchProcess_MVS(char *exe, char *cmdline, char *location, char *env, RA_HANDLE consoleChild[]) { >+ PID childPID = 0; >+ char *parsedArgs[MAX_ARGS]; >+ char *environment[MAX_ENV+1]; >+ int fd_map[3]; >+ int *fdmap; >+ int fdcount = 3; >+ char *current, *next; >+ int i, count; >+ char blank; >+ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ blank = ' '; >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+ if((cmdline == NULL) || (env == NULL)) { >+ return -1; >+ } >+ >+ current = cmdline; >+ >+ /* 178427 begin */ >+ /* Move past any leading blanks */ >+ while (*current == blank) { >+ current++; >+ } >+ >+ /* Parse out the args */ >+ for(i = 0; (next = (char*)strchr(current, blank)) != NULL; i++) { >+ /* If this is a quoted arg we need to remove the quote and skip to the next quote */ >+ if(current[0]=='\"') { >+ current++; >+ next=(char*)strchr(current, '\"'); >+ if(next) { >+ *next='\0'; >+ } >+ } >+ else { >+ *next='\0'; >+ } >+ >+ #ifdef _DEBUG >+ #pragma convlit(suspend) >+ fprintf(trcFile, "hc_launchProcess: command arg=<%s>\n", current); >+ fflush(trcFile); >+ #pragma convlit(resume) >+ #endif >+ >+ parsedArgs[i]=current; >+ >+ /* move past blanks */ >+ do { >+ next++; >+ } while (*next == blank); >+ current=next; >+ } >+ >+ /* check if there is another argument */ >+ if (strlen(current) > 0) { /* 178427 - handles case of blank at end of cmd line */ >+ if(current[0]=='\"') { /* If this is a quoted arg we need to remove the quote and skip to the next quote */ >+ current++; >+ next=(char*)strchr(current, '\"'); >+ if(next) { >+ *next='\0'; >+ } >+ } >+ >+ #ifdef _DEBUG >+ #pragma convlit(suspend) >+ fprintf(trcFile, "hc_launchProcess: command arg=<%s>\n", current); >+ fflush(trcFile); >+ #pragma convlit(resume) >+ #endif >+ >+ parsedArgs[i]=current; >+ /* End the list of arguments */ >+ parsedArgs[i+1]=NULL; >+ } >+ else { >+ /* else end the list of arguments */ >+ parsedArgs[i]=NULL; >+ } >+ >+ /* 178427 end */ >+ /* Load the environment array */ >+ i=count=0; >+ do { >+ #ifdef _DEBUG >+ #pragma convlit(suspend) >+ fprintf(trcFile, "hc_launchProcess: i=%d count=%d env var=<%s>\n", i, count, &env[i]); >+ fflush(trcFile); >+ #pragma convlit(resume) >+ #endif >+ >+ environment[count]=&env[i]; >+ i+=strlen(&env[i])+1; >+ count++; >+ } while(env[i]!='\0' && count<MAX_ENV); >+ >+ /* We have imposed a limit on the number of environment variables */ >+ if(count==MAX_ENV) { >+ >+ #ifdef _DEBUG >+ #pragma convlit(suspend) >+ fprintf(trcFile, "hc_launchProcess: Launching process failed, too many environment variables. count=%d but Maximum=%d\n", count, MAX_ENV); >+ fflush(trcFile); >+ #pragma convlit(resume) >+ #endif >+ >+ exit(-1); >+ } >+ else { >+ /* End the list of environment variables */ >+ environment[count]=NULL; >+ } >+ >+ /* Set up file descriptor map for child process */ >+ if (consoleChild) { >+ if ((fd_map[0]=dup(consoleChild[0])) < 0) { /* child stdin is read end of pipe */ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_SEVERE, "Creating stdin for process failed. Platform specific error is %d", errno); >+ } >+ if ((fd_map[1]=dup(consoleChild[1])) < 0) { /* child stdout is write end of pipe */ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_SEVERE, "Creating stdout for process failed. Platform specific error is %d", errno); >+ } >+ if ((fd_map[2]=dup(consoleChild[2])) < 0) { /* child stderr is write end of pipe */ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_SEVERE, "Creating stderr for process failed. Platform specific error is %d", errno); >+ } >+ fdmap = fd_map; >+ } >+ else { >+ fdcount = 0; >+ fdmap = NULL; >+ } >+ >+ /* Change directory if one was specified */ >+ if (location != NULL) { >+ #ifdef _DEBUG >+ #pragma convlit(suspend) >+ fprintf(trcFile, "hc_launchProcess: location=<%s>\n", location); >+ fflush(trcFile); >+ #pragma convlit(resume) >+ #endif >+ >+ if(chdir(location)) { >+ >+ #ifdef _DEBUG >+ #pragma convlit(suspend) >+ fprintf(trcFile, "hc_launchProcess: chdir to %s failed with error %d %s - returning 0 pid\n", location, errno, strerror(errno)); >+ fflush(trcFile); >+ #pragma convlit(resume) >+ #endif >+ >+ childPID = 0; >+ return childPID; >+ } >+ } >+ >+ /* Spawn the new process */ >+ if((childPID = spawnp(parsedArgs[0], fdcount, fdmap, NULL, parsedArgs, environment))<0) { >+ #ifdef _DEBUG >+ #pragma convlit(suspend) >+ fprintf(trcFile, "hc_launchProcess: spawn failed with error %d %s - path=<%s>\n", errno, strerror(errno), parsedArgs[0]); >+ fflush(trcFile); >+ #pragma convlit(resume) >+ #endif >+ >+ childPID = -1; /* 179338 */ >+ } >+ >+ return childPID; >+} >+#endif >+ >+ >+/* >+ * OS/400 launcher >+ */ >+#ifdef __OS400__ >+ /* Please refer to launcher_os400.c */ >+#endif >+ >+ >+/* >+ * UNIX launcher >+ */ >+#if !defined (_WIN32) && !defined (MVS) && !defined (__OS400__) >+PID hc_launchProcess_UNIX(char *exe, char *cmdline, char *location, char *env, RA_HANDLE consoleChild[]) { >+ >+ PID childPID = 0; >+ >+ childPID = fork(); >+ >+ if(childPID == 0) { /* Child process */ >+ char *parsedArgs[MAX_ARGS]; >+ char *environment[MAX_ENV+1]; >+ char *current, *next; >+ int i, count; >+ current=cmdline; >+ >+ /* Move past any leading blanks */ >+ while (*current == ' ') { >+ current++; >+ } >+ >+ /* Parse out the args */ >+ for(i=0; (next=(char*)strchr(current, ' '))!=NULL; i++) { >+ if(current[0]=='\"') { /* If this is a quoted arg we need to remove the quote and skip to the next quote */ >+ current++; >+ next=(char*)strchr(current, '\"'); >+ if(next) { >+ *next='\0'; >+ } >+ } >+ else { >+ *next='\0'; >+ } >+ >+ parsedArgs[i]=current; >+ >+ do { /* move past blanks */ >+ next++; >+ } while (*next == ' '); >+ current=next; >+ } >+ >+ /* check if there is another argument */ >+ if (strlen(current) > 0) { /* handles case of blank at end of cmd line */ >+ if(current[0]=='\"') { /* If this is a quoted arg we need to remove the quote and skip to the next quote */ >+ current++; >+ next=(char*)strchr(current, '\"'); >+ if(next) { >+ *next='\0'; >+ } >+ } >+ parsedArgs[i]=current; >+ parsedArgs[i+1]='\0'; >+ } >+ >+ else { /* Else end the list of arguments */ >+ parsedArgs[i]='\0'; >+ } >+ >+ /* Load the environment array */ >+ i=count=0; >+ do{ >+ environment[count]=&env[i]; >+ i+=strlen(&env[i])+1; >+ count++; >+ } while(env[i]!='\0' && count<MAX_ENV); >+ >+ if(count==MAX_ENV) { >+ printf("Launching process failed, too many environment variables. Maximum=%d\n", MAX_ENV); >+ return (-1); >+ } >+ else { >+ environment[count]='\0'; >+ } >+ >+ /* Change directory to the specified location if it exists */ >+ if(location) { >+ if(chdir(location)) { >+ printf("Launching process failed, cannot set location. Platform specific error is %d. Location=%s\n", errno, location); >+ return (-1); >+ } >+ } >+ >+ /* Setup the console */ >+ if(dup2(consoleChild[0], STDIN_FILENO) < 0) { >+ printf("Creating stdin for process failed. Platform specific error is %d\n", errno); >+ } >+ if(dup2(STDOUT_FILENO, consoleChild[1]) < 0) { >+ printf("Creating stdout for process failed. Platform specific error is %d\n", errno); >+ } >+ if(dup2(STDERR_FILENO, consoleChild[2]) < 0) { >+ printf("Creating stderr for process failed. Platform specific error is %d\n", errno); >+ } >+ >+ /* Exec the target process */ >+ if(execve(parsedArgs[0], parsedArgs, environment)<0) { >+ printf("Launching process failed, platform specific error is %d. Process command line = %s\n", errno, cmdline); >+ return (-1); /* exec failed */ >+ } >+ } >+ else { /* parent process */ >+ return childPID; >+ } >+} >+#endif >+ >+ >+/******************************************************************************* >+ * * >+ * Environment * >+ * * >+ ******************************************************************************/ >+ >+ >+/* >+ * Get the current system environment >+ */ >+void* hc_getEnvironment() { >+ >+#ifdef _WIN32 >+ return GetEnvironmentStrings(); /* Return a string of environment variables */ >+#else >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(trcFile, "hc_getEnvironment: environ=%p\n", environ); >+ fflush(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ return (void*)environ; >+#endif >+} >+ >+/* >+ * Get the environment variable at the specified offset in the specified environment >+ * and returns the offset of the next environment variable. >+ * Input: >+ * env - environment >+ * offset - offset of variable in the environment >+ * >+ * Output: >+ * envvarName - ptr to environment variable name >+ * envvarValue - ptr to environment variable value >+ * >+ * Returns - offset of next environment variable in the specified environment >+ * - -1 if no more environment variables >+ */ >+ >+int hc_getEnvironmentVariable(void *env, int offset, char **envvarName, char **envvarValue) { >+ int nextOffset, nameLen, valueLen; >+ char *tmp; >+ char *envvar; >+ >+#ifdef _WIN32 >+ char *sysEnv = (char *)env; >+ >+ #ifdef _DEBUG >+ fprintf(trcFile, "hc_getEnvironmentVariable: offset=%d sysEnv=%p\n", offset, sysEnv); >+ fflush(trcFile); >+ #endif >+ >+ envvar = sysEnv+offset; >+ >+ #ifdef _DEBUG >+ fprintf(trcFile, "hc_getEnvironmentVariable: envvar = <%s>\n", envvar); >+ fflush(trcFile); >+ #endif >+ >+ /* Get the name-value pairs - look for = */ >+ tmp = strchr(envvar, '='); >+ >+ /* If we don't have an = then return the whole string for the name and an empty string for the value */ >+ if (tmp == NULL) { >+ nameLen = strlen(envvar); >+ valueLen = 0; >+ } >+ >+ /* Check if the first character is = (on Windows this is the case for some variables) */ >+ else if (tmp-envvar == 0) { >+ /* check if there is another = >+ * If there is another = Then use that one >+ * If there isn't another = then use the whole string for the name and make the value an empty string >+ */ >+ tmp = strchr(envvar+1, '='); >+ >+ if (tmp == NULL) { >+ nameLen = strlen(envvar); >+ valueLen = 0; >+ } >+ else { >+ nameLen = tmp-envvar; >+ valueLen = strlen(tmp)-1; >+ } >+ >+ } >+ else { >+ nameLen = tmp-envvar; >+ valueLen = strlen(tmp)-1; >+ } >+ >+ *envvarName = (char *)malloc(nameLen+1); >+ *envvarValue = (char *)malloc(valueLen+1); >+ memcpy(*envvarName, envvar, nameLen); >+ *(*envvarName+nameLen) = '\0'; >+ if ((tmp == NULL) || (valueLen == 0)) { /* Bug 68899 */ >+ **envvarValue = '\0'; >+ } >+ else { >+ strcpy(*envvarValue, tmp+1); >+ } >+ >+ >+ #ifdef _DEBUG >+ fprintf(trcFile, "hc_getEnvironmentVariable: envvarName=%p <%s> envvarValue=%p <%s>\n", *envvarName, *envvarName, *envvarValue, *envvarValue); >+ fflush(trcFile); >+ #endif >+ >+ /* Get offset to next environment variable */ >+ nextOffset = offset + strlen(envvar) + 1; >+ >+ if (sysEnv[nextOffset] == '\0') { >+ nextOffset = -1; >+ } >+ >+#else /* Non-Windows Platforms */ >+ char *n_envvarName; /* native encoded name */ >+ char *n_envvarValue; /* native encoded value */ >+ char **sysEnv = (char **)env; >+ size_t rc_n; >+ size_t rc_v; >+ >+#ifdef MVS >+ #pragma convlit(suspend) >+#endif >+ >+ #ifdef _DEBUG >+ fprintf(trcFile, "hc_getEnvironmentVariable: offset=%d sysEnv=%p\n", offset, sysEnv); >+ fflush(trcFile); >+ #endif >+ >+ envvar = sysEnv[offset]; >+ >+ #ifdef _DEBUG >+ fprintf(trcFile, "hc_getEnvironmentVariable: envvar = <%s>\n", envvar); >+ fflush(trcFile); >+ #endif >+ >+ /* Get the name-value pairs - look for = */ >+ tmp = strchr(envvar, '='); >+ >+ /* If we don't have an = then return the whole string for the name and an empty string for the value */ >+ if (tmp == NULL) { >+ nameLen = strlen(envvar); >+ valueLen = 0; >+ } >+ else { >+ nameLen = tmp-envvar; >+ valueLen = strlen(tmp)-1; >+ } >+ >+ n_envvarName = (char *)malloc(nameLen+1); >+ n_envvarValue = (char *)malloc(valueLen+1); >+ memcpy(n_envvarName, envvar, nameLen); >+ *(n_envvarName+nameLen) = '\0'; >+ if ((tmp == NULL) || (valueLen == 0)) { /* Bug 68899 */ >+ *n_envvarValue = '\0'; >+ } >+ else { >+ strcpy(n_envvarValue, tmp+1); >+ } >+ >+ #ifdef _DEBUG >+ fprintf(trcFile, "hc_getEnvironmentVariable: envvarName=%p <%s> envvarValue=%p <%s>\n", n_envvarName, n_envvarName, n_envvarValue, n_envvarValue); >+ fflush(trcFile); >+ #endif >+ >+ /* Convert the string from native to UTF-8 */ >+ rc_n = native2unicode(envvarName, n_envvarName, nameLen + 1); >+ rc_v = native2unicode(envvarValue, n_envvarValue, valueLen + 1); >+ >+ free(n_envvarName); >+ free(n_envvarValue); >+ >+ /* Get offset to next environment variable */ >+ nextOffset = offset + 1; >+ >+ /* If we are at the end of the environment variable array then signal it by returning -1 */ >+ if (sysEnv[nextOffset] == NULL) { >+ nextOffset = -1; >+ } >+ >+ if((rc_n == 0) || (rc_v == 0)) { >+ *envvarName = NULL; >+ *envvarValue = NULL; >+ } >+#endif >+ >+ return nextOffset; >+ >+} >+ >+/******************************************************************************* >+ * * >+ * Process handling * >+ * * >+ ******************************************************************************/ >+ >+/* >+ * Get the process state >+ * Please refer to IExecutionComponent definition >+ */ >+int hc_getProcessStatus(PID pid) { >+#ifdef _WIN32 >+ HANDLE hProcess; >+ DWORD exitCode; >+ >+ hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); >+ if (hProcess) { >+ GetExitCodeProcess(hProcess, &exitCode); >+ CloseHandle(hProcess); >+ } >+ else { >+ return org_eclipse_hyades_execution_core_IExecutionComponent_DEAD; >+ } >+ >+ if(exitCode == STILL_ACTIVE) { >+ return org_eclipse_hyades_execution_core_IExecutionComponent_READY; >+ } >+ else { >+ return org_eclipse_hyades_execution_core_IExecutionComponent_DEAD; >+ } >+#else >+ int status = 0; >+ >+ pid = waitpid(pid, &status, WNOHANG | WUNTRACED); >+ if(pid == 0) { >+ return org_eclipse_hyades_execution_core_IExecutionComponent_READY; >+ } >+ else { >+ return org_eclipse_hyades_execution_core_IExecutionComponent_DEAD; >+ } >+#endif >+} >+ >+/* >+ * Kill the process specified by the process id >+ */ >+void hc_killProcess(int pid) { >+#ifdef _WIN32 >+ HANDLE hProcess; >+ >+ hProcess=OpenProcess(PROCESS_TERMINATE, FALSE, pid); >+ if(hProcess!=NULL) { >+ TerminateProcess(hProcess, 0); >+ } >+#else >+ kill(pid, SIGKILL); >+#endif >+ >+ return; >+} >+ >+ >+/******************************************************************************* >+ * * >+ * File I/O * >+ * * >+ ******************************************************************************/ >+ >+/* >+ * Read data from file descriptor >+ */ >+int hc_readFile(RA_HANDLE fd, char* buffer, int count) { >+ int rc; >+#ifdef _WIN32 >+ ReadFile(fd, buffer, count, &rc, NULL); >+#else >+ rc = read(fd, buffer, count); >+#endif >+ return rc; >+} >+ >+ >+/* >+ * Write a single character to the file descriptor >+ */ >+int hc_writeFileChar(RA_HANDLE fd, char c) { >+ int rc; >+#ifdef _WIN32 >+ WriteFile(fd, &c, 1, &rc, NULL); >+#elif defined (__OS400__) >+ rc = write(fd, as400_atoe(&c), 1); >+#elif defined (MVS) >+ char c2[2]; >+ c2[0] = c; >+ c2[1] = '\0'; >+ __atoe(c2); >+ rc = write(fd, c2, 1); >+#else >+ rc = write(fd, &c, 1); >+#endif >+ return rc; >+} >Index: src-native-new/src/agents/native/java_profiler/java_profiler.make >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/java_profiler.make >diff -N src-native-new/src/agents/native/java_profiler/java_profiler.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/java_profiler.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,130 @@ >+ >+################################################################################ >+# >+# makefile: java_profiler project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libpiAgent >+TARGETDIR := ../../../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux ../../RABindings ../../../transport/RACommon ../../../transport/RASocket ../../../transport/RASharedMemory ../../../transport/RADataTransfer >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl hcbnd >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+#SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) $(wildcard ../heapsnapshots/*.c) $(wildcard ../heapsnapshots/*.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/transport/RADataTransfer/RADataTransfer.make >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/RADataTransfer.make >diff -N src-native-new/src/transport/RADataTransfer/RADataTransfer.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/RADataTransfer.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+ >+################################################################################ >+# >+# makefile: RADataTransfer project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libhccldt >+TARGETDIR := ../../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux ../RACommon ../RASocket ../RASharedMemory >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl hcclco hccls hcclsm pthread >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/agents/native/WinBuild/java_profiler.dsp >=================================================================== >RCS file: src-native-new/src/agents/native/WinBuild/java_profiler.dsp >diff -N src-native-new/src/agents/native/WinBuild/java_profiler.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/WinBuild/java_profiler.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,219 @@ >+# Microsoft Developer Studio Project File - Name="java_profiler" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=java_profiler - Win32 Debug >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "java_profiler.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "java_profiler.mak" CFG="java_profiler - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "java_profiler - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "java_profiler - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "java_profiler" >+# PROP Scc_LocalPath ".." >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "Release" >+# PROP BASE Intermediate_Dir "Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "bin" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /Ob2 /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /I "..\..\..\transport\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /YX /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /fo"Release/piagent.res" /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib rpcrt4.lib ws2_32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /version:0.1 /dll /pdb:none /map /machine:I386 /out:"..\..\..\..\bin\piAgent.dll" /libpath:"..\..\..\..\lib" >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 1 >+# PROP BASE Output_Dir "Debug" >+# PROP BASE Intermediate_Dir "Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 1 >+# PROP Output_Dir "bin" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /I "..\..\..\transport\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /FR /YX /FD /GZ /c >+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "_DEBUG" >+# ADD RSC /l 0x409 /fo"Debug/piagent.res" /d "_DEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib rpcrt4.lib ws2_32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\..\bin\piAgent.dll" /pdbtype:sept /libpath:"..\..\..\..\lib" >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "java_profiler - Win32 Release" >+# Name "java_profiler - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\java_profiler\agentDebug.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\filters.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\hash.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\JvmpiWriter.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\options.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\performance.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\print.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\segmentedValue.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\stack.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\StatelessHeapSnapshotManager_C.cpp >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\utility.c >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\java_profiler\agentDebug.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\binary_print.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\eventmask.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\filters.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\hash.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\JVMPIException.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\JvmpiWriter.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\options.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\performance.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\piAgentExtension.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\print.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\resource.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\segmentedValue.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\stack.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\StatelessHeapSnapshotManager_C.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\strings.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\java_profiler\utility.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\java_profiler\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/native/heapsnapshots/LBTimestamp.h >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/LBTimestamp.h >diff -N src-native-new/src/agents/native/heapsnapshots/LBTimestamp.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/LBTimestamp.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,74 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: LBTimestamp.h,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef LBTIMESTAMP_H >+#define LBTIMESTAMP_H >+ >+#ifdef WIN32 >+#include <time.h> >+typedef clock_t LBCLOCK_t; >+ >+static void getClock(LBCLOCK_t *pclock) { >+ *pclock = clock(); >+} >+static unsigned int clockDiffInMilliseconds(const LBCLOCK_t *start) { >+ LBCLOCK_t end; >+ getClock(&end); >+ return (unsigned int)(1000*((double)(end-*start))/CLOCKS_PER_SEC); >+} >+static double clockDiffInFractionalMilliseconds(const LBCLOCK_t *start) { >+ LBCLOCK_t end; >+ getClock(&end); >+ return (1000000.0*((double)(end-*start))/CLOCKS_PER_SEC); >+} >+static unsigned int clockDiffInMicroseconds(const LBCLOCK_t *start) { >+ LBCLOCK_t end; >+ getClock(&end); >+ return (unsigned int)(1000000*((double)(end-*start))/CLOCKS_PER_SEC); >+} >+ >+#else >+#include <sys/time.h> >+typedef struct timeval LBCLOCK_t; >+ >+# define timersub(a, b, result) \ >+ do { \ >+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ >+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ >+ if ((result)->tv_usec < 0) { \ >+ --(result)->tv_sec; \ >+ (result)->tv_usec += 1000000; \ >+ } \ >+ } while (0) >+ >+static void getClock(LBCLOCK_t *pclock) { >+ gettimeofday(pclock, NULL); >+} >+static double clockDiffInFractionalMilliseconds(const LBCLOCK_t *start) { >+ LBCLOCK_t end, interval; >+ getClock(&end); >+ timersub(&end, start, &interval); >+ return interval.tv_sec*1e3 + interval.tv_usec/1e3; >+} >+static unsigned int clockDiffInMilliseconds(const LBCLOCK_t *start) { >+ return (unsigned int) clockDiffInFractionalMilliseconds(start); >+} >+static unsigned int clockDiffInMicroseconds(const LBCLOCK_t *start) { >+ LBCLOCK_t end, interval; >+ getClock(&end); >+ timersub(&end, start, &interval); >+ return (unsigned int) (interval.tv_sec/1e6 + interval.tv_usec); >+} >+ >+#endif >+ >+#endif /* LBTIMESTAMP_H */ >Index: src-native-new/src/agents/thread/hcthread.make >=================================================================== >RCS file: src-native-new/src/agents/thread/hcthread.make >diff -N src-native-new/src/agents/thread/hcthread.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/hcthread.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+ >+################################################################################ >+# >+# makefile: hcthread project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libhcthread >+TARGETDIR := ../../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux ../RABindings ../../transport/RACommon ../../transport/RASocket ../../transport/RASharedMemory ../../transport/RADataTransfer >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl hcbnd pthread >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/agents/perfmon/rac/rac.make >=================================================================== >RCS file: src-native-new/src/agents/perfmon/rac/rac.make >diff -N src-native-new/src/agents/perfmon/rac/rac.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/rac/rac.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+ >+################################################################################ >+# >+# makefile: rac project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := librac >+TARGETDIR := ../../../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../resutils ../../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux ../../RABindings ../../../transport/RACommon ../../../transport/RASocket ../../../transport/RASharedMemory ../../../transport/RADataTransfer >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl resutils >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DLINUX >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/agents/perfmon/rac/resource.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/rac/resource.h >diff -N src-native-new/src/agents/perfmon/rac/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/rac/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/agents/perfmon/WinBuild/sysperf.mak >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/sysperf.mak >diff -N src-native-new/src/agents/perfmon/WinBuild/sysperf.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/sysperf.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,231 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on sysperf.dsp >+!IF "$(CFG)" == "" >+CFG=sysperf - Win32 Release >+!MESSAGE No configuration specified. Defaulting to sysperf - Win32 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "sysperf - Win32 Release" && "$(CFG)" != "sysperf - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "sysperf.mak" CFG="sysperf - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "sysperf - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "sysperf - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "sysperf - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\sysperf.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\perfcalc.obj" >+ -@erase "$(INTDIR)\perfcontrol.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\sysperf.dll" >+ -@erase "$(OUTDIR)\sysperf.exp" >+ -@erase "$(OUTDIR)\sysperf.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\sysperf.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib rac.lib mpr.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\sysperf.pdb" /machine:I386 /out:"$(OUTDIR)\sysperf.dll" /implib:"$(OUTDIR)\sysperf.lib" /libpath:"./bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\perfcalc.obj" \ >+ "$(INTDIR)\perfcontrol.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\sysperf.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "sysperf - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\sysperf.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\perfcalc.obj" >+ -@erase "$(INTDIR)\perfcontrol.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\sysperf.dll" >+ -@erase "$(OUTDIR)\sysperf.exp" >+ -@erase "$(OUTDIR)\sysperf.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\sysperf.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib rac.lib mpr.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\sysperf.pdb" /machine:I386 /out:"$(OUTDIR)\sysperf.dll" /implib:"$(OUTDIR)\sysperf.lib" /libpath:"./bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\perfcalc.obj" \ >+ "$(INTDIR)\perfcontrol.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\sysperf.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("sysperf.dep") >+!INCLUDE "sysperf.dep" >+!ELSE >+!MESSAGE Warning: cannot find "sysperf.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "sysperf - Win32 Release" || "$(CFG)" == "sysperf - Win32 Debug" >+SOURCE=..\sysperf\perfcalc.c >+ >+"$(INTDIR)\perfcalc.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\sysperf\perfcontrol.c >+ >+"$(INTDIR)\perfcontrol.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\sysperf\version.rc >+ >+!IF "$(CFG)" == "sysperf - Win32 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "\TPTP-4.2.0-200512011334C\workspace\org.eclipse.tptp.platform.agentcontroller\src-native\collection\collectors\perfmon\sysperf" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "sysperf - Win32 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "\TPTP-4.2.0-200512011334C\workspace\org.eclipse.tptp.platform.agentcontroller\src-native\collection\collectors\perfmon\sysperf" /d "NDEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/WinBuild/sysperf.mak64 >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/sysperf.mak64 >diff -N src-native-new/src/agents/perfmon/WinBuild/sysperf.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/sysperf.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,384 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on sysperf.dsp >+!IF "$(CFG)" == "" >+CFG=sysperf - IA64 Release >+!MESSAGE No configuration specified. Defaulting to sysperf - IA64 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "sysperf - IA64 Release" && "$(CFG)" != "sysperf - IA64 Debug" && "$(CFG)" != "sysperf - X64 Release" && "$(CFG)" != "sysperf - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "sysperf.mak64" CFG="sysperf - IA64 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "sysperf - IA64 Release" >+!MESSAGE "sysperf - IA64 Debug" >+!MESSAGE "sysperf - X64 Release" >+!MESSAGE "sysperf - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "sysperf - IA64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\sysperf.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\perfcalc.obj" >+ -@erase "$(INTDIR)\perfcontrol.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\sysperf.dll" >+ -@erase "$(OUTDIR)\..\lib\sysperf.exp" >+ -@erase "$(OUTDIR)\..\lib\sysperf.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib rac.lib mpr.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\sysperf.pdb" /out:"$(OUTDIR)\sysperf.dll" /implib:"$(OUTDIR)\..\lib\sysperf.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\perfcalc.obj" \ >+ "$(INTDIR)\perfcontrol.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\sysperf.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "sysperf - IA64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\sysperf.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\perfcalc.obj" >+ -@erase "$(INTDIR)\perfcontrol.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\sysperf.dll" >+ -@erase "$(OUTDIR)\..\lib\sysperf.exp" >+ -@erase "$(OUTDIR)\..\lib\sysperf.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib rac.lib mpr.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\sysperf.pdb" /out:"$(OUTDIR)\sysperf.dll" /implib:"$(OUTDIR)\..\lib\sysperf.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\perfcalc.obj" \ >+ "$(INTDIR)\perfcontrol.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\sysperf.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "sysperf - X64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\sysperf.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\perfcalc.obj" >+ -@erase "$(INTDIR)\perfcontrol.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\sysperf.dll" >+ -@erase "$(OUTDIR)\..\lib\sysperf.exp" >+ -@erase "$(OUTDIR)\..\lib\sysperf.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib rac.lib mpr.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\sysperf.pdb" /out:"$(OUTDIR)\sysperf.dll" /implib:"$(OUTDIR)\..\lib\sysperf.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\perfcalc.obj" \ >+ "$(INTDIR)\perfcontrol.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\sysperf.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "sysperf - X64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\sysperf.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\perfcalc.obj" >+ -@erase "$(INTDIR)\perfcontrol.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\sysperf.dll" >+ -@erase "$(OUTDIR)\..\lib\sysperf.exp" >+ -@erase "$(OUTDIR)\..\lib\sysperf.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib rac.lib mpr.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\sysperf.pdb" /out:"$(OUTDIR)\sysperf.dll" /implib:"$(OUTDIR)\..\lib\sysperf.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\perfcalc.obj" \ >+ "$(INTDIR)\perfcontrol.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\sysperf.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "sysperf - IA64 Release" || "$(CFG)" == "sysperf - IA64 Debug" || "$(CFG)" == "sysperf - X64 Release" || "$(CFG)" == "sysperf - X64 Debug" >+SOURCE=..\sysperf\perfcalc.c >+ >+"$(INTDIR)\perfcalc.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\sysperf\perfcontrol.c >+ >+"$(INTDIR)\perfcontrol.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\sysperf\version.rc >+ >+!IF "$(CFG)" == "sysperf - IA64 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "sysperf - IA64 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "sysperf - X64 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "sysperf - X64 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/transport/RADataTransfer/resource.h >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/resource.h >diff -N src-native-new/src/transport/RADataTransfer/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.4 2006/04/06 15:48:13 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+//{{NO_DEPENDENCIES}} >+// Microsoft Developer Studio generated include file. >+// Used by version.rc >+// >+ >+ >+// Next default values for new objects >+// >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/agents/perfmon/sysperf/perfconstants.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/sysperf/perfconstants.h >diff -N src-native-new/src/agents/perfmon/sysperf/perfconstants.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/sysperf/perfconstants.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,23 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+ >+ >+#ifndef __PERFCONSTANTS_H__ >+#define __PERFCONSTANTS_H__ >+ >+static char* PERFMON_KEY_HOST = "PERFMON_REG_HOST"; >+static char* PERFMON_USERNAME = "PERFMON_USERNAME"; >+static char* PERFMON_PASSWORD = "PERFMON_PASSWORD"; >+ >+#endif >Index: src-native-new/src/agents/java/resource.h >=================================================================== >RCS file: src-native-new/src/agents/java/resource.h >diff -N src-native-new/src/agents/java/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.4 2006/04/06 15:48:11 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+//{{NO_DEPENDENCIES}} >+// Microsoft Developer Studio generated include file. >+// Used by version.rc >+// >+ >+ >+// Next default values for new objects >+// >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/agents/native/java_profiler/piAgent.exp >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/piAgent.exp >diff -N src-native-new/src/agents/native/java_profiler/piAgent.exp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/piAgent.exp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,21 @@ >+#! libpiAgent.so exports >+JVM_OnLoad >+Java_com_ibm_etools_logging_tracing_agent_Callback_JVMPICatch0 >+Java_com_ibm_etools_logging_tracing_agent_Callback_JVMPIThrow0 >+Java_com_ibm_etools_logging_tracing_agent_Callback_JVMPICoverage0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_initialize0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_setMode0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_startProfiling0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_stopProfiling0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_markHeap0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_analyzeHeap0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_optimizedHeapDump0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_stopOptimizedHeapInfoSnapshot0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_disableGC0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_enableGC0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_runGC0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_release0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_emitXMLFragment0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_getCurrentTime0 >+Java_org_eclipse_hyades_collection_profiler_Profiler_getCurrentThreadCpuTime0 >+ >Index: src-native-new/src/agents/perfmon/PerfmonAgent/resinterface.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/PerfmonAgent/resinterface.h >diff -N src-native-new/src/agents/perfmon/PerfmonAgent/resinterface.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/PerfmonAgent/resinterface.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,62 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resinterface.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+////////////////////////////////////////////////////////////// >+// The function definitions for the resourceDLL >+////////////////////////////////////////////////////////////// >+// >+// The four function defintions to be implemented by the custom >+// resource DLL. >+// >+////////////////////////////////////////////////////////////// >+#ifndef __RES_INTERFACE__H__ >+#define __RES_INTERFACE__H__ >+ >+#include "hashtable.h" >+#include "system.h" >+ >+// >+// The startup method - called once to initialize the resource data >+// returning errorcode >+// >+typedef int (*LPSTARTUP) (HashTable*, HashTable*, HashTable*); >+ >+// >+// The shutdown method - called once when the agent is stopped >+// and also returns errorcode >+// >+typedef int (*LPSHUTDOWN) (); >+ >+// >+// Get the tree data : returns a char** of the tree strings with each stirngs of the form >+// parent ID \0 ID \0 name \0 help \0 suffix \0 >+// where int* returns the number of strings in the array. >+// >+// The first hashTable is the request hash >+// The second hashTable is the variable hash >+typedef char** (*LPGETTREE) (int*); >+ >+// >+// Get resource results : char** returns strings of the form >+// ID \0 value \0 >+// where int* is the number of returned results >+// >+// The first hashTable is the filter hash >+// The second hashTable is the variable hash >+typedef char** (*LPGETRESULTS) (int*); >+ >+typedef void (*LPDUMPMEMORY) (); >+ >+typedef char* (*LPGETAGENTNAME) (); >+ >+#endif >+ >Index: src-native-new/src/HCLauncher/launcher_common.h >=================================================================== >RCS file: src-native-new/src/HCLauncher/launcher_common.h >diff -N src-native-new/src/HCLauncher/launcher_common.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/launcher_common.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,59 @@ >+/********************************************************************** >+Copyright (c) 2005 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: launcher_common.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+ >+#ifndef _LAUNCHER_H_ >+#define _LAUNCHER_H_ >+ >+#define MAX_ARGS 64 >+#define MAX_ENV 512 >+ >+#include "RAComm.h" >+#include "hclaunch.h" >+#include "launcher_md.h" >+#include "launcher_error.h" >+#include <stdio.h> >+ >+ >+/* >+ * The structure that contains information regarding a console connection >+ */ >+typedef struct { >+ RA_HANDLE remote; >+ RA_HANDLE in; >+ RA_HANDLE out; >+ RA_HANDLE err; >+} RemoteConsole_t; >+ >+ >+/* Copyright */ >+static char *kCBIBMCopyright="(c) Copyright IBM Corporation 2000,2001"; >+ >+/** START_PROCESS *************************************************** >+ * This function lauches a process on the current OS. Using the >+ * specified executable and arguments it checks the server configuration >+ * to determine if the specified process is allowed to be launched, and >+ * if so, creates the specified environment for the process before it >+ * is launched. >+ * @param exe - the alias name of the process to launch. >+ * @param args - the arguments for the process. >+ * @param location - the directory to launch the process in. >+ * @param remoteCOnsoleIP - the IP address of the remote console. >+ * @param remoteConsolePort - the port of the remote console. >+ * @param finalEnvironment -the hc_array_t structure to recieve the process environment. >+ */ >+PID hc_startProcess(char *exe, >+ char *cmdline, >+ char *location, >+ char *env, >+ RemoteConsole_t *console); >+ >+#endif >Index: src-native-new/src/agents/native/WinBuild/heapsnapshots.dsp >=================================================================== >RCS file: src-native-new/src/agents/native/WinBuild/heapsnapshots.dsp >diff -N src-native-new/src/agents/native/WinBuild/heapsnapshots.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/WinBuild/heapsnapshots.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,124 @@ >+# Microsoft Developer Studio Project File - Name="heapsnapshots" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Static Library" 0x0104 >+ >+CFG=heapsnapshots - Win32 Debug >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "heapsnapshots.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "heapsnapshots.mak" CFG="heapsnapshots - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "heapsnapshots - Win32 Release" (based on "Win32 (x86) Static Library") >+!MESSAGE "heapsnapshots - Win32 Debug" (based on "Win32 (x86) Static Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "heapsnapshots" >+# PROP Scc_LocalPath ".." >+CPP=cl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "heapsnapshots - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "heapsnapshots___Win32_Release" >+# PROP BASE Intermediate_Dir "heapsnapshots___Win32_Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "bin" >+# PROP Intermediate_Dir "Release" >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LIB32=link.exe -lib >+# ADD BASE LIB32 /nologo >+# ADD LIB32 /nologo >+ >+!ELSEIF "$(CFG)" == "heapsnapshots - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 1 >+# PROP BASE Output_Dir "heapsnapshots___Win32_Debug" >+# PROP BASE Intermediate_Dir "heapsnapshots___Win32_Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 1 >+# PROP Output_Dir "bin" >+# PROP Intermediate_Dir "Debug" >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c >+# ADD BASE RSC /l 0x409 /d "_DEBUG" >+# ADD RSC /l 0x409 /d "_DEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LIB32=link.exe -lib >+# ADD BASE LIB32 /nologo >+# ADD LIB32 /nologo >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "heapsnapshots - Win32 Release" >+# Name "heapsnapshots - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\AbstractHeapSnapshotManager.cpp >+# End Source File >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\StatelessHeapSnapshotManager.cpp >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\AbstractHeapSnapshotManager.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\HeapSnapshotManager.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\LBTimestamp.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\SnapshotAgentInterface.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\SnapshotFiller.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\heapsnapshots\StatelessHeapSnapshotManager.h >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/native/java_profiler/piAgentExtension.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/piAgentExtension.h >diff -N src-native-new/src/agents/native/java_profiler/piAgentExtension.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/piAgentExtension.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,235 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: piAgentExtension.h,v 1.3 2005/10/15 22:07:51 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+/* >+ * This file contains typedefs and a structure definition for >+ * agent extensions to use. >+ * >+ >+How to write an agent extension to extend the Hyades piAgent: >+ >+Your source should #include "piAgentExtension.h" from >+o.e.h.datacollectors/collection/collectors/native/java_profiler because >+that's where the structures and typedefs below appear. >+ >+You use the Agent Controller's plugin/config system to tell >+the main piAgent that it should load your extension. Here's how: >+ >+In the RASERVER_HOME directory, there is a subdirectory "plugins." >+Make a new subdirectory of "plugins" using a name that won't collide >+with others - something like "com.sample.myAgentExtension" using your >+company's domain name. >+ >+Make a subdirectory of your plugin directory called "config." >+ >+Put a file in your "config" directory called "pluginconfig.xml." >+ >+Put something like this in your pluginconfig.xml file: >+ >+<?xml version="1.0" encoding="UTF-8"?> >+<PluginConfiguration requires="org.eclipse.hyades.datacollection"> >+ <Agent configuration="default" name="Java Profiling Agent" extends="default"> >+ <Option name="piAgentExtension" >+ type="libraryName" >+ value="%RASERVER_HOME%\plugins\com.sample.myAgentExtension\lib\myLib.dll" >+ /> >+ </Agent> >+</PluginConfiguration> >+ >+The only thing in this example that you should fill in is the value of >+the Option that has the name "piAgentExtension" and the type "libraryName." >+All the other element and attribute names have to exactly as shown. You can >+add other Option lines and the options you put there will be accessible to >+your agent using ra_getDefaultConfiguration(). >+ >+Your agent extension library has to export a function called >+"agent_extension_init" using standard C calling conventions, and it has >+to have this signature: JNIEXPORT void >+agent_extension_init(AgentExtensionInitArgs_t *args); >+ >+That function will be called by the main piAgent during the processing >+of the JVM_OnLoad function, which is called by JVMPI when it wants to >+let the JVMPI agent initialize itself. >+ >+These are the meanings of the values in the AgentExtensionInitArgs >+structure: >+ >+int api_version >+ Holds the number '1' today. >+ >+ Will increase if there are additions to the args struct. >+ >+ Use this in the future to test for additional functionality >+ provided by the base piAgent beyond what's described here. >+ >+const char* options >+ The option string that followed "-XrunpiAgent:" on the Java command line. >+ >+ The option string passed will be a null string (ie: properly terminated >+ string of length 0) if there are no options (specified with or without a >+ colon). >+ >+JavaVM jvm >+ The JavaVM* pointer obtained during JVM_OnLoad. >+ >+JVMPI_Interface jvmpi_interface >+ The JVMPI_Interface* pointer obtained during JVM_OnLoad. >+ >+RA_AGENT_HANDLE agent_handle >+ The RAC agent handle obtained by piAgent from ra_initializeBindings. >+ Use this when calling RAC functions that take a handle argument. >+ >+SetCommandHandlerFunction set_command_handler >+ Call this function to register your handler for incoming RAC commands. >+ >+SetEventHandlerFunction set_event_handler >+ Call this function to register your handler for JVMPI events. >+ >+event_enable_safety_flag >+ This flag is true if it's safe to call set_event_handler() >+ from the extension's agent_extension_init function. See >+ below about when it's safe to call set_event_handler. >+ >+The "args" structure will not be preserved after your init function >+returns, so copy anything you want from it into your own storage. >+ >+REGISTERING FOR JVMPI EVENTS >+ >+Your JVMPI event handler functions must have this signature: >+void myEventHandler(JVMPI_Event *event); >+ >+You register an event handler by calling through the set_event_handler >+function pointer: >+ (args->set_event_handler)(event_number, my_handler_function); >+ >+It's not always safe to call set_event_handler. It can only be called >+at a time when a JVMPI agent is permitted to call the JVMPI function >+EnableEvent. >+ >+If args->enable_event_safety_flag is true (nonzero), then it is >+safe to call set_event_handler from inside your agent_extension_init >+function. >+ >+If args->enable_event_safety_flag is false (zero), or from outside your >+agent_extension_init function, the agent extension is responsible for >+making sure it's safe to call EnableEvent. The surest way to do this is >+to create a new thread, attach that thread to the JVM, make the enable_event >+call, then detach the thread and let it die. >+ >+RECEIVING EVENTS >+ >+When you register a handler for a JVMPI event and the event occurs, the >+JVMPI_Event struct pointer you get is exactly as it came from JVMPI. >+Your handler is called before the one in the main piAgent (if any). If >+you want to call JNI or JVMPI functions from your handler, call them >+directly using the pointers you got in agent_extension_init. >+ >+REGISTERING FOR AND RECEIVING RAC COMMANDS >+ >+Your RAC command handler function must have this signature: >+ void myCommandHandler(ra_command_t *command); >+ >+Use the set_command_handler function to register your handler. >+After you register it, your handler will be called for all RAC commands >+that the piAgent gets. >+ >+The command struct you receive is exactly the same as the piAgent sees. >+Your command processor runs before the one in the main piAgent. It is >+not safe to change the contents of the command struct. >+ >+EXAMPLE >+ >+Below is a small but complete sample of an agent extension using most of >+the features described here. >+*/ >+ >+#if 0 >+----------------- begin agent extension example; see above --------------- >+#include "piAgentExtension.h" >+ >+/* >+ * This example agent extension exercises some of the features of the >+ * piAgent extensibility architecture: >+ * >+ * It writes a line to stderr when the agent_extension_init function gets called. >+ * It registers handlers for two JVMPI events (INIT_DONE and CLASS_LOAD). >+ * It registers a handler for RAC commands. >+ * >+ * The event handler for INIT_DONE just reports that it occurred. >+ * >+ * The event handler for CLASS_LOAD maintains count of how >+ * many classes were loaded and reports the count every >+ * time a new class loads. >+ * >+ * The event handler for RAC commands reports the type of the command received. >+ */ >+ >+void example_init_done_handler(JVMPI_Event *event) >+{ >+ fprintf(stderr, "(Agent extension received init_done event)\n"); >+} >+ >+void example_class_load_handler(JVMPI_Event *event) >+{ >+ /* add one to the class load count */ >+ class_load_count++; >+ fprintf(stderr, "(Load class %s, %d so far)\n", >+ event->u.class_load.class_name, >+ class_load_count); >+} >+ >+void example_command_handler(ra_command_t *command) >+{ >+ fprintf(stderr, "(Received RAC command, type %d)\n", command->tag); >+} >+ >+JNIEXPORT void agent_extension_init(AgentExtensionInitArgs *args) >+{ >+ fprintf(stderr, "(agent_extension_init called.)\n"); >+ (*args->set_command_handler)(example_command_handler); >+ (*args->set_event_handler)(JVMPI_EVENT_JVM_INIT_DONE, example_init_done_handler); >+ (*args->set_event_handler)(JVMPI_EVENT_CLASS_LOAD, example_class_load_handler); >+} >+----------------------- end agent extension example --------------- >+#endif >+ >+/* >+ * This is the real start of this header file. >+ * Everything above is a comment. >+ */ >+ >+#include "RAComm.h" >+#include "jni.h" >+#include "jvmpi.h" >+#include "RABindings.h" >+ >+/* Typedefs for sub-agent handler functions and the setters for them */ >+typedef void (*AgentExtensionEventHandler)(JVMPI_Event *event, void **sub_agent_slot); >+typedef void (*SetEventHandlerFunction)(jint event_type, AgentExtensionEventHandler fn); >+typedef void (*AgentExtensionCommandHandler)(ra_command_t *command); >+typedef void (*SetCommandHandlerFunction)(AgentExtensionCommandHandler fn); >+ >+/* agent extension initialization argument structure */ >+ >+typedef struct { >+ int api_version; >+ const char *options; >+ JavaVM *jvm; >+ JVMPI_Interface *jvmpi_interface; >+ RA_AGENT_HANDLE agent_handle; >+ SetCommandHandlerFunction set_command_handler; >+ SetEventHandlerFunction set_event_handler; >+ char event_enable_safety_flag; >+} AgentExtensionInitArgs; >+ >+typedef void (*AgentExtensionInitFunction)(AgentExtensionInitArgs *args); >+ >Index: src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.cpp >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.cpp >diff -N src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.cpp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.cpp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,525 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: StatelessHeapSnapshotManager.cpp,v 1.6 2005/09/09 21:33:11 apratt Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <stdlib.h> // free >+#include <string.h> >+ >+#include "StatelessHeapSnapshotManager.h" >+#include "LBTimestamp.h" >+ >+static const char* CORRUPT_HEAP_DUMP = "heap dump that the JVM gave us is corrupt!"; >+static const char* BOGUS_CONSTANT_POOL = "JVMPI bogus class constant pool"; >+ >+StatelessHeapSnapshotManager::StatelessHeapSnapshotManager(SnapshotFiller* filler, >+ SnapshotAgentInterface* agent, >+ JVMPI_Interface* jvmpi, >+ bool optHeapDebug, >+ FILE * debugOut) >+ : AbstractHeapSnapshotManager(filler, agent, jvmpi) >+{ >+ _optHeapDebug = optHeapDebug; >+ _debugOut = debugOut; >+} >+char StatelessHeapSnapshotManager::isStateless() const >+{ >+ return 1; >+} >+ >+void StatelessHeapSnapshotManager::handleHeapSnapshot(JNIEnv* env, >+ int dump_level, >+ char* begin, >+ char* end, >+ HeapDumpMode heapDumpMode) >+{ >+ // 1. for timing... >+ LBCLOCK_t now; >+ getClock(&now); >+ >+ // 2. need certain class information that isn't in the heap snapshot >+ if(!getClassInfos(begin, end)) return; >+ >+ if(agent().shouldIReportHeapSnapshotDuration()) { >+ agent().status("part 1 (milliseconds):", >+ clockDiffInMilliseconds(&now)); >+ } >+ getClock(&now); >+ >+ // 3. add a generation begin marker >+ filler().FillJvmpiSnapshot(begin, end); >+ // 4. done, report timing >+ if(agent().shouldIReportHeapSnapshotDuration()) { >+ agent().status("part 2 (milliseconds):", >+ clockDiffInMilliseconds(&now)); >+ } >+} >+ >+#define DUMP_READ(buf, current, size) memcpy(buf, *current, size); *current+= size >+ >+void *StatelessHeapSnapshotManager::prof_dump_read_ptr(char **current) const >+{ >+ void *p; >+#ifdef __OS400__ >+/* On AS/400 pointers are 16-byte aligned within the buffer. >+ Forward to the next 16 byte boundary if we currently aren't on one */ >+ unsigned int i = (unsigned int) *current; >+ i &= 0x0000000f; /* grab lowest 4 bits of i */ >+ if (i > 0) { >+ *current = *current + (16 - i); /* align the pointer */ >+ } >+#endif >+ DUMP_READ(&p, current, sizeof(void *)); >+ return p; >+} >+ >+#ifdef __OS400__ >+void StatelessHeapSnapshotManager::parseClassDump(unsigned int object_dump_len, >+ char *object_dump_data, int numInterfaces, int numStaticReferenceFields, >+ unsigned int *instanceSize, jobjectID** classRefs) const >+{ >+ >+ char* cursor; >+ jobjectID cls; >+ *instanceSize = 0; >+ *classRefs = NULL; >+ if ((object_dump_len = 0) || >+ (object_dump_data[0] != JVMPI_GC_CLASS_DUMP)) >+ return; >+ >+ cursor = object_dump_data + 1; >+ cls = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); /* class id */ >+ >+ if(cls == NULL) { >+ // something funky happened, and we have to bail out >+ agent().error(CORRUPT_HEAP_DUMP); >+ return; >+ } >+ >+ cursor += sizeof(jobjectID); /* super class Id */ >+ cursor += sizeof(jobjectID); /* class loader Id */ >+ cursor += sizeof(jobjectID); /* signers Id */ >+ cursor += 2*sizeof(jobjectID); /* protection domain , class name */ >+ prof_dump_read_ptr(&cursor); /* resv2 */ >+ *instanceSize = agent().swap32(agent().dump_read_u4(cursor)); /* instance size */ >+ cursor += sizeof(unsigned int); >+ >+ int i; >+ for(i=0; i<numInterfaces; i++) { >+ //jobjectID iref = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); /* All the ids of numInterfacees */ >+ } >+ >+ // CONSTANT POOL >+ unsigned short constPoolSize = agent().swap16(agent().dump_read_u2(cursor)); >+ /* size of constant pool */ >+ cursor += 2; >+ >+ for (i=0; i<constPoolSize; i++) { >+ //unsigned short constPoolIndex = agent().swap16(agent().dump_read_u2(cursor)); >+ cursor += 2; >+ >+ char constPoolType = agent().dump_read_u1(cursor); >+ cursor += 1; >+ >+ /* skip over the constant; how much depends on its type */ >+ switch(constPoolType) { >+ case JVMPI_BOOLEAN: >+ case JVMPI_BYTE: >+ cursor += 1; break; >+ case JVMPI_CHAR: >+ case JVMPI_SHORT: >+ cursor += 2; break; >+ case JVMPI_FLOAT: >+ case JVMPI_INT: >+ cursor += 4; break; >+ case JVMPI_CLASS: >+ case JVMPI_NORMAL_OBJECT : >+ { >+ // this is a reference case >+ //jobjectID constPoolValue = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); >+ break; >+ } >+ case JVMPI_LONG: >+ case JVMPI_DOUBLE: >+ cursor += 8; break; >+ default: >+ agent().error(BOGUS_CONSTANT_POOL); break; >+ } >+ } >+ >+ // STATIC FIELDS >+ int j; >+ int objIdSize = sizeof(jobjectID); >+ jobjectID *buildClassRefs = (jobjectID *)malloc(objIdSize * (numStaticReferenceFields)); >+ *classRefs = buildClassRefs; >+ for (i=0; i<numStaticReferenceFields; i++) { >+ buildClassRefs[i] = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); >+ } >+} >+#endif >+ >+/* >+ Anandi 1 April 2005: The OS400 jvm does not include all the classes >+ in the dump. Only the user ones seem to be included. >+ 1. Added code to explicitly request jvmpi to dump classes and class >+ objects (to dump static class references) whenever getClassInfos >+ comes across an instance or an object array whose class has not >+ been seen till then. >+ 2. Changed FillClassInfo (only for OS400) to write out all the class >+ details, including static class references. What this implies is that the >+ classInfos store ALL the class related data in OS400 optHeap files and >+ the parser must build the classes from these. These heaps may include >+ the normal JVMPI_GC_CLASS_DUMP for some classes, the parser should ignore >+ these. >+ */ >+char StatelessHeapSnapshotManager::getClassInfos(char* begin, char* end) const >+{ >+ char* cursor = begin; >+ char poisonPill = 0; // found terminal error? >+ >+ if (_optHeapDebug) { >+ fprintf(_debugOut, "In getClassInfos.\n"); >+ fflush(_debugOut); >+ } >+ >+ while (cursor < end && !poisonPill) { >+ >+ if(!agent().stillAlive() || !agent().stillTracing()) { >+ poisonPill = 1; >+ break; >+ } >+ >+ // the type of current entry in the bit bucket >+ unsigned char type = agent().dump_read_u1(cursor); >+ cursor += sizeof(char); >+ >+ switch (type) { // big switch statement >+ case JVMPI_GC_ROOT_UNKNOWN: >+ cursor += sizeof(jobjectID); >+ break; >+ >+ case JVMPI_GC_ROOT_JNI_GLOBAL: >+ cursor += sizeof(jobjectID); >+ cursor += sizeof(jobject); >+ break; >+ >+ case JVMPI_GC_ROOT_JNI_LOCAL: >+ cursor += sizeof(jobjectID); >+ prof_dump_read_ptr(&cursor); >+// cursor += sizeof(JNIEnv*); >+ cursor += sizeof(int); >+ break; >+ >+ case JVMPI_GC_ROOT_JAVA_FRAME: >+ cursor += sizeof(jobjectID); >+ prof_dump_read_ptr(&cursor); >+// cursor += sizeof(JNIEnv*); >+ cursor += sizeof(int); >+ break; >+ >+ case JVMPI_GC_ROOT_NATIVE_STACK: >+ cursor += sizeof(jobjectID); >+ prof_dump_read_ptr(&cursor); >+// cursor += sizeof(JNIEnv*); >+ break; >+ >+ case JVMPI_GC_ROOT_STICKY_CLASS: >+ cursor += sizeof(jobjectID); >+ break; >+ >+ case JVMPI_GC_ROOT_THREAD_BLOCK: >+ cursor += sizeof(jobjectID); >+ prof_dump_read_ptr(&cursor); >+// cursor += sizeof (JNIEnv*); >+ break; >+ >+ case JVMPI_GC_ROOT_MONITOR_USED: >+ cursor += sizeof(jobjectID); >+ break; >+ >+ case JVMPI_GC_CLASS_DUMP: >+ { >+ jobjectID cls = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); /* class id */ >+ >+ if(cls == NULL) { >+ // something funky happened, and we have to bail out >+ agent().error(CORRUPT_HEAP_DUMP); >+ poisonPill = 1; >+ if (_optHeapDebug) { >+ fprintf(_debugOut, "In getClassInfo NULL class id.\n"); >+ fflush(_debugOut); >+ } >+ break; >+ } >+ >+ cursor += sizeof(jobjectID); /* super class Id */ >+ cursor += sizeof(jobjectID); /* class loader Id */ >+ cursor += sizeof(jobjectID); /* signers Id */ >+ cursor += 2*sizeof(jobjectID); /* protection domain , class name */ >+ prof_dump_read_ptr(&cursor); /* resv2 */ >+ unsigned int instanceSize = agent().swap32(agent().dump_read_u4(cursor)); /* instance size */ >+ cursor += sizeof(unsigned int); >+ >+ int numInterfaces, numStaticReferenceFields; >+ char* className; >+ char className_freeMe; >+ >+ if (_optHeapDebug) { >+ fprintf(_debugOut, "In getClassInfo 0x%x.\n", cls); >+ fflush(_debugOut); >+ } >+ >+#ifdef __OS400__ >+ /* 96108: Anandi On AS400, with jvm 1.4, objects are showing up >+ before classes. Which, because we create classInfos from objects >+ causes this to return status = 1 for such classes. >+ Handle this by calling FillClassInfo only when status =0 >+ */ >+ char getClassInfoStatus = agent().getClassInfo(cls, &className, &className_freeMe, &numInterfaces, &numStaticReferenceFields); >+ if (getClassInfoStatus !=0 && getClassInfoStatus !=1) { >+ agent().error(CORRUPT_HEAP_DUMP); >+ fprintf(stderr, "agent().getClassInfo non 0 or 1 return.\n"); >+ poisonPill = 1; >+ break; >+ } >+#else >+ if(agent().getClassInfo(cls, &className, &className_freeMe, &numInterfaces, &numStaticReferenceFields)) { >+ agent().error(CORRUPT_HEAP_DUMP); >+ fprintf(stderr, "agent().getClassInfo non 0 or 1 return.\n"); >+ poisonPill = 1; >+ break; >+ } >+#endif >+ >+ int i; >+ for(i=0; i<numInterfaces; i++) { >+ //jobjectID iref = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); /* All the ids of numInterfacees */ >+ } >+ >+ // CONSTANT POOL >+ unsigned short constPoolSize = agent().swap16(agent().dump_read_u2(cursor)); >+ /* size of constant pool */ >+ cursor += 2; >+ >+ for (i=0; i<constPoolSize; i++) { >+ //unsigned short constPoolIndex = agent().swap16(agent().dump_read_u2(cursor)); >+ cursor += 2; >+ >+ char constPoolType = agent().dump_read_u1(cursor); >+ cursor += 1; >+ >+ /* skip over the constant; how much depends on its type */ >+ switch(constPoolType) { >+ case JVMPI_BOOLEAN: >+ case JVMPI_BYTE: >+ cursor += 1; break; >+ case JVMPI_CHAR: >+ case JVMPI_SHORT: >+ cursor += 2; break; >+ case JVMPI_FLOAT: >+ case JVMPI_INT: >+ cursor += 4; break; >+ case JVMPI_CLASS: >+ case JVMPI_NORMAL_OBJECT : >+ { >+ // this is a reference case >+ //jobjectID constPoolValue = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); >+ break; >+ } >+ case JVMPI_LONG: >+ case JVMPI_DOUBLE: >+ cursor += 8; break; >+ default: >+ agent().error(BOGUS_CONSTANT_POOL); break; >+ } >+ } >+ >+ // STATIC FIELDS >+ int j; >+#ifdef __OS400__ >+ // dump the classRefs here, including the null refs >+ int objIdSize = sizeof(jobjectID); >+ jobjectID *classRefs = (jobjectID *)malloc(objIdSize * (numStaticReferenceFields)); >+ for (j=0; j<numStaticReferenceFields; j++) { >+ classRefs[j] = agent().dump_read_jobjectID(cursor); >+ cursor += sizeof(jobjectID); >+ } >+#else >+ for (j=0; j<numStaticReferenceFields; j++) { >+ cursor += sizeof(jobjectID); >+ } >+#endif >+ >+#ifdef __OS400__ >+ if (getClassInfoStatus !=1) { >+#endif >+ filler().FillClassInfo(cls, >+ className, >+ numStaticReferenceFields, >+ numInterfaces, >+#ifdef __OS400__ >+ instanceSize, classRefs); >+ free(classRefs); >+#else >+ instanceSize); >+#endif >+#ifdef __OS400__ >+ } >+#endif >+ >+ if(className_freeMe) { >+ free(className); >+ } >+ >+ break; >+ } >+ >+ case JVMPI_GC_INSTANCE_DUMP: >+ { >+ >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ int numInterfaces, numStaticReferenceFields; >+ char* className; >+ char className_freeMe = 0; >+ unsigned int instanceSize = 0; >+ unsigned int object_dump_len = 0; >+ char *object_dump_data = NULL; >+ jobjectID* classRefs = NULL; >+#endif >+ >+ cursor += sizeof(jobjectID); /* object */ >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ jobjectID cls = agent().dump_read_jobjectID(cursor); >+#endif >+ cursor += sizeof(jobjectID); /* class id */ >+ >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ int status = agent().getOS400ClassInfo(cls, &className, &className_freeMe, >+ &numInterfaces, &numStaticReferenceFields, &object_dump_len, &object_dump_data >+ ) ; >+ >+ if(status < 0) { >+ agent().error(CORRUPT_HEAP_DUMP); >+ poisonPill = 1; >+ break; >+ } >+ >+ if ( status == 0 ) { >+ parseClassDump(object_dump_len, object_dump_data, numInterfaces, >+ numStaticReferenceFields, &instanceSize, &classRefs); >+ filler().FillClassInfo(cls, >+ className, >+ numStaticReferenceFields, >+ numInterfaces, >+ instanceSize, classRefs); >+ free(classRefs); >+ } >+ >+ if(className_freeMe) { >+ free(className); >+ free(object_dump_data); >+ } >+#endif >+ unsigned int remainingBytes = agent().swap32(agent().dump_read_u4(cursor)); >+ cursor += sizeof(unsigned int); >+ cursor += remainingBytes; >+ break; >+ } >+ >+ case JVMPI_GC_OBJ_ARRAY_DUMP: >+ { >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ int numInterfaces, numStaticReferenceFields; >+ char* className; >+ char className_freeMe = 0; >+ unsigned int instanceSize = 0; >+ unsigned int object_dump_len = 0; >+ char *object_dump_data = NULL; >+ jobjectID *classRefs = NULL; >+#endif >+ cursor += sizeof(jobjectID); >+ int numElem = agent().swap32(agent().dump_read_u4(cursor)); >+ cursor += sizeof(int); >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ jobjectID cls = agent().dump_read_jobjectID(cursor); >+#endif >+ cursor += sizeof(jobjectID); >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ int status = agent().getOS400ClassInfo(cls, &className, &className_freeMe, >+ &numInterfaces, &numStaticReferenceFields, &object_dump_len, &object_dump_data >+ ) ; >+ >+ if(status < 0) { >+ agent().error(CORRUPT_HEAP_DUMP); >+ poisonPill = 1; >+ break; >+ } >+ >+ if ( status == 0 ) { >+ parseClassDump(object_dump_len, object_dump_data, numInterfaces, >+ numStaticReferenceFields, &instanceSize, &classRefs); >+ filler().FillClassInfo(cls, >+ className, >+ numStaticReferenceFields, >+ numInterfaces, >+ instanceSize, classRefs); >+ free(classRefs); >+ } >+ >+ if(className_freeMe) { >+ free(className); >+ free(object_dump_data); >+ } >+#endif >+ for (int i=0; i<numElem; i++) { >+ cursor += sizeof(jobjectID); >+ } >+ break; >+ } >+ >+ case JVMPI_GC_PRIM_ARRAY_DUMP: >+ cursor += sizeof(jobjectID); >+ cursor += sizeof(int); >+ cursor += sizeof(char); >+ break; >+ >+ default: >+ // some error in the trace, or in our processing of it >+ poisonPill = 1; >+ if (_optHeapDebug) { >+ fprintf(_debugOut, >+ "Possible parse error in getClassInfos. Unknown heap dump record type %d.\n", >+ type); >+ fflush(_debugOut); >+ } >+ break; >+ } //switch >+ } // while >+ >+ // return whether finished without error >+ if (_optHeapDebug) { >+ fprintf(_debugOut, "End getClassInfos: poisonPill %d\n", poisonPill); >+ fflush(_debugOut); >+ } >+ return poisonPill==0; >+} >Index: src-native-new/src/HCLauncher/launcher_common.c >=================================================================== >RCS file: src-native-new/src/HCLauncher/launcher_common.c >diff -N src-native-new/src/HCLauncher/launcher_common.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/launcher_common.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,53 @@ >+/********************************************************************** >+Copyright (c) 2005 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: launcher_common.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+ >+#include "launcher_common.h" >+ >+ >+/** START_PROCESS *************************************************** >+ * This function lauches a process on the current OS. Using the >+ * specified execuatble and arguments it checks the server configuration >+ * to determine if the specified process is allowed to be launched, and >+ * if so, creates the specified environment for the process before it >+ * is launched >+ */ >+PID hc_startProcess(char *exe, char *cmdline, char *location, char *env, RemoteConsole_t *console) { >+ PID childPID; >+ RA_HANDLE consoleChild[3]; >+ >+ /* Set the console to be NULL initially */ >+ console->in = RA_HANDLE_NULL; >+ console->out = RA_HANDLE_NULL; >+ console->err = RA_HANDLE_NULL; >+ consoleChild[0] = RA_HANDLE_NULL; /* in */ >+ consoleChild[1] = RA_HANDLE_NULL; /* out */ >+ consoleChild[2] = RA_HANDLE_NULL; /* err */ >+ >+ /* When a process is launched through this mechanism we would like to >+ capture the remote console information to be transported to the remote >+ monitor. >+ */ >+ if(!ra_createPipe(&consoleChild[0], &console->in)) { >+ printf("Error creating stdin pipe\n"); >+ } >+ if(!ra_createPipe(&console->out, &consoleChild[1])) { >+ printf("Error creating stdout pipe\n"); >+ } >+ if(!ra_createPipe(&console->err, &consoleChild[2])) { >+ printf("Error creating stderr pipe\n"); >+ } >+ >+ /* Launch the process */ >+ childPID = hc_launchProcess(exe, cmdline, location, env, consoleChild); >+ >+ return childPID; >+} >Index: src-native-new/src/agents/perfmon/resutils/clock.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/clock.c >diff -N src-native-new/src/agents/perfmon/resutils/clock.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/clock.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,196 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: clock.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+/*********************************************************************** >+ * >+ * File: Event.c >+ * Overview: The following code provides a simple clock interface, >+ * refer to Clock.h for definitions of Clock struct and return >+ * types. Note that the Clock struct is explicitly allocated >+ * by user. >+ * >+ ***********************************************************************/ >+ >+#include "system.h" >+ >+/*********************************************************************** >+ * Function: ClockMillis >+ * Purpose: return milliseconds since arbitrary start point >+ * Parameters: >+ * Returns: >+ ***********************************************************************/ >+ >+static int ClockMillis(XINT64 *d) >+{ >+#ifdef WIN32 >+ >+ GetSystemTimeAsFileTime((LPFILETIME)d); >+ >+ (*d) = (((*d) + 5000) / 10000); >+#endif >+#if defined(SOLARIS) || defined(LINUX) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ struct timeval tv; >+ >+ if (gettimeofday(&tv, NULL) < 0) >+ { >+ return XCLOCK_ERROR_UNKNOWN; >+ } >+ >+ *d = (tv.tv_sec * 1000) + ((tv.tv_usec + 500) / 1000); >+// (*d) = ((((XINT64)(tv.tv_sec) * 1000) + (((XINT64)(tv.tv_usec) + 500) / 1000))); >+ >+#endif >+ >+ return SUCCESS; >+} >+ >+int XClockMillis(XINT64 *d) { >+ >+#ifdef WIN32 >+ LARGE_INTEGER time; >+ FILETIME ftime; >+ LPFILETIME fileTime = &ftime; >+ >+ GetSystemTimeAsFileTime(fileTime); >+ >+// (*d) = (((*d) + 5000) / 10000); >+ >+ time.LowPart = fileTime->dwLowDateTime; time.HighPart = fileTime->dwHighDateTime; >+ *d = (time.QuadPart / 10000L) - 11644473600000L; >+ >+#else >+ >+ struct timeb t; >+ ftime(&t); >+ *d = ((XINT64)(t.time))*1000 + t.millitm; >+ >+#endif >+ >+ return SUCCESS; >+} >+/*********************************************************************** >+ * Function: SC_ClockCreate >+ * Purpose: Initialises Clock struct with the time of the call. This >+ * is when the clock was created. >+ * Parameters: Clock *, a pointer to a Clock struct. >+ * Returns: int, CLOCK_SUCCESS as the routine cannot fail. >+ ***********************************************************************/ >+ >+int XClockCreate(XClock *clock) >+{ >+ int okay; >+ >+ if ((okay = ClockMillis(&clock->initial)) != SUCCESS) >+ { >+ return okay; >+ } >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XClockDelete >+ * Purpose: Invalidates the clock struct. >+ * Parameters: Clock *, a pointer to a Clock struct. >+ * Returns: int, CLOCK_SUCCESS as the routine cannot fail. >+ ***********************************************************************/ >+ >+int XClockDelete(XClock *clock) >+{ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: ClockAdjust >+ * Purpose: Adjusts clock initial >+ * Parameters: Clock *, a pointer to a Clock struct. >+ * Returns: int, CLOCK_SUCCESS as the routine cannot fail. >+ ***********************************************************************/ >+ >+int XClockAdjust(XClock *clock, XINT64 adj) >+{ >+ clock->initial = clock->initial + adj; >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: ClockRead >+ * Purpose: Returns the number of clock ticks in ticks that have >+ * passed since creation (modulo adjustment). >+ * Parameters: Clock *, a pointer to a Clock struct. >+ * Returns: int, CLOCK_SUCCESS, function cannot fail. >+ ***********************************************************************/ >+ >+int XClockRead(XClock *clock, XINT64 *ticks) >+{ >+ int okay; >+ XINT64 current; >+ >+ if ((okay = ClockMillis(¤t)) != SUCCESS) >+ { >+ return okay; >+ } >+ >+ *ticks = current - clock->initial; >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XClockWait >+ * Purpose: suspend calling thread until (at least) until on the clock >+ * Parameters: Clock *, a pointer to a Clock struct. >+ * Returns: int, CLOCK_SUCCESS, function cannot fail. >+ ***********************************************************************/ >+ >+int XClockWait(XClock *clock, XINT64 until) >+{ >+ int okay; >+ XINT64 current; >+ >+ if ((okay = ClockMillis(¤t)) != SUCCESS) >+ { >+ return okay; >+ } >+ >+ current = current - clock->initial; >+ >+ if (until > current) >+ { >+ long period = (long) (until - current); >+ >+#ifdef XCLOCK_PRECISION >+ long doirep = period % (XCLOCK_PRECISION); >+ >+ period = period - doirep; >+ >+ if ((long)(XRandomUniform() * (XCLOCK_PRECISION)) < doirep) >+ { >+ period = period + (XCLOCK_PRECISION); >+ } >+#endif >+ >+#ifdef WIN32 >+ (void)Sleep(period * 1); >+#endif >+#if defined(SOLARIS) || defined(LINUX) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ (void)usleep(period * 1000); >+#endif >+ } >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * EOF >+ ***********************************************************************/ >Index: src-native-new/src/HCLauncher/hclaunch.exp >=================================================================== >RCS file: src-native-new/src/HCLauncher/hclaunch.exp >diff -N src-native-new/src/HCLauncher/hclaunch.exp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/hclaunch.exp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,9 @@ >+#!libhclaunch.so exports >+JNI_OnLoad >+Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_startProcess0 >+Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_killProcess0 >+Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_writeToProcess0 >+Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessOutput0 >+Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessError0 >+Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_getProcessStatus0 >+Java_org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl_getNativeSystemEnvironment0 >Index: src-native-new/src/agents/RABindings/RABindings.h >=================================================================== >RCS file: src-native-new/src/agents/RABindings/RABindings.h >diff -N src-native-new/src/agents/RABindings/RABindings.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/RABindings.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,202 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: RABindings.h,v 1.4 2005/04/26 19:37:30 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef _RABINDINGS_H_ >+#define _RABINDINGS_H_ >+ >+ >+#include "RAComm.h" >+#include "RASocket.h" >+ >+#if defined __cplusplus >+extern "C" { >+#endif >+ >+/* The various log message severities. */ >+enum _RA_ERROR_LEVEL {RA_DEBUG, RA_INFORMATION, RA_WARNING, RA_SEVERE, RA_MAX_ERROR_LEVEL}; >+typedef enum _RA_ERROR_LEVEL RA_ERROR_LEVEL; >+ >+ >+/* The default agent configuration information provided by the RAC is kept in a list */ >+typedef struct _agentConfigListEntry { >+ ra_agentConfigEntry_t entry; >+ struct _agentConfigListEntry *next; >+ struct _agentConfigListEntry *previous; >+}ra_agentConfigListEntry_t; >+ >+typedef struct { >+ ra_agentConfigListEntry_t *head; >+ ra_agentConfigListEntry_t *tail; >+}ra_agentConfigList_t; >+ >+ >+/* A handle for an agent that is used to hang all the agents information off of. */ >+typedef struct { >+ BOOL finalized; >+ BOOL registered; >+ RA_HANDLE pipefd; >+ TID tid; >+ ra_commandHandler_t commandHandler; >+ PID processID; >+ ra_string_t agentUUID; >+ ra_string_t processUUID; >+ ra_string_t nodeUUID; >+ ra_string_t agentType; >+ ra_string_t agentName; >+ ra_agentConfigList_t defaultConfiguration; >+#ifdef _WIN32 >+ HANDLE tHandle; /* thread handle of the pipe server */ >+#endif >+}ra_agenthandle_t; >+ >+typedef ra_agenthandle_t* RA_AGENT_HANDLE; >+ >+/** INITIALIZE_BINDINGS *********************************************** >+ * Initialization routine for the agent bindings, must be called first >+ * by te agent before running any of the other functions specified in this >+ * header file. >+ * @param name - the name of the agent. >+ * @param type - the type of the agent >+ * @param handler - the callback routine for all incomming messages. >+ * @param standalone - determines whether this agent should communicate with the RAC >+ * if standalone is TRUE the RAC is never used. >+ * @returns the new handle that is used to manage the agent. >+ */ >+extern RA_AGENT_HANDLE ra_initializeBindings(const char *name, >+ const char *type, >+ ra_commandHandler_t handler, >+ BOOL standalone); >+ >+/** FINALIZE_BINDINGS ********************************************************* >+ * Cleans up all the resources that were allocated during the agents >+ * interaction with the bindings. Once this is called the handle is >+ * no longer valid. >+ * @param handle - a handle returned by ra_initializeBindings. >+ */ >+extern void ra_finalizeBindings(RA_AGENT_HANDLE handle); >+ >+/** START_LISTENER ************************************************************ >+ * Start the message processor. >+ * @param handle - a handle returned by ra_initializeBindings >+ * @param block - whether to block until the agent is successfuly >+ * attached to a remote client. >+ * @returns NULL call failed, call ra_getLastError() to determine failure >+ * otherwise the address of the thread number the server message processor is >+ * listening on >+ * >+ */ >+extern TID *ra_startListener(RA_AGENT_HANDLE handle, >+ char block); >+ >+ >+/** STOP_LISTENER ************************************************************* >+ * Stops the message processor >+ * @param handle - a handle returned by ra_initializeBindings >+ */ >+extern void ra_stopListener(RA_AGENT_HANDLE handle); >+ >+/** SEND_MESSAGE ************************************************************** >+ * Send the message to the RAC on this node. It will >+ * then be forwarded by the server to the client. >+ * @param handle - a handle returned by ra_initializeBindings >+ * @param message - the message structure to send. >+ * @returns the number of bytes sent to the RAC. >+ */ >+extern int ra_sendMessage(RA_AGENT_HANDLE handle, >+ ra_message_t *message); >+ >+/** GET_PROCESS_ID ************************************************************ >+ * Multiplatform convenience method to retrieve the current process >+ * id. >+ * @returns the PID of the curren process >+ */ >+extern PID ra_getProcessId(); >+ >+/** GET_NODE_UUID ************************************************************* >+ * Retrieves the UUID of the node which this agent is running on. >+ * Calling this function before ra_startListener has undefined >+ * behaviour. >+ */ >+extern const char* ra_getNodeUUID(RA_AGENT_HANDLE handle); >+ >+/** GET_PROCESS_ID ************************************************************ >+ * Retrieves the UUID of the process which this agent is running in. >+ * Calling this function before ra_startListener results in undefined >+ * behaviour. >+ */ >+extern const char* ra_getProcessUUID(RA_AGENT_HANDLE handle); >+ >+/** GET_AGENT_UUID ************************************************************ >+ * Retrieves the agent's UUID. >+ */ >+extern const char* ra_getAgentUUID(RA_AGENT_HANDLE handle); >+ >+/** GET_DEFAULT_CONFIGURATION ************************************************* >+ * Retrieves a list of the options provided by the RAC as a default configuration >+ * of the agent. The configuration will only be available after the agent >+ * has successfuly registered with the RAC. >+ * @param handle - a handle returned by ra_initializeBindings >+ * @returns the agent's default configuration list if the agent has registered >+ * with the RAC. NULL otherwise. >+ */ >+extern ra_agentConfigList_t* ra_getDefaultConfiguration(RA_AGENT_HANDLE handle); >+ >+/** GET_PROCESS_COMMAND_LINE ****************************************** >+ */ >+extern char* ra_getProcessCommandLine(); >+ >+ >+/** LOG_ERROR_MESSAGE ************************************************** >+ * >+ */ >+extern void ra_logErrorMessage(RA_AGENT_HANDLE handle, >+ RA_ERROR_LEVEL severity, >+ const char *messageId, >+ const char *message); >+ >+/* Bug 74367 */ >+extern int ra_logErrorMessage_return(RA_AGENT_HANDLE handle, RA_ERROR_LEVEL severity, const char *messageId, const char *message); >+ >+ >+/** REQUEST_PEER_MONITOR ****************************************************** >+ * Requests a remote client to start monitoring this agent by asking the agent >+ * controller to find the client currently monitoring a peer agent. >+ * THIS IS NOT CURRENTLY SUPPORTED. DO NOT USE!!!!!!! >+ */ >+extern int ra_requestPeerMonitor(RA_AGENT_HANDLE handle, ra_ipaddr_t *peerAddress, PID peerPID, ra_string_t *peerAgent, unsigned long timeout); >+extern int ra_requestPeerMonitor_p(RA_AGENT_HANDLE handle, ra_ipaddr_t *peerAddress, int port, PID peerPID, ra_string_t *peerAgent, unsigned long timeout); /* Bug 77768 */ >+ >+/** REQUEST_PEER_MONITOR ****************************************************** >+ * Requests a remote client to start monitoring this agent by asking the agent >+ * controller to find the client currently monitoring a peer agent. The timeout >+ * is currently not supported. >+ */ >+extern int ra_requestPeerMonitor2(RA_AGENT_HANDLE handle, ra_ipaddr_t *peerAddress, ra_string_t *peerAgentUUID, unsigned long timeout); >+extern int ra_requestPeerMonitor2_p(RA_AGENT_HANDLE handle, ra_ipaddr_t *peerAddress, int port, ra_string_t *peerAgentUUID, unsigned long timeout); /* Bug 77768 */ >+ >+ >+extern BOOL ra_initializeVMLock(); >+extern void ra_setVMLock(); >+extern void ra_releaseVMLock(); >+extern void ra_testVMLock(); >+extern BOOL ra_getVMLockState(); >+ >+/* >+ * Return the Option values specified in the config file >+ */ >+extern void ra_getPropertyValues(RA_AGENT_HANDLE handle, char* name, char* type); >+ >+#if defined __cplusplus >+} >+#endif >+ >+#endif >Index: src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.cpp >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.cpp >diff -N src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.cpp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/AbstractHeapSnapshotManager.cpp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,44 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: AbstractHeapSnapshotManager.cpp,v 1.3 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include "AbstractHeapSnapshotManager.h" >+ >+ >+#ifdef IBM_OE >+#pragma convlit(suspend) >+#endif //IBM_OE >+ >+#ifdef IBM_OE >+#pragma convlit(resume) >+#endif //IBM_OE >+ >+ >+AbstractHeapSnapshotManager::AbstractHeapSnapshotManager(SnapshotFiller* filler, >+ SnapshotAgentInterface* agent, >+ JVMPI_Interface* jvmpi) >+{ >+ _filler = filler; >+ _agent = agent; >+ _jvmpi = jvmpi; >+} >+SnapshotFiller& AbstractHeapSnapshotManager::filler() const >+{ >+ return *_filler; >+} >+SnapshotAgentInterface& AbstractHeapSnapshotManager::agent() const >+{ >+ return *_agent; >+} >+JVMPI_Interface& AbstractHeapSnapshotManager::jvmpi() const >+{ >+ return *_jvmpi; >+} >Index: src-native-new/src/agents/perfmon/WinBuild/rac.mak >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/rac.mak >diff -N src-native-new/src/agents/perfmon/WinBuild/rac.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/rac.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,221 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on rac.dsp >+!IF "$(CFG)" == "" >+CFG=rac - Win32 Release >+!MESSAGE No configuration specified. Defaulting to rac - Win32 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "rac - Win32 Release" && "$(CFG)" != "rac - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "rac.mak" CFG="rac - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "rac - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "rac - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "rac - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\rac.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\rac.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\rac.dll" >+ -@erase "$(OUTDIR)\rac.exp" >+ -@erase "$(OUTDIR)\rac.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "../resutils" /I "../../../framework/RABindings" /I "../../../framework/RACommon" /I "../../../framework/RASocket" /I "../../../framework/RADataTransfer" /I "../../../framework/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\rac.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\rac.pdb" /machine:I386 /out:"$(OUTDIR)\rac.dll" /implib:"$(OUTDIR)\rac.lib" /libpath:"bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\rac.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\rac.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "rac - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\rac.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\rac.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\rac.dll" >+ -@erase "$(OUTDIR)\rac.exp" >+ -@erase "$(OUTDIR)\rac.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "../resutils" /I "../../../framework/RABindings" /I "../../../framework/RACommon" /I "../../../framework/RASocket" /I "../../../framework/RADataTransfer" /I "../../../framework/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\rac.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\rac.pdb" /machine:I386 /out:"$(OUTDIR)\rac.dll" /implib:"$(OUTDIR)\rac.lib" /libpath:"bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\rac.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\rac.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("rac.dep") >+!INCLUDE "rac.dep" >+!ELSE >+!MESSAGE Warning: cannot find "rac.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "rac - Win32 Release" || "$(CFG)" == "rac - Win32 Debug" >+SOURCE=..\rac\rac.c >+ >+"$(INTDIR)\rac.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\rac\version.rc >+ >+!IF "$(CFG)" == "rac - Win32 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "\perfmon\rac" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "rac - Win32 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "\perfmon\rac" /d "NDEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/RABindings/RABindings.c >=================================================================== >RCS file: src-native-new/src/agents/RABindings/RABindings.c >diff -N src-native-new/src/agents/RABindings/RABindings.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/RABindings.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1402 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: RABindings.c,v 1.12 2006/10/30 19:10:00 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <stdio.h> >+#include <time.h> >+#ifndef __OS400__ >+ #include <sys/timeb.h> >+#endif >+#include <sys/types.h> >+ >+/** Platform specifics */ >+#ifdef _WIN32 /* _WIN32 */ >+ #define TIMEB struct _timeb >+ #define FTIME(param) _ftime(param) >+#else /* not Win32 */ >+ #include <sys/socket.h> >+ #include <netinet/in.h> >+ #include <netdb.h> >+ #include <unistd.h> >+ #include <pthread.h> >+ #include <errno.h> >+ #ifdef _HPUX >+ #include <stdlib.h> /* for atexit() */ >+ #include <ctype.h> /* for isdigit() */ >+ #endif >+ #define TIMEB struct timeb >+ #define FTIME(param) ftime(param) >+#endif >+ /* endif */ >+#include "lock3.h" >+#include "RAError.h" >+#include "RASocket.h" >+#include "RABindings.h" >+ >+#define AGENT_START_PORT 10004 >+#define MESSAGE_BUFFER_INCREMENT 1024 >+#define MAX_AGENT 512 /* maximum number of agents allowed */ >+ >+/** >+ * Globals >+ */ >+#ifdef _WIN32 >+static HANDLE _vmLock=NULL; >+#else >+static pthread_mutex_t _vmLock_mutex; >+static pthread_cond_t _vmLock_cond; >+#endif >+static BOOL _pendingVMLock; >+ >+static BOOL _serverInitialized=FALSE; >+ >+ >+static unsigned long _usageCount=0; >+ >+#ifdef _DEBUG >+static FILE *dbgFile=NULL; >+#endif >+ >+/** LinuxThreads follows the so-called "one-to-one" model: each thread is actually >+ a separate process in the kernel. The kernel scheduler takes care of scheduling >+ the threads, just like it schedules regular processes. The threads are created >+ with the Linux clone() system call, which is a generalization of fork() allowing >+ the new process to share the memory space, file descriptors, and signal handlers >+ of the parent. In the end this maps to a different result when calling getpid() >+ when in different threads. Providing startListener is invoked on the main thread >+ of the process I will cache the process ID here and retrieve it using >+ ra_getCurrentProcessId() >+ */ >+#if defined __linux__ || defined _HPUX >+static PID _pid; >+#endif >+ >+/** >+ * Function prototypes >+ */ >+static BOOL processControlMessage(RA_AGENT_HANDLE handle, >+ ra_message_t *message); >+ >+static int readConnection(RA_HANDLE connection, >+ unsigned char *buffer, >+ int offset, >+ int length, >+ unsigned int *bytesRead); >+ >+static void messageLoop(RA_AGENT_HANDLE agentHandle, int timeout); /* APAR PK01709: Configurable named pipe timeout */ >+ >+static BOOL validateRecvBuffer(unsigned char *buffer, >+ int length); >+ >+static ra_uint_t errorRecoveryScan(unsigned char *buffer, >+ int length); >+ >+static ra_uint_t getMessageLengthfromValidBuffer(unsigned char *buffer); >+ >+static void sendAgentInactive(RA_AGENT_HANDLE handle); >+ >+void pipeServerCleanup(void *arg); >+ >+ >+void *PipeServer(void *args); >+#ifdef _WIN32 >+DWORD WINAPI win32pipeServerProxy(LPVOID args); >+#endif >+ >+/* List and function to store agents for cleaning up */ >+int agentHandleCount = 0; >+RA_AGENT_HANDLE agentHandleList[MAX_AGENT]; >+static void addHandle(RA_AGENT_HANDLE handle); >+static void removeAllHandles(); >+static void removeHandle(RA_AGENT_HANDLE handle); >+ >+/** INITIALIZE_BINDINGS *********************************************** >+ * Initialization routine for the agent bindings, must be called first >+ * by te agent before running any of the other functions specified in this >+ * header file. >+ * @param name - the name of the agent. >+ * @param type - the type of the agent >+ * @param handler - the callback routine for all incomming messages. >+ * @param standalone - determines whether this agent should communicate with the RAC >+ * if standalone is TRUE the RAC is never used. >+ * @returns the new handle that is used to manage the agent. >+ */ >+RA_AGENT_HANDLE ra_initializeBindings(const char *name, >+ const char *type, >+ ra_commandHandler_t handler, >+ BOOL standalone) { >+ >+ /* Allocate the handle */ >+ RA_AGENT_HANDLE handle=(RA_AGENT_HANDLE)ra_malloc(sizeof(ra_agenthandle_t)); >+ BZERO(handle, sizeof(ra_agenthandle_t)); >+ >+ /* At this point we are neither registered with the RAC nor are our bindings finalized */ >+ handle->registered=handle->finalized=FALSE; >+ handle->pipefd = -1; /* 46651 */ >+ >+ /* Setup the command handler */ >+ handle->commandHandler=handler; >+ >+ /* Generate a UUID for this agent */ >+ ra_generateUUID(&handle->agentUUID); >+ >+ /* Create the agent name/type */ >+ ra_createRASTRING(&handle->agentName, name); >+ ra_createRASTRING(&handle->agentType, type); >+ >+ /* We won't know this information until we register with the RAC */ >+ handle->nodeUUID.length=0; >+ handle->nodeUUID.data=NULL; >+ handle->processUUID.length=0; >+ handle->processUUID.data=NULL; >+ >+ /* TO_DO: Determine node UUID in standalone mode for now..generate anew every time */ >+ if(!handle->nodeUUID.length) { >+ ra_generateUUID(&handle->nodeUUID); >+ } >+ >+ if(standalone && !handle->processUUID.length) { >+ ra_generateUUID(&handle->processUUID); >+ } >+ >+ >+ /* The first agent needs to start the RAC watcher as well as cache the process ID on Linux */ >+ if(!_serverInitialized) { >+ atexit(removeAllHandles); >+/* BEGIN: 235649 */ >+#if defined __linux__ || defined _HPUX >+ /* Save the process ID for later retrieval */ >+ if(!_pid) { >+ _pid=getpid(); >+ } >+#endif >+/* END: 235649 */ >+ _serverInitialized=TRUE; >+ } >+ >+ >+ /* Copy the process ID into the storage structure */ >+ handle->processID=ra_getProcessId(); >+ >+ >+ /* Set the default configuration to be empty */ >+ handle->defaultConfiguration.head=handle->defaultConfiguration.tail=NULL; >+ >+ _usageCount++; >+ >+ return handle; >+} >+ >+/** FINALIZE_BINDINGS ********************************************************* >+ * Cleans up all the resources that were allocated during the agents >+ * interaction with the bindings. Once this is called the handle is >+ * no longer valid. >+ * @param handle - a handle returned by ra_initializeBindings. >+ */ >+extern void ra_finalizeBindings(RA_AGENT_HANDLE handle) { >+ ra_destroyRASTRING(&handle->agentUUID); >+ ra_destroyRASTRING(&handle->nodeUUID); >+ ra_destroyRASTRING(&handle->processUUID); >+ ra_destroyRASTRING(&handle->agentName); >+ ra_destroyRASTRING(&handle->agentType); >+ _usageCount--; >+} >+ >+ >+/** START_LISTENER ************************************************************ >+ * Start the message processor. >+ * @param handle - a handle returned by ra_initializeBindings >+ * @param block - whether to block until the agent is successfuly >+ * attached to a remote client. >+ * @returns NULL call failed, call ra_getLastError() to determine failure >+ * otherwise the address of the thread number the server message processor is >+ * listening on >+ * >+ */ >+TID *ra_startListener(RA_AGENT_HANDLE handle, >+ char lock) { >+ >+ /* Add the handler code when exiting */ >+ addHandle(handle); >+ >+ /* Create our named pipe */ >+ handle->pipefd=ra_createNamedPipe(handle->agentUUID.data); >+ >+ /* Run the server on a separate thread and return the tid */ >+#ifdef _WIN32 >+ handle->tHandle = CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ win32pipeServerProxy, /* Thread entry point */ >+ (LPVOID)handle, /* params */ >+ 0, /* start executing immediately */ >+ &(handle->tid)); /* the thread ID */ >+#else >+ errno=0; >+ if(pthread_create(&(handle->tid), >+ NULL, >+ PipeServer, >+ handle)!=0) { >+ /* bug 64225 begin */ >+ int thrdCreateLoopIndex = 1; >+ int createRC = -1; >+ >+ /* Loop a finite number of times trying to create the thread if the operation >+ * fails with errno=EAGAIN >+ */ >+ while ( createRC != 0 && errno == EAGAIN && thrdCreateLoopIndex < 8 ) { >+ #ifdef _DEBUG >+ fprintf(dbgFile, "ra_startListener: EAGAIN failure creating PipeServer thread %d times\n", thrdCreateLoopIndex); >+ fflush(dbgFile); >+ #endif >+ sleep(1); >+ createRC = pthread_create(&(handle->tid), >+ NULL, >+ PipeServer, >+ handle); >+ thrdCreateLoopIndex++; >+ >+ } >+ >+ /* If a thread still can't be created then quit */ >+ if (createRC != 0) { >+ ra_setLastError(THREAD_CREATE_FAILED, errno); >+ #ifdef _DEBUG >+ fprintf(dbgFile, "ra_startListener: Failure creating PipeServer thread - errno=%d >%s\n", errno, strerror(errno)); >+ fflush(dbgFile); >+ #endif >+ return (TID*)(-1); >+ } >+ /* bug 64225 end */ >+ } >+#endif >+ >+/* jvmpiAgent_initializeLock(handle); */ >+ ra_initializeVMLock(); >+ >+ >+ /* If we are told to block until JVMPI_RESUME_VM */ >+ if(lock) { >+ ra_setVMLock(); >+ ra_testVMLock(); >+ >+/* >+ jvmpiAgent_getWriteLock(handle); >+ >+ /* Don't return until specified >+ jvmpiAgent_getWriteLock(handle); >+ jvmpiAgent_releaseWriteLock(handle); >+*/ >+ } >+ return &handle->tid; >+} >+ >+/** STOP_LISTENER ************************************************************* >+ * Stops the message processor >+ * @param handle - a handle returned by ra_initializeBindings >+ */ >+void ra_stopListener(RA_AGENT_HANDLE handle) { >+ >+#ifndef _WIN32 >+ void *status; >+#endif >+ /* Set that this handle is no longer valid. The PipeServer created in initializeBindings >+ * will then exit and cleanup the remainder of this agents info. >+ */ >+ >+ /* AS/400 need to call this because the thread_cleanup_push() isn't working as expected. >+ * We may need to revisit this thread issue on the AS/400 >+ */ >+#ifdef _DEBUG >+ fprintf(dbgFile, "ra_stopListener: about to stop listener thread\n"); >+ fflush(dbgFile); >+#endif >+ >+ handle->finalized=TRUE; >+#if defined _WIN32 >+ /* we need to do this on Windows so that the PipeServer doesn't block on any >+ calls dealing with the agent's pipe -- we do this on other platforms when >+ pipeServerCleanup is called */ >+ ra_closeNamedPipe(handle->pipefd); >+ WaitForSingleObject(handle->tHandle, INFINITE); >+ CloseHandle(handle->tHandle); >+#endif >+#if defined _WIN32 || defined __OS400__ /* 238529 */ >+ pipeServerCleanup(handle); >+#endif >+ >+ >+ /* On posix we need to cancel the message processing thread so >+ * it can cleanup its resources. >+ * 227339 - we need to wait until the message processing thread >+ * ends to ensure the cleanup happens >+ */ >+#ifndef _WIN32 >+ pthread_cancel(handle->tid); >+ pthread_join(handle->tid, &status); >+#endif >+ >+} >+ >+/** SEND_MESSAGE ************************************************************** >+ * Send the message to the RAC on this node. It will >+ * then be forwarded by the server to the client. >+ * @param handle - a handle returned by ra_initializeBindings >+ * @param message - the message structure to send. >+ * @returns the number of bytes sent to the RAC. >+ */ >+int ra_sendMessage(RA_AGENT_HANDLE handle, >+ ra_message_t *message) { >+ int byte=0, length=0; >+ char readyBuffer[MESSAGE_BUFFER_INCREMENT]; >+ char *buffer=NULL; >+ int result; >+ int paddingGuess = 64; /* we have to guess the number of padding byes for all RASTRING */ >+ RA_HANDLE racConnection = -1; /* 46651 */ >+ int retryAttempts = 600; /* Bug 146962 */ /* number of times to retry our connection to the master pipe */ >+ >+ /* Reconnect the server pipe */ >+ while ( (result=ra_openNamedPipe(RA_MASTER_ADDRESS)) < 0 && !handle->finalized && retryAttempts-- > 0) { >+ SLEEP(100); /* sleep before connect reattempt so as not to create tightly spinning loop >+ that consumes CPU */ >+ } >+ >+ if (result < 0) { >+ return 0; >+ } >+ >+ racConnection = result; >+ /* Get the length here as we could overflow, otherwise use the static buffer */ >+ length=ra_determineMessageLength(message); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "ra_sendMessage: about to write message of length %d\n", length); >+ fflush(dbgFile); >+ #endif >+ >+ if(length>MESSAGE_BUFFER_INCREMENT) { >+ length=length*sizeof(char) + paddingGuess; >+ buffer=(char*)ra_malloc(length); /* allocate with the extra padding bytes */ >+ } >+ else { >+ buffer=readyBuffer; >+ length = MESSAGE_BUFFER_INCREMENT; >+ } >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "ra_sendMessage: about to write message to buffer %x with length %d\n", buffer, length); >+ fflush(dbgFile); >+ #endif >+ >+ /* Write the message to the buffer */ >+ length=ra_writeMessageToBuffer((unsigned char *)buffer, length, message); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "ra_sendMessage: about to write message of length %d to named pipe\n", length); >+ fflush(dbgFile); >+ #endif >+ >+ /* Send to the RAC */ >+ if(racConnection >= 0) { /* 46651 */ >+ result=ra_writeToNamedPipe(racConnection, buffer, 0, length, &byte); >+ ra_closeNamedPipe(racConnection); >+ #ifdef _DEBUG >+ fprintf(dbgFile, "ra_sendMessage: wrote %d bytes to named pipe - result=%d\n", byte, result); >+ fflush(dbgFile); >+ #endif >+ } >+ >+ return byte; >+} >+ >+/** GET_PROCESS_ID ************************************************** >+ * Multiplatform convenience method to retrieve the current process >+ * id. >+ * @returns the PID of the curren process >+ */ >+PID ra_getProcessId() { >+#ifdef _WIN32 >+ return GetCurrentProcessId(); >+#elif defined __linux__ || defined _HPUX >+ return _pid; >+#else >+ return getpid(); >+#endif >+} >+ >+/** GET_NODE_UUID ***************************************************** >+ * Retrieves the UUID of the node which this agent is running on. >+ * Calling this function before ra_startListener results in undefined >+ * behaviour. >+ */ >+const char* ra_getNodeUUID(RA_AGENT_HANDLE storage) { >+ if(storage->registered) { >+ return storage->nodeUUID.data; >+ } >+ return NULL; >+} >+ >+/** GET_PROCESS_ID **************************************************** >+ * Retrieves the UUID of the process which this agent is running in. >+ * Calling this function before ra_startListener results in undefined >+ * behaviour. >+ */ >+const char* ra_getProcessUUID(RA_AGENT_HANDLE storage) { >+ if(storage->registered) { >+ return storage->processUUID.data; >+ } >+ return NULL; >+} >+ >+/** GET_AGENT_UUID ************************************************************ >+ * Retrieves the agent's UUID. >+ */ >+const char* ra_getAgentUUID(RA_AGENT_HANDLE storage) { >+ return storage->agentUUID.data; >+} >+ >+/** GET_DEFAULT_CONFIGURATION ************************************************* >+ * Retrieves a list of the options provided by the RAC as a default configuration >+ * of the agent. The configuration will only be available after the agent >+ * has successfuly registered with the RAC. >+ * @param handle - a handle returned by ra_initializeBindings >+ * @returns the agent's default configuration list if the agent has registered >+ * with the RAC. NULL otherwise. >+ */ >+ra_agentConfigList_t* ra_getDefaultConfiguration(RA_AGENT_HANDLE handle) { >+ if(!handle->registered) { >+ return NULL; >+ } >+ return &handle->defaultConfiguration; >+} >+ >+ >+/** GET_PROCESS_COMMAND_LINE ****************************************** >+ */ >+char* ra_getProcessCommandLine() { >+#ifdef _WIN32 >+ char *temp; >+ char * cmdLine=GetCommandLine(); >+ temp=cmdLine; >+ while ((temp=strchr(temp, '\"'))!=NULL) { >+ *temp=' '; >+ } >+ return cmdLine; >+#else >+ return NULL; >+#endif >+} >+ >+/** LOG_ERROR_MESSAGE ************************************************** >+ * >+ */ >+/* Bug 74367 */ >+int ra_logErrorMessage_return(RA_AGENT_HANDLE storage, RA_ERROR_LEVEL severity, const char *messageId, const char *message) { >+ int byteSent = 0; >+ ra_message_t *errorMessage=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ ra_command_t *errorCommand=ra_addCommandToMessage(errorMessage, NULL); >+ errorCommand->tag=RA_ERROR_STRING; >+ errorCommand->info.error_string.context=0; >+ errorCommand->info.error_string.processId=ra_getProcessId(); >+ ra_copyRASTRING(&errorCommand->info.error_string.agent, &storage->agentName); >+ errorCommand->info.error_string.severity=severity; >+ ra_createRASTRING(&errorCommand->info.error_string.messageId, messageId); >+ ra_createRASTRING(&errorCommand->info.error_string.message, message); >+ byteSent = ra_sendMessage(storage, errorMessage); >+ ra_destroyMessage(errorMessage, TRUE); >+ return byteSent; >+} >+ >+void ra_logErrorMessage(RA_AGENT_HANDLE storage, RA_ERROR_LEVEL severity, const char *messageId, const char *message) { >+ ra_logErrorMessage_return(storage, severity, messageId, message); >+} >+ >+ >+/** REQUEST_PEER_MONITOR ****************************************************** >+ * Requests a remote client to start monitoring this agent by asking the agent >+ * controller to find the client currently monitoring a peer agent. >+ * THIS IS NOT CURRENTLY SUPPORTED. DO NOT USE!!!!!!! >+ */ >+extern int ra_requestPeerMonitor(RA_AGENT_HANDLE storage, ra_ipaddr_t *peerAddress, PID peerPID, ra_string_t *peerAgent, unsigned long timeout) { >+ return ra_requestPeerMonitor_p(storage, peerAddress, 10002, peerPID, peerAgent, timeout); >+} >+ >+extern int ra_requestPeerMonitor_p(RA_AGENT_HANDLE storage, ra_ipaddr_t *peerAddress, int peerPort, PID peerPID, ra_string_t *peerAgent, unsigned long timeout) { >+ >+ ra_message_t *attachRequestMessage=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ ra_command_t *command=ra_addCommandToMessage(attachRequestMessage, NULL); >+ >+ if(peerPort == RA_CTL_PORT_NUM_SERVER) { >+ command->tag=RA_AGENT_REQUEST_MONITOR; >+ command->info.agent_request_monitor.context=0; >+ command->info.agent_request_monitor.processId=ra_getProcessId(); >+ ra_copyRASTRING(&command->info.agent_request_monitor.agent, &storage->agentName); >+ ra_createRASTRING(&command->info.agent_request_monitor.node, NULL); /* This will be filled in by the RAC */ >+ >+ /* Peer info */ >+ ra_createRASTRING3(&command->info.agent_request_monitor.peerNode, (const char*)peerAddress->addr, peerAddress->addrLength); >+ command->info.agent_request_monitor.peerProcessId=peerPID; >+ ra_copyRASTRING(&command->info.agent_request_monitor.peerAgent, peerAgent); >+ } >+ /* Bug 77768 */ >+ else { >+ command->tag=RA_AGENT_REQUEST_MONITOR_PORT; >+ command->info.agent_request_monitor_port.context=0; >+ command->info.agent_request_monitor_port.processId=ra_getProcessId(); >+ ra_copyRASTRING(&command->info.agent_request_monitor_port.agent, &storage->agentName); >+ ra_createRASTRING(&command->info.agent_request_monitor_port.node, NULL); /* This will be filled in by the RAC */ >+ >+ /* Peer info */ >+ ra_createRASTRING3(&command->info.agent_request_monitor_port.peerNode, (const char*)peerAddress->addr, peerAddress->addrLength); >+ command->info.agent_request_monitor_port.peerProcessId=peerPID; >+ ra_copyRASTRING(&command->info.agent_request_monitor_port.peerAgent, peerAgent); >+ command->info.agent_request_monitor_port.port = 0; >+ command->info.agent_request_monitor_port.peerPort = peerPort; >+ } >+ >+ ra_sendMessage(storage, attachRequestMessage); >+ ra_destroyMessage(attachRequestMessage, TRUE); >+ return 0; >+} >+ >+/** REQUEST_PEER_MONITOR ****************************************************** >+ * Requests a remote client to start monitoring this agent by asking the agent >+ * controller to find the client currently monitoring a peer agent. >+ */ >+extern int ra_requestPeerMonitor2(RA_AGENT_HANDLE handle, ra_ipaddr_t *peerAddress, ra_string_t *peerAgentUUID, unsigned long timeout) { >+ return ra_requestPeerMonitor2_p(handle, peerAddress, 10002, peerAgentUUID, timeout); >+} >+ >+extern int ra_requestPeerMonitor2_p(RA_AGENT_HANDLE handle, ra_ipaddr_t *peerAddress, int peerPort, ra_string_t *peerAgentUUID, unsigned long timeout) { >+ >+ ra_message_t *attachRequestMessage=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ ra_command_t *command=ra_addCommandToMessage(attachRequestMessage, NULL); >+ >+ if(peerPort == RA_CTL_PORT_NUM_SERVER) { >+ command->tag=RA_AGENT_REQUEST_MONITOR; >+ command->info.agent_request_monitor.context=0; >+ command->info.agent_request_monitor.processId=ra_getProcessId(); >+ ra_copyRASTRING(&command->info.agent_request_monitor.agent, &handle->agentName); >+ ra_createRASTRING(&command->info.agent_request_monitor.node, NULL); /* This will be filled in by the RAC */ >+ >+ /* Peer info */ >+ ra_createRASTRING3(&command->info.agent_request_monitor.peerNode, (const char*)peerAddress->addr, peerAddress->addrLength); >+ command->info.agent_request_monitor.peerProcessId=0; >+ ra_copyRASTRING(&command->info.agent_request_monitor.peerAgent, peerAgentUUID); >+ } >+ /* Bug 77768 */ >+ else { >+ command->tag=RA_AGENT_REQUEST_MONITOR_PORT; >+ command->info.agent_request_monitor_port.context=0; >+ command->info.agent_request_monitor_port.processId=ra_getProcessId(); >+ ra_copyRASTRING(&command->info.agent_request_monitor_port.agent, &handle->agentName); >+ ra_createRASTRING(&command->info.agent_request_monitor_port.node, NULL); /* This will be filled in by the RAC */ >+ >+ /* Peer info */ >+ ra_createRASTRING3(&command->info.agent_request_monitor_port.peerNode, (const char*)peerAddress->addr, peerAddress->addrLength); >+ command->info.agent_request_monitor_port.peerProcessId=0; >+ ra_copyRASTRING(&command->info.agent_request_monitor_port.peerAgent, peerAgentUUID); >+ command->info.agent_request_monitor_port.port = 0; >+ command->info.agent_request_monitor_port.peerPort = peerPort; >+ } >+ >+ ra_sendMessage(handle, attachRequestMessage); >+ ra_destroyMessage(attachRequestMessage, TRUE); >+ return 0; >+} >+ >+ >+ >+/** PROCESS_CONTROL_MESSAGE **************************************** >+ * Called by processMessage for JVMPI_CTL_MSG messages. >+ * Breaks the message up into individual commands and forwards each >+ * command to the registered _jvmpicomm_notify_message method. >+ */ >+static BOOL processControlMessage(RA_AGENT_HANDLE handle, >+ ra_message_t *message) { >+ ra_command_list_node_t *current; >+ ra_command_t connectedCommand; >+ /* Process each command in turn */ >+ current=message->commands.head; >+ >+ while(current != NULL ) { >+ /* Intercept the configuration information */ >+ if(current->command->tag==RA_AGENT_CONFIGURATION) { >+ unsigned int i; >+ ra_agentConfigListEntry_t *iterator; >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "processControlMessage: about to process RA_AGENT_CONFIGURATION\n"); >+ fflush(dbgFile); >+ #endif >+ >+ /* Cleanup any configuration data from a previous handshake with the RAC */ >+ ra_destroyRASTRING(&handle->nodeUUID); >+ ra_destroyRASTRING(&handle->processUUID); >+ /* ra_destroyRASTRING(&handle->nodeUUID); */ >+ iterator=handle->defaultConfiguration.head; >+ while(iterator) { >+ ra_agentConfigListEntry_t *current; >+ current=iterator; >+ ra_destroyRASTRING(¤t->entry.type); >+ ra_destroyRASTRING(¤t->entry.name); >+ ra_destroyRASTRING(¤t->entry.value); >+ iterator=current->next; >+ ra_free(current); >+ } >+ handle->defaultConfiguration.head=handle->defaultConfiguration.tail=NULL; >+ >+ >+ /* Copy the binding information */ >+ ra_copyRASTRING(&handle->nodeUUID, ¤t->command->info.agent_configuration.nodeUUID); >+ ra_copyRASTRING(&handle->processUUID, ¤t->command->info.agent_configuration.processUUID); >+ >+ /* Loop through the configuration and create a default configuration for the agent */ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "processControlMessage: Loop through the configuration and create a default configuration for the agent\n"); >+ fflush(dbgFile); >+ #endif >+ for(i=0; i<current->command->info.agent_configuration.configuration.length; i++) { >+ ra_agentConfigListEntry_t *copy; >+ ra_agentConfigEntry_t *entry; >+ >+ entry=((ra_agentConfigEntry_t*)(current->command->info.agent_configuration.configuration.data[i])); >+ copy=(ra_agentConfigListEntry_t*)ra_malloc(sizeof(ra_agentConfigListEntry_t)); >+ ra_copyRASTRING(©->entry.type, &entry->type); >+ ra_copyRASTRING(©->entry.name, &entry->name); >+ ra_copyRASTRING(©->entry.value, &entry->value); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "processControlMessage:type=%s\n", copy->entry.type.data); >+ fprintf(dbgFile, "processControlMessage:name=%s\n", copy->entry.name.data); >+ fprintf(dbgFile, "processControlMessage:value=%s\n", copy->entry.value.data); >+ fflush(dbgFile); >+ #endif >+ /* Insert into the list */ >+ copy->next=NULL; >+ copy->previous=handle->defaultConfiguration.tail; >+ handle->defaultConfiguration.tail=copy; >+ >+ /* If this not the first entry we must set the link in the previous tail */ >+ if(copy->previous) { >+ copy->previous->next=copy; >+ } >+ else { >+ handle->defaultConfiguration.head=copy; >+ } >+ } >+ /* bugzilla 71840 start */ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "processControlMessage: let agent process RA_AGENT_CONTROLER_AVAILABLE\n"); >+ fflush(dbgFile); >+ #endif >+ >+ /* Inform the agent we are connected */ >+ handle->registered=TRUE; >+ connectedCommand.tag=RA_AGENT_CONTROLER_AVAILABLE; >+ ra_copyRASTRING(&(connectedCommand.info.agentName), &handle->agentName); >+ (handle->commandHandler)(&connectedCommand); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "processControlMessage: after handling RA_AGENT_CONTROLER_AVAILABLE command\n"); >+ fflush(dbgFile); >+ #endif >+ >+ ra_destroyRASTRING((ra_string_t*)&connectedCommand.info.agentName); >+ /* bugzilla 71840 end */ >+ >+ >+ } >+ else if(current->command->tag==RA_AGENT_CONTROLER_UNAVAILABLE) { >+ return FALSE; >+ } >+ else { >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "procesControlMessage: about to pass command %d to command handler\n", current->command->tag); >+ fflush(dbgFile); >+ #endif >+ >+ /* Call the user defined message handler */ >+ if(handle->commandHandler) { >+ (*handle->commandHandler)(current->command); >+ } >+ } >+ current=current->next; >+ } >+ >+ return TRUE; >+} >+ >+ >+void pipeServerCleanup(void *arg) { >+ RA_AGENT_HANDLE handle=(RA_AGENT_HANDLE)arg; >+ >+ sendAgentInactive(handle); >+ >+ removeHandle(handle); >+#ifndef _WIN32 >+ /* done already prior to calling pipeServerCleanup() on Windows. */ >+ ra_closeNamedPipe(handle->pipefd); >+#endif >+ ra_destroyNamedPipe(handle->agentUUID.data); >+ removeHandle(handle); >+ ra_free(handle); >+} >+ >+ >+/** PIPE_SERVER *************************************************************** >+ * This is the message loop for communications with the RAC. >+ */ >+void *PipeServer(void *args) { >+ RA_HANDLE handshakeConnection; >+ >+ RA_AGENT_HANDLE handle; >+ /* APAR PK01709: Configurable named pipe timeout */ >+ int pipe_timeout = 1000; /* 1 second default timeout for opening master named pipe */ >+ char *pipe_timeout_name = "RA_IO_IDLE_TIME"; >+ char *pipe_timeout_value; >+ unsigned int i; >+ int rc; >+ BOOL isValidTimeout = TRUE; >+ >+ /* Determine the pipe timeout */ >+#ifdef _WIN32 >+ pipe_timeout_value = (char*)malloc(sizeof(char) * 32); >+ BZERO(pipe_timeout_value, 32); >+ rc = GetEnvironmentVariable(pipe_timeout_name, pipe_timeout_value, 32); >+ if(rc == 0) { >+ /* Failed to retrieve the env var */ >+ pipe_timeout = 1000; >+ } >+ else if(rc == 16) { >+ /* Env var string too long */ >+ pipe_timeout = 1000; >+ } >+ else { >+ /* Check to see if it is all digit */ >+ for(i = 0; isValidTimeout && (i < strlen(pipe_timeout_value)); i++) { >+ if(!isdigit(pipe_timeout_value[i])) { >+ isValidTimeout = FALSE; >+ } >+ } >+ if(isValidTimeout) { >+ pipe_timeout = atoi(pipe_timeout_value); >+ } >+ } >+ free(pipe_timeout_value); >+#else >+ /*printf("DEBUG: Timeout initially set to %d ms\n", pipe_timeout);*/ >+ pipe_timeout_value = (char*)getenv(pipe_timeout_name); >+ if(pipe_timeout_value == NULL) { >+ /* Failed to retrieve the env var */ >+ /*printf("DEBUG: Error retrieving timeout environment, leaving it as %d ms\n", pipe_timeout);*/ >+ pipe_timeout = 1000; >+ } >+ else { >+ /*printf("DEBUG: Timeout environment variable %s set to: %s\n", pipe_timeout_name, pipe_timeout_value);*/ >+ /* Check to see if it is all digit */ >+ for(i = 0; isValidTimeout && (i < strlen(pipe_timeout_value)); i++) { >+ if(!isdigit(pipe_timeout_value[i])) { >+ isValidTimeout = FALSE; >+ } >+ } >+ if(isValidTimeout) { >+ pipe_timeout = atoi(pipe_timeout_value); >+ } >+ else { >+ /*printf("DEBUG: Environment string cannot be converted to an integer value\n");*/ >+ } >+ } >+ /*printf("DEBUG: New pipe timeout set to %d ms\n", pipe_timeout);*/ >+#endif >+ >+ handle=((RA_AGENT_HANDLE)args); >+ >+ /* On posix we need to push a cleanup handler to ensure we destroy our message >+ * processing thread correctly >+ */ >+#ifndef _WIN32 >+ pthread_cleanup_push(pipeServerCleanup, handle); >+#endif >+ >+ #ifdef _DEBUG >+ dbgFile = fopen("hcbnd.dbg", "a"); >+ fprintf(dbgFile, "==========================PipeServer: starting server===================\n"); >+ fflush(dbgFile); >+ #endif >+ >+outer: >+ /* Loop as long as our handle is not finalized */ >+ while(!handle->finalized) { >+ BOOL firstConnectTial=TRUE; >+ ra_message_t *bindingMessage; >+ ra_command_t *bindingCommand; >+ unsigned char buffer[1024]; >+ int bytesWrote; >+ unsigned int length; >+ int result; >+ BOOL sleepPrinted = FALSE; /* APAR PK01709: Configurable named pipe timeout */ >+ ra_command_t connectedCommand; >+ >+ /* Handshake with the RAC */ >+ firstConnectTial=TRUE; >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PiprServer: Try to connect to RAC master named pipe\n"); >+ fflush(dbgFile); >+ #endif >+ do { >+ handshakeConnection=ra_openNamedPipe(RA_MASTER_ADDRESS); >+ if((int)handshakeConnection < 0) { /* 46651 */ >+ if(firstConnectTial) { >+ /* Inform the agent that the RAC is not available */ >+ handle->registered=FALSE; >+ connectedCommand.tag=RA_AGENT_CONTROLER_UNAVAILABLE; >+ ra_copyRASTRING(&connectedCommand.info.agentName, &handle->agentName); >+ (handle->commandHandler)(&connectedCommand); >+ ra_destroyRASTRING((ra_string_t*)&connectedCommand.info.agentName); >+ firstConnectTial=FALSE; >+ } >+ /* APAR PK01709: Configurable named pipe timeout */ >+ if(!sleepPrinted) { >+#if defined(MVS) >+ fprintf(stdout, "Agent Controller is not active: will wait in a %d ms loop\n", pipe_timeout); >+ fflush(stdout); >+#else >+ printf("Agent Controller is not active: will wait in a %d ms loop\n", pipe_timeout); >+#endif >+ sleepPrinted = TRUE; >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: Agent Controller is not active: will wait in a %d ms loop\n", pipe_timeout); >+ fflush(dbgFile); >+ #endif >+ } >+ SLEEP(pipe_timeout); >+ } >+ if(handle->finalized){ >+ goto outer; >+ } >+ }while((int)handshakeConnection < 0); /* 46651 */ /* Bug 66383 */ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: Connected to RAC master named pipe\n"); >+ fflush(dbgFile); >+ #endif >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: Trying to sent agent registration to the RAC\n"); >+ fflush(dbgFile); >+ #endif >+ >+ /* Create our Binding message */ >+ bindingMessage=ra_createMessage(RA_CONTROL_MESSAGE, 1); >+ bindingCommand=ra_addCommandToMessage(bindingMessage, NULL); >+ bindingCommand->tag=RA_AGENT_SCOPING_INFORMATION; >+ ra_copyRASTRING(&bindingCommand->info.agent_scoping_information.agent, &handle->agentName); >+ ra_copyRASTRING(&bindingCommand->info.agent_scoping_information.agentUUID, &handle->agentUUID); >+ ra_copyRASTRING(&bindingCommand->info.agent_scoping_information.nodeUUID, &handle->nodeUUID); >+ ra_copyRASTRING(&bindingCommand->info.agent_scoping_information.agentType, &handle->agentType); >+ ra_copyRASTRING(&bindingCommand->info.agent_scoping_information.processUUID, &handle->processUUID); >+ bindingCommand->info.agent_scoping_information.processId=ra_getProcessId(); >+/* BEGIN: 235649 */ >+#if defined __linux__ >+ bindingCommand->info.agent_scoping_information.messageProcessId=getpid(); >+#endif >+/* END: 235649 */ >+ bindingCommand->info.agent_scoping_information.context=0; >+ >+ /* We are handshaking, send our agent binding information */ >+ ra_determineMessageLength(bindingMessage); /* Bug 129050 */ >+ length=ra_writeMessageToBuffer(buffer, 1024, bindingMessage); >+ >+ /* RKD: Need to check our return code here */ >+ result=ra_writeToNamedPipe(handshakeConnection, (char*)buffer, 0, length, &bytesWrote); >+ ra_destroyMessage(bindingMessage, TRUE); >+ >+ /* Finish the handshake */ >+ ra_closeNamedPipe(handshakeConnection); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: Successfully sent agent registration to the RAC\n"); >+ fflush(dbgFile); >+ #endif >+ >+ /* APAR PK01709: Configurable named pipe timeout */ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: Waiting for Agent Named Pipe %s\n", handle->agentUUID.data); >+ fflush(dbgFile); >+ #endif >+ while(!(ra_connectToNamedPipe(&handle->pipefd, handle->agentUUID.data)) && !handle->finalized) { >+#if defined(MVS) >+ fprintf(stdout, "Agent named pipe is not active: will wait in a %d ms loop\n", pipe_timeout); >+ fflush(stdout); >+#else >+ printf("Agent named pipe is not active: will wait in a %d ms loop\n", pipe_timeout); >+#endif >+#ifdef _DEBUG >+ fprintf(dbgFile, "Agent Named Pipe is not active: will wait in a %d ms loop\n", pipe_timeout); >+ fflush(dbgFile); >+#endif >+ SLEEP(pipe_timeout); >+ } >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: Agent Named Pipe %s has connected, fd = %d\n", handle->agentUUID.data, handle->pipefd); >+ fflush(dbgFile); >+ #endif >+ >+ /* Read our configuration info from the RAC. */ >+ messageLoop(handle, pipe_timeout); /* APAR PK01709: Configurable named pipe timeout */ >+ >+ ra_disconnectFromNamedPipe(handle->pipefd); /* Bug 159179 */ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: disconnecting and closing named pipe %d\n", handle->pipefd); >+ fflush(dbgFile); >+ #endif >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "PipeServer: messageLoop has been broken due to RAC connection lost\n"); >+ fflush(dbgFile); >+ #endif >+ } >+ >+ /* Perform the thread cleanup */ >+#ifndef _WIN32 >+ pthread_cleanup_pop(1); >+#endif >+ >+#ifdef _DEBUG >+ fclose(dbgFile); >+#endif >+ >+ return NULL; >+} >+ >+ >+#ifdef _WIN32 >+DWORD WINAPI win32pipeServerProxy(LPVOID args) { >+ DWORD returnVal=0; >+ PipeServer(args); >+ return returnVal; >+} >+#endif >+ >+ >+static void messageLoop(RA_AGENT_HANDLE agentHandle, int timeout) { /* APAR PK01709: Configurable named pipe timeout */ >+ int result; >+ unsigned int bytesRead; >+ unsigned char request[MESSAGE_BUFFER_INCREMENT]; >+ ra_message_t *message; >+ unsigned char *correctBuffer; >+ ra_uint_t messageLength, offset; >+ BOOL sleepPrinted = FALSE; /* APAR PK01709: Configurable named pipe timeout */ >+ ra_command_t connectedCommand; >+ >+ /* Initialize our variables */ >+ message=NULL; >+ offset=0; >+ >+ while(!agentHandle->finalized) { >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: About to read from Agent Named Pipe %s, fd = %d\n", agentHandle->agentUUID.data, agentHandle->pipefd); >+ fflush(dbgFile); >+ #endif >+ >+ result = readConnection(agentHandle->pipefd, request, offset, MESSAGE_BUFFER_INCREMENT, &bytesRead); >+ >+ /* Inform the agent we are connected */ >+ agentHandle->registered = TRUE; >+ connectedCommand.tag = RA_AGENT_CONTROLER_AVAILABLE; >+ ra_copyRASTRING(&(connectedCommand.info.agentName), &agentHandle->agentName); >+ (agentHandle->commandHandler)(&connectedCommand); >+ ra_destroyRASTRING((ra_string_t*)&connectedCommand.info.agentName); >+ >+ /* The connection is going down. We need to break the loop */ >+ if(result <= 0) { >+ /* Close the message pump */ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: readConnection on fd = %d failed, recheck RAC status, errno = %d\n", agentHandle->pipefd, ra_getLastErrorMinor()); >+ fflush(dbgFile); >+ #endif >+ return; /* Let PipeServer to check for RAC connection */ >+ } >+ >+ /* Increment bytesRead in case the master buffer contained a message fragment - 223065 */ >+ bytesRead+=offset; >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, bytesRead=%d offset=%d\n", agentHandle->pipefd, bytesRead, offset); >+ fflush(dbgFile); >+ #endif >+ >+ /* We assume the master buffer will not be fragmented due to an error later */ >+ offset=0; >+ >+ /* Validate the header of this message. If it is invalid go into >+ error recovery mode. If it is valid then find out how long this >+ message is. >+ */ >+ correctBuffer=request; >+validate: >+ if(validateRecvBuffer(correctBuffer, bytesRead)) { >+ BOOL agentControllerStillActive; >+ messageLength=getMessageLengthfromValidBuffer(correctBuffer); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, messageLength=%d bytesRead=%d\n", agentHandle->pipefd, messageLength, bytesRead); >+ fflush(dbgFile); >+ #endif >+ >+ /* Are we missing part of the message because of overflow in the buffer */ >+ if(messageLength>bytesRead) { >+ unsigned char *temp=(unsigned char*)ra_malloc(messageLength); >+ unsigned int currentLength=bytesRead; >+ >+ /* Save the data we have so far. */ >+ memcpy(temp, correctBuffer, currentLength); >+ >+ while(currentLength < messageLength) { >+ result = readConnection(agentHandle->pipefd, temp, currentLength, messageLength, &bytesRead); >+ >+ /* If we have lost a connection before a message is complete we should abandon */ >+ if(result <= 0) { >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: readConnection on fd = %d failed, recheck RAC status, errno = %d\n", agentHandle->pipefd, ra_getLastErrorMinor()); >+ fflush(dbgFile); >+ #endif >+ return; /* Let PipeServer to check for RAC connection */ >+ } >+ currentLength += bytesRead; >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, currentLength = %d\n", agentHandle->pipefd, currentLength); >+ fflush(dbgFile); >+ #endif >+ } >+ >+ message=ra_readMessageFromBuffer(temp, (unsigned long)messageLength); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, after reading message from buffer 1: length=%d\n", agentHandle->pipefd, message->length); >+ fflush(dbgFile); >+ #endif >+ >+ /* Forward to the handler */ >+ agentControllerStillActive=processControlMessage(agentHandle, message); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, after processing control message\n", agentHandle->pipefd); >+ fflush(dbgFile); >+ #endif >+ >+ ra_destroyMessage(message, TRUE); >+ ra_free(temp); >+ >+ if(!agentControllerStillActive) { >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, Agent Controller is not active, exiting message loop\n", agentHandle->pipefd); >+ fflush(dbgFile); >+ #endif >+ return; >+ } >+ } >+ else { >+ /* We have the entire message, but do we have more then one message */ >+ message=ra_readMessageFromBuffer(correctBuffer, (unsigned long)(bytesRead)); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, after reading message from buffer 2: length=%d\n", agentHandle->pipefd, message->length); >+ fflush(dbgFile); >+ #endif >+ >+ /* Forward to the handler */ >+ agentControllerStillActive=processControlMessage(agentHandle, message); >+ >+ bytesRead=bytesRead-message->length; >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, after processing control message - bytesRead = %d\n", agentHandle->pipefd, bytesRead); >+ fflush(dbgFile); >+ #endif >+ >+ memcpy(correctBuffer, correctBuffer+message->length, bytesRead); >+ ra_destroyMessage(message, TRUE); >+ >+ if(!agentControllerStillActive) { >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, Agent Controller is not active, exiting message loop\n", agentHandle->pipefd); >+ fflush(dbgFile); >+ #endif >+ return; /* Let PipeServer to check for RAC connection */ >+ } >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, go back to validate remainder of message data\n", agentHandle->pipefd); >+ fflush(dbgFile); >+ #endif >+ >+ goto validate; >+ } >+ } >+ else { >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, invalid buffer processing.\n", agentHandle->pipefd); >+ fflush(dbgFile); >+ #endif >+ >+ bytesRead=errorRecoveryScan(correctBuffer, bytesRead); >+ >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, bytesRead after errorRecoveryScan = %d\n", agentHandle->pipefd, bytesRead); >+ fflush(dbgFile); >+ #endif >+ >+ /* If we have enough left that constitutes a header continue processing */ >+ if(bytesRead>=24) { >+ goto validate; >+ } >+ else { >+ /* We need to read some more data. Keep what we have so far */ >+ if(correctBuffer!=request) { >+ memcpy(request, correctBuffer, bytesRead); >+ } >+ offset=bytesRead; >+ } >+ #ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, go back to read some more data\n", agentHandle->pipefd); >+ fflush(dbgFile); >+ #endif >+ } >+ } >+ >+#ifdef _DEBUG >+ fprintf(dbgFile, "messageLoop: fd = %d, connection with RAC has been broken\n", agentHandle->pipefd); >+ fflush(dbgFile); >+#endif >+ >+ return; >+} >+ >+/** READ_CONNECTIION ********************************************************** >+ * Generic read function for all platforms for both sockets and pipes. >+ * @returns 0 - connection closed gracefully >+ */ >+static int readConnection(RA_HANDLE connection, >+ unsigned char *buffer, >+ int offset, >+ int length, >+ unsigned int *bytesRead) { >+#if defined _HPUX || defined __OS400__ >+ return ra_readFromNamedPipe(connection, (char*)buffer, offset, length, (int*)bytesRead); >+#else >+ return ra_readFromNamedPipe(connection, buffer, offset, length, bytesRead); >+#endif >+} >+ >+ >+/** VALIDATE_RECV_BUFFER ***************************************************** >+ * This is a simple test to ensure a message starts with the majic number >+ * and that it at least contains enough information that we can determine >+ * the message length. >+ */ >+static BOOL validateRecvBuffer(unsigned char *buffer, int length) { >+ /* Do we have a full header? */ >+ if(length<24) { >+ return FALSE; >+ } >+ >+ /* Compare against the majic number 0x82656780 */ >+ if(buffer[0]!=0x82 || buffer[1]!=0x65 || buffer[2]!=0x67 || buffer[3]!=0x80) { >+ return FALSE; >+ } >+ return TRUE; >+ >+} >+ >+ >+/** ERROR_RECOVERY_SCAN ***************************************************** >+ * When we get a bad message flow we go into recovery mode, searching for the >+ * next occurance of the majic number in the stream. The buffer is then >+ * compressed and number of valid remaining bytes is returned. >+ */ >+static ra_uint_t errorRecoveryScan(unsigned char *buffer, int length) { >+ int offset; >+ /* If there isn't enough bytes to check the majic number return zero */ >+ if(length<4) { >+ return length; >+ } >+ /* Search for the next occurance of the majic number */ >+ for(offset=0; offset<length-3; offset++) { >+ if(buffer[offset]==0x82 && buffer[offset+1]==0x65 && buffer[offset+2]==0x67 && buffer[offset+3]==0x80) { >+ memcpy(buffer, buffer+offset, length-offset); >+ return length-offset; >+ } >+ } >+ /* If we didn't find the magic number we need to save the last 3 bytes and return */ >+ memcpy(buffer, buffer+offset, length-offset); >+ return length-offset; >+ >+} >+ >+ >+/** GET_MESSAGE_LENGTH_FROM_VALID_BUFFER ************************************* >+ * This simply extracts the message length from a message buffer that has >+ * previously been validated successfuly. >+ */ >+static ra_uint_t getMessageLengthfromValidBuffer(unsigned char *buffer) { >+ return ((buffer[16]<<24) >+ |(ra_uint_t)(buffer[17]<<16) >+ |(ra_uint_t)(buffer[18]<<8) >+ | buffer[19]); >+} >+ >+ >+ >+ >+ >+BOOL ra_initializeVMLock() { >+#ifdef _WIN32 >+ _vmLock=CreateEvent(NULL, >+ TRUE, >+ TRUE, >+ NULL); >+ if(_vmLock==NULL) >+ return FALSE; >+#else >+ pthread_mutex_init(&_vmLock_mutex, NULL); >+ pthread_cond_init(&_vmLock_cond, NULL); >+#endif >+ _pendingVMLock=FALSE; >+ return TRUE; >+} >+ >+void ra_setVMLock() { >+#ifdef _WIN32 >+ ResetEvent(_vmLock); >+#else >+ pthread_mutex_lock(&_vmLock_mutex); >+#endif >+ _pendingVMLock=TRUE; >+#ifndef _WIN32 >+ pthread_mutex_unlock(&_vmLock_mutex); >+#endif >+} >+ >+void ra_releaseVMLock() { >+#ifndef _WIN32 >+ pthread_mutex_lock(&_vmLock_mutex); >+#endif >+ _pendingVMLock=FALSE; >+#ifdef _WIN32 >+ SetEvent(_vmLock); >+#else >+ pthread_mutex_unlock(&_vmLock_mutex); >+ pthread_cond_broadcast(&_vmLock_cond); >+#endif >+} >+ >+void ra_testVMLock() { >+#ifndef _WIN32 >+ pthread_mutex_lock(&_vmLock_mutex); >+#endif >+ if(_pendingVMLock) { >+#ifdef _WIN32 >+ WaitForSingleObject(_vmLock, INFINITE); >+#else >+ pthread_cond_wait(&_vmLock_cond, &_vmLock_mutex); >+#endif >+ } >+#ifndef _WIN32 >+ pthread_mutex_unlock(&_vmLock_mutex); >+#endif >+ >+} >+ >+BOOL ra_getVMLockState() { >+ if(_pendingVMLock) >+ return TRUE; >+ else >+ return FALSE; >+} >+ >+static void addHandle(RA_AGENT_HANDLE handle) { >+ agentHandleList[agentHandleCount++] = handle; >+} >+ >+static void removeAllHandles() { >+ int i; >+ for(i = 0; i < agentHandleCount; i++) { >+ if(agentHandleList[i] != NULL) { >+ #ifdef _DEBUG >+ if (dbgFile != NULL) { >+ fprintf(dbgFile, "removeAllHandles: about to stop listener thread\n"); >+ fflush(dbgFile); >+ } >+ #endif >+ ra_stopListener(agentHandleList[i]); >+ /* Getting a SIGSEV on Red Hat when exiting workbench, disable the finalize for now. */ >+/* ra_finalizeBindings(agentHandleList[i]);*/ >+ } >+ } >+} >+ >+ >+static void removeHandle(RA_AGENT_HANDLE handle) { >+ int i; >+ for(i = 0; i < agentHandleCount; i++) { >+ if(agentHandleList[i] == handle) { >+ agentHandleList[i]=NULL; >+ return; >+ } >+ } >+} >+ >+ >+static void sendAgentInactive(RA_AGENT_HANDLE handle) { >+ ra_message_t *message; >+ ra_command_t *command; >+ >+ message=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ command=ra_addCommandToMessage(message, NULL); >+ >+ >+ /* Set the agent information */ >+ command->tag=RA_AGENT_INACTIVE; >+ command->info.agent_inactive.processId = ra_getProcessId(); >+ ra_createRASTRING(&command->info.agent_inactive.processUUID, ra_getProcessUUID(handle)); >+ ra_copyRASTRING(&command->info.agent_inactive.agent, &handle->agentName); >+ ra_createRASTRING(&command->info.agent_inactive.agentUUID, ra_getAgentUUID(handle)); >+ ra_copyRASTRING(&command->info.agent_inactive.agentType, &handle->agentType); >+ >+ /* Inform server we are exiting */ >+ ra_sendMessage(handle, message); >+ >+ /* Clean up the allocated memory */ >+ ra_destroyMessage(message, TRUE); >+ >+} >+ >+void ra_getPropertyValues(RA_AGENT_HANDLE handle, char* name, char* type) { >+ ra_message_t *message; >+ ra_command_t *command; >+ >+ message = ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ command = ra_addCommandToMessage(message, NULL); >+ >+ command->tag = RA_GET_PROPERTY_LIST; >+ command->info.query_property_list.context = 0; >+ ra_createRASTRING(&command->info.query_property_list.name, name); >+ ra_createRASTRING(&command->info.query_property_list.type, type); >+ ra_createRASTRING(&command->info.query_property_list.agentUUID, ra_getAgentUUID(handle)); >+ >+ ra_sendMessage(handle, message); >+ >+ ra_destroyMessage(message, TRUE); >+ >+ return; >+} >Index: src-native-new/src/agents/java/WinBuild/log_agent.mak >=================================================================== >RCS file: src-native-new/src/agents/java/WinBuild/log_agent.mak >diff -N src-native-new/src/agents/java/WinBuild/log_agent.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/WinBuild/log_agent.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,229 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on log_agent.dsp >+!IF "$(CFG)" == "" >+CFG=log_agent - Win32 Debug >+!MESSAGE No configuration specified. Defaulting to log_agent - Win32 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "log_agent - Win32 Release" && "$(CFG)" != "log_agent - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "log_agent.mak" CFG="log_agent - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "log_agent - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "log_agent - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "log_agent - Win32 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcjbnd.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcjbnd.obj" >+ -@erase "$(INTDIR)\hcjbnd.res" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcjbnd.dll" >+ -@erase "$(OUTDIR)\hcjbnd.exp" >+ -@erase "$(OUTDIR)\hcjbnd.lib" >+ -@erase ".\Release\hcjbnd.map" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /GX /O2 /Ob0 /I "..\..\framework\RABindings" /I "..\..\framework\RACommon" /I "..\..\framework\RASocket" /I "..\..\framework\RADataTransfer" /I "..\..\framework\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /Fp"$(INTDIR)\log_agent.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\log_agent.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /version:0.1 /dll /incremental:no /pdb:"$(OUTDIR)\hcjbnd.pdb" /map:"$(INTDIR)\hcjbnd.map" /machine:I386 /def:"..\hcjbnd.def" /out:"$(OUTDIR)\hcjbnd.dll" /implib:"$(OUTDIR)\hcjbnd.lib" /libpath:"..\..\..\lib" >+DEF_FILE= \ >+ "..\hcjbnd.def" >+LINK32_OBJS= \ >+ "$(INTDIR)\hcjbnd.obj" \ >+ "$(INTDIR)\hcjbnd.res" >+ >+"$(OUTDIR)\hcjbnd.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "log_agent - Win32 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hcjbnd.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hcjbnd.obj" >+ -@erase "$(INTDIR)\hcjbnd.res" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcjbnd.dll" >+ -@erase "$(OUTDIR)\hcjbnd.exp" >+ -@erase "$(OUTDIR)\hcjbnd.ilk" >+ -@erase "$(OUTDIR)\hcjbnd.lib" >+ -@erase "$(OUTDIR)\hcjbnd.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\framework\RABindings" /I "..\..\framework\RACommon" /I "..\..\framework\RASocket" /I "..\..\framework\RADataTransfer" /I "..\..\framework\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /Fp"$(INTDIR)\log_agent.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcjbnd.res" /d "_DEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\log_agent.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcjbnd.pdb" /debug /machine:I386 /def:"..\hcjbnd.def" /out:"$(OUTDIR)\hcjbnd.dll" /implib:"$(OUTDIR)\hcjbnd.lib" /pdbtype:sept /libpath:"..\..\..\lib" >+DEF_FILE= \ >+ "..\hcjbnd.def" >+LINK32_OBJS= \ >+ "$(INTDIR)\hcjbnd.obj" \ >+ "$(INTDIR)\hcjbnd.res" >+ >+"$(OUTDIR)\hcjbnd.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("log_agent.dep") >+!INCLUDE "log_agent.dep" >+!ELSE >+!MESSAGE Warning: cannot find "log_agent.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "log_agent - Win32 Release" || "$(CFG)" == "log_agent - Win32 Debug" >+SOURCE=..\hcjbnd.c >+ >+"$(INTDIR)\hcjbnd.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\version.rc >+ >+!IF "$(CFG)" == "log_agent - Win32 Release" >+ >+ >+"$(INTDIR)\hcjbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcjbnd.res" /i "\eclipse\workspace\org.eclipse.hyades.datacollection\collection\collectors\java" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "log_agent - Win32 Debug" >+ >+ >+"$(INTDIR)\hcjbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcjbnd.res" /i "\eclipse\workspace\org.eclipse.hyades.datacollection\collection\collectors\java" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/transport/RADataTransfer/hccldt.exp >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/hccldt.exp >diff -N src-native-new/src/transport/RADataTransfer/hccldt.exp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/hccldt.exp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+#! libracldt.so exports >+ra_allocateMessageBlock >+ra_freeMessageBlock >+ra_writeMessageBlock >Index: src-native-new/src/agents/perfmon/sysperf/perfcalc.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/sysperf/perfcalc.h >diff -N src-native-new/src/agents/perfmon/sysperf/perfcalc.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/sysperf/perfcalc.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: perfcalc.h,v 1.5 2006/05/23 16:21:26 gchristelis Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+#ifndef __PERFCALC_H__ >+#define __PERFCALC_H__ >+ >+//#include <winsock2.h> /* Bug 134924 */ >+#include <windows.h> >+ >+void createValueTables(); >+void freeValueTables(); >+ >+void getPERF_COUNTER_RAWCOUNT (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr); >+void getPERF_RAW_FRACTION (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2); >+void getPERF_COUNTER_COUNTER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_BULK_COUNT (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_100NSEC_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_100NSEC_TIMER_INV (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_ELAPSED_TIME (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData, PPERF_OBJECT_TYPE PerfObj); >+void getPERF_COUNTER_LARGE_RAWCOUNT (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr); >+void getPERF_COUNTER_LARGE_RAWCOUNT_HEX (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr); >+void getPERF_AVERAGE_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2,PPERF_DATA_BLOCK PerfData); >+void getPERF_AVERAGE_BULK (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2); >+void getPERF_COUNTER_LARGE_QUEUELEN_TYPE(char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_NODATA (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr); >+void getPERF_SAMPLE_FRACTION (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2); >+void getPERF_SAMPLE_COUNTER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2); >+void getPERF_COUNTER_DELTA (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr); >+void getPERF_COUNTER_LARGE_DELTA (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr); >+void getPERF_100NSEC_MULTI_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData); >+void getPERF_100NSEC_MULTI_TIMER_INV (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_RAWCOUNT_HEX (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr); >+void getPERF_COUNTER_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_TIMER_INV (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_MULTI_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_MULTI_TIMER_INV (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_QUEUELEN_TYPE (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_OBJ_TIME_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+void getPERF_PRECISION_100NS_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData); >+void getPERF_PRECISION_OBJECT_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData); >+void getPERF_PRECISION_SYSTEM_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData); >+void getPERF_COUNTER_100NS_QUEUELEN_TYPE(char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData); >+ >+ >+ >+ >+ >+ >+ >+ >+#endif __PERFCALC_H__ >Index: src-native-new/src/transport/RADataTransfer/RADataTransfer.dsp >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/RADataTransfer.dsp >diff -N src-native-new/src/transport/RADataTransfer/RADataTransfer.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/RADataTransfer.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,123 @@ >+# Microsoft Developer Studio Project File - Name="RADataTransfer" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=RADataTransfer - Win32 Debug >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "RADataTransfer.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "RADataTransfer.mak" CFG="RADataTransfer - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "RADataTransfer - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "RADataTransfer - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "RADataTransfer - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "RADataTransfer___Win32_Release" >+# PROP BASE Intermediate_Dir "RADataTransfer___Win32_Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "../../../bin" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /Ob0 /I "..\RACommon" /I "..\RASharedMemory" /I "..\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /fo"Release/hccldt.res" /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcclco.lib hccls.lib hcclsm.lib /nologo /version:0.1 /dll /pdb:none /machine:I386 /out:"../../../bin/hccldt.dll" /libpath:"../../../lib" /implib:"../../../lib/hccldt.lib" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 1 >+# PROP BASE Output_Dir "RADataTransfer___Win32_Debug" >+# PROP BASE Intermediate_Dir "RADataTransfer___Win32_Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 1 >+# PROP Output_Dir "../../../bin" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\RACommon" /I "..\RASharedMemory" /I "..\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /D "ENW" /D "SQLWINT" /YX /FD /GZ /c >+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "_DEBUG" >+# ADD RSC /l 0x409 /fo"Debug/hccldt.res" /d "_DEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcclco.lib hccls.lib hcclsm.lib /nologo /dll /debug /machine:I386 /out:"../../../bin/hccldt.dll" /pdbtype:sept /libpath:"../../../lib" /implib:"../../../lib/hccldt.lib" >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "RADataTransfer - Win32 Release" >+# Name "RADataTransfer - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\RADataTransfer\RADataTransfer.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\RADataTransfer\RADataTransfer.def >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\RADataTransfer\RADataTransfer.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\RADataTransfer\resource.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\RADataTransfer\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/HCLauncher/resource.h >=================================================================== >RCS file: src-native-new/src/HCLauncher/resource.h >diff -N src-native-new/src/HCLauncher/resource.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/resource.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: resource.h,v 1.4 2006/04/06 15:48:12 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+//{{NO_DEPENDENCIES}} >+// Microsoft Developer Studio generated include file. >+// Used by version.rc >+// >+ >+ >+// Next default values for new objects >+// >+#ifdef APSTUDIO_INVOKED >+#ifndef APSTUDIO_READONLY_SYMBOLS >+#define _APS_NEXT_RESOURCE_VALUE 101 >+#define _APS_NEXT_COMMAND_VALUE 40001 >+#define _APS_NEXT_CONTROL_VALUE 1000 >+#define _APS_NEXT_SYMED_VALUE 101 >+#endif >+#endif >Index: src-native-new/src/agents/perfmon/WinBuild/resutils.dsp >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/resutils.dsp >diff -N src-native-new/src/agents/perfmon/WinBuild/resutils.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/resutils.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,136 @@ >+# Microsoft Developer Studio Project File - Name="resutils" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Static Library" 0x0104 >+ >+CFG=resutils - Win32 Release >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "resutils.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "resutils.mak" CFG="resutils - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "resutils - Win32 Release" (based on "Win32 (x86) Static Library") >+!MESSAGE "resutils - Win32 Debug" (based on "Win32 (x86) Static Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "resutils - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "resutils___Win32_Release" >+# PROP BASE Intermediate_Dir "resutils___Win32_Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Release" >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LIB32=link.exe -lib >+# ADD BASE LIB32 /nologo >+# ADD LIB32 /nologo >+ >+!ELSEIF "$(CFG)" == "resutils - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "resutils___Win32_Debug" >+# PROP BASE Intermediate_Dir "resutils___Win32_Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Debug" >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LIB32=link.exe -lib >+# ADD BASE LIB32 /nologo >+# ADD LIB32 /nologo >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "resutils - Win32 Release" >+# Name "resutils - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\resutils\clock.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\hashtable.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\library.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\mutex.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\random.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\streq.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\thread.c >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\resutils\DataCollectionInterface.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\DataTransferInterface.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\hashtable.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resutils\system.h >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/perfmon/resutils/resutils.make >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/resutils.make >diff -N src-native-new/src/agents/perfmon/resutils/resutils.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/resutils.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,118 @@ >+ >+################################################################################ >+# >+# makefile: resutils project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libresutils >+TARGETDIR := ../../../../lib >+ >+TARGETLIB := $(TARGET).a >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../resutils ../../../../include >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DLINUX >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+ARFLAGS := -rs $(TARGETDIR)/$(TARGETLIB) >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+AR := ar >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) $(wildcard ../resutils/*.c) $(wildcard ../resutils/*.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(AR) $(ARFLAGS) $(OBJS) >Index: src-native-new/src/HCLauncher/hclaunch.def >=================================================================== >RCS file: src-native-new/src/HCLauncher/hclaunch.def >diff -N src-native-new/src/HCLauncher/hclaunch.def >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/hclaunch.def 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,10 @@ >+LIBRARY hclaunch >+DESCRIPTION >+EXPORTS >+ Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_startProcess0 @1 >+ Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_killProcess0 @2 >+ Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_writeToProcess0 @3 >+ Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessOutput0 @4 >+ Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessError0 @5 >+ Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_getProcessStatus0 @6 >+ Java_org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl_getNativeSystemEnvironment0 @7 >Index: src-native-new/src/agents/perfmon/sysperf/perfcalc.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/sysperf/perfcalc.c >diff -N src-native-new/src/agents/perfmon/sysperf/perfcalc.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/sysperf/perfcalc.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,784 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: perfcalc.c,v 1.6 2006/05/23 16:21:25 gchristelis Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+#include <windows.h> >+#include "perfcalc.h" >+#include <stdio.h> >+#include <stdlib.h> >+#include <math.h> >+#include "hashtable.h" >+#include "perfconstants.h" >+ >+static HashTable* XHasht; >+static HashTable* YHasht; >+static HashTable* BHasht; >+ >+static ACCURACY = 1; >+ >+double round(double num,int numplaces) >+{ >+ num = num * pow(10,numplaces); >+ num = (double)((int) (num / 1)); >+ num = num / pow(10,numplaces); >+ return num; >+} >+ >+void createValueTables() >+{ >+ XHasht = tableCreate(); >+ YHasht = tableCreate(); >+ BHasht = tableCreate(); >+} >+ >+void freeValueTables() >+{ >+ tableDelete(XHasht); >+ tableDelete(YHasht); >+ tableDelete(BHasht); >+} >+ >+void getPERF_100NSEC_MULTI_TIMER (char* output, char* key, PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_COUNTER_DEFINITION PerfCntr2 ,PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 X1,Y1,X0,Y0,B1; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ Y1 = PerfData->PerfTime100nSec.QuadPart; >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ B1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ tmp1 = (XDOUBLE)(X1 - X0); >+ tmp2 = (XDOUBLE)(Y1 - Y0); >+ >+ result = 100*(tmp1/tmp2)/B1; >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, (XINT64) X1); >+ tablePut(YHasht, key, (XINT64) Y1); >+} >+ >+void getPERF_100NSEC_MULTI_TIMER_INV (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 X1,Y1,X0,Y0,B1; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ Y1 = PerfData->PerfTime100nSec.QuadPart; >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ B1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ tmp1 = (XDOUBLE)(X1 - X0); >+ tmp2 = (XDOUBLE)(Y1 - Y0); >+ >+ result = 100*(B1 - (tmp1/tmp2))/B1; >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, (XINT64) X1); >+ tablePut(YHasht, key, (XINT64) Y1); >+} >+ >+void getPERF_100NSEC_TIMER (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData) >+{ >+ >+ XINT64 X1,Y1,X0,Y0; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ Y1 = PerfData->PerfTime100nSec.QuadPart; >+ >+ tmp1 = (XDOUBLE)(X1-X0); >+ tmp2 = (XDOUBLE)(Y1-Y0); >+ >+ result = (double) (100*(tmp1/tmp2)); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,X1); >+ tablePut(YHasht,key,Y1); >+} >+ >+void getPERF_100NSEC_TIMER_INV (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData ) >+{ >+ XINT64 X1,Y1,X0,Y0; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ Y1 = PerfData->PerfTime100nSec.QuadPart; >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ tmp1 = (XDOUBLE)(X1-X0); >+ tmp2 = (XDOUBLE)(Y1-Y0); >+ >+ result = (double) (100 * (1 - (tmp1/tmp2) )); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,X1); >+ tablePut(YHasht,key,Y1); >+} >+ >+void getPERF_AVERAGE_BULK (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2) >+{ >+ DWORD X1,B1,X0,B0; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ X0 = (DWORD) tableGet(XHasht,key); >+ B0 = (DWORD) tableGet(BHasht,key); >+ >+ X1 = *(DWORD*)((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ B1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ tmp2 = (XDOUBLE) (B1 - B0); >+ if (tmp2 == 0) >+ { >+ result = 0; >+ } >+ else >+ { >+ tmp1 = (XDOUBLE) (X1 - X0); >+ result = (double)(tmp1/tmp2); >+ } >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,X1); >+ tablePut(BHasht,key,B1); >+} >+ >+void getPERF_AVERAGE_TIMER (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2,PPERF_DATA_BLOCK PerfData) >+{ >+ DWORD X1,B1,X0,B0; >+ XINT64 TB; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ // Get Previous Data >+ X0 = (DWORD) tableGet(XHasht,key); >+ B0 = (DWORD) tableGet(BHasht,key); >+ >+ // Get PerfFreq... >+ TB = PerfData->PerfFreq.QuadPart; >+ >+ X1 = *(DWORD*)((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ B1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ tmp2 = (XDOUBLE) (B1 - B0); >+ >+ if (tmp2 == 0) >+ { >+ result = 0; >+ } >+ else >+ { >+ tmp1 = (XDOUBLE) (X1-X0); >+ result = (double)((tmp1/TB)/(tmp2)); >+ } >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, (XINT64) X1); >+ tablePut(BHasht, key, (XINT64) B1); >+} >+ >+void getPERF_COUNTER_BULK_COUNT (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 X1,X0,TB,Y1,Y0; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ TB = PerfData->PerfFreq.QuadPart; >+ Y1 = PerfData->PerfTime.QuadPart; >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) (tmp1/(tmp2/TB)); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(YHasht,key,(XINT64) Y1); >+} >+ >+void getPERF_COUNTER_COUNTER (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 TB, Y1,Y0; >+ double result; >+ DWORD X1, X0; >+ XDOUBLE tmp1, tmp2; >+ >+ X0 = (DWORD) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = PerfData->PerfTime.QuadPart; >+ TB = PerfData->PerfFreq.QuadPart; >+ >+ tmp1 = (XDOUBLE)(X1-X0); >+ tmp2 = (XDOUBLE)(Y1-Y0); >+ >+ result = (double) (tmp1/(tmp2/TB)); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(YHasht,key,(XINT64) Y1); >+} >+ >+void getPERF_COUNTER_DELTA (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ DWORD X1,X0; >+ double result; >+ >+ // Get Previous Data >+ X0 = (DWORD) tableGet(XHasht,key); >+ >+ X1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ result = (double) (X1-X0); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, (XINT64) X1); >+} >+ >+void getPERF_COUNTER_LARGE_DELTA (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ XINT64 X1,X0; >+ double result; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ result = (double) (X1-X0); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, (XINT64) X1); >+} >+ >+void getPERF_COUNTER_LARGE_QUEUELEN_TYPE (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 X1,Y1; >+ XDOUBLE tmp1, tmp2; >+ XINT64 X0, Y0; >+ double result; >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = PerfData->PerfTime.QuadPart; >+ >+ tmp1 = (XDOUBLE)(X1 - X0); >+ tmp2 = (XDOUBLE)(Y1 - Y0); >+ >+ result = (double) (tmp1/tmp2); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,X0); >+ tablePut(YHasht,key,Y0); >+} >+ >+void getPERF_COUNTER_LARGE_RAWCOUNT (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ double result; >+ XINT64 tmp; >+ >+ tmp = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ result = (double) tmp; >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+} >+ >+void getPERF_COUNTER_LARGE_RAWCOUNT_HEX (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ double result; >+ XINT64 tmp; >+ >+ tmp = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ result = (double) tmp; >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+} >+ >+void getPERF_COUNTER_MULTI_TIMER (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 X1,X0,Y1,Y0,TB,B1; >+ XDOUBLE tmp1, tmp2; >+ double result; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ B1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ Y1 = PerfData->PerfTime.QuadPart; >+ TB = PerfData->PerfFreq.QuadPart; >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double)(100*(tmp1/(tmp2/TB))/B1); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%I64Ld",result); >+ >+ >+ tablePut(XHasht, key, X1); >+ tablePut(YHasht, key, Y1); >+} >+ >+void getPERF_COUNTER_MULTI_TIMER_INV (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 X1,X0,Y1,Y0,TB,B1; >+ XDOUBLE tmp1, tmp2; >+ double result; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ B1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ Y1 = PerfData->PerfTime.QuadPart; >+ TB = PerfData->PerfFreq.QuadPart; >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double)(100*(1-(tmp1/(tmp2/TB)))/B1); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%I64Ld",result); >+ >+ tablePut(XHasht, key, X1); >+ tablePut(YHasht, key, Y1); >+} >+ >+ >+void getPERF_COUNTER_NODATA (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ sprintf(output,"0"); >+} >+ >+ >+void getPERF_COUNTER_QUEUELEN_TYPE (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 Y1,X1,X0,Y0; >+ double result; >+ XDOUBLE tmp1, tmp2; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(DWORD*)((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = PerfData->PerfTime.QuadPart; >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) (tmp1/tmp2); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, (XINT64) X1); >+ tablePut(YHasht, key, (XINT64) Y1); >+} >+ >+void getPERF_COUNTER_RAWCOUNT (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ double result; >+ DWORD tmp; >+ >+ tmp = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ result = tmp; >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+} >+ >+ >+void getPERF_COUNTER_RAWCOUNT_HEX (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ double result; >+ DWORD tmp; >+ >+ tmp = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ result = tmp; >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+} >+ >+void getPERF_COUNTER_TEXT (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+// DWORD len; >+// wchar_t* result; >+ >+// len = *(DWORD*)((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ //TODO STILL >+} >+ >+void getPERF_COUNTER_TIMER (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 Y1, TB, X1,X0,Y0; >+ double result; >+ XDOUBLE tmp1,tmp2; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(DWORD*)((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = PerfData->PerfTime.QuadPart; >+ TB = PerfData->PerfFreq.QuadPart; >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) (100*(tmp1/tmp2)); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, X1); >+ tablePut(YHasht, key, Y1); >+} >+ >+void getPERF_COUNTER_TIMER_INV (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData) >+{ >+ XINT64 Y1, TB, X1,X0,Y0; >+ double result; >+ XDOUBLE tmp1,tmp2; >+ >+ // Get Previous Data >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(DWORD*)((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = PerfData->PerfTime.QuadPart; >+ TB = PerfData->PerfFreq.QuadPart; >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) (100*(1-(tmp1/tmp2))); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht, key, X1); >+ tablePut(YHasht, key, Y1); >+} >+ >+void getPERF_ELAPSED_TIME (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr, PPERF_DATA_BLOCK PerfData, PPERF_OBJECT_TYPE PerfObj) >+{ >+ XINT64 X1, Y1, TB; >+ double result; >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ Y1 = PerfObj->PerfTime.QuadPart; >+ >+ TB = PerfObj->PerfFreq.QuadPart; >+ >+ result = (double) ((XDOUBLE)(Y1-X1))/((XDOUBLE) TB); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+} >+ >+void getPERF_RAW_FRACTION (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_COUNTER_DEFINITION PerfCntr2) >+{ >+ DWORD X1, B1; >+ double result; >+ >+ X1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ B1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ if (B1 > 0) >+ { >+ result = 100*(((double) X1) / ((double) B1)); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f%c",result,'\0'); >+ } >+} >+ >+void getPERF_SAMPLE_COUNTER (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_COUNTER_DEFINITION PerfCntr2) >+{ >+ DWORD X1, B1, X0, B0; >+ XDOUBLE tmp1, tmp2; >+ double result; >+ >+ X0 = (DWORD) tableGet(XHasht,key); >+ B0 = (DWORD) tableGet(BHasht,key); >+ >+ X1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ B1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ tmp2 = (XDOUBLE)(B1 - B0); >+ >+ if ((B1 > 0) && (tmp2 !=0)) >+ { >+ tmp1 = (XDOUBLE)(X1 - X0); >+ result = (double)(tmp1/tmp2); >+ } >+ else >+ { >+ result = 0; >+ } >+ >+ result = round(result,ACCURACY); >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(BHasht,key,(XINT64) B1); >+} >+ >+void getPERF_SAMPLE_FRACTION (char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_COUNTER_DEFINITION PerfCntr2) >+{ >+ DWORD X1, B1, X0, B0; >+ XDOUBLE tmp1, tmp2; >+ double result; >+ >+ X0 = (DWORD) tableGet(XHasht,key); >+ B0 = (DWORD) tableGet(BHasht,key); >+ >+ X1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ >+ B1 = *(DWORD*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ tmp2 = (XDOUBLE)(B1 - B0); >+ if ((B1 > 0) && (tmp2 !=0)) >+ { >+ tmp1 = (XDOUBLE)(X1 - X0); >+ result = (double)(100*tmp1/tmp2); >+ } >+ else >+ { >+ result = 0; >+ } >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(BHasht,key,(XINT64) B1); >+} >+ >+void getPERF_OBJ_TIME_TIMER(char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_DATA_BLOCK PerfData) >+{ >+ double result; >+ XDOUBLE tmp1, tmp2; >+ XINT64 X1, X0, Y1, Y0; >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = PerfData->PerfTime.QuadPart; >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) (tmp1/tmp2); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(YHasht,key,(XINT64) Y1); >+} >+ >+void getPERF_PRECISION_100NS_TIMER(char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_COUNTER_DEFINITION PerfCntr2,PPERF_DATA_BLOCK PerfData) >+{ >+ double result; >+ XDOUBLE tmp1, tmp2; >+ XINT64 X1, X0, Y1, Y0; >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ // Precision stored time in next counter >+ Y1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) (100*tmp1/tmp2); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(YHasht,key,(XINT64) Y1); >+} >+ >+// THIS IN PARTICULAR HAS NOT BEEN TESTED - I AM NOT 100% SURE YET. >+void getPERF_PRECISION_OBJECT_TIMER(char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr,PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_DATA_BLOCK PerfData) >+{ >+ double result; >+ XDOUBLE tmp1, tmp2; >+ XINT64 X1, X0, Y1, Y0, TB; >+ TB = 1; >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ TB = PerfData->PerfFreq.QuadPart; >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) ((TB*tmp1)/tmp2); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(YHasht,key,(XINT64) Y1); >+} >+ >+void getPERF_PRECISION_SYSTEM_TIMER(char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr,PPERF_COUNTER_DEFINITION PerfCntr2, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_DATA_BLOCK PerfData) >+{ >+ double result; >+ XDOUBLE tmp1, tmp2; >+ XINT64 X1, X0, Y1, Y0; >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr2->CounterOffset); >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ result = (double) (100*tmp1/tmp2); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(YHasht,key,(XINT64) Y1); >+} >+ >+void getPERF_COUNTER_100NS_QUEUELEN_TYPE(char* output, char* key,PPERF_COUNTER_BLOCK PtrToCntr, PPERF_COUNTER_DEFINITION PerfCntr,PPERF_DATA_BLOCK PerfData) >+{ >+ double result; >+ XDOUBLE tmp1, tmp2; >+ XINT64 X1, X0, Y1, Y0; >+ >+ X1 = *(XINT64*) ((PBYTE)PtrToCntr + PerfCntr->CounterOffset); >+ Y1 = PerfData->PerfTime100nSec.QuadPart; >+ >+ X0 = (XINT64) tableGet(XHasht,key); >+ Y0 = (XINT64) tableGet(YHasht,key); >+ >+ tmp1 = (XDOUBLE) (X1 - X0); >+ tmp2 = (XDOUBLE) (Y1 - Y0); >+ >+ // The MSDN Docs say this should be tmp2/tmp1 but the results that generates are not at all plausible... >+ // These results also match perfmon. >+ >+ result = (double) (tmp1/tmp2); >+ >+ result = round(result,ACCURACY); >+ >+ sprintf(output,"%f",result); >+ >+ tablePut(XHasht,key,(XINT64) X1); >+ tablePut(YHasht,key,(XINT64) Y1); >+} >Index: src-native-new/src/agents/perfmon/resutils/thread.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/thread.c >diff -N src-native-new/src/agents/perfmon/resutils/thread.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/thread.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,285 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: thread.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+/*********************************************************************** >+ * >+ * File: Threads.c >+ * Overview: The following code provides a wrapper to the Win32 >+ * API routines for threads.Here we have Thread >+ * struct, defined in thread.h, allocated and partially >+ * initialised by the caller. >+ ***********************************************************************/ >+ >+#include "system.h" >+ >+#ifdef PTHREAD_INIT_NEEDED >+void pthread_init(void); >+#endif >+ >+#ifdef WIN32 >+static unsigned WINAPI ThreadWrapper(void *); >+#endif >+#if defined(LINUX) | defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+static void *ThreadWrapper(void *); >+#endif >+ >+/*********************************************************************** >+ * Function: XThreadStartup >+ * Purpose: This function calls any necessary thread startup procedures >+ * Parameters: none >+ * Returns: int SUCCESS >+ ***********************************************************************/ >+ >+int XThreadStartup() >+{ >+#ifdef PTHREAD_INIT_NEEDED >+ pthread_init(); >+#endif >+ return SUCCESS; >+} >+ >+int XThreadMakeAbortable() >+{ >+#if defined(LINUX) | defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); >+ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); >+#endif >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XThreadCreate >+ * Purpose: This function creates a thread running the routine >+ * provided as an argument. >+ * Parameters: ThreadRoutine *, a pointer to a thread start routine; >+ * void *, a pointer to an argument to the routine and >+ * Thread *, a pointer to a Thread struct. >+ * Returns: int, THREAD_SUCCESS if successful creation, >+ * THREAD_FAILURE otherwise. >+ ***********************************************************************/ >+/* Here ThreadRoutine is of type THREAD_START_ROUTINE >+ * e.g. DWORD WINAPI ThreadStartFunc(LPVOID lpThreadParameter). */ >+ >+int XThreadCreate(XThreadFunction *function, void *argument, XThread *thread) >+{ >+#ifdef WIN32 >+ thread->function = function; >+ thread->argument = argument; >+ >+ /* >+ * use this if the threads make c runtime library calls >+ */ >+ >+ thread->handle = (HANDLE)_beginthreadex(NULL, XTHREAD_STACKSZ, ThreadWrapper, (void *)thread, 0, &(thread->id)); >+ >+ /* use this if the threads only make call to Win 32 API >+ * thread->handle = CreateThread(NULL, 0, function, argument, thread->flags, &(thread->id)); >+ */ >+ >+ if (! thread->handle) >+ { >+ return XTHREAD_ERROR_CREATE; >+ } >+#endif >+#if defined(LINUX) | defined(SOLARIS) || defined(USS) || defined(HPUX) || defined(AIX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+// thread->function = function; >+// thread->argument = argument; >+// >+// if (pthread_create(&thread->pthread, NULL, ThreadWrapper, (void *)thread) != 0) >+// { >+// return FAILURE; >+// } >+//#endif >+//#if defined(AIX) >+ pthread_attr_t attr; >+ pthread_attr_init(&attr); >+#if defined(LINUX) | defined(SOLARIS) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_JOINABLE); >+#endif >+#if defined(AIX) >+ pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED); >+#endif >+ >+ thread->function = function; >+ thread->argument = argument; >+ >+ if (pthread_create(&thread->pthread, &attr, ThreadWrapper, (void *)thread) != 0) >+ { >+ pthread_attr_destroy(&attr); >+ return FAILURE; >+ } >+ >+ pthread_attr_destroy(&attr); >+#endif >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XThreadExit >+ * Purpose: The routine causes a thread to exit normally. The >+ * thread will not terminate until all references to the >+ * kernel thread object are closed. >+ * Parameters: unsigned int (=UINT), the exit code for the thread. >+ * Returns: void, this function does not return. >+ ***********************************************************************/ >+void XThreadExit(unsigned int code) >+{ >+#ifdef WIN32 >+ /* has same effect as returning from entry procedure, both call ExitThread(). */ >+ _endthreadex(code); >+ /* >+ ExitThread(code); */ >+#endif >+#if defined(LINUX) | defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ pthread_exit((void*)&code); >+#endif >+} >+ >+/*********************************************************************** >+ * Function: XThreadWait >+ * Purpose: The routine causes the calling thread to block until >+ * the specified thread has terminated. The terminated >+ * thread's Thread struct is invalidated. >+ * Parameters: Thread *, pointer to Thread struct; unisigned int * >+ * (=LPDWORD), pointer to exit code of thread. >+ * Returns: int, THREAD_SUCCESS if specified thread terminates >+ * with correct exit code, THREAD_FAILURE otherwise. >+ ***********************************************************************/ >+/* Thread kernel objects are signalled on termination */ >+/* is LPDWORD the same as unsigned int* ??? */ >+int XThreadWait(XThread *thread, unsigned int *code) >+{ >+#ifdef WIN32 >+ BOOL terminated; >+ DWORD result; >+ >+ result = WaitForSingleObject(thread->handle, INFINITE); /* unbounded wait */ >+ >+ if (result == WAIT_OBJECT_0) /* signalled (=thread terminated) */ >+ { >+ terminated = GetExitCodeThread(thread->handle, code); /* find out the exit code of thread */ >+ /* terminated = TRUE as signalled implies */ >+ (void) CloseHandle(thread->handle); >+ ZeroMemory(thread, sizeof(XThread)); /* invalidate Thread struct */ >+ } >+ else >+ { >+ return XTHREAD_ERROR_WAIT; >+ } >+#endif >+#if defined(LINUX) | defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ int okay; >+ >+ if ((okay = pthread_join(thread->pthread, (void **)&code)) != 0) >+ { >+ return FAILURE; >+ } >+#endif >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XThreadAbort >+ * Purpose: Forcefully terminates a specified thread. The thread's >+ * Thread struct is invalidated. >+ * Parameters: Thread *, pointer to Thread struct. >+ * Returns: int, THREAD_SUCCESS if successful termination, >+ * THREAD_FAILURE otherwise. >+ ***********************************************************************/ >+int XThreadAbort(XThread *thread) >+{ >+#ifdef WIN32 >+ BOOL terminated; >+ DWORD exitcode = 0; >+ >+ terminated = TerminateThread(thread->handle, exitcode); >+ >+ if (terminated) >+ { >+ (void) CloseHandle(thread->handle); >+ ZeroMemory(thread, sizeof(XThread)); /* invalidate Thread struct */ >+ } >+ else >+ { >+ return XTHREAD_ERROR_ABORT; >+ } >+#endif >+#if defined(LINUX) | defined(SOLARIS) || defined(USS) || defined(HPUX) || defined(AIX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ >+ if (pthread_cancel(thread->pthread) != 0) >+ { >+ return FAILURE; >+ } >+ >+#endif >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XThreadGetIdentifier >+ * Purpose: gets the thread identifier of the calling thread >+ * Parameters: >+ * Returns: int, PROCESS_SUCCESS if set is successful, >+ * PROCESS_FAILURE otherwise. >+ ***********************************************************************/ >+int XThreadGetIdentifier(int *tid) >+{ >+#ifdef WIN32 >+ *tid = GetCurrentThreadId(); >+#endif >+#if defined(LINUX) | defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ *tid = (int)getpid(); >+#endif >+ >+ return SUCCESS; >+} >+ >+#ifdef WIN32 >+/*********************************************************************** >+ * Function: ThreadWrapper >+ * Purpose: wrapper around our thread function to abstract windows >+ * _beginthreadex/_endthreadex threads - yuk yuk yuk ;-) >+ * Parameters: void *argument which is (void *) cast of the thread >+ * Returns: unsigned WINAPI SUCCESS if it returns at all ... >+ ***********************************************************************/ >+ >+static unsigned WINAPI ThreadWrapper(void *argument) >+{ >+ ((XThread *)argument)->function(((XThread *)argument)->argument); >+ >+ _endthreadex(EXIT_SUCCESS); >+ return EXIT_SUCCESS; >+} >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+/*********************************************************************** >+ * Function: ThreadWrapper >+ * Purpose: wrapper around our thread function to abstract specifics >+ * Parameters: void *argument which is (void *) cast of the thread >+ * Returns: (void *)NULL, if at all ... >+ ***********************************************************************/ >+ >+static void *ThreadWrapper(void *argument) >+{ >+ (*((XThread *)argument)->function)(((XThread *)argument)->argument); >+ >+ return NULL; >+} >+#endif >+ >+/*********************************************************************** >+ * EOF >+ ***********************************************************************/ >+ >Index: src-native-new/src/agents/perfmon/perflin/perflin.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/perflin/perflin.h >diff -N src-native-new/src/agents/perfmon/perflin/perflin.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/perflin/perflin.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,198 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+#ifndef __PERFLIN__H__ >+#define __PERFLIN__H__ >+ >+#include "system.h" >+#include "hashtable.h" >+#include "DataCollectionInterface.h" >+#include <sys/sysinfo.h> >+ >+#define STAT_CPU "10000" >+#define STAT_CPU1 "C10001" >+#define STAT_CPU2 "C10002" >+#define STAT_CPU3 "C10003" >+#define STAT_CPU4 "C10004" >+#define STAT_CPU5 "C12305" >+#define STAT_CPU6 "C12306" >+#define STAT_CPU7 "C12307" >+#define STAT_OTHER "10005" >+#define STAT_SWAP1 "C10006" >+#define STAT_SWAP2 "C10007" >+#define STAT_PAGE1 "C10008" >+#define STAT_PAGE2 "C10009" >+#define STAT_INTR "C10010" >+#define STAT_CTXT "C10011" >+#define STAT_BTIME "C10012" >+#define STAT_PROC "C10013" >+#define STAT_TOTAL "10014" >+#define STAT_CPU_TOTAL "10015" >+#define STAT_CPU1_TOTAL "C10016" >+#define STAT_CPU2_TOTAL "C10017" >+#define STAT_CPU3_TOTAL "C10018" >+#define STAT_CPU4_TOTAL "C10019" >+#define STAT_CPU5_TOTAL "C12320" >+#define STAT_CPU6_TOTAL "C12321" >+#define STAT_CPU7_TOTAL "C12322" >+#define STAT_CPU0_TOTAL "C11020" >+#define STAT_CPU0 "C11021" >+#define STAT_TOTAL_PROC "C11022" >+ >+#define STAT_PARENT "10020" >+#define STAT_DISK "10021" >+#define STAT_NOINFO "C10022" >+#define STAT_READ_IO "C10023" >+#define STAT_READ_BLKS "C10024" >+#define STAT_WRITE_IO "C10025" >+#define STAT_WRITE_BLKS "C10026" >+ >+#define MEM_PARENT "10130" >+#define MEM_TOTAL "C10030" >+#define MEM_FREE "C10031" >+#define MEM_USED "C10032" >+#define MEM_BUFFERS "C10033" >+#define MEM_CACHED "C10034" >+#define MEM_SWAPT "C10035" >+#define MEM_SWAPF "C10036" >+#define MEM_SWAPU "C10037" >+#define MEM_PERC "C10038" >+#define MEM_SPERC "C10039" >+ >+#define PROC_MAIN "10050" >+#define PROC_PARENT "10040" >+#define PROC_CPU "10041" >+#define PROC_CPU_BOTH "C10042" >+#define PROC_CPU_TIME "C10043" >+#define PROC_CPU_UTIME "C10044" >+#define PROC_CPU_STIME "C10045" >+#define PROC_CPU_CTIME "C10046" >+#define PROC_CPU_CUTIME "C10047" >+#define PROC_CPU_CSTIME "C10048" >+#define PROC_VSIZE "C10049" >+ >+#define PROC_OTHER "10055" >+#define PROC_OTHER_PID "C10056" >+#define PROC_OTHER_PPID "C10057" >+#define PROC_OTHER_PROCESSOR "C10058" >+ >+#define PROC_MEM "10059" >+#define PROC_MEM_RSS "C10060" >+#define PROC_MEM_NSWAP "C10061" >+#define PROC_MEM_CNSWAP "C10062" >+#define PROC_MEM_SIZE "C10063" >+#define PROC_MEM_RESIDENT "C10064" >+#define PROC_MEM_SHARE "C10065" >+#define PROC_MEM_TRS "C10066" >+#define PROC_MEM_DRS "C10067" >+#define PROC_MEM_LRS "C10068" >+#define PROC_MEM_DT "C10069" >+#define PROC_MEM_SWAP "C10070" >+#define PROC_MEM_CMINFLT "C10071" >+#define PROC_MEM_MINFLT "C10072" >+#define PROC_MEM_MAJFLT "C10073" >+#define PROC_MEM_CMAJFLT "C10074" >+#define PROC_MEM_PERC "C10075" >+ >+#define NET_INTERFACE "10080" >+#define NET_RBYTES "C10081" >+#define NET_RPACKETS "C10082" >+#define NET_RERRS "C10083" >+#define NET_RDROP "C10084" >+#define NET_RFIFO "C10085" >+#define NET_RFRAME "C10086" >+#define NET_RCOMPRESSED "C10087" >+#define NET_RMULTICAST "C10088" >+#define NET_TBYTES "C10089" >+#define NET_TPACKETS "C10090" >+#define NET_TERRS "C10091" >+#define NET_TDROP "C10092" >+#define NET_TFIFO "C10093" >+#define NET_TCOLLISIONS "C10094" >+#define NET_TCARRIER "C10095" >+#define NET_TCOMPRESSED "C10096" >+ >+#define PART_PARENT "10100" >+#define PART_PART "10101" >+#define PART_PERCU "C10102" >+#define PART_PERCF "C10103" >+#define PART_TOTAL_SIZE "C10104" >+#define PART_FREE_SIZE "C10105" >+#define PART_AVAIL_SIZE "C10106" >+#define PART_USED_SIZE "C10107" >+#define PART_TOTAL_BLKS "C10108" >+#define PART_FREE_BLKS "C10109" >+#define PART_AVAIL_BLKS "C10110" >+#define PART_USED_BLKS "C10111" >+#define PART_OPTIMAL "C10112" >+#define PART_TOTAL_NODES "C10113" >+#define PART_TOTAL_FREE "C10114" >+#define PART_TOTAL_USED "C10115" >+#define PART_TOTAL_MAXLEN "C10116" >+ >+#define SWAP_PARENT "10150" >+#define SWAP_PART "10151" >+#define SWAP_TOTAL "C10152" >+#define SWAP_USED "C10153" >+#define SWAP_FREE "C10154" >+#define SWAP_PUSED "C10155" >+#define SWAP_PFREE "C10156" >+ >+#define NEW_DISK_PARENT "20000" >+#define NEW_DISK_READNO "C20001" >+#define NEW_DISK_READMERGE "C20002" >+#define NEW_DISK_READSECTORS "C20003" >+#define NEW_DISK_READMILLI "C20004" >+#define NEW_DISK_WRITENO "C20005" >+#define NEW_DISK_WRITEMERGE "C20006" >+#define NEW_DISK_WRITESECTORS "C20007" >+#define NEW_DISK_WRITEMILLI "C20008" >+#define NEW_DISK_IOCOUNT "C20009" >+#define NEW_DISK_IOMILLI "C20010" >+#define NEW_DISK_WEIGHTED "C20011" >+ >+#define LWP_MAIN "30000" >+ >+#define NDEBUG !DEBUG >+ >+#define BUFFSIZE 1024 >+ >+#ifndef NUM_SNAPSHOTS >+ #define NUM_SNAPSHOTS 2 >+#endif >+ >+// General Stat Methods >+void getStatInfo(char* pid); >+void getStatResults(); >+ >+// Memory Information Methods >+void getMemInfoResults(); >+void getMemInfoTree(char* parentid); >+ >+// Process Information Methods >+void getProcessesResults(); >+void getProcessesTree(char* parentid); >+void addProcessMemResults(char* pid,long size,long resident,long share,long trs,long drs,long lrs,long dr); >+void addProcessMemTree(char* parentid); >+ >+// Network Information Method >+void getNetInfoTree(char* parentid); >+void getNetInfoResults(); >+ >+void getMountTree(char* parentid); >+void getMountResults(); >+ >+void getSwapTree(char* parentid); >+void getSwapResults(); >+ >+#endif >Index: src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak64 >=================================================================== >RCS file: src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak64 >diff -N src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,444 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on HCLauncher.dsp >+!IF "$(CFG)" == "" >+CFG=HCLaunch - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to HCLaunch - IA64 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "HCLaunch - IA64 Release" && "$(CFG)" != "HCLaunch - IA64 Debug" && "$(CFG)" != "HCLaunch - X64 Release" && "$(CFG)" != "HCLaunch - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "HCLauncher.mak64" CFG="HCLaunch - IA64 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "HCLaunch - IA64 Release" >+!MESSAGE "HCLaunch - IA64 Debug" >+!MESSAGE "HCLaunch - X64 Release" >+!MESSAGE "HCLaunch - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "HCLaunch - IA64 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hclaunch.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hclaunch.obj" >+ -@erase "$(INTDIR)\hclaunch.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\launcher_common.obj" >+ -@erase "$(INTDIR)\launcher_md.obj" >+ -@erase "$(INTDIR)\launcher_os400.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hclaunch.dll" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.exp" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /I "..\..\transport\RACommon" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /Fp"$(INTDIR)\HCLauncher.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\HCLauncher.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\hclaunch.pdb" /machine:IA64 /out:"$(OUTDIR)\hclaunch.dll" /implib:"$(OUTDIR)\..\lib\hclaunch.lib" >+LINK32_OBJS= \ >+ "$(INTDIR)\hclaunch.obj" \ >+ "$(INTDIR)\launcher_common.obj" \ >+ "$(INTDIR)\launcher_md.obj" \ >+ "$(INTDIR)\launcher_os400.obj" \ >+ "$(INTDIR)\hclaunch.res" \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" >+ >+"$(OUTDIR)\hclaunch.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "HCLaunch - X64 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hclaunch.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hclaunch.obj" >+ -@erase "$(INTDIR)\hclaunch.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\launcher_common.obj" >+ -@erase "$(INTDIR)\launcher_md.obj" >+ -@erase "$(INTDIR)\launcher_os400.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hclaunch.dll" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.exp" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /I "..\..\transport\RACommon" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /Fp"$(INTDIR)\HCLauncher.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\HCLauncher.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\hclaunch.pdb" /machine:AMD64 /out:"$(OUTDIR)\hclaunch.dll" /implib:"$(OUTDIR)\..\lib\hclaunch.lib" >+LINK32_OBJS= \ >+ "$(INTDIR)\hclaunch.obj" \ >+ "$(INTDIR)\launcher_common.obj" \ >+ "$(INTDIR)\launcher_md.obj" \ >+ "$(INTDIR)\launcher_os400.obj" \ >+ "$(INTDIR)\hclaunch.res" \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" >+ >+"$(OUTDIR)\hclaunch.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "HCLaunch - IA64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hclaunch.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hclaunch.obj" >+ -@erase "$(INTDIR)\hclaunch.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\launcher_common.obj" >+ -@erase "$(INTDIR)\launcher_md.obj" >+ -@erase "$(INTDIR)\launcher_os400.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hclaunch.dll" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.exp" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.ilk" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.lib" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\transport\RACommon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /Fp"$(INTDIR)\HCLauncher.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "_DEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\HCLauncher.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hclaunch.pdb" /debug /machine:IA64 /out:"$(OUTDIR)\hclaunch.dll" /implib:"$(OUTDIR)\..\lib\hclaunch.lib" >+LINK32_OBJS= \ >+ "$(INTDIR)\hclaunch.obj" \ >+ "$(INTDIR)\launcher_common.obj" \ >+ "$(INTDIR)\launcher_md.obj" \ >+ "$(INTDIR)\launcher_os400.obj" \ >+ "$(INTDIR)\hclaunch.res" \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" >+ >+"$(OUTDIR)\hclaunch.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "HCLaunch - X64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hclaunch.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hclaunch.obj" >+ -@erase "$(INTDIR)\hclaunch.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\launcher_common.obj" >+ -@erase "$(INTDIR)\launcher_md.obj" >+ -@erase "$(INTDIR)\launcher_os400.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hclaunch.dll" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.exp" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.ilk" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.lib" >+ -@erase "$(OUTDIR)\..\lib\hclaunch.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\transport\RACommon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /Fp"$(INTDIR)\HCLauncher.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "_DEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\HCLauncher.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hclaunch.pdb" /debug /machine:AMD64 /out:"$(OUTDIR)\hclaunch.dll" /implib:"$(OUTDIR)\..\lib\hclaunch.lib" >+LINK32_OBJS= \ >+ "$(INTDIR)\hclaunch.obj" \ >+ "$(INTDIR)\launcher_common.obj" \ >+ "$(INTDIR)\launcher_md.obj" \ >+ "$(INTDIR)\launcher_os400.obj" \ >+ "$(INTDIR)\hclaunch.res" \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" >+ >+"$(OUTDIR)\hclaunch.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+ >+!ENDIF >+ >+!IF "$(CFG)" == "HCLaunch - IA64 Release" || "$(CFG)" == "HCLaunch - IA64 Debug" || "$(CFG)" == "HCLaunch - X64 Release" || "$(CFG)" == "HCLaunch - X64 Debug" >+SOURCE=..\hclaunch.c >+ >+"$(INTDIR)\hclaunch.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\..\transport\RACommon\java.c >+ >+"$(INTDIR)\java.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\launcher_common.c >+ >+"$(INTDIR)\launcher_common.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\launcher_md.c >+ >+"$(INTDIR)\launcher_md.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\launcher_os400.c >+ >+"$(INTDIR)\launcher_os400.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\..\transport\RACommon\RAComm.c >+ >+"$(INTDIR)\RAComm.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\version.rc >+ >+!IF "$(CFG)" == "HCLaunch - IA64 Release" || "$(CFG)" == "HCLaunch - X64 Release" >+ >+ >+"$(INTDIR)\hclaunch.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "HCLaunch - IA64 Debug" || "$(CFG)" == "HCLaunch - X64 Debug" >+ >+ >+"$(INTDIR)\hclaunch.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/perflin/perflin.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/perflin/perflin.c >diff -N src-native-new/src/agents/perfmon/perflin/perflin.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/perflin/perflin.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2191 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+#include <stdio.h> >+#include <stdlib.h> >+#include <ctype.h> >+#include <string.h> >+#include <strings.h> >+#include <assert.h> >+#include <errno.h> >+#include <malloc.h> >+#include <dirent.h> >+#include <limits.h> >+#include <sys/types.h> >+#include <sys/vfs.h> >+#include <sys/ioctl.h> >+#include "perflin.h" >+ >+#include <fcntl.h> >+#include <mntent.h> >+#include <sys/unistd.h> >+#include <sys/dir.h> >+#include <sys/sysinfo.h> >+#include <unistd.h> >+ >+static int VERBOSE = FALSE; >+static int pageSize = 0; >+ >+static int buflen = 8; >+static char* buff = NULL; >+ >+static int cpuCount = 1; >+ >+static HashTable* treeHash; >+static HashTable* filtersHash; >+static HashTable* variablesHash; >+static HashTable* previousValues; // Used to cache previous results >+static HashTable* processHash; >+static HashTable* currentValues; >+ >+static HashTable* counterSeen; >+ >+static char** results = NULL; >+static int max = 0; >+static int size = 0; >+ >+static char* agent_type = "LinuxAgent"; >+ >+/*************************************************************************************/ >+ >+void crash(char* error) >+{ >+ printf("Error - crash in "); >+ printf("%s\n",error); >+ exit(1); >+} >+ >+void addToArray(char* string) >+{ >+ if (results == NULL || max == 0) >+ { >+ max = 128; >+ size = 0; >+ results = malloc(sizeof(char*)*(max)); >+ } >+ >+ if (size+1 == max) >+ { >+ max = (max)*2; >+ results = realloc(results, sizeof(char*)*(max)); >+ } >+ >+ results[size] = string; >+ size = size + 1; >+} >+ >+void addToResultsArray(char* id, char* result) >+{ >+ // Format the id-result string and add to the tree,no need ot free resultstring here - done in PerfmonAgent >+ char* resultString = malloc(sizeof(char)*(1+strlen(id)+strlen(result)+3)); >+ sprintf(resultString,"%s%c%s%c",id,'\0',result,'\0'); >+ addToArray(resultString); >+} >+ >+void addToTreeArray(char* pid, char* id, char* name, char* desc, char* suffix) >+{ >+ // Format the tree string and add it to the getTree results array 'array' >+ char* treeString = malloc(sizeof(char)*(1+strlen(id)+strlen(pid)+strlen(name)+strlen(desc)+strlen(suffix)+10)); >+ if (strchr(id,'C') == NULL) >+ sprintf(treeString,"%s%c%s%c%s%c%s%c%s%c%d%c",pid,'\0',id,'\0',name,'\0',desc,'\0',suffix,'\0',0,'\0'); >+ else >+ sprintf(treeString,"%s%c%s%c%s%c%s%c%s%c%d%c",pid,'\0',id,'\0',name,'\0',desc,'\0',suffix,'\0',1,'\0'); >+ >+ addToArray(treeString); >+} >+ >+void addDoubleCounter(double number, char* id, char* resultString) >+{ >+ sprintf(resultString, "%lf%c",number,'\0'); >+ addToResultsArray(id, resultString); >+} >+ >+void addLongCounter(long number, char* id, char* resultString) >+{ >+ sprintf(resultString, "%lu%c",number,'\0'); >+ addToResultsArray(id, resultString); >+} >+ >+void addUnsignedCounter(long number, char* id, char* resultString) >+{ >+ sprintf(resultString, "%lu%c",number, '\0'); >+ addToResultsArray(id, resultString); >+} >+ >+void getLinuxTree() >+{ >+ if (VERBOSE == TRUE) printf("*** in getLinuxTree\n"); >+ >+ getStatInfo(""); >+ getMemInfoTree(""); >+ getProcessesTree(""); >+ getNetInfoTree(""); >+ getMountTree(""); >+ getSwapTree(""); >+ >+ if (VERBOSE == TRUE) printf("*** out getLinuxTree\n"); >+} >+ >+void getLinuxResults() >+{ >+ if (VERBOSE == TRUE) printf("*** in getLinuxResults\n"); >+ >+ getStatResults(); >+ getMemInfoResults(); >+ >+ // If we have some filters requested >+ if (tableGet(filtersHash, PROC_MAIN) != (XINT64) NULL) >+ getProcessesResults(); >+ >+ getNetInfoResults(); >+ getMountResults(); >+ getSwapResults(); >+ if (VERBOSE == TRUE) printf("*** out getLinuxResults\n"); >+} >+ >+void expandBuffer() >+{ >+ buflen = buflen*2; >+ buff = realloc(buff, sizeof(char)*buflen); >+} >+ >+int readFromFile(char* filename) >+{ >+ static int file; >+ if ((file = open(filename, O_RDONLY, 0)) != -1) >+ { >+ memset(buff,'\0',buflen-1); >+ buff[buflen - 1] = '\0'; /* ensure null termination in buffer */ >+ >+ while (read(file, buff, buflen - 1) == (buflen - 1)) >+ { >+ expandBuffer(); >+ buff[buflen - 1] = '\0'; /* Bug 121258 - we must still ensure null termination of the expanded buffer */ >+ lseek(file,0,SEEK_SET); >+ } >+ close(file); >+ return TRUE; >+ } >+ else >+ printf("Unable to open file %s\n",filename); >+ return FALSE; >+} >+ >+int readSwapInfo() >+{ >+ return readFromFile("/proc/swaps"); >+} >+ >+int readNetDevInfo() >+{ >+ return readFromFile("/proc/net/dev"); >+} >+ >+int readNetWirelessInfo() >+{ >+ return readFromFile("proc/stat"); >+} >+ >+int readStatInfo() >+{ >+ return readFromFile("/proc/stat"); >+} >+ >+int readMemInfo() >+{ >+ return readFromFile("/proc/meminfo"); >+} >+ >+int readProcInfo(char * fileName) >+{ >+ return readFromFile(fileName); >+} >+ >+void getSwapTree(char* parentid) >+{ >+ if (VERBOSE == TRUE) printf("*** in getSwapTree\n"); >+ >+ if (readSwapInfo()) >+ { >+ char* b; >+ char* id = malloc(sizeof(char)*128); >+ char* pid = malloc(sizeof(char)*128); >+ char* name = malloc(sizeof(char)*128); >+ char* type = malloc(sizeof(char)*128); >+ >+ // The parent swap node. >+ addToTreeArray(parentid, SWAP_PARENT,"${LINUX.AGENT.1}","${LINUX.AGENT.2}",""); >+ >+ // Cycle through the swaps >+ >+ b = strchr(buff,'\n'); >+ b++; >+ >+ while (b[0] != '\0') >+ { >+ sscanf(b, "%s %s %*d %*d %*d",name, type); >+ >+ // Add the partition node >+ sprintf(pid, "%s_%s%c",SWAP_PART,name,'\0'); >+ addToTreeArray(SWAP_PARENT,pid, name, type, ""); >+ >+ // Now add its children >+ sprintf(id, "%s_%s%c",SWAP_PUSED,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.3}","${LINUX.AGENT.4}",""); >+ sprintf(id, "%s_%s%c",SWAP_PFREE,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.5}","${LINUX.AGENT.6}",""); >+ sprintf(id, "%s_%s%c",SWAP_TOTAL,name, '\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.7}","${LINUX.AGENT.8}",""); >+ sprintf(id, "%s_%s%c",SWAP_USED,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.9}","${LINUX.AGENT.10}",""); >+ sprintf(id, "%s_%s%c",SWAP_FREE,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.11}","${LINUX.AGENT.12}",""); >+ >+ b = strchr(b,'\n'); >+ b++; >+ } >+ >+ b = NULL; >+ >+ free(id); >+ free(pid); >+ free(name); >+ free(type); >+ } >+ if (VERBOSE == TRUE) printf("*** out getSwapTree\n"); >+} >+ >+void getSwapResults() >+{ >+ if (VERBOSE == TRUE) printf("*** in getSwapResults\n"); >+ >+ if (tableGet(filtersHash, SWAP_PARENT) != (XINT64) NULL) >+ { >+ if (readSwapInfo()) >+ { >+ char* b; >+ char* id = malloc(sizeof(char)*128); >+ char* resultString = malloc(sizeof(char) * 128); >+ char* name = malloc(sizeof(char)*128); >+ long used, ssize; >+ >+ // Cycle through the swaps >+ >+ b = strchr(buff,'\n'); >+ b++; >+ >+ while (b[0] != '\0') >+ { >+ sscanf(b, "%s %*s %d %d %*d",name, &ssize, &used); >+ >+ // Now add its children >+ sprintf(id, "%s_%s%c",SWAP_PUSED,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addDoubleCounter(((double) used)/((double)ssize)*100, id,resultString); >+ >+ sprintf(id, "%s_%s%c",SWAP_PFREE,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addDoubleCounter(((double) ssize-used)/((double)ssize)*100, id,resultString); >+ >+ sprintf(id, "%s_%s%c",SWAP_TOTAL,name, '\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(ssize, id,resultString); >+ >+ sprintf(id, "%s_%s%c",SWAP_USED,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addDoubleCounter(used, id,resultString); >+ >+ sprintf(id, "%s_%s%c",SWAP_FREE,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addDoubleCounter(ssize-used, id,resultString); >+ >+ >+ b = strchr(b,'\n'); >+ b++; >+ } >+ >+ b = NULL; >+ >+ free(id); >+ free(resultString); >+ free(name); >+ } >+ } >+ if (VERBOSE == TRUE) printf("*** out getSwapTree\n"); >+ >+} >+ >+void addMountCounterTree( char* pid, char* dir) >+{ >+ long bytesize; >+ char* id = malloc(sizeof(char) * 128); >+ >+ sprintf(id,"%s_%s%c",PART_PERCU,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.13}","${LINUX.AGENT.14}",""); >+ >+ sprintf(id,"%s_%s%c",PART_PERCF,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.15}","${LINUX.AGENT.16}",""); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_SIZE,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.17}","${LINUX.AGENT.18}",""); >+ >+ sprintf(id,"%s_%s%c",PART_FREE_SIZE,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.19}","${LINUX.AGENT.20}",""); >+ >+ sprintf(id,"%s_%s%c",PART_AVAIL_SIZE,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.21}","${LINUX.AGENT.22}",""); >+ >+ sprintf(id,"%s_%s%c",PART_USED_SIZE,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.23}","${LINUX.AGENT.24}",""); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_BLKS,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.25}","${LINUX.AGENT.26}",""); >+ >+ sprintf(id,"%s_%s%c",PART_USED_BLKS,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.27}","${LINUX.AGENT.28}",""); >+ >+ sprintf(id,"%s_%s%c",PART_FREE_BLKS,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.29}","${LINUX.AGENT.30}",""); >+ >+ sprintf(id,"%s_%s%c",PART_AVAIL_BLKS,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.31}","${LINUX.AGENT.32}",""); >+ >+ sprintf(id,"%s_%s%c",PART_OPTIMAL,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.33}","${LINUX.AGENT.34}","kb"); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_NODES,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.35}","${LINUX.AGENT.36}",""); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_USED,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.37}","${LINUX.AGENT.38}",""); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_FREE,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.39}","${LINUX.AGENT.40}",""); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_MAXLEN,dir,'\0'); >+ addToTreeArray(pid, id, "${LINUX.AGENT.41}","${LINUX.AGENT.42}",""); >+ >+ free(id); >+} >+ >+void getMountTree( char* parentid) >+{ >+ FILE* fp; >+ struct mntent* mnt; >+ char* id = malloc(sizeof(char) * 128); >+ char* name = malloc(sizeof(char) * 128); >+ char* desc = malloc(sizeof(char) * 128); >+ >+ fp = setmntent("/etc/mtab", "r"); >+ if (fp != NULL) >+ { >+ // Lets add the parent node here - only if /etc/mtab was opened succesfully >+ addToTreeArray(parentid, PART_PARENT, "${LINUX.AGENT.43}","${LINUX.AGENT.44}",""); >+ >+ mnt = getmntent(fp); >+ while (mnt != NULL) >+ { >+ sprintf(id, "%s_%s%c",PART_PART,(*mnt).mnt_dir,'\0'); >+ sprintf(desc, "%s [%s]%c", (*mnt).mnt_type, (*mnt).mnt_dir, '\0'); >+ addToTreeArray(PART_PARENT, id, (*mnt).mnt_fsname, desc, ""); >+ >+ addMountCounterTree(id, (*mnt).mnt_dir); >+ >+ mnt = getmntent(fp); >+ } >+ } >+ endmntent(fp); >+ >+ free(id); >+ free(name); >+ free(desc); >+} >+ >+void addMountCounterResults(char* dir) >+{ >+ struct statfs fs; >+ char* id = malloc(sizeof(char) * 128); >+ char* resultString = malloc(sizeof(char) * 128); >+ >+ statfs(dir, &fs); >+ >+ sprintf(id,"%s_%s%c",PART_PERCU,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addDoubleCounter(((double) (fs.f_blocks - fs.f_bavail))/((double)fs.f_blocks)*100, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_PERCF,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addDoubleCounter(((double) (fs.f_bavail))/((double)fs.f_blocks)*100, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_SIZE,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_blocks * fs.f_bsize, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_FREE_SIZE,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_bfree * fs.f_bsize, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_AVAIL_SIZE,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_bavail * fs.f_bsize, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_USED_SIZE,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter((fs.f_blocks - fs.f_bfree)*fs.f_bsize, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_BLKS,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_blocks, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_USED_BLKS,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_blocks - fs.f_bfree, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_FREE_BLKS,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_bfree, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_AVAIL_BLKS,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_bavail, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_OPTIMAL,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_bsize, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_NODES,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_files, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_USED,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_files - fs.f_ffree, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_FREE,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_ffree, id, resultString); >+ >+ sprintf(id,"%s_%s%c",PART_TOTAL_MAXLEN,dir,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(fs.f_namelen, id, resultString); >+ >+ free(id); >+ free(resultString); >+} >+ >+void getMountResults() >+{ >+ if (tableGet(filtersHash, PART_PARENT) != (XINT64) NULL) >+ { >+ FILE* fp; >+ struct mntent *mnt; >+ char* id = malloc(sizeof(char) * 128); >+ >+ fp = setmntent("/etc/mtab", "r"); >+ if (fp != NULL) >+ { >+ mnt = getmntent(fp); >+ while (mnt != NULL) >+ { >+ sprintf(id, "%s_%s%c",PART_PART,(*mnt).mnt_dir,'\0'); >+ addMountCounterResults((*mnt).mnt_dir); >+ >+ mnt = getmntent(fp); >+ } >+ } >+ endmntent(fp); >+ >+ free(id); >+ } >+} >+ >+long getProcessCount() >+{ >+ DIR * proc; >+ static struct direct * ent; >+ >+ long value = 0; >+ >+ if ((proc = opendir("/proc")) == NULL) >+ crash("/proc"); >+ >+ // Read all the entries in the proc directory >+ while((ent = readdir(proc))) >+ if (isdigit(ent->d_name[0])) >+ value++; >+ >+ closedir(proc); >+ >+ return value; >+} >+ >+void getSysStatsInfoTree(char* pid) >+{ >+ int len; >+ char * b = strstr(buff, "cpu "); >+ unsigned long l1, l2, l3 ,l4; >+ int i; >+ char* id = malloc(sizeof(char)*128); >+ char* cpuid = malloc(sizeof(char) * 128); >+ char* name = malloc(sizeof(char) * 128); >+ int counterCount = 0; >+ long t; >+ >+ if (VERBOSE == TRUE) printf("*** in getSysStatsInfoTree\n"); >+ >+ counterCount = sscanf(buff,"cpu %lu %lu %lu %lu %lu %lu %lu",&t,&t,&t,&t,&t,&t,&t); >+ >+ addToTreeArray(pid, STAT_CPU_TOTAL, "${LINUX.AGENT.45}", "${LINUX.AGENT.46}", ""); >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU0_TOTAL, "${LINUX.AGENT.64}", "${LINUX.AGENT.65}",""); >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU1_TOTAL, "${LINUX.AGENT.66}", "${LINUX.AGENT.67}", ""); >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU3_TOTAL, "${LINUX.AGENT.68}", "${LINUX.AGENT.69}", ""); >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU2_TOTAL, "${LINUX.AGENT.70}", "${LINUX.AGENT.71}", ""); >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU4_TOTAL, "${LINUX.AGENT.72}", "${LINUX.AGENT.73}", ""); >+ >+ if (counterCount == 7) >+ { >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU5_TOTAL, "${LINUX.AGENT.74}", "${LINUX.AGENT.75}", ""); >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU6_TOTAL, "${LINUX.AGENT.76}", "${LINUX.AGENT.77}", ""); >+ addToTreeArray(STAT_CPU_TOTAL, STAT_CPU7_TOTAL, "${LINUX.AGENT.78}", "${LINUX.AGENT.79}", ""); >+ } >+ >+ // In linux kernel 2.6, there are 7 counters, the above ones PLUS 3 others >+ // Check if they are available and then add them. >+ >+ >+ for (i =0; i<cpuCount; i++) >+ { >+ char test[32]; >+ // We need to check if this is an older kernel rep >+ // or a newer one. >+ >+ sprintf(test, "cpu%d%c",i,'\0'); >+ >+ if (strstr(buff,test) != NULL) >+ { >+ >+ // Add the 4 CPU counters >+ sprintf(cpuid, "%s_%d%c",STAT_CPU,i,'\0'); >+ sprintf(name, "CPU_%d%c",i,'\0'); >+ addToTreeArray(pid, cpuid, name, "${LINUX.AGENT.63}",""); >+ >+ sprintf(id, "%s_%d%c", STAT_CPU0,i,'\0'); >+ addToTreeArray(cpuid, id, "${LINUX.AGENT.64}", "${LINUX.AGENT.65}",""); >+ sprintf(id, "%s_%d%c", STAT_CPU1,i,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.66}","${LINUX.AGENT.67}",""); >+ sprintf(id, "%s_%d%c", STAT_CPU3,i,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.68}","${LINUX.AGENT.69}",""); >+ sprintf(id, "%s_%d%c", STAT_CPU2,i,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.70}","${LINUX.AGENT.71}",""); >+ sprintf(id, "%s_%d%c", STAT_CPU4,i,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.72}","${LINUX.AGENT.73}",""); >+ >+ if (counterCount == 7) >+ { >+ sprintf(id, "%s_%d%c", STAT_CPU5,i,'\0'); >+ addToTreeArray(cpuid, id, "${LINUX.AGENT.74}", "${LINUX.AGENT.75}", ""); >+ >+ sprintf(id, "%s_%d%c", STAT_CPU6,i,'\0'); >+ addToTreeArray(cpuid, id, "${LINUX.AGENT.76}", "${LINUX.AGENT.77}", ""); >+ >+ sprintf(id, "%s_%d%c", STAT_CPU7,i,'\0'); >+ addToTreeArray(cpuid, id, "${LINUX.AGENT.78}", "${LINUX.AGENT.79}", ""); >+ >+ } >+ } >+ } >+ >+ addToTreeArray(pid, STAT_OTHER, "${LINUX.AGENT.80}","${LINUX.AGENT.81}",""); >+ >+ if (counterCount != 7) >+ { >+ b = strstr(buff, "page "); >+ if (b != NULL) >+ { >+ // Add the 2 Page counters >+ addToTreeArray(STAT_OTHER, STAT_PAGE1,"${LINUX.AGENT.82}","${LINUX.AGENT.83}",""); >+ addToTreeArray(STAT_OTHER, STAT_PAGE2,"${LINUX.AGENT.84}","${LINUX.AGENT.85}",""); >+ } >+ >+ b = strstr(buff, "swap "); >+ if (b != NULL) >+ { >+ // Add the 2 swap counters >+ addToTreeArray(STAT_OTHER, STAT_SWAP2,"${LINUX.AGENT.86}","${LINUX.AGENT.87}",""); >+ addToTreeArray(STAT_OTHER, STAT_SWAP1,"${LINUX.AGENT.88}","${LINUX.AGENT.89}",""); >+ } >+ } >+ >+ b = strstr(buff, "intr "); >+ if (b != NULL) >+ // Add the 1 Interrupt counter here >+ addToTreeArray(STAT_OTHER, STAT_INTR,"${LINUX.AGENT.90}","${LINUX.AGENT.91}",""); >+ >+ b = strstr(buff, "ctxt "); >+ if (b != NULL) >+ // Add the context switch counter >+ addToTreeArray(STAT_OTHER, STAT_CTXT,"${LINUX.AGENT.92}","${LINUX.AGENT.93}",""); >+ >+ b = strstr(buff, "btime "); >+ if (b != NULL) >+ addToTreeArray(STAT_OTHER, STAT_BTIME,"${LINUX.AGENT.94}","${LINUX.AGENT.95}",""); >+ >+ b = strstr(buff, "processes "); >+ if (b != NULL) >+ addToTreeArray(STAT_OTHER, STAT_PROC,"${LINUX.AGENT.96}","${LINUX.AGENT.97}",""); >+ >+ addToTreeArray(STAT_OTHER, STAT_TOTAL_PROC, "${LINUX.AGENT.98}","${LINUX.AGENT.99}",""); >+ >+ b = NULL; >+ >+ if (VERBOSE == TRUE) printf("*** out getSysStatsInfoTree\n"); >+ free(id); >+ free(name); >+ free(cpuid); >+} >+ >+void addSysCounter( long value, char* id, char* resultString) >+{ >+ long prevValue = (XINT64) tableGet(previousValues, id); >+ >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ { >+ if (prevValue == 0) >+ { >+ if (containsKey(previousValues, id) == TRUE) >+ addLongCounter(value-prevValue,id, resultString); >+ } >+ else >+ addLongCounter(value-prevValue,id, resultString); >+ } >+ >+ tablePut(previousValues, id, (XINT64) value); >+} >+ >+void addCPUCounter( long value, long prevValue,long total, char* id, char* resultString) >+{ >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ { >+ if (prevValue == 0) >+ { >+ if (containsKey(previousValues, id) == TRUE) >+ addDoubleCounter(((double) (value-prevValue)/ (double) total)*100, id, resultString); >+ } >+ else >+ addDoubleCounter(((double) (value-prevValue)/ (double) total)*100, id, resultString); >+ } >+ >+ tablePut(previousValues, id, (XINT64) value); >+ tablePut(currentValues, id, (XINT64) value-prevValue); >+ >+} >+ >+void getSysStatsInfoResults() >+{ >+ // Previous values used for caching of previous result - better than doing hashtable lookups >+ char* resultString = malloc(sizeof(char)*128); >+ char* cpuid = malloc(sizeof(char) * 128); >+ char* cpu = malloc(sizeof(char) * 128); >+ char * b; >+ >+ long l1, l2,l3, l4, total, l5, l6, l7; >+ long pl1, pl2, pl3, pl4,pl5,pl6,pl7; >+ int i; >+ int counterCount = 0; >+ long t; >+ >+ if (VERBOSE == TRUE) >+ printf("*** in getSysStatsInfoResults\n"); >+ >+ >+ b = strstr(buff, "cpu "); >+ >+ // Deal with the total first >+ counterCount = sscanf(b, "cpu %u %u %u %u %u %u %u", &l1, &l2, &l3, &l4, &l5, &l6, &l7); >+ >+ // We ALWAYS do this, because the values are used later on in other calculations >+ pl1 = (long) tableGet(previousValues, STAT_CPU1_TOTAL); >+ pl2 = (long) tableGet(previousValues, STAT_CPU2_TOTAL); >+ pl3 = (long) tableGet(previousValues, STAT_CPU3_TOTAL); >+ pl4 = (long) tableGet(previousValues, STAT_CPU4_TOTAL); >+ >+ if (counterCount > 4) >+ { >+ pl5 = (long) tableGet(previousValues, STAT_CPU5_TOTAL); >+ pl6 = (long) tableGet(previousValues, STAT_CPU6_TOTAL); >+ pl7 = (long) tableGet(previousValues, STAT_CPU7_TOTAL); >+ >+ total = (l1-pl1) + (l2-pl2) + (l3-pl3) + (l4-pl4) + (l5 - pl5) + (l6-pl6) + (l7-pl7); >+ addCPUCounter((l1+l2+l3+l5+l6+l7), pl1+pl2+pl3+pl5+pl6+pl7,total,STAT_CPU0_TOTAL,resultString); >+ } >+ else >+ { >+ total = (l1-pl1) + (l2-pl2) + (l3-pl3) + (l4-pl4); >+ addCPUCounter((l1+l2+l3), pl1+pl2+pl3,total,STAT_CPU0_TOTAL,resultString); >+ } >+ >+ addCPUCounter(l1, pl1, total, STAT_CPU1_TOTAL, resultString); >+ addCPUCounter(l2, pl2, total, STAT_CPU2_TOTAL, resultString); >+ addCPUCounter(l3, pl3, total, STAT_CPU3_TOTAL, resultString); >+ addCPUCounter(l4, pl4, total, STAT_CPU4_TOTAL, resultString); >+ >+ if (counterCount > 4) >+ { >+ addCPUCounter(l5, pl5, total, STAT_CPU5_TOTAL, resultString); >+ addCPUCounter(l6, pl6, total, STAT_CPU6_TOTAL, resultString); >+ addCPUCounter(l7, pl7, total, STAT_CPU7_TOTAL, resultString); >+ } >+ >+ tablePut(currentValues, STAT_TOTAL, (XINT64) total); >+ >+ // Now check for each 'sub' CPU >+ for (i=0; i<cpuCount; i++) >+ { >+ static char cpu0[32]; >+ static char cpu1[32]; >+ static char cpu2[32]; >+ static char cpu3[32]; >+ static char cpu4[32]; >+ static char cpu5[32]; >+ static char cpu6[32]; >+ static char cpu7[32]; >+ >+ sprintf(cpu, "cpu%d ", i); >+ b = strstr(buff, cpu); >+ if (b != NULL) >+ { >+ sprintf(cpu, "cpu%d",i,'\0'); >+ strcat(cpu," \%u \%u \%u \%u \%u \%u \%u"); >+ counterCount = sscanf(b, cpu, &l1, &l2, &l3, &l4, &l5, &l6, &l7); >+ sprintf(cpu0, "%s_%d%c", STAT_CPU0,i,'\0'); >+ sprintf(cpu1, "%s_%d%c", STAT_CPU1,i,'\0'); >+ sprintf(cpu2, "%s_%d%c", STAT_CPU2,i,'\0'); >+ sprintf(cpu3, "%s_%d%c", STAT_CPU3,i,'\0'); >+ sprintf(cpu4, "%s_%d%c", STAT_CPU4,i,'\0'); >+ sprintf(cpu5, "%s_%d%c", STAT_CPU5,i,'\0'); >+ sprintf(cpu6, "%s_%d%c", STAT_CPU6,i,'\0'); >+ sprintf(cpu7, "%s_%d%c", STAT_CPU7,i,'\0'); >+ >+ pl1 = (XINT64) tableGet(previousValues, cpu1); >+ pl2 = (XINT64) tableGet(previousValues, cpu2); >+ pl3 = (XINT64) tableGet(previousValues, cpu3); >+ pl4 = (XINT64) tableGet(previousValues, cpu4); >+ >+ if (counterCount > 4) >+ { >+ pl5 = (XINT64) tableGet(previousValues, cpu5); >+ pl6 = (XINT64) tableGet(previousValues, cpu6); >+ pl7 = (XINT64) tableGet(previousValues, cpu7); >+ total = l1 - pl1 + l2 - pl2 + l3 - pl3 + l4 - pl4 + l5 - pl5 + l6 - pl6 + l7 - pl7; >+ addCPUCounter(l1+l2+l3, pl1+pl2+pl3 ,total, cpu0, resultString); >+ } >+ else >+ { >+ total = l1 - pl1 + l2 - pl2 + l3 - pl3 + l4 - pl4; >+ addCPUCounter(l1+l2+l3+l5+l6+l7, pl1+pl2+pl3+pl5+pl6+pl7 ,total, cpu0, resultString); >+ } >+ >+ addCPUCounter(l1, pl1, total, cpu1, resultString); >+ addCPUCounter(l2, pl2, total, cpu2, resultString); >+ addCPUCounter(l3, pl3, total, cpu3, resultString); >+ addCPUCounter(l4, pl4, total, cpu4, resultString); >+ >+ if (counterCount > 4) >+ { >+ addCPUCounter(l5, pl5, total, cpu5, resultString); >+ addCPUCounter(l6, pl6, total, cpu6, resultString); >+ addCPUCounter(l7, pl7, total, cpu7, resultString); >+ } >+ } >+ } >+ >+ if (counterCount != 7) >+ { >+ // Page swaps >+ b = strstr(buff, "page "); >+ sscanf(b, "page %lu %lu", &l1, &l2); >+ >+ addSysCounter(l1, STAT_PAGE1, resultString); >+ addSysCounter(l2, STAT_PAGE2, resultString); >+ >+ // Swap swaps >+ b = strstr(buff, "swap "); >+ sscanf(b, "swap %lu %lu", &l1, &l2); >+ >+ addSysCounter(l1, STAT_SWAP1, resultString); >+ addSysCounter(l2, STAT_SWAP2, resultString); >+ } >+ // Interrupts >+ b = strstr(buff, "intr "); >+ sscanf(b, "intr %lu", &l1); >+ >+ addSysCounter(l1, STAT_INTR, resultString); >+ >+ // Context Switches >+ b = strstr(buff, "ctxt "); >+ sscanf(b, "ctxt %lu", &l1); >+ >+ addSysCounter(l1, STAT_CTXT, resultString); >+ >+ // Boottime >+ b = strstr(buff, "btime "); >+ sscanf(b, "btime %lu", &l1); >+ >+ if (tableGet(filtersHash, STAT_BTIME) != (XINT64) NULL) >+ addLongCounter(l1 ,STAT_BTIME, resultString); >+ >+ // Processes >+ b = strstr(buff, "processes "); >+ sscanf(b, "processes %lu", &l1); >+ >+ if (tableGet(filtersHash, STAT_PROC) != (XINT64) NULL) >+ addDoubleCounter(l1,STAT_PROC, resultString); >+ >+ // This call is different, execute code to fetch process count >+ if (tableGet(filtersHash, STAT_TOTAL_PROC) != (XINT64) NULL) >+ { >+ addDoubleCounter(getProcessCount(), STAT_TOTAL_PROC,resultString); >+ } >+ >+ b = NULL; >+ >+ free(resultString); >+ free(cpuid); >+ free(cpu); >+ if (VERBOSE == TRUE) printf("*** out getSysStatsInfo\n"); >+} >+ >+ >+/*************************************************************************************/ >+// DISK METHODS >+// >+ >+void addDiskCounter( long val, char* mainid, char* counterid, char ch, char* resultString) >+{ >+ long diff; >+// Below comments remove caching >+ sprintf(counterid, "%s%d%c",mainid,(ch-'a'+1),'\0'); >+ if (tableGet(filtersHash,counterid) != (XINT64)NULL) >+ { >+// diff = val - ((XINT64) tableGet(previousValues, counterid)); >+// if (diff == val) >+// { >+// if (containsKey(previousValues, counterid)==TRUE) >+// addLongCounter(diff, counterid, resultString); >+// } >+// else >+// addLongCounter(diff, counterid, resultString); >+ >+ // New line below >+ addLongCounter(val, counterid, resultString); >+// tablePut(previousValues, counterid, (XINT64) val); >+ } >+} >+ >+void addDiskResults( long major, long minor, long noinfo, long r_io, long r_blks, long w_io, long w_blks, char ch) >+{ >+ char* counterid = malloc(sizeof(char)*128); >+ char* resultString = malloc(sizeof(char)*128); >+ long diff; >+ >+ // This populates the disk menu, for the disk with id ch. >+ // We must cache previous values, as all are total counts. >+ addDiskCounter(r_io, STAT_READ_IO, counterid, ch, resultString); >+ addDiskCounter(r_blks, STAT_READ_BLKS, counterid, ch, resultString); >+ addDiskCounter(w_io, STAT_WRITE_IO, counterid, ch, resultString); >+ addDiskCounter(w_blks, STAT_WRITE_BLKS, counterid, ch, resultString); >+ addDiskCounter(noinfo, STAT_NOINFO, counterid, ch, resultString); >+ >+ free(counterid); >+ free(resultString); >+} >+ >+void addNewDiskResults( long major, long minor, char* name,long readno,long rmerge,long rsectors,long rmilli,long writeno,long wmerge,long wsectors,long wmilli,long ioc,long iomilli, long ioweight) >+{ >+ char* id = malloc(sizeof(char)*128); >+ char* pid = malloc(sizeof(char)*128); >+ char* result = malloc(sizeof(char)*128); >+ >+ sprintf(id, "%s_%s%c",NEW_DISK_READNO,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(readno, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_READMERGE,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(rmerge, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_READSECTORS,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(rsectors, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_READMILLI,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(rmilli, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITENO,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(writeno, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITEMERGE,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(wmerge, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITESECTORS,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(wsectors, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITEMILLI,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(wmilli, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_IOCOUNT,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(ioc, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_IOMILLI,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(iomilli, id, result); >+ sprintf(id, "%s_%s%c",NEW_DISK_WEIGHTED,name,'\0'); >+ if (tableGet(filtersHash,id) != (XINT64) NULL) >+ addLongCounter(ioweight, id, result); >+ >+ free(pid); >+ free(id); >+ free(result); >+} >+ >+void addDisk( char* pid, long major, long minor, long noinfo, long r_io, long r_blks, long w_io, long w_blks, char ch) >+{ >+ char* newid = malloc(sizeof(char)*128); >+ char* name = malloc(sizeof(char)*128); >+ char* desc = malloc(sizeof(char)*128); >+ char* childid = malloc(sizeof(char)*128); >+ >+ sprintf(newid,"%s%d%c",STAT_DISK,ch-'a'+1,'\0'); >+ >+ // Construct the disk name here >+ sprintf(name, "Disk %d%c",ch-'a'+1,'\0'); >+ sprintf(desc, ""); >+ >+ // Construct the disks description here, eg hd'a' hd'b' and sd'c' sd'd' ... etc.. >+ if (major == 8) >+ sprintf(desc,"/dev/sd%c (%lu,%lu)%c",ch-1,major,minor,'\0'); >+ else if (major == 3) >+ sprintf(desc,"/dev/hd%c (%lu,%lu)%c",ch-1,major,minor,'\0'); >+ else >+ sprintf(desc,"%c%c",ch-1,'\0'); >+ >+ addToTreeArray(pid, newid, name,desc, ""); >+ >+ // Now add all the child nodes >+ sprintf(name, "${LINUX.AGENT.100}%c",'\0'); >+ sprintf(childid, "%s%d%c",STAT_READ_IO,(ch-'a'+1),'\0'); >+ addToTreeArray(newid, childid, name, "${LINUX.AGENT.101}", ""); >+ >+ sprintf(name, "Read Blocks%c",'\0'); >+ sprintf(childid, "%s%d%c",STAT_READ_BLKS,(ch-'a'+1),'\0'); >+ addToTreeArray(newid, childid, name, "${LINUX.AGENT.103}", ""); >+ >+ sprintf(name, "Write IO Operations%c",'\0'); >+ sprintf(childid, "%s%d%c",STAT_WRITE_IO,(ch-'a'+1),'\0'); >+ addToTreeArray(newid, childid, name, "${LINUX.AGENT.105}", ""); >+ >+ sprintf(name, "Write Blocks%c",'\0'); >+ sprintf(childid, "%s%d%c",STAT_WRITE_BLKS,(ch-'a'+1),'\0'); >+ addToTreeArray(newid, childid, name, "${LINUX.AGENT.107}", ""); >+ >+ sprintf(name, "No Info%c",'\0'); >+ sprintf(childid, "%s%d%c",STAT_NOINFO,(ch-'a'+1),'\0'); >+ addToTreeArray(newid, childid, name, "${LINUX.AGENT.109}", ""); >+ >+ free(newid); >+ free(name); >+ free(desc); >+ free(childid); >+} >+ >+void getDiskStatsInfoResults() >+{ >+ if (VERBOSE == TRUE) printf("*** in getDiskStatsInfoResults\n"); >+ >+ if (tableGet(filtersHash, STAT_PARENT) != (XINT64) NULL) >+ { >+ char disk[17] = "disk_io "; >+ char * b; >+ long major=0, minor=0, noinfo=0, read_io_ops=0, read_blks=0, write_io_ops=0, write_blks=0; >+ char ch = 'a'; >+ char* diskid = malloc(sizeof(char)*128); >+ >+ if (strstr(buff, "disk_io: ") != NULL) >+ { >+ >+ b = strstr(buff, "disk_io: "); >+ >+ sscanf(b, "disk_io: (%lu,%lu):(%lu,%lu,%lu,%lu,%lu)",&major,&minor,&noinfo, &read_io_ops, &read_blks, &write_io_ops, &write_blks); >+ >+ sprintf(diskid,"%s%d%c",STAT_DISK,(ch-'a'+1),'\0'); >+ >+ if (tableGet(filtersHash, diskid) != (XINT64)NULL) >+ addDiskResults(major, minor, noinfo, read_io_ops, read_blks, write_io_ops, write_blks,ch); >+ >+ ch++; >+ b = strstr(b,") "); >+ >+ if (b == NULL) >+ return; >+ >+ while ((b = strstr(b," ("))!= NULL) >+ { >+ sscanf(b, " (%lu,%lu):(%lu,%lu,%lu,%lu,%lu)",&major,&minor,&noinfo, &read_io_ops, &read_blks, &write_io_ops, &write_blks); >+ >+ sprintf(diskid,"%s%d%c",STAT_DISK,(ch-'a'+1),'\0'); >+ >+ if (tableGet(filtersHash, diskid) != (XINT64)NULL) >+ addDiskResults(major, minor, noinfo, read_io_ops, read_blks, write_io_ops, write_blks,ch); >+ >+ ch++; >+ b = strstr(b,") "); >+ } >+ } >+ else if (strstr(buff,"disk") != NULL) >+ { >+ long noinfo1, noinfo2, noinfo3, noinfo4; >+ long read_io1, read_io2, read_io3, read_io4; >+ long write_io1, write_io2, write_io3, write_io4; >+ long write_blks1, write_blks2, write_blks3, write_blks4; >+ long read_blks1, read_blks2, read_blks3, read_blks4; >+ >+ // Deal with the older format here >+ b = strstr(buff, "disk "); >+ sscanf(b,"disk %lu %lu %lu %lu",&noinfo1, &noinfo2, &noinfo3, &noinfo4); >+ b = strstr(buff, "disk_rio "); >+ sscanf(b,"disk_rio %lu %lu %lu %lu",&read_io1, &read_io2, &read_io3, &read_io4); >+ b = strstr(buff, "disk_wio "); >+ sscanf(b,"disk_wio %lu %lu %lu %lu",&write_io1, &write_io2, &write_io3, &write_io4); >+ b = strstr(buff, "disk_rblk "); >+ sscanf(b,"disk_rblk %lu %lu %lu %lu",&read_blks1,&read_blks2,&read_blks3,&read_blks4); >+ b = strstr(buff, "disk_wblk "); >+ sscanf(b,"disk_wblk %lu %lu %lu %lu",&write_blks1,&write_blks2,&write_blks3,&write_blks4); >+ >+ major = 0; >+ minor = 0; >+ >+ addDiskResults(major, minor, noinfo1, read_io1, read_blks1, write_io1, write_blks1,'a'); >+ addDiskResults(major, minor, noinfo2, read_io2, read_blks2, write_io2, write_blks2,'b'); >+ addDiskResults(major, minor, noinfo3, read_io3, read_blks3, write_io3, write_blks3,'c'); >+ addDiskResults(major, minor, noinfo4, read_io4, read_blks4, write_io4, write_blks4,'d'); >+ >+ } >+ else if (readFromFile("/proc/diskstats")) >+ { >+ long read_no, read_merge, read_sectors, read_milli, write_no, write_sectors, write_milli, iocount, iomilli, weighted, major, minor, write_merge; >+ >+ char* name = malloc(sizeof(char)*128); >+ >+ b = buff; >+ while ((b[0] != '\0') && (b[0] != '\n')) >+ { >+ sscanf(b,"%u %u %s %u %u %u %u %u %u %u %u %u %u %u",&major,&minor,name,&read_no,&read_merge, &read_sectors, &read_milli, &write_no, &write_merge, &write_sectors, &write_milli, &iocount,&iomilli, &weighted); >+ addNewDiskResults(major, minor,name, read_no, read_merge, read_sectors, read_milli, write_no, write_merge,write_sectors, write_milli, iocount, iomilli, weighted); >+ b = strchr(b,'\n')+1; >+ } >+ >+ free(name); >+ } >+ >+ b = NULL; >+ >+ free(diskid); >+ } >+ >+ if (VERBOSE == TRUE) printf("*** out getDiskStatsInfoResults\n"); >+} >+ >+void addNewDisk( char* parent, long major, long minor, char* name) >+{ >+ char* id = malloc(sizeof(char)*128); >+ char* pid = malloc(sizeof(char)*128); >+ char* dname = malloc(sizeof(char) * 128); >+ >+ sprintf(dname, "%s (%u,%u)%c",name,major,minor,'\0'); >+ >+ sprintf(pid,"%s_%s%c",NEW_DISK_PARENT,name,'\0'); >+ addToTreeArray(parent,pid,dname,"${LINUX.AGENT.110}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_READNO,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.111}","${LINUX.AGENT.112}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_READMERGE,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.113}","${LINUX.AGENT.114}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_READSECTORS,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.115}","${LINUX.AGENT.116}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_READMILLI,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.117}","${LINUX.AGENT.118}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITENO,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.119}","${LINUX.AGENT.120}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITEMERGE,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.121}","${LINUX.AGENT.122}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITESECTORS,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.123}","${LINUX.AGENT.124}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_WRITEMILLI,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.125}","${LINUX.AGENT.126}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_IOCOUNT,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.127}","${LINUX.AGENT.128}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_IOMILLI,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.129}","${LINUX.AGENT.130}",""); >+ sprintf(id, "%s_%s%c",NEW_DISK_WEIGHTED,name,'\0'); >+ addToTreeArray(pid,id,"${LINUX.AGENT.131}","${LINUX.AGENT.132}",""); >+ >+ free(pid); >+ free(id); >+ free(dname); >+} >+ >+void getDiskStatsInfoTree( char* pid) >+{ >+ char * b; >+ long major=0, minor=0, noinfo=0, read_io_ops=0, read_blks=0, write_io_ops=0, write_blks=0; >+ char ch = 'a'; >+ int kver = 0; // Just a value we can switch on later >+ >+ addToTreeArray(pid, STAT_PARENT, "${LINUX.AGENT.133}", "${LINUX.AGENT.249}", ""); >+ // Populate the tree with entries and ids relevant for each disk installed. >+ // What we do here is scanf entries from the disk_io stats entry >+ // and for each entry we can get we populate the tree >+ if (VERBOSE == TRUE) printf("*** in getDiskStatsInfoTree\n"); >+ >+ // Accomadate for older kernel disk usage here - >+ // check if disk_io is present : if so, then assume ~2.4 >+ // check if diskstats file exists : if so then assume ~2.6 >+ // else, assume older disk in stat : k ~2.2 >+ >+ if (strstr(buff, "disk_io") != NULL) >+ { >+ b = strstr(buff, "disk_io: "); >+ >+ sscanf(b, "disk_io: (%lu,%lu):(%lu,%lu,%lu,%lu,%lu)",&major,&minor,&noinfo, &read_io_ops, &read_blks, &write_io_ops, &write_blks); >+ >+ addDisk(STAT_PARENT, major, minor, noinfo, read_io_ops, read_blks, write_io_ops, write_blks,ch); >+ >+ ch++; >+ b = strstr(b,") "); >+ >+ if (b == NULL) >+ return; >+ >+ while ((b = strstr(b," ("))!= NULL) >+ { >+ sscanf(b, " (%lu,%lu):(%lu,%lu,%lu,%lu,%lu)",&major,&minor,&noinfo, &read_io_ops, &read_blks, &write_io_ops, &write_blks); >+ >+ addDisk(STAT_PARENT, major, minor, noinfo, read_io_ops, read_blks, write_io_ops, write_blks,ch); >+ ch++; >+ b = strstr(b,") "); >+ } >+ } >+ else if (strstr(buff,"disk") != NULL) >+ { >+ long noinfo1, noinfo2, noinfo3, noinfo4; >+ long read_io1, read_io2, read_io3, read_io4; >+ long write_io1, write_io2, write_io3, write_io4; >+ long write_blks1, write_blks2, write_blks3, write_blks4; >+ long read_blks1, read_blks2, read_blks3, read_blks4; >+ >+ // Deal with the older format here >+ b = strstr(buff, "disk "); >+ sscanf(b,"disk %lu %lu %lu %lu",&noinfo1, &noinfo2, &noinfo3, &noinfo4); >+ b = strstr(buff, "disk_rio "); >+ sscanf(b,"disk_rio %lu %lu %lu %lu",&read_io1, &read_io2, &read_io3, &read_io4); >+ b = strstr(buff, "disk_wio "); >+ sscanf(b,"disk_wio %lu %lu %lu %lu",&write_io1, &write_io2, &write_io3, &write_io4); >+ b = strstr(buff, "disk_rblk "); >+ sscanf(b,"disk_rblk %lu %lu %lu %lu",&read_blks1,&read_blks2,&read_blks3,&read_blks4); >+ b = strstr(buff, "disk_wblk "); >+ sscanf(b,"disk_wblk %lu %lu %lu %lu",&write_blks1,&write_blks2,&write_blks3,&write_blks4); >+ >+ major = 0; >+ minor = 0; >+ >+ addDisk(STAT_PARENT, major, minor, noinfo1, read_io1, read_blks1, write_io1, write_blks1,'a'); >+ addDisk(STAT_PARENT, major, minor, noinfo2, read_io2, read_blks2, write_io2, write_blks2,'b'); >+ addDisk(STAT_PARENT, major, minor, noinfo3, read_io3, read_blks3, write_io3, write_blks3,'c'); >+ addDisk(STAT_PARENT, major, minor, noinfo4, read_io4, read_blks4, write_io4, write_blks4,'d'); >+ >+ } >+ else if (readFromFile("/proc/diskstats")) >+ { >+ long read_no, read_merge, read_sectors, read_milli, write_no, write_sectors, write_milli, iocount, iomilli, weighted, major, minor; >+ >+ char* name = malloc(sizeof(char)*128); >+ >+ b = buff; >+ while ((b[0] != '\0') && (b[0] != '\n')) >+ { >+ sscanf(b,"%u %u %s %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u",&major,&minor,name); >+ addNewDisk(STAT_PARENT, major, minor,name); >+ >+ b = strchr(b,'\n')+1; >+ } >+ >+ free(name); >+ } >+ >+ b = NULL; >+ >+ if (VERBOSE == TRUE) printf("*** out getDiskStatsInfoTree\n"); >+} >+ >+// Count the cpu number >+int processCpuCount() >+{ >+ char* cpu = malloc(sizeof(char)*16); >+ int count = 0; >+ >+ // The format of the stats file is cpu#, starting from 0 >+ // Lets count them up >+ >+ sprintf(cpu,"cpu%d",count); >+ >+ while (strstr(buff, cpu) != NULL) >+ { >+ count++; >+ sprintf(cpu,"cpu%d ",count); >+ } >+ >+ free(cpu); >+ return count; >+} >+ >+void getStatResults() >+{ >+ char* newpid = "/proc/stat"; >+ >+ if (VERBOSE == TRUE) printf("*** in getStatResults\n"); >+ >+ if (readStatInfo()) >+ { >+ getSysStatsInfoResults(); >+ >+ getDiskStatsInfoResults(); >+ } >+ else >+ { >+ crash("/proc/stat"); >+ } /* end if */ >+ if (VERBOSE == TRUE) printf("*** out getStatResults\n"); >+} >+ >+ >+void getStatInfo( char* pid) >+{ >+ char* newpid = "/proc/stat"; >+ >+ if (VERBOSE == TRUE) printf("*** in getStatInfo\n"); >+ >+ addToTreeArray(pid, newpid, "${LINUX.AGENT.134}","${LINUX.AGENT.135}", ""); >+ >+ if (readStatInfo()) >+ { >+ cpuCount = processCpuCount(); >+ >+ getSysStatsInfoTree(newpid); >+ getDiskStatsInfoTree(pid); >+ } >+ else >+ crash("/proc/stat"); >+ >+ if (VERBOSE == TRUE) printf("*** out getStatInfo\n"); >+} >+ >+ >+/*************************************************************************************/ >+// MEMINFO STUFF BELOW >+ >+void getMemInfoTree(char* parentid) >+{ >+ if (VERBOSE == TRUE) printf("*** in getMemInfo\n"); >+ >+ addToTreeArray(parentid, MEM_PARENT, "${LINUX.AGENT.136}","${LINUX.AGENT.137}",""); >+ >+ if (readMemInfo()) >+ { >+ addToTreeArray(MEM_PARENT,MEM_PERC, "${LINUX.AGENT.138}", "${LINUX.AGENT.139}" ,""); >+ addToTreeArray(MEM_PARENT,MEM_SPERC, "${LINUX.AGENT.140}", "${LINUX.AGENT.141}" ,""); >+ addToTreeArray(MEM_PARENT,MEM_TOTAL, "${LINUX.AGENT.142}","${LINUX.AGENT.143}",""); >+ addToTreeArray(MEM_PARENT,MEM_FREE, "${LINUX.AGENT.144}","${LINUX.AGENT.145}",""); >+ addToTreeArray(MEM_PARENT,MEM_USED, "${LINUX.AGENT.146}","${LINUX.AGENT.147}",""); >+ addToTreeArray(MEM_PARENT,MEM_SWAPT, "${LINUX.AGENT.148}","${LINUX.AGENT.149}",""); >+ addToTreeArray(MEM_PARENT,MEM_SWAPF, "${LINUX.AGENT.150}","${LINUX.AGENT.151}",""); >+ addToTreeArray(MEM_PARENT,MEM_SWAPU, "${LINUX.AGENT.152}","${LINUX.AGENT.153}",""); >+ addToTreeArray(MEM_PARENT,MEM_CACHED, "${LINUX.AGENT.154}","${LINUX.AGENT.155}",""); >+ addToTreeArray(MEM_PARENT,MEM_BUFFERS, "${LINUX.AGENT.156}","${LINUX.AGENT.157}",""); >+ } >+ else >+ crash("/proc/meminfo"); >+ >+ if (VERBOSE == TRUE) printf("*** out getMemInfo\n"); >+} >+ >+void getMemInfoResults() >+{ >+ if (VERBOSE == TRUE) printf("*** in getMemInfoResults\n"); >+ >+ if (tableGet(filtersHash, MEM_PARENT) != (XINT64) NULL) >+ { >+ char* resultString = malloc(sizeof(char) * 128); >+ >+ // Just return the memory info from /proc/meminfo - its pretty standard stuff. >+ // No need for caching here, as we are interested in the TOTAL :) >+ if (readMemInfo()) >+ { >+ char* b; >+ long total, free; >+ >+ b = strstr(buff, "MemTotal: "); >+ sscanf(b, "MemTotal: %lu", &total); >+ if (tableGet(filtersHash, MEM_TOTAL) != (XINT64) NULL) >+ addLongCounter(total, MEM_TOTAL, resultString); >+ // Add the total memory to the currentvalues hash so that we can use it later. >+ tablePut(currentValues, MEM_TOTAL, (XINT64) total); >+ >+ b = strstr(buff, "MemFree: "); >+ sscanf(b, "MemFree: %lu", &free); >+ if (tableGet(filtersHash, MEM_FREE) != (XINT64) NULL) >+ addLongCounter(free, MEM_FREE, resultString); >+ >+ if (tableGet(filtersHash, MEM_USED) != (XINT64) NULL) >+ addLongCounter(total-free, MEM_USED, resultString); >+ >+ if (tableGet(filtersHash, MEM_PERC) != (XINT64) NULL) >+ addDoubleCounter((((double) (total-free))/((double) total))*100 ,MEM_PERC,resultString); >+ >+ b = strstr(buff, "Buffers: "); >+ sscanf(b, "Buffers: %u", &total); >+ if (tableGet(filtersHash, MEM_BUFFERS) != (XINT64) NULL) >+ addLongCounter(total, MEM_BUFFERS, resultString); >+ >+ b = strstr(buff, "Cached: "); >+ sscanf(b, "Cached: %u", &total); >+ if (tableGet(filtersHash, MEM_CACHED) != (XINT64) NULL) >+ addLongCounter(total, MEM_CACHED, resultString); >+ >+ b = strstr(buff, "SwapTotal: "); >+ sscanf(b, "SwapTotal: %lu", &total); >+ if (tableGet(filtersHash, MEM_SWAPT) != (XINT64) NULL) >+ addLongCounter(total, MEM_SWAPT, resultString); >+ >+ b = strstr(buff, "SwapFree: "); >+ sscanf(b, "SwapFree: %u", &free); >+ if (tableGet(filtersHash, MEM_SWAPF) != (XINT64) NULL) >+ addLongCounter(free, MEM_SWAPF, resultString); >+ >+ if (tableGet(filtersHash, MEM_SWAPU) != (XINT64) NULL) >+ addLongCounter(total-free, MEM_SWAPU,resultString); >+ >+ if (tableGet(filtersHash, MEM_SPERC) != (XINT64) NULL) >+ addDoubleCounter((((double) (total-free))/((double) total))*100 ,MEM_SPERC,resultString); >+ >+ b = NULL; >+ } >+ else >+ crash("/proc/meminfo"); >+ >+ free(resultString); >+ } >+ if (VERBOSE == TRUE) printf("*** out getMemInfoResults\n"); >+ >+} >+ >+/*************************************************************************************/ >+// PROCESS METHODS >+// >+void addProcessMemChild( int pid, char* parentid) >+{ >+ char* id = malloc(sizeof(char) * 128); >+ char* memid = malloc(sizeof(char) * 128); >+ >+ sprintf(memid, "%s_%d%c",PROC_MEM,pid,'\0'); >+ addToTreeArray(parentid, memid, "${LINUX.AGENT.158}", "${LINUX.AGENT.159}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_MEM_PERC,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.160}","${LINUX.AGENT.161}",""); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_SIZE,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.162}","${LINUX.AGENT.163}","kb"); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_RESIDENT,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.164}","${LINUX.AGENT.165}","kb"); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_SWAP,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.166}","${LINUX.AGENT.167}","kb"); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_SHARE,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.168}","${LINUX.AGENT.169}","kb"); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_TRS,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.170}","${LINUX.AGENT.171}","kb"); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_DRS,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.172}","${LINUX.AGENT.173}","kb"); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_LRS,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.174}","${LINUX.AGENT.175}","kb"); >+ >+ sprintf(id,"%s_%d%c",PROC_MEM_DT,pid,'\0'); >+ addToTreeArray(memid, id, "${LINUX.AGENT.176}","${LINUX.AGENT.177}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_MEM_MAJFLT, pid,'\0'); >+ addToTreeArray(memid, id,"${LINUX.AGENT.178}","${LINUX.AGENT.179}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_MEM_MINFLT, pid,'\0'); >+ addToTreeArray(memid, id,"${LINUX.AGENT.180}", "${LINUX.AGENT.181}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_MEM_CMAJFLT, pid,'\0'); >+ addToTreeArray(memid, id,"${LINUX.AGENT.182}","${LINUX.AGENT.183}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_MEM_CMINFLT, pid,'\0'); >+ addToTreeArray(memid, id,"${LINUX.AGENT.184}", "${LINUX.AGENT.185}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_MEM_NSWAP, pid,'\0'); >+ addToTreeArray(memid, id,"${LINUX.AGENT.186}", "${LINUX.AGENT.187}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_MEM_CNSWAP, pid,'\0'); >+ addToTreeArray(memid, id,"${LINUX.AGENT.188}", "${LINUX.AGENT.189}",""); >+ >+ free(id); >+ free(memid); >+} >+ >+void addProcessOtherChild( int pid, char* parentid) >+{ >+ char* otherid = malloc(sizeof(char) * 128); >+ char* id = malloc(sizeof(char) * 128); >+ >+ // First, add the Other tree node >+ sprintf(otherid, "%s_%d%c",PROC_OTHER,pid,'\0'); >+ addToTreeArray(parentid, otherid, "${LINUX.AGENT.190}", "${LINUX.AGENT.191}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_OTHER_PID, pid, '\0'); >+ addToTreeArray(otherid, id,"${LINUX.AGENT.192}", "${LINUX.AGENT.193}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_OTHER_PPID, pid, '\0'); >+ addToTreeArray(otherid, id,"${LINUX.AGENT.194}", "${LINUX.AGENT.195}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_OTHER_PROCESSOR, pid, '\0'); >+ addToTreeArray(otherid, id,"${LINUX.AGENT.196}", "${LINUX.AGENT.197}",""); >+ >+ free(id); >+ free(otherid); >+ >+} >+ >+void addProcessCpuChild( int pid, char* parentid) >+{ >+ char* cpuid = malloc(sizeof(char) * 128); >+ char* id = malloc(sizeof(char) * 128); >+ >+ // First, add the CPU tree node >+ sprintf(cpuid, "%s_%d%c",PROC_CPU,pid,'\0'); >+ addToTreeArray(parentid, cpuid, "${LINUX.AGENT.198}", "${LINUX.AGENT.199}",""); >+ >+ sprintf(id, "%s_%d%c", PROC_CPU_BOTH, pid, '\0'); >+ addToTreeArray(cpuid, id, "${LINUX.AGENT.200}", "${LINUX.AGENT.201}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_CPU_TIME, pid, '\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.202}", "${LINUX.AGENT.203}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_CPU_UTIME, pid,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.204}", "${LINUX.AGENT.205}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_CPU_STIME, pid,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.206}", "${LINUX.AGENT.207}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_CPU_CTIME, pid,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.208}", "${LINUX.AGENT.209}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_CPU_CUTIME, pid,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.210}", "${LINUX.AGENT.211}",""); >+ >+ sprintf(id, "%s_%d%c",PROC_CPU_CSTIME, pid,'\0'); >+ addToTreeArray(cpuid, id,"${LINUX.AGENT.212}", "${LINUX.AGENT.213}",""); >+ >+ free(id); >+ free(cpuid); >+} >+ >+void getProcessesTree( char* parentid) >+{ >+ // return the tree of the processs' stat file, and statm files >+ static struct direct * ent; >+ static char filename[128]; >+ static char executeName[128]; >+ static int pid; >+ DIR * proc; >+ char* procParentID = malloc(sizeof(char)*128); >+ char* procName = malloc(sizeof(char) * 128); >+ char* strpid = malloc(sizeof(char)*128); >+ >+ if (VERBOSE == TRUE) printf("*** in getProcesses\n"); >+ >+ if ((proc = opendir("/proc")) == NULL) >+ crash("/proc"); >+ >+ // Lets add the process parent element to the resutls tree >+ addToTreeArray(parentid, PROC_MAIN,"${LINUX.AGENT.214}","${LINUX.AGENT.215}",""); >+ >+ // Read all the entries in the proc directory >+ while((ent = readdir(proc))) >+ { >+ // Processes must have directories that start with a digit >+ if (isdigit(ent->d_name[0])) >+ { >+ sprintf(filename, "/proc/%s/stat", ent->d_name); >+ if (readProcInfo(filename)) >+ { >+ sscanf(buff, "%d (%s) %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*d %*d %*d %*d %*d %*d %*u %*u %*d %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u\n", &pid, executeName); >+ >+ executeName[strlen(executeName)-1] = '\0'; >+ >+ // First, lets deal with the process tree node >+ sprintf(procParentID,"%s_%d%c",PROC_PARENT, pid,'\0'); >+ sprintf(procName, "%s [%d]%c",executeName, pid,'\0'); >+ sprintf(strpid, "%d%c",pid,'\0'); >+ >+ // Add to the process Hash - this just keeps a record of all the processes that we have populated the tree >+ // with, and should be less expensive than processing ALL ids >+ tablePut(processHash, strpid,1); >+ addToTreeArray(PROC_MAIN, procParentID, procName,"",""); >+ >+ >+ // Now lets deal with the children of the process node >+ addProcessCpuChild(pid, procParentID); >+ >+ sprintf(filename, "/proc/%s/statm", ent->d_name); >+ if (readProcInfo(filename)) >+ { >+ sscanf(buff, "%*d %*d %*d %*d %*d %*d %*d"); >+ >+ addProcessMemChild(pid, procParentID); >+ } >+ addProcessOtherChild(pid, procParentID); >+ } >+ } >+ } >+ closedir(proc); >+ >+ free(procParentID); >+ free(procName); >+ free(strpid); >+ >+ if (VERBOSE == TRUE) printf("***out getProcessesTree\n"); >+} >+ >+// Add the other counter results here >+void addProcessOtherResults( char* pid,long lpid, long ppid, long processor) >+{ >+ char* id = malloc(sizeof(char)*128); >+ char* resultString = malloc(sizeof(char) * 128); >+ >+ sprintf(id, "%s_%s%c",PROC_OTHER_PID, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(lpid, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_OTHER_PPID, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(ppid, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_OTHER_PROCESSOR, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(processor, id,resultString); >+ >+ free(resultString); >+ free(id); >+} >+ >+ >+// Add the memopry specific stuff to the results tree for a specific process >+void addProcessMemResults(char* pid,long size,long resident,long share,long trs,long drs,long lrs,long dr) >+{ >+ char* id = malloc(sizeof(char) * 128); >+ char* resultString = malloc(sizeof(char) * 128); >+ >+ sprintf(id, "%s_%s%c",PROC_MEM_PERC,pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ { >+ long total = (XINT64) tableGet(currentValues, MEM_TOTAL); >+ long res = resident*pageSize/1024; >+ double perc = ((double) res)/ ((double) total)*100; >+ addDoubleCounter(perc, id, resultString); >+ } >+ >+ sprintf(id, "%s_%s%c",PROC_MEM_SIZE, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(size*pageSize/1024, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_RESIDENT, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(resident*pageSize/1024, id,resultString); >+ >+ sprintf(id, "%s_%s%c",PROC_MEM_SWAP, pid,'\0'); // SWAP = VIRT - RES = size - resident >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter((size - resident)*pageSize/1024, id,resultString); >+ >+ sprintf(id, "%s_%s%c",PROC_MEM_SHARE, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(share*pageSize/1024, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_TRS, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(trs*pageSize/1024, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_DRS, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter((drs+lrs)*pageSize/1024, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_LRS, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(lrs*pageSize/1024, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_DT, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(dr, id,resultString); >+ >+ free(id); >+ free(resultString); >+} >+ >+// Add Process Results method - covenience method to add the result children of a process node >+// Must check if the counters have been requested, and so much rebuild the specific keys >+// for this pid >+ >+void addProcessCounter( char* pid, char* id, char* mainid, long current, char* resultString) >+{ >+ // Remove Caching with the comments below... >+ >+ sprintf(id, "%s_%s%c",mainid, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ { >+// long prev = (long) tableGet(previousValues, id); >+// if (prev == 0) >+// { >+// if (containsKey(previousValues, id) == TRUE) >+// addLongCounter(current-prev, id,resultString); } >+// else >+// addLongCounter(current-prev, id,resultString); >+// tablePut(previousValues,id,(XINT64) current); >+ >+// New line below >+ addLongCounter(current, id, resultString); >+ } >+} >+ >+long getProcessCounter( char* pid, char* idtemp, char* mainid, long current, long ptotal, char* resultString) >+{ >+ long val, prev; >+ >+ sprintf(idtemp, "%s_%s%c",mainid, pid,'\0'); >+ if ((prev = tableGet(previousValues, idtemp)) == (XINT64) NULL) >+ prev = 0; >+ val = ((double) (current-prev)/ (double) ptotal)*100; >+ >+ if (tableGet(filtersHash, idtemp) != (XINT64) NULL) >+ { >+ if (prev != 0) >+ addDoubleCounter(val, idtemp,resultString); >+ else >+ if (containsKey(previousValues, idtemp) == TRUE) >+ addDoubleCounter(val, idtemp,resultString); >+ } >+ >+ // return -1 if this value should NOT be used for a CPU aggregate >+ if (prev == 0) >+ if (containsKey(previousValues, idtemp) == TRUE) >+ { >+ tablePut(previousValues,idtemp,(XINT64) current); >+ return val; >+ } >+ else >+ { >+ tablePut(previousValues,idtemp,(XINT64) current); >+ return -1; >+ } >+ tablePut(previousValues,idtemp,(XINT64) current); >+ >+ return val; >+} >+ >+void addProcessResults( char* pid,long minflt,long cminflt,long majflt,long cmajflt,long utime,long stime,long cutime,long cstime,long vsize,long rss,long nswap,long cnswap) >+{ >+ char* id = malloc(sizeof(char) * 128); >+ char* idtemp = malloc(sizeof(char) * 128); >+ char* resultString = malloc(sizeof(char)*128); >+ long total = utime+stime; >+ long ctotal = cutime + cstime; >+ >+ addProcessCounter(pid, id, PROC_MEM_MINFLT, minflt, resultString); >+ addProcessCounter(pid, id, PROC_MEM_CMINFLT, cminflt, resultString); >+ addProcessCounter(pid, id, PROC_MEM_MAJFLT, majflt, resultString); >+ addProcessCounter(pid, id, PROC_MEM_CMAJFLT, cmajflt, resultString); >+ >+ sprintf(id, "%s_%s%c", PROC_CPU_BOTH, pid, '\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ { >+ long prev, ptotal; >+ double val1, val2, val3, val4; >+ >+ ptotal = (XINT64) tableGet(currentValues, STAT_TOTAL); >+ >+ val1 = getProcessCounter(pid, idtemp, PROC_CPU_UTIME, utime, ptotal, resultString); >+ val2 = getProcessCounter(pid, idtemp, PROC_CPU_STIME, stime, ptotal, resultString); >+ val3 = getProcessCounter(pid, idtemp, PROC_CPU_CUTIME, cutime, ptotal, resultString); >+ val4 = getProcessCounter(pid, idtemp, PROC_CPU_CSTIME, cstime, ptotal, resultString); >+ >+ // If the accumulated counters have been requested then just return them below, >+ // as we already have computed all the values required. >+ if (!(val1 == -1 || val2 == -1 || val3 == -1 || val4 == -1)) >+ { >+ sprintf(idtemp, "%s_%s%c", PROC_CPU_TIME, pid, '\0'); >+ if (tableGet(filtersHash, idtemp) != (XINT64) NULL) >+ addDoubleCounter(val1+val2,idtemp, resultString); >+ >+ sprintf(idtemp, "%s_%s%c", PROC_CPU_CTIME, pid, '\0'); >+ if (tableGet(filtersHash, idtemp) != (XINT64) NULL) >+ addDoubleCounter(val3+val4,idtemp, resultString); >+ >+ addDoubleCounter(val1+val2+val3+val4, id, resultString); >+ } >+ } >+ else >+ { >+ >+ sprintf(id, "%s_%s%c", PROC_CPU_TIME, pid, '\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ { >+ double val1, val2; >+ long ptotal = (XINT64) tableGet(currentValues, STAT_TOTAL); >+ >+ val1 = getProcessCounter(pid, idtemp, PROC_CPU_UTIME, utime, ptotal, resultString); >+ val2 = getProcessCounter(pid, idtemp, PROC_CPU_STIME, stime, ptotal, resultString); >+ >+ if (!(val1 == -1 || val2 == -1)) >+ addDoubleCounter(val1+val2, id, resultString); >+ } >+ else >+ { >+ long ptotal = (XINT64) tableGet(currentValues, STAT_TOTAL); >+ >+ getProcessCounter(pid, idtemp, PROC_CPU_UTIME, utime, ptotal, resultString); >+ getProcessCounter(pid, idtemp, PROC_CPU_STIME, utime, ptotal, resultString); >+ } >+ >+ sprintf(id, "%s_%s%c", PROC_CPU_CTIME, pid, '\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ { >+ double val1, val2; >+ long ptotal = (XINT64) tableGet(currentValues, STAT_TOTAL); >+ >+ val1 = getProcessCounter(pid, idtemp, PROC_CPU_CUTIME, utime, ptotal, resultString); >+ val2 = getProcessCounter(pid, idtemp, PROC_CPU_CSTIME, stime, ptotal, resultString); >+ >+ if (!(val1 == -1 || val2 == -1)) >+ addDoubleCounter(val1+val2, id, resultString); >+ } >+ else >+ { >+ long ptotal = (XINT64) tableGet(currentValues, STAT_TOTAL); >+ >+ getProcessCounter(pid, idtemp, PROC_CPU_CUTIME, utime, ptotal, resultString); >+ getProcessCounter(pid, idtemp, PROC_CPU_CSTIME, utime, ptotal, resultString); >+ } >+ } >+ >+ sprintf(id, "%s_%s%c",PROC_VSIZE, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(vsize, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_RSS, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(rss, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_NSWAP, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(nswap, id,resultString); >+ sprintf(id, "%s_%s%c",PROC_MEM_CNSWAP, pid,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(cnswap, id,resultString); >+ >+ free(id); >+ free(idtemp); >+ free(resultString); >+} >+ >+void getProcessesResults() >+{ >+ // Get the results of the requested (if any) processes >+ >+ int pSize = 0; >+ int pLen = 128; >+ char** processes = malloc(sizeof(char*)*pLen); >+ >+ if (VERBOSE == TRUE) printf("*** in getProcessesResults\n"); >+ >+ while (pLen <= (pSize = tableKeysAsList(processHash, processes, pLen))) >+ { >+ pLen = pLen * 2; >+ processes = realloc(processes, sizeof(char*)*pLen); >+ } >+ >+ if (pSize > 0) >+ { >+ static char filename[128]; >+ static char executeName[128]; >+ char* procParentID = malloc(sizeof(char)*128); >+ char* procName = malloc(sizeof(char) * 128); >+ int i; >+ long minflt=0,cminflt=0,majflt=0,cmajflt=0,utime=0,stime=0,cutime=0,cstime=0,vsize=0,rss=0,nswap=0,cnswap=0; >+ long size, resident, share, trs, drs, lrs, dr, pid, ppid, processor; >+ >+ for (i=0; i<pSize; i++) >+ { >+ // Recreate the process key here,and then check if it has been requested >+ sprintf(procParentID,"%s_%s%c",PROC_PARENT, processes[i],'\0'); >+ >+ if (tableGet(filtersHash, procParentID) != (XINT64) NULL) >+ { >+ sprintf(filename, "/proc/%s/stat", processes[i]); >+ if (readProcInfo(filename)) >+ { >+ sscanf(buff, "%d %*s %*c %d %*d %*d %*d %*d %*u %lu %lu %lu %lu %lu %lu %lu %lu %*d %*d %*u %*u %*d %lu %lu %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %lu %lu %*d %d",&pid, &ppid, &minflt,&cminflt,&majflt,&cmajflt,&utime,&stime,&cutime,&cstime,&vsize,&rss,&nswap,&cnswap, &processor); >+ >+ addProcessResults(processes[i],minflt,cminflt,majflt,cmajflt,utime,stime,cutime,cstime,vsize,rss,nswap,cnswap); >+ >+ sprintf(filename, "/proc/%s/statm", processes[i]); >+ if (readProcInfo(filename)) >+ { >+ sscanf(buff, "%d %d %d %d %d %d %d",&size,&resident,&share,&trs,&drs,&lrs,&dr); >+ addProcessMemResults(processes[i],size,resident,share,trs,drs,lrs,dr); >+ } >+ addProcessOtherResults(processes[i],pid, ppid, processor); >+ } >+ } >+ } >+ >+ free(procParentID); >+ free(procName); >+ } >+ >+ free(processes); >+ >+ if (VERBOSE == TRUE) printf("***out getProcesses\n"); >+} >+ >+/*************************************************************************************/ >+// NET METHODS >+ >+void addNetInterface(char* parentid, char** bstr) >+{ >+ char* b = *bstr; >+ char* name = malloc(sizeof(char) * 128); >+ char* temp = malloc(sizeof(char) * 128); >+ char* interfaceid = malloc(sizeof(char) * 128); >+ char* id = malloc(sizeof(char) * 128); >+ int i=0; >+ >+ while (b[i] != ':') >+ i++; >+ >+ b[i] = '\0'; >+ sprintf(temp, "%s%c",b,'\0'); >+ sscanf(temp, "%s",name); >+ b = b+(sizeof(char)*(i+1)); >+ >+ // Firstly, lets add the interface node >+ sprintf(interfaceid,"%s_%s%c",NET_INTERFACE,name,'\0'); >+ addToTreeArray(parentid, interfaceid, name,"${LINUX.AGENT.216}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RBYTES,name,'\0'); >+ addToTreeArray(interfaceid, id, "${MySQL.AGENT.217}","${LINUX.AGENT.218}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RPACKETS,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.219}","${LINUX.AGENT.220}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RERRS,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.221}","${LINUX.AGENT.222}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RDROP,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.223}","${LINUX.AGENT.224}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RFIFO,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.225}","${LINUX.AGENT.226}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RFRAME,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.227}","${LINUX.AGENT.228}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RCOMPRESSED,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.229}","${LINUX.AGENT.230}",""); >+ >+ sprintf(id,"%s_%s%c",NET_RMULTICAST,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.231}","${LINUX.AGENT.232}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TBYTES,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.233}","${LINUX.AGENT.234}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TPACKETS,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.235}","${LINUX.AGENT.236}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TERRS,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.237}","${LINUX.AGENT.238}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TDROP,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.239}","${LINUX.AGENT.240}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TFIFO,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.241}","${LINUX.AGENT.242}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TCOLLISIONS,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.243}","${LINUX.AGENT.244}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TCARRIER,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.245}","${LINUX.AGENT.246}",""); >+ >+ sprintf(id,"%s_%s%c",NET_TCOMPRESSED,name,'\0'); >+ addToTreeArray(interfaceid, id, "${LINUX.AGENT.247}","${LINUX.AGENT.248}",""); >+ >+ free(id); >+ free(interfaceid); >+ free(temp); >+ free(name); >+ *bstr = b; >+} >+ >+void getNetInterfaceResults( char** bstr) >+{ >+ char* b = *bstr; >+ char* name = malloc(sizeof(char) * 128); >+ char* temp = malloc(sizeof(char) * 128); >+ char* id = malloc(sizeof(char) * 128); >+ char* resultString = malloc(sizeof(char) * 128); >+ long rbytes, rpackets, rerrs, rdrop, rfifo, rframe, rcompressed, rmulticast; >+ long tbytes, tpackets, terrs, tdrop, tfifo, tcollisions, tcarrier, tcompressed; >+ int i=0; >+ >+ while (b[i] != ':') >+ i++; >+ >+ b[i] = '\0'; >+ sprintf(temp, "%s%c",b,'\0'); >+ sscanf(temp, "%s",name); >+ b = b+(sizeof(char)*(i+1)); >+ >+ sscanf(b, "%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu", &rbytes, &rpackets, &rerrs, &rdrop, &rfifo, &rframe, &rcompressed, &rmulticast, &tbytes, &tpackets, &terrs, &tdrop, &tfifo, &tcollisions, &tcarrier, &tcompressed); >+ >+ sprintf(id,"%s_%s%c",NET_RBYTES,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(rbytes,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_RPACKETS,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64) NULL) >+ addLongCounter(rpackets,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_RERRS,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(rerrs,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_RDROP,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(rdrop,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_RFIFO,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(rfifo,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_RFRAME,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(rframe,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_RCOMPRESSED,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(rcompressed,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_RMULTICAST,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(rmulticast,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TBYTES,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(tbytes,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TPACKETS,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(tpackets,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TERRS,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(terrs,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TDROP,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(tdrop,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TFIFO,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(tfifo,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TCOLLISIONS,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(tcollisions,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TCARRIER,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(tcarrier,id,resultString); >+ >+ sprintf(id,"%s_%s%c",NET_TCOMPRESSED,name,'\0'); >+ if (tableGet(filtersHash, id) != (XINT64)NULL) >+ addLongCounter(tcompressed,id,resultString); >+ >+ free(id); >+ free(temp); >+ free(name); >+ free(resultString); >+ *bstr = b; >+} >+ >+void getNetInfoResults() >+{ >+ if (VERBOSE == TRUE) printf("*** in getNetInfoResults\n"); >+ >+ if (readNetDevInfo()) >+ { >+ char *b, *btemp = NULL; >+ char* name = malloc(sizeof(char)*32); >+ int i = 0; >+ >+ // Parse the buffer and add each interface to the disk >+ // Delete the first two lines - they are headings, and useless >+ b = strstr(buff,"\n"); >+ b++; >+ b = strstr(b,"\n"); >+ b++; >+ while (b != NULL && b[0] != '\0') >+ { >+ if (strchr(b,':') == NULL) >+ break; >+ getNetInterfaceResults(&b); >+ >+ if (b[0] == '\0') >+ break; >+ >+ b = strchr(b,'\n'); >+ } >+ free(name); >+ } >+ else >+ crash("/proc/net"); >+ >+ if (VERBOSE == TRUE) printf("*** out getNetInfoResults\n"); >+} >+ >+void getNetInfoTree( char* parentid) >+{ >+ if (VERBOSE == TRUE) printf("*** in getNetInfoTree\n"); >+ >+ if (readNetDevInfo()) >+ { >+ char *b, *btemp = NULL; >+ char* name = malloc(sizeof(char)*32); >+ int i = 0; >+ >+ addToTreeArray(parentid, "/proc/net", "${LINUX.AGENT.250}","${LINUX.AGENT.251}",""); >+ >+ // Parse the buffer and add each interface to the disk >+ // Delete the first two lines - they are headings, and useless >+ b = strstr(buff,"\n"); >+ b++; >+ b = strstr(b,"\n"); >+ b++; >+ >+ while (b[0] != '\0') >+ { >+ if (strchr(b,':') == NULL) >+ break; >+ >+ addNetInterface("/proc/net", &b); >+ if (b[0] == '\0') >+ break; >+ >+ b = strchr(b,'\n'); >+ } >+ free(name); >+ } >+ else >+ crash("/proc/net"); >+ >+ if (VERBOSE == TRUE) printf("*** out getNetInfoTree\n"); >+} >+ >+/*************************************************************************************/ >+ >+void freeArray() >+{ >+ int i; >+ if (max != 0) >+ { >+// printf("about to free array : size = %d, max = %d\n",size,max); >+ for (i=0;i<size;i++) >+ free(results[i]); >+ free(results); >+ max = 0; >+ size = 0; >+ results = NULL; >+ } >+} >+ >+void getResults() >+{ >+ getLinuxResults(); >+} >+ >+void getTree() >+{ >+ getLinuxTree(); >+} /* end getStats */ >+ >+ >+char** DC_CollectionGetTree (int* numresults) >+{ >+ freeArray(); >+ getTree(); >+ *numresults = size; >+ max = 0; >+ size = 0; >+ return results; >+} >+ >+char** DC_CollectionGetResults (int* numresults) >+{ >+ freeArray(); >+ getResults(); >+ *numresults = size; >+ return results; >+} >+ >+int DC_CollectionStartup(HashTable* hasht_variables, HashTable* hasht_filters, HashTable* hasht_tree) >+{ >+ variablesHash = hasht_variables; >+ filtersHash = hasht_filters; >+ treeHash = hasht_tree; >+ previousValues = tableCreate(); >+ processHash = tableCreate(); >+ currentValues = tableCreate(); >+ >+ pageSize = getpagesize(); >+ >+ buff = malloc(sizeof(char) * buflen); >+ >+ return 0; >+} >+ >+int DC_CollectionShutdown() >+{ >+ tableDelete(previousValues); >+ tableDelete(processHash); >+ tableDelete(currentValues); >+ >+ free(buff); >+ >+ return 0; >+} >+ >+char* DC_CollectionGetAgentName() >+{ >+ return agent_type; >+} >Index: src-native-new/src/agents/native/java_profiler/binary_print.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/binary_print.h >diff -N src-native-new/src/agents/native/java_profiler/binary_print.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/binary_print.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,98 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: binary_print.h,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef BINARY_PRINT_H >+#define BINARY_PRINT_H >+ >+extern void BINARYTRACE_printUnknownRoot(ThreadLocalStorage* tps, >+ ObjectEntry* unknown); >+extern void BINARYTRACE_printJNIGlobalRoot(ThreadLocalStorage* tps, >+ ObjectEntry* parent, >+ ObjectEntry* child); >+extern void BINARYTRACE_printJNILocalRoot(ThreadLocalStorage* tps, >+ ObjectEntry* object, >+ ThreadLocalStorage* localToThisThread, >+ int stackDepth); >+extern void BINARYTRACE_printJavaStackRoot(ThreadLocalStorage* tps, >+ ThreadLocalStorage* rootedToThisThread, >+ ObjectEntry* object, >+ int depth); >+extern void BINARYTRACE_printNativeStackRoot(ThreadLocalStorage* tps, >+ ThreadLocalStorage* rootedToThisThread, >+ ObjectEntry* object); >+extern void BINARYTRACE_printStickyClassRoot(ThreadLocalStorage* tps, >+ ObjectEntry* clazzObject); >+extern void BINARYTRACE_printThreadRoot(ThreadLocalStorage* tps, >+ ThreadLocalStorage* theThread, >+ ObjectEntry* theThreadObject); >+extern void BINARYTRACE_printMonitorRoot(ThreadLocalStorage* tps, >+ ObjectEntry* monitorObject); >+ >+extern void BINARYTRACE_printGeneration(ThreadLocalStorage* tps); >+extern unsigned short BINARYTRACE_printArrayReference(char* buffer, >+ unsigned long parentOID, >+ unsigned long childOID); >+unsigned short BINARYTRACE_printClassReference(char* buffer, >+ unsigned long parentCID, >+ unsigned long childOID); >+extern unsigned short BINARYTRACE_printObjectReference(char* buffer, >+ unsigned long parentOID, >+ unsigned long childOID); >+extern void BINARYTRACE_printBOB(ThreadLocalStorage* tps); >+extern void BINARYTRACE_printEOB(ThreadLocalStorage* tps); >+extern void BINARYTRACE_printFields(ThreadLocalStorage* tps, >+ ClassEntry* classEntry, >+ jint numFields, >+ int startIndex, >+ PI_Field* fields, >+ BOOL isStatic); >+extern unsigned short BINARYTRACE_printClassDefine(char* buffer, >+ ClassEntry* classEntry); >+extern unsigned short BINARYTRACE_printClassLoad(char* buffer, >+ ClassEntry* classEntry); >+extern unsigned short BINARYTRACE_printMethodDefine(char* buffer, >+ MethodEntry* methodEntry); >+extern unsigned short BINARYTRACE_printMethodEnter(char* buffer, >+ StackEntry* stackEntry); >+unsigned short BINARYTRACE_printMethodExit(char* buffer, >+ ThreadLocalStorage* tps, >+ timestamp_t timeJustAfterGotControl); >+extern unsigned short BINARYTRACE_appendTimestamp(char* buffer, >+ unsigned short offset, >+ timestamp_t* time); >+ >+extern unsigned short BINARYTRACE_printThreadStart(char* buffer, >+ ThreadLocalStorage* tps); >+extern unsigned short BINARYTRACE_printObjectFree(char* buffer, >+ HashEntry* objectHashEntry); >+extern unsigned short >+BINARYTRACE_printWitnessedObjectAllocation(char* buffer, >+ ThreadPrivateStorage* creatingThread, >+ HashEntry* objectHashEntry, >+ HashEntry* classHashEntry, >+ timestamp_t allocTime); >+extern unsigned short BINARYTRACE_printObjectAllocation(char* buffer, >+ HashEntry* objectHashEntry, >+ HashEntry* classHashEntry); >+extern unsigned short BINARYTRACE_printClassUnload(char* buffer, >+ HashEntry* classHashEntry); >+extern unsigned short BINARYTRACE_printThreadEnd(char* buffer, >+ ThreadLocalStorage* tps); >+extern unsigned short BINARYTRACE_printGcStart(char* buffer); >+extern unsigned short BINARYTRACE_printGcFinish(char* buffer); >+extern unsigned short BINARYTRACE_printEndOfXMLHeader(char* buffer); >+extern void BINARYTRACE_printTraceHeader(ThreadLocalStorage* tps); >+extern void BINARYTRACE_printTraceEnd(ThreadLocalStorage* tps); >+ >+/* #include "watson_fieldvalues.h" */ >+ >+#endif /* BINARY_PRINT_H */ >Index: src-native-new/src/agents/perfmon/sysperf/perfcontrol.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/sysperf/perfcontrol.h >diff -N src-native-new/src/agents/perfmon/sysperf/perfcontrol.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/sysperf/perfcontrol.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,25 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: perfcontrol.h,v 1.3 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+ >+#ifndef __PERFCONTROL_H__ >+#define __PERFCONTROL_H__ >+ >+#include "hashtable.h" >+#include "system.h" >+#include "DataCollectionInterface.h" >+ >+void printout(char** data,int numstrings); >+void cleardata(char** data,int numstrings); >+ >+#endif >Index: src-native-new/src/agents/native/java_profiler/binary_print.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/binary_print.c >diff -N src-native-new/src/agents/native/java_profiler/binary_print.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/binary_print.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1171 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: binary_print.c,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+#ifdef BINARY_TRACE >+ >+#include "hash.h" >+#include "binarytrace.h" >+#include "binary_privates.h" >+#include "binary_print.h" >+ >+#if 0 >+#define BINARYTRACE_DEBUG(buffer, msg) \ >+ memcpy(buffer, msg, strlen(msg));\ >+ buffer += strlen(msg); >+#else >+#define BINARYTRACE_DEBUG(buffer, msg) >+#endif >+ >+static inline char jvmpi_to_jni(char jvmpi_type) { >+ switch(jvmpi_type) { >+ case JVMPI_BYTE: >+ return SIGNATURE_BYTE; >+ case JVMPI_BOOLEAN: >+ return SIGNATURE_BOOLEAN; >+ case JVMPI_CHAR: >+ return SIGNATURE_CHAR; >+ case JVMPI_SHORT: >+ return SIGNATURE_SHORT; >+ case JVMPI_INT: >+ return SIGNATURE_INT; >+ case JVMPI_FLOAT: >+ return SIGNATURE_FLOAT; >+ case JVMPI_LONG: >+ return SIGNATURE_LONG; >+ case JVMPI_DOUBLE: >+ return SIGNATURE_DOUBLE; >+ case JVMPI_CLASS: >+ return SIGNATURE_CLASS; >+ default: >+ assert(0); >+ return 0; >+ } >+} >+ >+inline void prof_fill_u1(char* cursor, >+ char data) >+{ >+ *cursor = data; >+} >+inline void prof_fill_boolean(char* cursor, >+ BOOL data) >+{ >+ prof_fill_u1(cursor, data ? 1 : 0); >+} >+inline void prof_fill_EventType(char* cursor, >+ jsEventType_t event) >+{ >+ prof_fill_u1(cursor, event); >+} >+inline void prof_fill_u2(char* cursor, >+ short data) >+{ >+#ifdef NEED_ALIGNMENT >+ memcpy((void*)cursor, (void*)&data, sizeof(short)); >+#else >+ short* buf = (short*)cursor; >+ *buf = data; >+#endif /* NEED_ALIGNMENT */ >+} >+inline void prof_fill_u4(char* cursor, >+ int32_t data) >+{ >+#ifdef NEED_ALIGNMENT >+ memcpy((void*)cursor, (void*)&data, sizeof(int32_t)); >+#else >+ int32_t* buf = (int32_t*)cursor; >+ *buf = data; >+#endif /* NEED_ALIGNMENT */ >+} >+inline void prof_fill_float(char* cursor, >+ float data) >+{ >+#ifdef NEED_ALIGNMENT >+ memcpy((void*)cursor, (void*)&data, sizeof(float)); >+#else >+ float* buf = (float*)cursor; >+ *buf = data; >+#endif /* NEED_ALIGNMENT */ >+} >+inline void prof_fill_double(char* cursor, >+ double data) >+{ >+#ifdef NEED_ALIGNMENT >+ memcpy((void*)cursor, (void*)&data, sizeof(double)); >+#else >+ double* buf = (double*)cursor; >+ *buf = data; >+#endif /* NEED_ALIGNMENT */ >+} >+inline void prof_fill_u8(char* cursor, >+ int64_t data) >+{ >+#ifdef NEED_ALIGNMENT >+ memcpy((void*)cursor, (void*)&data, sizeof(int64_t)); >+#else >+ int64_t* buf = (int64_t*)cursor; >+ *buf = data; >+#endif /* NEED_ALIGNMENT */ >+} >+inline void prof_fill_timestamp(char* cursor, >+ timestamp_t time) >+{ >+#ifdef SMURF >+ uint64_t longy = time->seconds; >+ longy *= 1000000; >+ longy += time->microseconds; >+#else >+ uint64_t longy = time; >+#endif >+ >+ /*fprintf(stderr, "%d %llu\n", sizeof(int64_t), longy);*/ >+ prof_fill_u8(cursor, longy); >+} >+inline void prof_fill_current_timestamp(char* cursor) >+{ >+ timestamp_t now; >+ jvmpiAgent_getCurrentTime(&now); >+ prof_fill_timestamp(cursor, now); >+} >+inline void prof_fill_TID(char* cursor, >+ ThreadPrivateStorage* tps) >+{ >+ jsThreadID_t data = tps->staticThreadId; >+#ifdef NEED_ALIGNMENT >+ memcpy((void*)cursor, (void*)&data, sizeof(jsThreadID_t)); >+#else >+ jsThreadID_t* buf = (jsThreadID_t*)cursor; >+ *buf = data; >+#endif /* NEED_ALIGNMENT */ >+} >+inline void prof_fill_OID(char* cursor, >+ jsObjectID_t data) >+{ >+ prof_fill_u4(cursor, data); >+} >+inline void prof_fill_CID(char* cursor, >+ jsClassID_t data) >+{ >+ prof_fill_u4(cursor, data); >+} >+inline void prof_fill_MID(char* cursor, >+ jsMethodID_t data) >+{ >+ prof_fill_u4(cursor, data); >+} >+inline unsigned short prof_fill_string(char* cursor, >+ const char* string) >+{ >+ int len = strlen(string); >+ >+ prof_fill_u2(cursor, len); >+ cursor += 2; >+ >+ memcpy(cursor, string, len); >+ >+ return (unsigned short)len+2; >+} >+_inline void prof_fill_ValueTypeTag(char* cursor, jsValueTypeTag_t type) >+{ >+ prof_fill_u1(cursor, type); >+} >+_inline char* prof_fill_byteValue(char* cursor, jsByteValue_t b) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_BYTE); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_u1(cursor, b); >+ cursor += sizeof(jsByteValue_t); >+ >+ return cursor; >+} >+_inline char* prof_fill_booleanValue(char* cursor, jsBooleanValue_t b) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_BOOLEAN); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_boolean(cursor, b); >+ cursor += sizeof(jsBooleanValue_t); >+ >+ return cursor; >+} >+_inline char* prof_fill_charValue(char* cursor, jsCharValue_t c) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_CHAR); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_u2(cursor, c); >+ cursor += sizeof(jsCharValue_t); >+ >+ return cursor; >+} >+_inline char* prof_fill_shortValue(char* cursor, jsShortValue_t s) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_SHORT); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_u2(cursor, s); >+ cursor += sizeof(jsShortValue_t); >+ >+ return cursor; >+} >+_inline char* prof_fill_intValue(char* cursor, jsIntValue_t i) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_INT); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_u4(cursor, i); >+ cursor += sizeof(jsIntValue_t); >+ >+ return cursor; >+} >+_inline char* prof_fill_floatValue(char* cursor, jsFloatValue_t f) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_FLOAT); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_float(cursor, f); >+ cursor += sizeof(jsFloatValue_t); >+ >+ return cursor; >+} >+_inline char* prof_fill_doubleValue(char* cursor, jsDoubleValue_t d) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_DOUBLE); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_double(cursor, d); >+ cursor += sizeof(jsDoubleValue_t); >+ >+ return cursor; >+} >+_inline char* prof_fill_longValue(char* cursor, jsLongValue_t l) >+{ >+ prof_fill_ValueTypeTag(cursor, SIGNATURE_LONG); >+ cursor += sizeof(jsValueTypeTag_t); >+ >+ prof_fill_u8(cursor, l); >+ cursor += sizeof(jsLongValue_t); >+ >+ return cursor; >+} >+ >+ >+/* hack for missing access bits: */ >+const short ACCESS_DEFAULT = 0x0000; >+const short ACCESS_STATIC = 0x0008; >+ >+#ifdef NEVER >+/* left this in temporarily because it is used by some code that's ifdef'd out. >+ * Find out from Richard if we can pull the other dead code. see printInterfaces. */ >+ >+static _inline void printClassId(char* buffer, jobjectID clazz) >+{ >+ HashEntry *classHashEntry = jvmpiAgent_FindSymbol((jint)clazz, Class_t); >+ if(classHashEntry == NULL) { >+ prof_fill_CID(buffer, NULL_CID); >+ } >+ else { >+ prof_fill_CID(buffer, CLASS_ENTRY(classHashEntry)->static_id); >+ } >+} >+#endif /* NEVER */ >+ >+void BINARYTRACE_printFields(ThreadLocalStorage* tps, >+ ClassEntry* classEntry, >+ jint numFields, >+ int startIndex, >+ PI_Field* fields, >+ BOOL isStatic) /* hack since don't have access bits*/ >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ int i; >+ >+ for(i=0; i<numFields; i++) { >+ buffer = bufferOrig; >+ >+ /* 1. event type */ >+ prof_fill_EventType(buffer, FieldDefine); >+ buffer += sizeof(jsEventType_t); >+ >+ /* 2. class cid */ >+ prof_fill_CID(buffer, classEntry->static_id); >+ buffer += sizeof(jsClassID_t); >+ >+ /* 3. field index */ >+ prof_fill_u4(buffer, i+startIndex); >+ buffer += 4; >+ >+ /* 3. field id */ >+ prof_fill_u4(buffer, fields[i].fieldId); >+ buffer += 4; >+ >+ /* 4. field name */ >+ buffer += prof_fill_string(buffer, fields[i].field_name); >+ >+ /* 5. field signature */ >+ buffer += prof_fill_string(buffer, fields[i].field_signature); >+ >+ /* 6. field access */ >+ prof_fill_u2(buffer, isStatic ? ACCESS_STATIC : ACCESS_DEFAULT); /* hacko */ >+ buffer += 2; >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+ } >+} >+ >+unsigned short printInterfaces(char* buffer, >+ ClassEntry* classEntry) >+{ >+#ifdef NEVER >+ /* What are we saving this for? */ >+ char *bufferOrig = buffer; >+ int i; >+ >+ prof_fill_u2(buffer, classEntry->numInterfaces); >+ buffer += 2; >+ >+ for(i=0; i<classEntry->numInterfaces; i++) { >+ jobjectID interface = classEntry->interfaces[i]; >+ printClassId(buffer, interface); >+ buffer += sizeof(jsClassID_t); >+ } >+ >+ return buffer - bufferOrig; >+#else /* NEVER */ >+ return 0; >+#endif /* NEVER */ >+} >+ >+unsigned short BINARYTRACE_printClassDefine(char* buffer, >+ ClassEntry* classEntry) >+{ >+ /* 1. event type */ >+ prof_fill_EventType(buffer, ClassDefine); >+ buffer += sizeof(jsEventType_t); >+ >+ /* 2. timestamp of the classload */ >+ if(_jvmpiAgent_Options.timestamp) { >+ prof_fill_timestamp(buffer, classEntry->timestamp); >+ } >+ else { >+ prof_fill_current_timestamp(buffer); >+ } >+ buffer += sizeof(jsTimestamp_t); >+ >+ /* 3. class cid */ >+ prof_fill_CID(buffer, classEntry->static_id); >+ buffer += sizeof(jsClassID_t); >+ >+ /* 4. class oid */ >+ if(classEntry->classObject == NULL) { >+ prof_fill_OID(buffer, NULL_OID); >+ } >+ else { >+ prof_fill_OID(buffer, OBJECT_ENTRY(classEntry->classObject)->static_id); >+ } >+ buffer += sizeof(jsObjectID_t); >+ >+#if 0 >+ /* this would make it a ClassDefine2 */ >+ >+ /* 5. loading thread */ >+ prof_fill_TID(buffer, NULL_TID); /* NMM FIXME */ >+ buffer += sizeof(jsThreadID_t); >+#endif >+ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + sizeof(jsClassID_t) >+ + sizeof(jsObjectID_t); >+} >+/* >+ Contents are: type, tick, oid, jsClsId, name_len, name >+*/ >+unsigned short BINARYTRACE_printClassLoad(char* buffer, >+ ClassEntry* classEntry) >+{ >+ char *bufferOrig = buffer; >+ >+ BINARYTRACE_DEBUG(buffer, "CLASS LOAD"); >+ >+ /* 1. event type */ >+ prof_fill_EventType(buffer, ClassLoad); >+ buffer += sizeof(jsEventType_t); >+ >+ /* 2. timestamp of the classload */ >+ if(_jvmpiAgent_Options.timestamp) { >+ prof_fill_timestamp(buffer, classEntry->timestamp); >+ } >+ else { >+ prof_fill_current_timestamp(buffer); >+ } >+ buffer += sizeof(jsTimestamp_t); >+ >+ /* 3. class cid */ >+ prof_fill_CID(buffer, classEntry->static_id); >+ buffer += sizeof(jsClassID_t); >+ >+ >+ /* 4. instance size */ >+ prof_fill_u2(buffer, 0/*(short)classEntry->instanceSize*/); >+ buffer += 2; >+ >+ /* 5. class name */ >+ buffer += prof_fill_string(buffer, classEntry->className); >+ >+ /* 6. num methods */ >+ prof_fill_u2(buffer, classEntry->numMethods); >+ buffer += 2; >+ >+ /* 7. num static fields */ >+ prof_fill_u2(buffer, classEntry->numStaticFields); >+ buffer += 2; >+ >+ /* 8. num instance fields */ >+ prof_fill_u2(buffer, classEntry->numInstanceFields); >+ buffer += 2; >+ >+ /* 9. superclass */ >+ if (classEntry->superClassEntry) { >+ prof_fill_CID(buffer, CLASS_ENTRY(classEntry->superClassEntry)->static_id); >+ } else { >+ prof_fill_CID(buffer, NULL_CID); >+ } >+ buffer += sizeof(jsClassID_t); >+ >+ /* 10. interfaces */ >+ buffer += printInterfaces(buffer, classEntry); >+ >+ return buffer - bufferOrig; >+} >+/* >+ Contents are: tag, classId, methodId methodName, methodSignature >+*/ >+unsigned short BINARYTRACE_printMethodDefine(char* buffer, >+ MethodEntry* methodEntry) >+{ >+ unsigned short methodNameLength, signatureLength; >+ >+ BINARYTRACE_DEBUG(buffer, "METHOD DEFINE"); >+ >+ /* 1. event type */ >+ prof_fill_EventType(buffer, MethodDefine); >+ buffer += sizeof(jsEventType_t); >+ >+ /* 2. class id */ >+ { >+ ClassEntry* classEntry = CLASS_ENTRY(methodEntry->classHashEntry); >+ prof_fill_CID(buffer, classEntry->static_id); >+ buffer += sizeof(jsClassID_t); >+ } >+ >+ /* 3. method id */ >+ prof_fill_MID(buffer, methodEntry->static_id); >+ buffer += sizeof(jsMethodID_t); >+ >+ /* 4. method name */ >+ methodNameLength = prof_fill_string(buffer, methodEntry->methodData.method_name); >+ buffer += methodNameLength; >+ >+ /* 5. method signature */ >+ signatureLength = prof_fill_string(buffer, methodEntry->methodData.method_signature); >+ buffer += signatureLength; >+ >+ /* 6. method access bits */ >+ prof_fill_u2(buffer, ACCESS_DEFAULT); >+ /*buffer += 2;*/ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsClassID_t) >+ + sizeof(jsMethodID_t) >+ + methodNameLength >+ + signatureLength >+ + 2; >+} >+/* >+ Contents are: type, ticks, jsThreadId<-threadCounter, jsMethodId, jsObjId, >+*/ >+unsigned short BINARYTRACE_printMethodEnter(char* buffer, >+ StackEntry* stackEntry) >+{ >+ jsObjectID_t oid; >+ BINARYTRACE_DEBUG(buffer, "METHOD ENTER"); >+ >+ /* 1. event type */ >+ prof_fill_EventType(buffer, JavaMethodEntry); >+ buffer += sizeof(jsEventType_t); >+ >+ /* 2. timestamp of the enter */ >+ prof_fill_timestamp(buffer, stackEntry->timestamp); >+ buffer += sizeof(jsTimestamp_t); >+ >+ /* 3. thread id */ >+ prof_fill_TID(buffer, stackEntry->tps); >+ buffer += sizeof(jsThreadID_t); >+ >+ /* 4. method id */ >+ prof_fill_u4(buffer, METHOD_ENTRY(stackEntry->methodHashEntry)->static_id); >+ buffer += sizeof(jsMethodID_t); >+ >+ /* 5. object id */ >+ if(stackEntry->objectHashEntry == NULL) { >+ oid = NULL_OID; >+ } >+ else { >+ oid = OBJECT_ENTRY(stackEntry->objectHashEntry)->static_id; >+ } >+ prof_fill_OID(buffer, oid); >+ >+#ifdef BINARYTRACE_LINENUMBERED_INVOCATIONS >+ buffer += sizeof(jsObjectID_t); >+ >+ /* 6. line number */ >+ prof_fill_u2(buffer, 0); /* NMM FIXME */ >+ /*buffer += 2;*/ >+#endif /* BINARYTRACE_LINENUMBERED_INVOCATIONS */ >+ >+ return >+#ifdef BINARYTRACE_LINENUMBERED_INVOCATIONS >+ 2 >+#endif /* BINARYTRACE_LINENUMBERED_INVOCATIONS */ >+ sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + sizeof(jsThreadID_t) >+ + sizeof(jsMethodID_t) >+ + sizeof(jsObjectID_t); >+} >+unsigned short BINARYTRACE_printMethodExit(char* buffer, >+ ThreadLocalStorage* tps, >+ timestamp_t timeJustAfterGotControl) >+{ >+ uint64_t exit_overhead, overheadSoFar, totalInvocationOverhead; >+ timestamp_t now; >+ BINARYTRACE_DEBUG(buffer, "METHOD EXIT"); >+ >+ /* 1. event type */ >+ prof_fill_EventType(buffer, JavaMethodExit); >+ buffer += sizeof(jsEventType_t); >+ >+ /* 2. timestamp of the exit */ >+ jvmpiAgent_getCurrentTime(&now); >+ prof_fill_timestamp(buffer, now); >+ buffer += sizeof(jsTimestamp_t); >+ >+ /* 3. overhead compensation */ >+#ifdef BINARYTRACE_OVERHEAD >+ exit_overhead = now-timeJustAfterGotControl; >+ overheadSoFar = tps->stackEntry[tps->tos].cumulative_overhead; >+ totalInvocationOverhead = overheadSoFar+exit_overhead; >+#else >+ totalInvocationOverhead = 0; >+#endif /* BINARYTRACE_OVERHEAD */ >+ prof_fill_u8(buffer, totalInvocationOverhead); >+ buffer += 8; >+ >+ /* 4. thread id */ >+ prof_fill_TID(buffer, tps); >+ /*buffer += sizeof(jsThreadID_t);*/ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + 8 >+ + sizeof(jsThreadID_t); >+} >+ >+/* >+ Contents are: type, tick, jsObjId, threadName >+*/ >+unsigned short BINARYTRACE_printThreadStart(char* buffer, >+ ThreadLocalStorage* tps) >+{ >+ unsigned short lengthOfThreadName; >+ >+ BINARYTRACE_DEBUG(buffer, "THREAD_START"); >+ >+ /* 1. event type */ >+ prof_fill_EventType(buffer, ThreadStart); >+ buffer += sizeof(jsEventType_t); >+ >+ /* 2. timestamp of thread start */ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ /* 3. thread id */ >+ prof_fill_TID(buffer, tps); >+ buffer += sizeof(jsThreadID_t); >+ >+ /* 4. thread name */ >+ lengthOfThreadName = prof_fill_string(buffer, tps->threadName); >+ /* buffer += lengthOfThreadName; */ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + sizeof(jsThreadID_t) >+ + lengthOfThreadName; >+} >+/* Contents: type, ticks, objectId */ >+unsigned short BINARYTRACE_printObjectFree(char* buffer, >+ HashEntry* objectHashEntry) >+{ >+ BINARYTRACE_DEBUG(buffer, "OBJECT FREE"); >+ >+ prof_fill_EventType(buffer, ObjectFree); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ prof_fill_OID(buffer, (unsigned long)(OBJECT_ENTRY(objectHashEntry)->static_id)); >+ /*buffer += sizeof(jsObjectID_t);*/ >+ >+ return sizeof(jsEventType_t) + sizeof(jsTimestamp_t) + sizeof(jsObjectID_t); >+} >+unsigned short >+BINARYTRACE_printWitnessedObjectAllocation(char* buffer, >+ ThreadPrivateStorage* creatingThread, >+ HashEntry* objectHashEntry, >+ HashEntry* classHashEntry, >+ timestamp_t allocTime) >+{ >+ char* bufferOrig = buffer; >+ ObjectEntry* newObject = OBJECT_ENTRY(objectHashEntry); >+ BOOL isArray = newObject->is_array != JVMPI_NORMAL_OBJECT; >+ >+ /* 1. type of event */ >+ if(!isArray) { >+ prof_fill_EventType(buffer, WitnessedObjectCreation); >+ } >+ else { >+ prof_fill_EventType(buffer, WitnessedArrayCreation); >+ } >+ buffer += sizeof(jsEventType_t); >+ >+ >+ /* 2. time of creation */ >+ prof_fill_timestamp(buffer, allocTime); >+ buffer += sizeof(jsTimestamp_t); >+ >+ /* 3. element type, for array objects */ >+ if(newObject->is_array == JVMPI_CLASS) { >+ prof_fill_CID(buffer, CLASS_ENTRY(classHashEntry)->static_id); >+ buffer += sizeof(jsClassID_t); >+ } >+ else if(isArray) { >+ prof_fill_u1(buffer, jvmpi_to_jni(newObject->is_array)); >+ buffer += sizeof(char); >+ } >+ >+ /* 4. OID */ >+ prof_fill_OID(buffer, newObject->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ /* 5. CID */ >+ if(!isArray) { >+ prof_fill_CID(buffer, CLASS_ENTRY(classHashEntry)->static_id); >+ buffer += sizeof(jsClassID_t); >+ } >+ else { >+ prof_fill_u4(buffer, newObject->size); >+ buffer += 4; >+ } >+ >+ prof_fill_TID(buffer, creatingThread); >+ buffer += sizeof(jsThreadID_t); >+ >+ return buffer-bufferOrig; >+} >+/* Contents: type, ticks, jsObjId, jsClsId */ >+unsigned short BINARYTRACE_printObjectAllocation(char* buffer, >+ HashEntry* objectHashEntry, >+ HashEntry* classHashEntry) >+{ >+ ObjectEntry* objectEntry = OBJECT_ENTRY(objectHashEntry); >+ BINARYTRACE_DEBUG(buffer, "OBJECT ALLOCATION"); >+ >+ switch(objectEntry->is_array) { >+ case JVMPI_NORMAL_OBJECT: >+ { >+ /* instances */ >+ prof_fill_EventType(buffer, ObjectFirstSeen); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ prof_fill_OID(buffer, objectEntry->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_CID(buffer, CLASS_ENTRY(classHashEntry)->static_id); >+ /*buffer += sizeof(jsClassID_t);*/ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + sizeof(jsObjectID_t) >+ + sizeof(jsClassID_t); >+ } >+ >+ case JVMPI_CLASS: >+ { >+ /* arrays of objects */ >+ prof_fill_EventType(buffer, ArrayOfObjectsFirstSeen); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ prof_fill_OID(buffer, objectEntry->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_CID(buffer, CLASS_ENTRY(classHashEntry)->static_id); >+ buffer += sizeof(jsClassID_t); >+ >+ prof_fill_u4(buffer, objectEntry->size); >+ /* buffer += 4; */ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + sizeof(jsObjectID_t) >+ + sizeof(jsClassID_t) >+ + 4; >+ } >+ >+ default: >+ { >+ /* arrays of primitives */ >+ prof_fill_EventType(buffer, ArrayOfPrimitivesFirstSeen); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ prof_fill_u1(buffer, jvmpi_to_jni((char) objectEntry->is_array)); >+ buffer += 1; >+ >+ prof_fill_OID(buffer, objectEntry->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_u4(buffer, objectEntry->size); >+ /* buffer += 4; */ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + 1 >+ + sizeof(jsObjectID_t) >+ + 4; >+ } >+ } >+} >+ >+/* Contents: type, tick, jsClsId */ >+unsigned short BINARYTRACE_printClassUnload(char* buffer, >+ HashEntry* classHashEntry) >+{ >+ BINARYTRACE_DEBUG(buffer, "CLASS UNLOAD"); >+ >+ prof_fill_EventType(buffer, ClassUnload); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ prof_fill_CID(buffer, CLASS_ENTRY(classHashEntry)->static_id); >+ /*buffer += sizeof(jsClassID_t);*/ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + sizeof(jsClassID_t); >+} >+/* Contents: type, ticks, jsThreadId */ >+unsigned short BINARYTRACE_printThreadEnd(char* buffer, >+ ThreadLocalStorage* tps) >+{ >+ BINARYTRACE_DEBUG(buffer, "THREAD END"); >+ >+ prof_fill_EventType(buffer, ThreadExit); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ prof_fill_TID(buffer, tps); >+ /*buffer += sizeof(jsThreadID_t);*/ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t) >+ + sizeof(jsThreadID_t); >+} >+/* Contents: type, tick */ >+unsigned short BINARYTRACE_printGenericTimestampedEvent(char* buffer, >+ jsEventType_t event) >+{ >+ prof_fill_EventType(buffer, event); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ /* buffer += sizeof(jsTimestamp_t); */ >+ >+ return sizeof(jsEventType_t) >+ + sizeof(jsTimestamp_t); >+} >+unsigned short BINARYTRACE_printGcStart(char* buffer) >+{ >+ BINARYTRACE_DEBUG(buffer, "GC START"); >+ return BINARYTRACE_printGenericTimestampedEvent(buffer, GCStart); >+} >+unsigned short BINARYTRACE_printGcFinish(char* buffer) >+{ >+ BINARYTRACE_DEBUG(buffer, "GC FINISH"); >+ return BINARYTRACE_printGenericTimestampedEvent(buffer, GCFinish); >+} >+BOOL isBigEndian() { >+ long i = 0x44332211; >+ unsigned char* a = (unsigned char*) &i; >+ int end = (*a != 0x11); >+ fprintf(stderr, "[Watson: detected %s-endian platform]\n", >+ ((end==1)?"big":"little")); >+ return end==1; >+} >+unsigned short BINARYTRACE_printEndOfXMLHeader(char* buffer) >+{ >+ char* bufferOrig = buffer; >+ >+ /* 1. some termination characters, so we know XML header is done */ >+ prof_fill_u1(buffer, 0xD); >+ buffer += 1; >+ prof_fill_u1(buffer, 0xE); >+ buffer += 1; >+ prof_fill_u1(buffer, 0xA); >+ buffer += 1; >+ prof_fill_u1(buffer, 0xD); >+ buffer += 1; >+ >+ /* 2. boolean indicating the endianness of this platform */ >+ prof_fill_boolean(buffer, isBigEndian()); >+ buffer += sizeof(jsBooleanValue_t); >+ >+ /* 3. short indicating the binary trace format version */ >+ prof_fill_u2(buffer, BINARYTRACE_TRACE_FORMAT_VERSION); >+ buffer += 2; >+ >+ /* 4. boolean indicating whether enter events will include line >+ numbers */ >+#ifdef BINARYTRACE_LINENUMBERED_INVOCATIONS >+ prof_fill_boolean(buffer, TRUE); >+#else >+ prof_fill_boolean(buffer, FALSE); >+#endif /* BINARYTRACE_LINENUMBERED_INVOCATIONS */ >+ buffer += sizeof(jsBooleanValue_t); >+ >+ /* 5. minimum tick count in the trace */ >+ prof_fill_timestamp(buffer, _startTime); >+ buffer += sizeof(jsTimestamp_t); >+ >+ /* 6. ticks per microsecond of the tick counts */ >+ { >+ /* at the end of this file */ >+ prof_fill_u4(buffer, _ticksPerMicrosecond); >+ buffer += 4; >+ } >+ >+ return buffer - bufferOrig; >+} >+void BINARYTRACE_printTraceHeader(ThreadLocalStorage* tps) >+{ >+ if (!_jvmpiAgent_suspendIO) { >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ if (!_jvmpiAgent_Options.standalone) { >+ /* jinsight viz expects ACK as first byte when connected live */ >+ prof_fill_u1(buffer, 1); >+ buffer += 1; >+ } >+ >+ prof_fill_u1(buffer, 'w'); >+ buffer += 1; >+ >+ { >+ unsigned short numBytes = buffer - bufferOrig; >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+ } >+ } >+} >+void BINARYTRACE_printTraceEnd(ThreadLocalStorage* tps) >+{ >+ char* buffer = tps->buffer; >+ >+ prof_fill_EventType(buffer, TraceEnd); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_u4(buffer, 0xDEAD); >+ buffer += 4; >+ >+ prof_fill_u4(buffer, 0xDEAD); >+ /*buffer += 4;*/ >+ >+ { >+ unsigned short numBytes = >+ sizeof(jsEventType_t) >+ + 4 >+ + 4; >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+ } >+} >+ >+void BINARYTRACE_printBOB(ThreadLocalStorage* tps) >+{ >+ char* buffer = tps->buffer; >+ >+ prof_fill_EventType(buffer, BOBEvent); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ /* buffer += sizeof(jsTimestamp_t); */ >+ >+ jvmpiAgent_print(tps, tps->buffer, 1+sizeof(jsTimestamp_t)); >+} >+void BINARYTRACE_printEOB(ThreadLocalStorage* tps) >+{ >+ char* buffer = tps->buffer; >+ prof_fill_EventType(buffer, EOBEvent); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ /* buffer += sizeof(jsTimestamp_t); */ >+ >+ jvmpiAgent_print(tps, tps->buffer, 1+sizeof(jsTimestamp_t)); >+} >+unsigned short BINARYTRACE_printArrayReference(char* buffer, >+ unsigned long parentOID, >+ unsigned long childOID) >+{ >+ if (TRUE || !_jvmpiAgent_suspendIO) { >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, ArrayRefs); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_OID(buffer, parentOID); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_u4(buffer, 1); >+ buffer += 4; >+ >+ prof_fill_OID(buffer, childOID); >+ buffer += sizeof(jsObjectID_t); >+ >+ return buffer-bufferOrig; >+ } >+ >+ return 0; >+} >+unsigned short BINARYTRACE_printClassReference(char* buffer, >+ unsigned long parentCID, >+ unsigned long childOID) >+{ >+ if (!_jvmpiAgent_suspendIO) { >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_StaticRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_CID(buffer, parentCID); >+ buffer += sizeof(jsClassID_t); >+ >+ prof_fill_OID(buffer, childOID); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_OID(buffer, NULL_OID); >+ buffer += sizeof(jsObjectID_t); >+ >+ return buffer-bufferOrig; >+ } >+ >+ return 0; >+} >+unsigned short BINARYTRACE_printObjectReference(char* buffer, >+ unsigned long parentOID, >+ unsigned long childOID) >+{ >+ if (!_jvmpiAgent_suspendIO) { >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, ObjectRefs); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_OID(buffer, parentOID); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_OID(buffer, childOID); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_OID(buffer, NULL_OID); >+ buffer += sizeof(jsObjectID_t); >+ >+ return buffer-bufferOrig; >+ } >+ >+ return 0; >+} >+void BINARYTRACE_printGeneration(ThreadLocalStorage* tps) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, Generation); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_current_timestamp(buffer); >+ buffer += sizeof(jsTimestamp_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printUnknownRoot(ThreadLocalStorage* tps, >+ ObjectEntry* unknown) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_UnknownRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_OID(buffer, unknown->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printJNIGlobalRoot(ThreadLocalStorage* tps, >+ ObjectEntry* parent, >+ ObjectEntry* child) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_JNI_GlobalRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_OID(buffer, parent->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ prof_fill_OID(buffer, child->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printJNILocalRoot(ThreadLocalStorage* tps, >+ ObjectEntry* object, >+ ThreadLocalStorage* localToThisThread, >+ int stackDepth) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_JNI_LocalRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_TID(buffer, localToThisThread); >+ buffer += sizeof(jsThreadID_t); >+ >+ prof_fill_OID(buffer, object->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printJavaStackRoot(ThreadLocalStorage* tps, >+ ThreadLocalStorage* rootedToThisThread, >+ ObjectEntry* object, >+ int depth) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_JavaStackRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_TID(buffer, rootedToThisThread); >+ buffer += sizeof(jsThreadID_t); >+ >+ prof_fill_OID(buffer, object->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printNativeStackRoot(ThreadLocalStorage* tps, >+ ThreadLocalStorage* rootedToThisThread, >+ ObjectEntry* object) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_NativeStackRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_TID(buffer, rootedToThisThread); >+ buffer += sizeof(jsThreadID_t); >+ >+ prof_fill_OID(buffer, object->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printStickyClassRoot(ThreadLocalStorage* tps, >+ ObjectEntry* clazzObject) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_StickyClassRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_OID(buffer, clazzObject->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printThreadRoot(ThreadLocalStorage* tps, >+ ThreadLocalStorage* theThread, >+ ObjectEntry* theThreadObject) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_ThreadRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_TID(buffer, theThread); >+ buffer += sizeof(jsThreadID_t); >+ >+ prof_fill_OID(buffer, theThreadObject->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+void BINARYTRACE_printMonitorRoot(ThreadLocalStorage* tps, >+ ObjectEntry* monitorObject) >+{ >+ char* buffer = tps->buffer; >+ char* bufferOrig = buffer; >+ >+ prof_fill_EventType(buffer, GC_MonitorRoot); >+ buffer += sizeof(jsEventType_t); >+ >+ prof_fill_OID(buffer, monitorObject->static_id); >+ buffer += sizeof(jsObjectID_t); >+ >+ jvmpiAgent_print(tps, tps->buffer, buffer-bufferOrig); >+} >+ >+/* #include "watson_fieldvalues.c" */ >+ >+#endif /* BINARY_TRACE */ >Index: src-native-new/src/agents/native/WinBuild/heapsnapshots.mak64 >=================================================================== >RCS file: src-native-new/src/agents/native/WinBuild/heapsnapshots.mak64 >diff -N src-native-new/src/agents/native/WinBuild/heapsnapshots.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/WinBuild/heapsnapshots.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,326 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on heapsnapshots.dsp >+!IF "$(CFG)" == "" >+CFG=heapsnapshots - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to heapsnapshots - IA64 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "heapsnapshots - IA64 Release" && "$(CFG)" != "heapsnapshots - IA64 Debug" && "$(CFG)" != "heapsnapshots - X64 Release" && "$(CFG)" != "heapsnapshots - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "heapsnapshots.mak64" CFG="heapsnapshots - IA64 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "heapsnapshots - IA64 Release" >+!MESSAGE "heapsnapshots - IA64 Debug" >+!MESSAGE "heapsnapshots - X64 Release" >+!MESSAGE "heapsnapshots - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "heapsnapshots - IA64 Release" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\heapsnapshots.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\AbstractHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\heapsnapshots.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\heapsnapshots.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\AbstractHeapSnapshotManager.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ >+"$(OUTDIR)\heapsnapshots.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "heapsnapshots - IA64 Debug" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\heapsnapshots.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\AbstractHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\heapsnapshots.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\heapsnapshots.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\AbstractHeapSnapshotManager.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ >+"$(OUTDIR)\heapsnapshots.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "heapsnapshots - X64 Release" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\heapsnapshots.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\AbstractHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\heapsnapshots.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\heapsnapshots.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\AbstractHeapSnapshotManager.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ >+"$(OUTDIR)\heapsnapshots.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "heapsnapshots - X64 Debug" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\heapsnapshots.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\AbstractHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\heapsnapshots.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\heapsnapshots.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\AbstractHeapSnapshotManager.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ >+"$(OUTDIR)\heapsnapshots.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "heapsnapshots - IA64 Release" || "$(CFG)" == "heapsnapshots - IA64 Debug" || "$(CFG)" == "heapsnapshots - X64 Release" || "$(CFG)" == "heapsnapshots - X64 Debug" >+SOURCE=..\heapsnapshots\AbstractHeapSnapshotManager.cpp >+ >+"$(INTDIR)\AbstractHeapSnapshotManager.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\heapsnapshots\StatelessHeapSnapshotManager.cpp >+ >+"$(INTDIR)\StatelessHeapSnapshotManager.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/sysperf/perfcontrol.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/sysperf/perfcontrol.c >diff -N src-native-new/src/agents/perfmon/sysperf/perfcontrol.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/sysperf/perfcontrol.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1559 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2007 Scapa Technologies Limited and others >+ * >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+ >+//#include <winsock2.h> /* Bug 134924 */ >+#include <windows.h> >+#include <stdio.h> >+#include <stdlib.h> >+#include <tchar.h> >+#include <string.h> >+#include "hashtable.h" >+#include "perfcontrol.h" >+#include "perfconstants.h" >+#include "system.h" >+#include "perfcalc.h" >+ >+#ifdef WIN32 >+ #ifdef _DEBUG >+ #define _CRTDBG_MAP_ALLOC // include Microsoft memory leak detection procedures >+ #define _INC_MALLOC // exclude standard memory alloc procedures >+ >+ #include <crtdbg.h> >+ #endif >+#endif >+ >+ >+#define USE_REG_CONNECT TRUE >+ >+#define TOTALBYTES 131072 >+#define BYTEINCREMENT 8192 >+ >+#define PERF_OBJ_TIME_TIMER 543229184 >+#define PERF_LARGE_RAW_BASE 1073939715 >+#define PERF_PRECISION_TIMESTAMP 1073939712 >+#define PERF_PRECISION_100NS_TIMER 542573824 >+#define PERF_PRECISION_OBJECT_TIMER 543622400 >+#define PERF_PRECISION_SYSTEM_TIMER 541525248 >+#define PERF_COUNTER_100NS_QUEUELEN_TYPE 5571840 >+ >+LPSTR *lpNamesArray = NULL; >+LPSTR lpNameStrings; >+LPSTR *lpHelpArray = NULL; >+LPSTR lpHelpStrings; >+HashTable* instancecount; >+ >+static char* PREFIX = "Perfmon Datacollection:"; >+char* agent_type = "PerfmonAgent"; >+ >+static HashTable* idhasht; >+ >+static HashTable* hasht_variables; >+static HashTable* hasht_filters; >+static HashTable* hasht_tree; >+ >+static int results_len = -1; >+static char** results = NULL; >+static int value_index = 0; >+ >+static BOOLEAN is_connected = 0; >+static BOOLEAN disconnect = FALSE; >+static char* connected_host = NULL; >+ >+int LOG_TO_FILE = FALSE; >+static FILE* f = NULL; >+static char filename[] = "SysPerfDll.log"; >+ >+////////////////////// >+// Bug 165319 >+static int isVista = 0; >+unsigned long lpNamesArraySize = 0; >+////////////////////// >+ >+void logToFile(const char*, ...); >+ >+void logToFile(const char* temp, ...) >+{ >+ if (LOG_TO_FILE) >+ { >+ va_list ap; >+ if (f == NULL) >+ f = fopen(filename, "w"); >+ va_start (ap, temp); >+ vfprintf (f, temp, ap); >+// printf(temp,ap); >+ va_end (ap); >+ fflush(f); >+ } >+} >+ >+////////////////////////////////////////////////////////////// >+// Bug 165319 >+// Check whether or not this is running on VISTA >+ >+int isVistaOrLater() >+{ >+ int bIsWindowsVistaOrLater = 0; >+ OSVERSIONINFO OSVer; >+ OSVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); >+ >+ if(GetVersionEx(&OSVer)) >+ { >+ bIsWindowsVistaOrLater = (OSVer.dwMajorVersion >=6); >+ } >+ return bIsWindowsVistaOrLater; >+} >+////////////////////////////////////////////////////////////// >+ >+int DC_CollectionStartup(HashTable* xhasht_variables, HashTable* xhasht_filters, HashTable* xhasht_tree) >+{ >+ isVista = isVistaOrLater(); >+ >+ hasht_variables = xhasht_variables; >+ hasht_filters = xhasht_filters; >+ hasht_tree = xhasht_tree; >+ >+ createValueTables(); >+ idhasht = tableCreate(); >+ >+ return 0; >+} >+ >+BOOLEAN isConnectedWin32(char* host) >+{ >+ DWORD dwResult, cchBuff = sizeof(1024); >+ >+ // Call the WNetGetConnection function. >+ // >+ dwResult = WNetGetConnection(NULL, (LPSTR) host, &cchBuff); >+ >+ logToFile("RESULT = %d\n", dwResult); >+ switch (dwResult) >+ { >+ // >+ // Print the connection name or process errors. >+ // >+ case NO_ERROR: >+ return TRUE; >+ break; >+ >+ case ERROR_NOT_CONNECTED: >+ return FALSE; >+ break; >+ >+ default: >+ return FALSE; >+ break; >+ } >+} >+ >+void disconnectWin32(char* host) >+{ >+ DWORD dwResult; >+ >+ logToFile("Attempting to disconnect...\n"); >+ >+ dwResult = WNetCancelConnection2(host, >+ CONNECT_UPDATE_PROFILE, // remove connection from profile >+ FALSE); // fail if open files or jobs >+ >+ if (dwResult == ERROR_NOT_CONNECTED) >+ { >+ // It was not connected... >+ return; >+ } >+ else if(dwResult != NO_ERROR) >+ { >+ logToFile("Undefined error while disconnecting... \n\n"); >+ return; >+ } >+ >+ logToFile("Succesfully disconnected...\n\n"); >+} >+ >+int DC_CollectionShutdown() >+{ >+ tableDelete(idhasht); >+ freeValueTables(); >+ >+ if (disconnect) >+ { >+ if (connected_host == NULL) >+ { >+ disconnectWin32(connected_host); >+ } >+ } >+ >+ return 0; >+} >+ >+ >+ >+// Connect using the following credentials to the specified host >+BOOLEAN connectWin32(char* host, char* username, char* password) >+{ >+ DWORD connectResult; >+ NETRESOURCE networkResource; >+ >+ logToFile("Attempting to establish WNET Connection to %s...\n", host); >+ >+ networkResource.dwType = RESOURCETYPE_ANY; >+ networkResource.lpLocalName = NULL; >+ networkResource.lpRemoteName = host; >+ networkResource.lpProvider = NULL; >+ >+ // Call the WNetAddConnection2 function to make the connection, do not make this connection persistent >+ connectResult = WNetAddConnection2(&networkResource, (LPSTR) password, (LPSTR) username, 0); >+ >+ // The local device is already connected to a network resource. >+ if (connectResult == ERROR_ALREADY_ASSIGNED) >+ { >+ logToFile("Already connected to specified resource.\n\n"); >+ return FALSE; >+ } >+ else if (connectResult == ERROR_LOGON_FAILURE) >+ { >+ logToFile("The credentials for logon failed.\n\n"); >+ return FALSE; >+ } >+ else if(connectResult != NO_ERROR) >+ { >+ logToFile("Undefined Error # %d\n\n", connectResult); >+ return FALSE; >+ } >+ >+ logToFile("Connected to specified resource.\n\n"); >+ connected_host = host; >+ return TRUE; >+} >+ >+ >+int getRemoteKey(char* REG_HOST, HKEY* rKey) >+{ >+ HKEY remoteKey; >+ int rt; >+ >+ if (REG_HOST == NULL) >+ { >+ remoteKey = HKEY_PERFORMANCE_DATA; >+ } >+ else >+ { >+ if (USE_REG_CONNECT) >+ { >+ logToFile("%sTrying to connect to remote registry %s\n",PREFIX,REG_HOST); >+ >+ if (is_connected == FALSE) >+ { >+ // We need to get a connection to the remote host >+ >+ // First, lets just try a default connection >+ >+ char* newHostName = (char*) malloc(sizeof(char)*strlen(REG_HOST)+4); >+ sprintf(newHostName, "\\\\%s%c",REG_HOST, '\0'); >+ >+ if (isConnectedWin32(newHostName)) >+ { >+ // We are already connected >+ logToFile("Already connected to %s\n",newHostName); >+ is_connected = TRUE; >+ } >+ else >+ { >+ if (connectWin32(newHostName, NULL, NULL)) >+ { >+ // SUCCESS >+ is_connected = TRUE; >+ disconnect = TRUE; >+ } >+ else >+ { >+ // Try using passed in credentials >+ char* USERNAME = (char*) tableGet(hasht_variables,PERFMON_USERNAME); >+ char* PASSWORD = (char*) tableGet(hasht_variables,PERFMON_PASSWORD); >+ if (PASSWORD == NULL) >+ PASSWORD = ""; >+ if (connectWin32(newHostName, USERNAME, PASSWORD)) >+ { >+ is_connected = TRUE; >+ disconnect = TRUE; >+ } >+ } >+ } >+ } >+ // else we already have a valid connection >+ >+ // >+ // Connect to the registry (may be NULL in case we will connect to the local registry >+ // >+ if ((rt = RegConnectRegistry(REG_HOST,HKEY_PERFORMANCE_DATA,&remoteKey)) == ERROR_BAD_NETPATH) >+ { >+ logToFile("%sCONNECT ERROR : ERROR BAD NETPATH (Network Busy) %d",PREFIX,rt); >+ >+ return -1; >+ } >+ logToFile("%sConnected to remote machine OK\n",PREFIX); >+ } >+ else >+ { >+ remoteKey = HKEY_PERFORMANCE_DATA; >+ } >+ } >+ *rKey = remoteKey; >+ return ERROR_SUCCESS; >+} >+ >+char* getReqList(HashTable* hasht_filters) >+{ >+ >+ int objLen = 10; >+ int objSiz, z; >+ char** objList = (char**) malloc(sizeof(char*) * objLen); >+ >+ int reqLen = 1024; >+ int reqCount = 0; >+ char* reqList = (char*) malloc(sizeof(char) * reqLen); >+ >+ memset(objList,0,sizeof(char*) * objLen); >+ while (objLen <= (objSiz = tableKeysAsList(hasht_filters,objList,objLen))) { >+ objLen *= 2; >+ objList = (char**) realloc(objList,sizeof(char*) * objLen); >+ } >+ >+ // >+ // Build a list of the requested objects so we can request just those from HKEY_PERFORMANCE_DATA >+ // >+ reqCount = 0; >+ for (z = 0; z < objSiz; z++) { >+ if (objList[z] != NULL) { >+ char objTmp[64]; >+ char* tmp = objList[z]; >+ int index = 0; >+ >+ while (tmp[index] != '\0') { >+ objTmp[index] = tmp[index]; >+ if (objTmp[index] == 'C' || objTmp[index] == 'I') { >+ index = -1; >+ break; >+ } >+ index++; >+ } >+ >+ if (index > 0) { >+ //string length = index >+ //memcopy over the string into the buffer >+ >+ while ((reqLen-2) < (reqCount + index + 10)) { >+ //increase buffer size >+ reqLen *= 2; >+ reqList = (char*) realloc(reqList,sizeof(char) * reqLen); >+ } >+ >+ memcpy(&(reqList[reqCount]),tmp,index); >+ reqCount += index; >+ reqList[reqCount++] = ' '; >+ >+ } >+ } >+ } >+ >+ reqList[reqCount++] = '\0'; >+ >+ free(objList); >+ return reqList; >+} >+ >+ >+PPERF_DATA_BLOCK getPerfData(char* REG_HOST, BOOL results, HashTable* hasht_filters, XINT64 getGlobalAgain) >+{ >+ XINT32 TmpBufferSize = 0; >+ static XINT32 BufferSize = 64000; >+ DWORD rt; >+ char* reqFinal; >+ char* reqList; >+ char* tree_reqList = NULL; >+ char request_buf[20480]; >+ >+ PPERF_DATA_BLOCK PerfData = NULL; >+ HKEY remoteKey; >+ >+ PerfData = (PPERF_DATA_BLOCK) malloc( BufferSize ); >+ >+ if (getRemoteKey(REG_HOST, &remoteKey) == -1) >+ { >+ free(PerfData); >+ return NULL; >+ } >+ >+ if (results == TRUE) >+ { >+ reqList = getReqList(hasht_filters); >+ if (REG_HOST == NULL || USE_REG_CONNECT) >+ sprintf(request_buf,"%s%c",reqList,'\0'); >+ else >+ sprintf(request_buf,"Foreign %s %s%c",REG_HOST,reqList,'\0'); >+ >+ reqFinal = request_buf; >+ } >+ else >+ { >+ tree_reqList = getReqList(hasht_tree); >+ if (REG_HOST == NULL || USE_REG_CONNECT) >+ sprintf(request_buf,"%s%c",tree_reqList,'\0'); >+ else >+ sprintf(request_buf,"Foreign %s %s%c",REG_HOST,tree_reqList,'\0'); >+ >+ reqFinal = request_buf; >+ } >+ >+ if (reqFinal[0] == '\0' || getGlobalAgain == 1) >+ { >+ reqFinal = "Global"; >+ } >+ >+ TmpBufferSize = BufferSize; >+ while( (rt=RegQueryValueEx(remoteKey, >+ reqFinal, >+ NULL, >+ NULL, >+ (LPBYTE) PerfData, >+ (ULONG*) &TmpBufferSize )) == ERROR_MORE_DATA ) >+ { >+ /* RKD: The key is opened, we just failed to have enough room for the data. Close the key, create room, >+ * and run again. >+ */ >+ RegCloseKey(remoteKey); >+ >+ /* We closed the key, need to reopen it again >+ * >+ */ >+ if (getRemoteKey(REG_HOST, &remoteKey) == -1) >+ { >+ free(PerfData); >+ return NULL; >+ } >+ >+ BufferSize *= 2; >+ PerfData = (PPERF_DATA_BLOCK) realloc( PerfData, BufferSize ); >+ TmpBufferSize = BufferSize; >+ } >+ >+ if (rt != ERROR_SUCCESS) >+ { >+ logToFile("%sFailed to query performance data registry key for tree %d\n",PREFIX,rt); >+ free(PerfData); >+ return NULL; >+ } >+ >+ if ((rt=RegCloseKey(remoteKey)) != ERROR_SUCCESS) >+ logToFile("%sRegCloseKey FAILED %d\n",PREFIX,rt); >+ >+ if (results == TRUE) >+ free(reqList); >+ >+ if (tree_reqList != NULL) >+ free(tree_reqList); >+ >+ return PerfData; >+} >+ >+int isBaseType(int type) >+{ >+ switch(type) >+ { >+ case PERF_AVERAGE_BASE: >+ case PERF_SAMPLE_BASE: >+ case PERF_RAW_BASE: >+ case PERF_COUNTER_MULTI_BASE: >+ case PERF_LARGE_RAW_BASE: >+ case PERF_PRECISION_TIMESTAMP: return 1; >+ } >+ return 0; >+} >+ >+void printtype(char* key, PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ logToFile("Key: %s - ",key); >+ switch(PerfCntr->CounterType) >+ { >+ >+ case PERF_100NSEC_MULTI_TIMER: printf("PERF_100NSEC_MULTI_TIMER");break; >+ case PERF_100NSEC_MULTI_TIMER_INV: printf("PERF_100NSEC_MULTI_TIMER_INV");break; >+ case PERF_100NSEC_TIMER: printf("PERF_100NSEC_TIMER");break; >+ case PERF_100NSEC_TIMER_INV: printf("PERF_100NSEC_TIMER_INV");break; >+ case PERF_AVERAGE_BASE: printf("PERF_AVERAGE_BASE");break; >+ case PERF_AVERAGE_BULK: printf("PERF_AVERAGE_BULK");break; >+ case PERF_AVERAGE_TIMER: printf("PERF_AVERAGE_TIMER");break; >+ case PERF_COUNTER_100NS_QUEUELEN_TYPE: printf("PERF_COUNTER_100NS_QUEUELEN_TYPE");break; >+ case PERF_COUNTER_BULK_COUNT: printf("PERF_COUNTER_BULK_COUNT");break; >+ case PERF_COUNTER_COUNTER: printf("PERF_COUNTER_COUNTER");break; >+ case PERF_COUNTER_DELTA: printf("PERF_COUNTER_DELTA");break; >+ case PERF_COUNTER_LARGE_DELTA: printf("PERF_COUNTER_LARGE_DELTA");break; >+ case PERF_COUNTER_LARGE_QUEUELEN_TYPE: printf("PERF_COUNTER_LARGE_QUEUELEN_TYPE");break; >+ case PERF_COUNTER_LARGE_RAWCOUNT: printf("PERF_COUNTER_LARGE_RAWCOUNT");break; >+ case PERF_COUNTER_LARGE_RAWCOUNT_HEX: printf("PERF_COUNTER_LARGE_RAWCOUNT_HEX");break; >+ case PERF_COUNTER_MULTI_BASE: printf("PERF_COUNTER_MULTI_BASE");break; >+ case PERF_COUNTER_MULTI_TIMER: printf("PERF_COUNTER_MULTI_TIMER");break; >+ case PERF_COUNTER_MULTI_TIMER_INV: printf("PERF_COUNTER_MULTI_TIMER_INV");break; >+ case PERF_COUNTER_NODATA: printf("PERF_COUNTER_NODATA");break; >+ case PERF_COUNTER_QUEUELEN_TYPE: printf("PERF_COUNTER_QUEUELEN_TYPE");break; >+ case PERF_COUNTER_RAWCOUNT: printf("PERF_COUNTER_RAWCOUNT");break; >+ case PERF_COUNTER_RAWCOUNT_HEX: printf("PERF_COUNTER_RAWCOUNT_HEX");break; >+ case PERF_COUNTER_TEXT: printf("PERF_COUNTER_TEXT");break; >+ case PERF_COUNTER_TIMER: printf("PERF_COUNTER_TIMER");break; >+ case PERF_COUNTER_TIMER_INV: printf("PERF_COUNTER_TIMER_INV");break; >+ case PERF_ELAPSED_TIME: printf("PERF_ELAPSED_TIME");break; >+ case PERF_LARGE_RAW_BASE: printf("PERF_LARGE_RAW_BASE");break; >+ case PERF_OBJ_TIME_TIMER: printf("PERF_OBJ_TIME_TIMER");break; >+ case PERF_PRECISION_100NS_TIMER: printf("PERF_PRECISION_100NS_TIMER");break; >+ case PERF_PRECISION_OBJECT_TIMER: printf("PERF_PRECISION_OBJECT_TIMER");break; >+ case PERF_PRECISION_SYSTEM_TIMER: printf("PERF_PRECISION_SYSTEM_TIMER");break; >+ case PERF_RAW_BASE: printf("PERF_RAW_BASE");break; >+ case PERF_RAW_FRACTION: printf("PERF_RAW_FRACTION");break; >+ case PERF_SAMPLE_BASE: printf("PERF_SAMPLE_BASE");break; >+ case PERF_SAMPLE_COUNTER: printf("PERF_SAMPLE_COUNTER");break; >+ case PERF_SAMPLE_FRACTION: printf("PERF_SAMPLE_FRACTION");break; >+ case PERF_PRECISION_TIMESTAMP: printf("PERF_PRECISION_TIMESTAMP");break; >+ default : printf("Unrecognised Type"); >+ } >+ printf("\n"); >+} >+ >+PPERF_OBJECT_TYPE FirstObject( PPERF_DATA_BLOCK PerfData ) >+{ >+ return( (PPERF_OBJECT_TYPE)((PBYTE)PerfData + PerfData->HeaderLength) ); >+} >+ >+PPERF_OBJECT_TYPE NextObject(PPERF_OBJECT_TYPE PerfObj) >+{ >+ return( (PPERF_OBJECT_TYPE)((PBYTE)PerfObj + PerfObj->TotalByteLength) ); >+} >+ >+PPERF_INSTANCE_DEFINITION FirstInstance(PPERF_OBJECT_TYPE PerfObj) >+{ >+ return( (PPERF_INSTANCE_DEFINITION)((PBYTE)PerfObj + PerfObj->DefinitionLength) ); >+} >+ >+PPERF_INSTANCE_DEFINITION NextInstance(PPERF_INSTANCE_DEFINITION PerfInst) >+{ >+ PPERF_COUNTER_BLOCK PerfCntrBlk; >+ >+ PerfCntrBlk = (PPERF_COUNTER_BLOCK)((PBYTE)PerfInst + PerfInst->ByteLength); >+ >+ return( (PPERF_INSTANCE_DEFINITION)((PBYTE)PerfCntrBlk + PerfCntrBlk->ByteLength) ); >+} >+ >+PPERF_COUNTER_DEFINITION FirstCounter(PPERF_OBJECT_TYPE PerfObj) >+{ >+ return( (PPERF_COUNTER_DEFINITION) ((PBYTE)PerfObj + PerfObj->HeaderLength) ); >+} >+ >+PPERF_COUNTER_DEFINITION NextCounter(PPERF_COUNTER_DEFINITION PerfCntr) >+{ >+ return( (PPERF_COUNTER_DEFINITION)((PBYTE)PerfCntr + PerfCntr->ByteLength) ); >+} >+ >+void formatOutputString(char* output) >+{ >+ int i = 0; >+ for (i=strlen(output)-1; i>= 0; i--) >+ { >+ if ((output[i] >= 48 && output[i] <= 57) || output[i] == 'E' || output[i] == '-') >+ { >+ // The char is either a number of an E. ignore it >+ } >+ else >+ { >+ output[i] = '.'; >+ return; >+ } >+ } >+} >+ >+char* checktype(char* key, PPERF_COUNTER_BLOCK PtrToCntr,PPERF_COUNTER_DEFINITION PerfCntr,PPERF_DATA_BLOCK PerfData, PPERF_OBJECT_TYPE PerfObj) >+{ >+ char* output; >+ >+ PPERF_COUNTER_DEFINITION PerfCntr2; >+ >+ output = malloc(1024); >+ memset(output,'\0',1024); >+ >+// printtype(key,PerfCntr); >+ >+ switch(PerfCntr->CounterType) >+ { >+// Preliminary Testing Done... >+ case PERF_100NSEC_TIMER: getPERF_100NSEC_TIMER(output,key, PtrToCntr, PerfCntr, PerfData);break; >+ case PERF_100NSEC_TIMER_INV: getPERF_100NSEC_TIMER_INV(output,key, PtrToCntr, PerfCntr, PerfData);break; >+ case PERF_AVERAGE_BULK: PerfCntr2 = NextCounter(PerfCntr);getPERF_AVERAGE_BULK(output,key, PtrToCntr, PerfCntr, PerfCntr2);break; >+ case PERF_AVERAGE_TIMER: PerfCntr2 = NextCounter(PerfCntr);getPERF_AVERAGE_TIMER(output,key, PtrToCntr,PerfCntr, PerfCntr2 , PerfData);break; >+ case PERF_COUNTER_BULK_COUNT: getPERF_COUNTER_BULK_COUNT(output,key, PtrToCntr,PerfCntr,PerfData);break; >+ case PERF_COUNTER_COUNTER: getPERF_COUNTER_COUNTER(output,key, PtrToCntr,PerfCntr,PerfData);break; >+ case PERF_COUNTER_LARGE_RAWCOUNT: getPERF_COUNTER_LARGE_RAWCOUNT(output, key,PtrToCntr,PerfCntr);break; >+ case PERF_COUNTER_LARGE_RAWCOUNT_HEX: getPERF_COUNTER_LARGE_RAWCOUNT_HEX(output,key, PtrToCntr,PerfCntr);break; >+ case PERF_COUNTER_NODATA: getPERF_COUNTER_NODATA(output,key, PtrToCntr,PerfCntr);break; >+ case PERF_COUNTER_RAWCOUNT: getPERF_COUNTER_RAWCOUNT(output,key, PtrToCntr,PerfCntr);break; >+ case PERF_ELAPSED_TIME: getPERF_ELAPSED_TIME(output,key, PtrToCntr,PerfCntr, PerfData, PerfObj);break; >+ case PERF_RAW_FRACTION: PerfCntr2 = NextCounter(PerfCntr); getPERF_RAW_FRACTION(output,key, PtrToCntr,PerfCntr, PerfCntr2);break; >+ case PERF_SAMPLE_FRACTION: PerfCntr2 = NextCounter(PerfCntr); getPERF_SAMPLE_FRACTION(output,key, PtrToCntr,PerfCntr,PerfCntr2);break; >+ >+// NOT TESTED >+ case PERF_COUNTER_DELTA: getPERF_COUNTER_DELTA(output,key, PtrToCntr,PerfCntr);break; >+ case PERF_COUNTER_LARGE_DELTA: getPERF_COUNTER_LARGE_DELTA(output, key,PtrToCntr,PerfCntr);break; >+ case PERF_SAMPLE_COUNTER: PerfCntr2 = NextCounter(PerfCntr); getPERF_SAMPLE_COUNTER(output,key, PtrToCntr,PerfCntr,PerfCntr2);break; >+ case PERF_COUNTER_LARGE_QUEUELEN_TYPE: getPERF_COUNTER_LARGE_QUEUELEN_TYPE(output,key, PtrToCntr,PerfCntr, PerfData);break; >+ case PERF_100NSEC_MULTI_TIMER: PerfCntr2 = NextCounter(PerfCntr);getPERF_100NSEC_MULTI_TIMER(output, key, PtrToCntr, PerfCntr, PerfCntr2, PerfData);break; >+ case PERF_100NSEC_MULTI_TIMER_INV: PerfCntr2 = NextCounter(PerfCntr);getPERF_100NSEC_MULTI_TIMER_INV(output, key,PtrToCntr, PerfCntr, PerfCntr2, PerfData);break; >+ case PERF_COUNTER_RAWCOUNT_HEX: getPERF_COUNTER_RAWCOUNT_HEX(output,key, PtrToCntr, PerfCntr);break; >+ case PERF_COUNTER_TIMER: getPERF_COUNTER_TIMER(output,key, PtrToCntr,PerfCntr, PerfData);break; >+ case PERF_COUNTER_TIMER_INV: getPERF_COUNTER_TIMER_INV(output,key, PtrToCntr,PerfCntr, PerfData);break; >+ case PERF_COUNTER_MULTI_TIMER: PerfCntr2 = NextCounter(PerfCntr);getPERF_COUNTER_MULTI_TIMER(output,key, PtrToCntr,PerfCntr, PerfCntr2, PerfData);break; >+ case PERF_COUNTER_MULTI_TIMER_INV: PerfCntr2 = NextCounter(PerfCntr);getPERF_COUNTER_MULTI_TIMER_INV(output,key, PtrToCntr,PerfCntr, PerfCntr2, PerfData);break; >+ case PERF_COUNTER_QUEUELEN_TYPE: getPERF_COUNTER_QUEUELEN_TYPE(output,key, PtrToCntr,PerfCntr, PerfData);break; >+ case PERF_OBJ_TIME_TIMER: getPERF_OBJ_TIME_TIMER(output,key, PtrToCntr,PerfCntr, PerfData);break; >+ case PERF_PRECISION_100NS_TIMER: PerfCntr2 = NextCounter(PerfCntr);getPERF_PRECISION_100NS_TIMER(output,key, PtrToCntr,PerfCntr,PerfCntr2, PerfData);break; >+ case PERF_PRECISION_OBJECT_TIMER: PerfCntr2 = NextCounter(PerfCntr);printf("PERF_PRECISION_OBJECT_TIMER");break; >+ case PERF_PRECISION_SYSTEM_TIMER: PerfCntr2 = NextCounter(PerfCntr);printf("PERF_PRECISION_SYSTEM_TIMER");break; >+ case PERF_COUNTER_100NS_QUEUELEN_TYPE: getPERF_COUNTER_100NS_QUEUELEN_TYPE(output,key, PtrToCntr,PerfCntr, PerfData);break; >+ >+// NOT DONE YET >+// case PERF_COUNTER_TEXT: getPERF_COUNTER_TEXT(output, PtrToCntr,PerfCntr);break; >+ >+//Base Types - NO CALCULA TION NEEDED >+ case PERF_AVERAGE_BASE: break; >+ case PERF_SAMPLE_BASE: break; >+ case PERF_RAW_BASE: break; >+ case PERF_COUNTER_MULTI_BASE: break; >+ case PERF_LARGE_RAW_BASE: break; >+ case PERF_PRECISION_TIMESTAMP: break; >+ >+//Not Recognised Types >+ default: printf("Unrecognised Type (%s) - %d\n",key,PerfCntr->CounterType); >+ } >+ >+ formatOutputString(output); >+ return output; >+} >+ >+ >+int GetNameStrings(char* host) >+{ >+ HKEY hKeyPerflib; >+ HKEY hKeyPerflib009; >+ DWORD dwMaxValueLen; // maximum size of key values >+ DWORD dwBuffer; // bytes to allocate for buffers >+ DWORD dwBufferSize; // size of dwBuffer >+ LPSTR lpCurrentString; // pointer for enumerating data strings >+ DWORD dwCounter; // current counter index >+ HKEY remoteKeyLocalMachine; >+ int rt; >+ >+// Get the number of Counter items. >+ >+ if ((rt = RegConnectRegistry(host,HKEY_LOCAL_MACHINE,&remoteKeyLocalMachine)) != ERROR_SUCCESS) >+ { >+ logToFile("%sRegConnectRegistry ERROR : ? %d\n",PREFIX,rt); >+ return 0; >+ } >+ >+ >+ if( (rt = RegOpenKeyEx( remoteKeyLocalMachine, >+ "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib", >+ 0, >+ KEY_READ, >+ &hKeyPerflib)) != ERROR_SUCCESS >+ ) { >+ logToFile("%sRegOpenKeyEx ERROR : ? %d\n",PREFIX,rt); >+ return 0; >+ } >+ >+ dwBufferSize = sizeof(dwBuffer); >+ >+ if( (rt = RegQueryValueEx( hKeyPerflib, >+ "Last Counter", >+ NULL, >+ NULL, >+ (LPBYTE) &dwBuffer, >+ &dwBufferSize )) != ERROR_SUCCESS >+ ) { >+ logToFile("%sRegQueryValueEx ERROR : ? %d\n",PREFIX,rt); >+ return 0; >+ } >+ >+// Allocate memory for the names array. >+ >+ lpNamesArray = malloc( (dwBuffer+1) * sizeof(LPSTR) ); >+ lpNamesArraySize = dwBuffer+1; >+ if( lpNamesArray == NULL) { >+ return 0; >+ } >+ memset(lpNamesArray,'\0',(dwBuffer+1) * sizeof(LPSTR)); >+ >+ lpHelpArray = malloc( (dwBuffer+3) * sizeof(LPSTR) ); >+ if( lpHelpArray == NULL) { >+ free(lpNamesArray); >+ return 0; >+ } >+ memset(lpHelpArray,'\0',(dwBuffer+3) * sizeof(LPSTR)); >+ >+// Open the key containing the counter and object names. >+ >+ if( (rt=RegOpenKeyEx( remoteKeyLocalMachine, >+ "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\009", >+ 0, >+ KEY_READ, >+ &hKeyPerflib009)) != ERROR_SUCCESS >+ ){ >+ logToFile("%sRegOpenKexEx ERROR : ? %d\n",PREFIX,rt); >+ return 0; >+ } >+ >+// Get the size of the largest value in the key (Counter or Help). >+ >+ if( (rt=RegQueryInfoKey( hKeyPerflib009, >+ NULL, >+ NULL, >+ NULL, >+ NULL, >+ NULL, >+ NULL, >+ NULL, >+ NULL, >+ &dwMaxValueLen, >+ NULL, >+ NULL)) != ERROR_SUCCESS >+ ) { >+ logToFile("%sRegQueryValueEx ERROR : ? %d\n",PREFIX,rt); >+ return 0; >+ } >+ >+// Allocate memory for the counter and object names. >+ >+ dwBuffer = dwMaxValueLen + 1; >+ >+ lpNameStrings = malloc( dwBuffer * sizeof(CHAR) ); >+ if (lpNameStrings == NULL) { >+ free( lpNamesArray ); >+ free( lpHelpArray ); >+ return 0; >+ } >+ lpHelpStrings = malloc( dwBuffer * sizeof(CHAR) ); >+ if (lpHelpStrings == NULL) >+ { >+ free( lpNamesArray ); >+ free( lpHelpArray ); >+ free( lpNameStrings ); >+ return 0; >+ } >+ >+// Read the Counter value. >+ >+ dwBufferSize = dwBuffer; >+ >+ if( (rt=RegQueryValueEx( hKeyPerflib009, >+ "Counter", >+ NULL, >+ NULL, >+ lpNameStrings, &dwBuffer )) != ERROR_SUCCESS >+ ) { >+ free( lpNamesArray ); >+ free( lpHelpArray ); >+ free( lpNameStrings ); >+ free( lpHelpStrings ); >+ logToFile("%sUnable to read counter value : ? %d\n",PREFIX,rt); >+ return 0; >+ } >+ >+ if( (rt = RegQueryValueEx( hKeyPerflib009, >+ "Help", >+ NULL, >+ NULL, >+ lpHelpStrings, &dwBufferSize )) != ERROR_SUCCESS >+ ) { >+ free( lpNamesArray ); >+ free( lpHelpArray ); >+ free( lpNameStrings ); >+ free( lpHelpStrings ); >+ logToFile("%sUnable to read counter value : ? %d\n",PREFIX,rt); >+ return 0; >+ } >+ RegCloseKey( hKeyPerflib009 ); >+ RegCloseKey(remoteKeyLocalMachine); >+ RegCloseKey( hKeyPerflib ); >+ >+// Load names into an array, by index. >+ >+ for( lpCurrentString = lpNameStrings; *lpCurrentString;lpCurrentString += (lstrlen(lpCurrentString)+1) ) >+ { >+ dwCounter = atol( lpCurrentString ); >+ >+ lpCurrentString += (lstrlen(lpCurrentString)+1); >+ >+ lpNamesArray[dwCounter] = (LPSTR) lpCurrentString; >+ } >+ >+ for( lpCurrentString = lpHelpStrings; *lpCurrentString;lpCurrentString += (lstrlen(lpCurrentString)+1) ) >+ { >+ dwCounter = atol( lpCurrentString ); >+ >+ lpCurrentString += (lstrlen(lpCurrentString)+1); >+ >+ lpHelpArray[dwCounter] = (LPSTR) lpCurrentString; >+ } >+ >+ return 1; >+ >+} >+ >+void printout(char** data,int numstrings) >+{ >+ int i; >+ for (i=0;i<numstrings;i++) >+ { >+ logToFile("%s\n",data[i]); >+ } >+} >+ >+void cleardata(char** data,int numstrings) >+{ >+ int i; >+ for (i=0;i<numstrings;i++) >+ { >+ free(data[i]); >+ } >+ free(data); >+} >+ >+wchar_t* getParentInstanceName(PPERF_DATA_BLOCK PerfData, DWORD parentinstindex, DWORD objectid) >+{ >+ PPERF_OBJECT_TYPE PerfObj; >+ PPERF_INSTANCE_DEFINITION PerfInst; >+ wchar_t* strname; >+ DWORD i,k; >+ >+ PerfObj = FirstObject( PerfData ); >+ >+ for( i=0; i < PerfData->NumObjectTypes; i++ ) >+ { >+ if (PerfObj->ObjectNameTitleIndex != objectid) >+ { >+ PerfObj = NextObject( PerfObj ); >+ continue; >+ } >+ >+ if( PerfObj->NumInstances > 0 ) >+ { >+ PerfInst = FirstInstance( PerfObj ); >+ >+ for( k=0; k < (DWORD)(PerfObj->NumInstances); k++ ) >+ { >+ >+ if (k != parentinstindex) >+ { >+ PerfInst = NextInstance( PerfInst ); >+ continue; >+ } >+ >+ strname = ((wchar_t*)((PBYTE)PerfInst + PerfInst->NameOffset)); >+ >+ return strname; >+ } >+ } >+ return NULL; >+ } >+ return NULL; >+} >+ >+ >+int getObjectID(PPERF_OBJECT_TYPE PerfObj, char* id, int idsiz) { >+ int ret = _snprintf(id,idsiz,"%d\0",PerfObj->ObjectNameTitleIndex); >+ if (ret < 0) ret = idsiz; >+ return ret; >+} >+ >+int getObjectCntrID(PPERF_OBJECT_TYPE PerfObj, PPERF_COUNTER_DEFINITION PerfCntr, char* id, int idsiz) { >+ int ret = _snprintf(id,idsiz,"%dC%d\0",PerfObj->ObjectNameTitleIndex,PerfCntr->CounterNameTitleIndex); >+ if (ret < 0) ret = idsiz; >+ return ret; >+} >+ >+int getInstanceKey(PPERF_DATA_BLOCK PerfData, PPERF_INSTANCE_DEFINITION PerfInst, char* id, int idsiz) { >+ >+ wchar_t* temp1; >+ wchar_t* temp2; >+ int len1; >+ int len2; >+ >+ int ret; >+ >+ char* buf; >+ int count = 0; >+ >+ if (PerfInst->ParentObjectInstance != 0) >+ { >+ temp1 = getParentInstanceName(PerfData,PerfInst->ParentObjectInstance,PerfInst->ParentObjectTitleIndex); >+ temp2 = ((wchar_t*)((PBYTE)PerfInst + PerfInst->NameOffset)); >+ if (temp1 != NULL) >+ { >+ len1 = wcslen(temp1); >+ len2 = wcslen(temp2); >+ >+ buf = malloc(sizeof(char) * (len1+len2+10)); >+ sprintf(buf,"%S/%S%c",temp1,temp2,'\0'); >+ } >+ else >+ { >+ len2 = wcslen(temp2); >+ >+ buf = malloc(sizeof(char) * (len2+10)); >+ sprintf(buf,"%S%c",temp2,'\0'); >+ } >+ } >+ else >+ { >+ temp2 = ((wchar_t*)((PBYTE)PerfInst + PerfInst->NameOffset)); >+ >+ len2 = wcslen(temp2); >+ >+ buf = malloc(sizeof(char) * (len2+10)); >+ sprintf(buf,"%S%c",temp2,'\0'); >+ >+ } >+ >+ ret = _snprintf(id,idsiz,"%s%c",buf,'\0'); >+ if (ret < 0) ret = idsiz; >+ free(buf); >+ return ret; >+} >+ >+int getInstanceName(PPERF_DATA_BLOCK PerfData, char* instKey, int count, char* id, int idsiz) { >+ int ret; >+ >+ if (count == 0) { >+ ret = _snprintf(id,idsiz,"%s%c",instKey,'\0'); >+ if (ret < 0) ret = idsiz; >+ return ret; >+ } else { >+ ret = _snprintf(id,idsiz,"%s#%d%c",instKey,count,'\0'); >+ if (ret < 0) ret = idsiz; >+ return ret; >+ } >+} >+ >+int getInstanceID(PPERF_DATA_BLOCK PerfData, PPERF_OBJECT_TYPE PerfObj, char* instName, char* id, int idsiz, HashTable* idhasht, int populate_idhash) { >+ int keyLen = sizeof(char) * 128; >+ char* keyID = malloc(keyLen); >+ int instid; >+ int ret; >+ >+ while (0 > _snprintf(keyID,keyLen,"%dI%s%c",PerfObj->ObjectNameTitleIndex,instName,'\0')) { >+ keyLen *= 2; >+ keyID = realloc(keyID,keyLen); >+ } >+ >+ instid = (int)tableGet(idhasht,keyID); >+ >+ if (instid == 0 && populate_idhash) >+ { >+ instid = idhasht->count+1; >+ >+ tablePut(idhasht,keyID,instid); >+ } >+ >+ free(keyID); >+ >+ ret = _snprintf(id,idsiz,"%dI%d%c",PerfObj->ObjectNameTitleIndex,instid,'\0'); >+ if (ret < 0) ret = idsiz; >+ return ret; >+} >+ >+int getInstanceCntrID(PPERF_DATA_BLOCK PerfData, PPERF_OBJECT_TYPE PerfObj, char* instid, PPERF_COUNTER_DEFINITION PerfCntr, char* id, int idsiz, HashTable* idhasht) { >+ int ret = _snprintf(id,idsiz,"%sC%d%c",instid,PerfCntr->CounterNameTitleIndex,'\0'); >+ if (ret < 0) ret = idsiz; >+ return ret; >+} >+ >+void clearData(char** array, int count) >+{ >+ int i; >+ for (i =0 ;i<count;i++) { >+ free(array[i]); >+ } >+ free(array); >+} >+ >+unsigned long getObjectCount(PPERF_DATA_BLOCK PerfData) >+{ >+ PPERF_OBJECT_TYPE PerfObj; >+ unsigned long count =0; >+ unsigned long totalsize = 0; >+ >+ if (PerfData->TotalByteLength == PerfData->HeaderLength) >+ return 0; >+ >+ PerfObj = FirstObject(PerfData); >+ totalsize = PerfData->HeaderLength + PerfObj->TotalByteLength; >+ count++; >+ >+ while (totalsize < PerfData->TotalByteLength) >+ { >+ PerfObj = NextObject(PerfObj); >+ count++; >+ totalsize = totalsize + PerfObj->TotalByteLength; >+ } >+ >+ return count; >+} >+ >+char* getRemoteHost() >+{ >+ char* remoteHost = (char*) tableGet(hasht_variables,PERFMON_KEY_HOST); >+ >+ while (remoteHost == NULL) >+ { >+ logToFile("Waiting for variables to arrive..."); >+ Sleep(50); >+ remoteHost = (char*) tableGet(hasht_variables,PERFMON_KEY_HOST); >+ } >+ >+ if (isVista) >+ { >+ if (strcmp(remoteHost,"localhost") == 0 || strcmp(remoteHost,"127.0.0.1") == 0) >+ { >+ return NULL; >+ } >+ } >+ else >+ { >+ if (strcmp(remoteHost,"localhost") == 0) >+ { >+ return NULL; >+ } >+ } >+ >+ >+ return remoteHost; >+} >+ >+char** DC_CollectionGetResults(int* numresults) >+{ >+ int z; >+ >+ PPERF_DATA_BLOCK PerfData = NULL; >+ >+ char* REG_HOST; >+ >+ REG_HOST = getRemoteHost(); >+ >+ >+ PerfData = getPerfData(REG_HOST, TRUE, hasht_filters,0); >+ >+ >+ if (PerfData != NULL) >+ { >+ PPERF_OBJECT_TYPE PerfObj; >+ PPERF_COUNTER_DEFINITION PerfCntr; >+ PPERF_INSTANCE_DEFINITION PerfInst; >+ PPERF_COUNTER_BLOCK PtrToCntr; >+ >+ HashTable* instancecount = tableCreate(); >+ >+ DWORD i, j, k; >+ >+ int objLen = sizeof(char) * 128; >+ char* objID = malloc(128); >+ int cntrLen = sizeof(char) * 128; >+ char* cntrID = malloc(128); >+ int instLen = sizeof(char) * 128; >+ char* instID = malloc(128); >+ int instnLen = sizeof(char) * 128; >+ char* instName = malloc(instnLen); >+ int instkLen = sizeof(char) * 128; >+ char* instKey = malloc(instkLen); >+ int count; >+ >+ int value_len = 0; >+ char* value; >+ >+ if (results_len != -1) { >+ for (z = 0; z < value_index; z++) { >+ free(results[z]); >+ } >+ if (results != NULL) { >+ free(results); >+ } else { >+// logToFile("NULL results! length = %d\n",value_index); >+ } >+ } >+ value_index = 0; >+ results_len = 10; >+ results = malloc(sizeof(char*) * results_len); >+ >+ PerfObj = FirstObject( PerfData ); >+ >+ for( i=0; i < PerfData->NumObjectTypes; i++ ) >+ { >+ if (isVista) >+ { >+ // An out of bounds check on the name array >+ // A generic fix that is valid for all windows versions >+ if (PerfObj->ObjectNameTitleIndex > lpNamesArraySize) >+ { >+ PerfObj = NextObject( PerfObj ); >+ continue; >+ } >+ } >+ >+ while (objLen <= getObjectID(PerfObj,objID,objLen)) >+ { >+ objLen *= 2; >+ objID = realloc(objID,objLen); >+ } >+ >+ if (tableGet(hasht_filters,objID) != (XINT64)NULL) >+ { >+ //this object is ON >+ if (PerfObj->NumInstances == PERF_NO_INSTANCES) >+ { >+ // just check its counters >+ >+ PerfCntr = FirstCounter(PerfObj); >+ >+ for ( j=0; j < PerfObj->NumCounters; j++ ) { >+ while (cntrLen <= getObjectCntrID(PerfObj,PerfCntr,cntrID,cntrLen)) { >+ cntrLen *= 2; >+ cntrID = realloc(cntrID,cntrLen); >+ } >+ if ((tableGet(hasht_filters,cntrID) != (XINT64)NULL) && (isBaseType(PerfCntr->CounterType)==0)) { >+ //this counter is ON - send its value >+ PtrToCntr = (PPERF_COUNTER_BLOCK) ((PBYTE)PerfObj + PerfObj->DefinitionLength ); >+ >+ value = checktype(cntrID,PtrToCntr,PerfCntr,PerfData,PerfObj); >+ value_len = strlen(cntrID) + strlen(value) + 4; >+ >+ results[value_index] = malloc(value_len); >+ _snprintf(results[value_index],value_len,"%s%c%s%c",cntrID,'\0',value,'\0'); >+ >+ value_index++; >+ >+ if (value_index == results_len) { >+ results_len *= 2; >+ results = realloc(results,sizeof(char*) * results_len); >+ } >+ >+ free(value); >+ } >+ >+ PerfCntr = NextCounter(PerfCntr); >+ } >+ >+ } else { >+ //check its instances and their counters >+ >+ tableClear(instancecount); >+ >+ PerfInst = FirstInstance( PerfObj ); >+ >+ for ( j=0; j < ((DWORD) (PerfObj->NumInstances)); j++) >+ { >+ >+ while (instkLen <= getInstanceKey(PerfData,PerfInst,instKey,instkLen)) >+ { >+ instkLen *= 2; >+ instKey = realloc(instKey,instkLen); >+ } >+ >+ count = (int)tableGet(instancecount,instKey); >+ while (instnLen <= getInstanceName(PerfData,instKey,count,instName,instnLen)) >+ { >+ instnLen *= 2; >+ instName = realloc(instName,instnLen); >+ } >+ tablePut(instancecount,instKey,count+1); >+ >+ while (instLen <= getInstanceID(PerfData,PerfObj,instName,instID,instLen,idhasht,FALSE)) >+ { >+ instLen *= 2; >+ instID = realloc(instID,instLen); >+ } >+ >+ if (tableGet(hasht_filters,instID) != (XINT64)NULL) >+ { >+ PerfCntr = FirstCounter(PerfObj); >+ >+ for ( k=0; k < PerfObj->NumCounters; k++ ) >+ { >+ while (cntrLen <= getInstanceCntrID(PerfData,PerfObj,instID,PerfCntr,cntrID,cntrLen,idhasht)) >+ { >+ cntrLen *= 2; >+ cntrID = realloc(cntrID,cntrLen); >+ } >+ >+ if ((tableGet(hasht_filters,cntrID) != (XINT64)NULL)&& (isBaseType(PerfCntr->CounterType)==0)) >+ { >+ //this counter is ON - send its value >+ PtrToCntr = (PPERF_COUNTER_BLOCK) ((PBYTE)PerfInst + PerfInst->ByteLength); >+ >+ value = checktype(cntrID,PtrToCntr,PerfCntr,PerfData,PerfObj); >+ >+ value_len = strlen(cntrID) + strlen(value) + 4; >+ results[value_index] = malloc(value_len); >+ _snprintf(results[value_index],value_len,"%s%c%s%c",cntrID,'\0',value,'\0'); >+ value_index++; >+ >+ if (value_index == results_len) >+ { >+ results_len *= 2; >+ results = realloc(results,sizeof(char*) * results_len); >+ } >+ >+ free(value); >+ >+ } >+ PerfCntr = NextCounter(PerfCntr); >+ } >+ } >+ PerfInst = NextInstance( PerfInst ); >+ } >+ } >+ } >+ PerfObj = NextObject( PerfObj ); >+ } >+ free(PerfData); >+ >+ tableClear(instancecount); >+ >+ tableDelete(instancecount); >+ >+ free(objID); >+ free(instID); >+ free(cntrID); >+ free(instName); >+ free(instKey); >+ >+ *numresults = value_index; >+ >+ return results; >+ } >+ else >+ { >+ *numresults = 0; >+ >+ return NULL; >+ } >+} >+ >+void addToTree(char*** treedatp, int* treelenp, int* treeindexp, char* pid, char* id, char* name, char* help, char* suffix) >+{ >+ char** treedat = *treedatp; >+ int treelen = *treelenp; >+ int treeindex = *treeindexp; >+ int counter = 0; >+ >+ //this needs to be pid\id\name\help\suffix >+ int datLen = 128; >+ treedat[treeindex] = malloc(sizeof(char) * datLen); >+ >+ // Check if this is a counter or not. >+ if (strchr(id, 'C') == NULL) >+ counter = 0; >+ else >+ counter = 1; >+ >+//logToFile("ADD %s %s %s %s %s\n",pid,id,name,"(help)",suffix); >+ >+ while (0 > _snprintf(treedat[treeindex],datLen,"%s%c%s%c%s%c%s%c%s%c%d%c", >+ pid,'\0', //pid >+ id,'\0', //id >+ name,'\0', //name >+ help,'\0', //help >+ suffix,'\0', //suffix >+ counter,'\0')) >+ { >+ datLen *=2; >+ >+ treedat[treeindex] = realloc(treedat[treeindex],sizeof(char) * datLen); >+ } >+ >+ treeindex++; >+ >+ //extend tree length if necessary >+ if (treeindex == treelen) { >+ treelen += 20; >+ treedat = realloc(treedat,sizeof(char*) * treelen); >+ } >+ >+ *treedatp = treedat; >+ *treelenp = treelen; >+ *treeindexp = treeindex; >+} >+ >+char* DC_CollectionGetAgentName() >+{ >+ logToFile("Sending agent name from the collection DLL - %s\n",agent_type); >+ return agent_type; >+} >+ >+char** DC_CollectionGetTree( int* numstrings) >+{ >+ char* REG_HOST; >+ XINT64 getGlobalAgain; >+ PPERF_DATA_BLOCK PerfData; >+ >+ getGlobalAgain = tableGet(hasht_variables,REGET_CHILDREN); >+ >+ REG_HOST = getRemoteHost(); >+ >+ logToFile("%sCollecting from host %s\n",PREFIX,REG_HOST); >+ >+ PerfData = getPerfData(REG_HOST, FALSE, NULL,getGlobalAgain); >+ if (PerfData != NULL) >+ { >+ PPERF_OBJECT_TYPE PerfObj; >+ PPERF_INSTANCE_DEFINITION PerfInst; >+ PPERF_COUNTER_DEFINITION PerfCntr; >+ >+ HashTable* instancecount = tableCreate(); >+ >+ int treelen = 10; >+ int treeindex = 0; >+ char** treedat = malloc(sizeof(char*) * treelen); >+ >+ DWORD i, j, k; >+ >+ int objLen = sizeof(char) * 128; >+ char* objID = malloc(objLen); >+ >+ int instLen = sizeof(char) * 128; >+ char* instID = malloc(instLen); >+ >+ int cntrLen = sizeof(char) * 128; >+ char* cntrID = malloc(cntrLen); >+ >+ int instnLen = sizeof(char) * 128; >+ char* instName = malloc(instnLen); >+ >+ int instkLen = sizeof(char) * 128; >+ char* instKey = malloc(instkLen); >+ int count; >+ >+ //get the name and help arrays >+ if(GetNameStrings(REG_HOST)==0) >+ { >+ logToFile("%sError getting performance data from the registry...",PREFIX); >+ >+ /* RKD: Before we return we need to free the perfData object we recieved from the kernel */ >+ free(PerfData); >+ >+ return 0; >+ } >+ >+ //iterate through everything >+ //logToFile("Object Count is %lu\n",PerfData->NumObjectTypes); >+ PerfObj = FirstObject( PerfData ); >+ >+ for( i=0; i < PerfData->NumObjectTypes; i++ ) >+ { >+ if (isVista) >+ { >+ // Out of bounds check >+ if (PerfObj->ObjectNameTitleIndex > lpNamesArraySize) >+ { >+ PerfObj = NextObject( PerfObj ); >+ continue; >+ } >+ } >+ >+ // >+ // Get the object ID >+ // >+ while (objLen <= getObjectID(PerfObj,objID,objLen)) >+ { >+ objLen *=2; >+ objID = realloc(objID,objLen); >+ } >+ >+ // >+ // Unseen object - trace its data >+ // >+ addToTree(&treedat,&treelen,&treeindex, >+ "", //pid >+ objID, //id >+ lpNamesArray[PerfObj->ObjectNameTitleIndex], //name >+ lpHelpArray[PerfObj->ObjectHelpTitleIndex], //help / desc >+ ""); //suffix >+ >+ if (PerfObj->NumInstances == PERF_NO_INSTANCES) >+ { >+ // just check its counters >+ PerfCntr = FirstCounter(PerfObj); >+ >+ for ( j=0; j < PerfObj->NumCounters; j++ ) >+ { >+ char *t1, *t2; >+ // >+ // Get the counter ID >+ // >+ while (cntrLen <= getObjectCntrID(PerfObj,PerfCntr,cntrID,cntrLen)) >+ { >+ cntrLen *= 2; >+ cntrID = realloc(cntrID,cntrLen); >+ } >+ >+ // >+ // Unseen counter - trace its data >+ // >+ >+ t1 = lpNamesArray[PerfCntr->CounterNameTitleIndex]; >+ t2 = lpHelpArray[PerfCntr->CounterHelpTitleIndex]; >+ >+ if (t1 == NULL) >+ { >+ logToFile("%sSkipped Counter #%d\n",PREFIX,PerfCntr->CounterNameTitleIndex); >+ logToFile("%s\n",t2); >+ continue; >+ } >+ else if (t1[0] == '\0') >+ { >+ logToFile("%sSkipped Counter #%d\n",PREFIX,PerfCntr->CounterNameTitleIndex); >+ logToFile("%s\n",t2); >+ continue; >+ } >+ >+ addToTree(&treedat,&treelen,&treeindex, >+ objID, //pid >+ cntrID, //id >+ lpNamesArray[PerfCntr->CounterNameTitleIndex], //name >+ lpHelpArray[PerfCntr->CounterHelpTitleIndex], //help / desc >+ ""); //suffix >+ >+ PerfCntr = NextCounter(PerfCntr); >+ } >+ } >+ else >+ { >+ //check its instances and their counters >+ >+ tableClear(instancecount); >+ >+ PerfInst = FirstInstance( PerfObj ); >+ >+ for ( j=0; j < ((DWORD)(PerfObj->NumInstances)); j++) >+ { >+ >+ while (instkLen <= getInstanceKey(PerfData,PerfInst,instKey,instkLen)) >+ { >+ instkLen *= 2; >+ instKey = realloc(instKey,instkLen); >+ } >+ >+ count = (int)tableGet(instancecount,instKey); >+ while (instnLen <= getInstanceName(PerfData,instKey,count,instName,instnLen)) >+ { >+ instnLen *= 2; >+ instName = realloc(instName,instnLen); >+ } >+ tablePut(instancecount,instKey,count+1); >+ >+ // >+ // Get the instance ID >+ // >+ while(instLen <= getInstanceID(PerfData,PerfObj,instName,instID,instLen,idhasht,TRUE)) >+ { >+ instLen *= 2; >+ instID = realloc(instID,instLen); >+ } >+ >+ // >+ // Unseen instance - trace its data >+ // >+ >+ addToTree(&treedat,&treelen,&treeindex, >+ objID, //pid >+ instID, //id >+ instName, //name >+ "", //help / desc >+ ""); //suffix >+ >+ PerfCntr = FirstCounter(PerfObj); >+ >+ for ( k=0; k < PerfObj->NumCounters; k++ ) >+ { >+ char* t1; >+ // >+ // Get the counter ID >+ // >+ while (cntrLen <= getInstanceCntrID(PerfData,PerfObj,instID,PerfCntr,cntrID,cntrLen,idhasht)) >+ { >+ cntrLen *= 2; >+ cntrID = realloc(cntrID,cntrLen); >+ } >+ >+ // >+ // Unseen instance counter - trace its data >+ // >+ >+ t1 = lpNamesArray[PerfCntr->CounterNameTitleIndex]; >+ >+ if (t1 == NULL) >+ { >+ logToFile("%sSkipped Counter #%d\n",PREFIX,PerfCntr->CounterNameTitleIndex); >+ continue; >+ } >+ else if (t1[0] == '\0') >+ { >+ logToFile("%sSkipped Counter #%d\n",PREFIX,PerfCntr->CounterNameTitleIndex); >+ continue; >+ } >+ >+ addToTree(&treedat,&treelen,&treeindex, >+ instID, //pid >+ cntrID, //id >+ lpNamesArray[PerfCntr->CounterNameTitleIndex], //name >+ lpHelpArray[PerfCntr->CounterHelpTitleIndex], //help / desc >+ ""); //suffix >+ >+ >+ PerfCntr = NextCounter(PerfCntr); >+ } >+ PerfInst = NextInstance( PerfInst ); >+ } >+ >+ } >+ >+ PerfObj = NextObject( PerfObj ); >+ } >+ >+ free(PerfData); >+ tableDelete(instancecount); >+ free(objID); >+ free(instID); >+ free(cntrID); >+ free(instName); >+ free(instKey); >+ free( lpNameStrings ); >+ free( lpHelpStrings ); >+ free( (void*)lpNamesArray ); >+ free( (void*)lpHelpArray ); >+ *numstrings = treeindex; >+ return treedat; >+ } >+ else >+ { >+ *numstrings = 0; >+ return NULL; >+ } >+} >+ >+ >Index: src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsw >=================================================================== >RCS file: src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsw >diff -N src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsw >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsw 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,29 @@ >+Microsoft Developer Studio Workspace File, Format Version 6.00 >+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! >+ >+############################################################################### >+ >+Project: "HCLauncher"=.\HCLauncher.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Global: >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<3> >+{{{ >+}}} >+ >+############################################################################### >+ >Index: src-native-new/src/agents/RABindings/WinBuild/RABindings.dsw >=================================================================== >RCS file: src-native-new/src/agents/RABindings/WinBuild/RABindings.dsw >diff -N src-native-new/src/agents/RABindings/WinBuild/RABindings.dsw >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/WinBuild/RABindings.dsw 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,29 @@ >+Microsoft Developer Studio Workspace File, Format Version 6.00 >+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! >+ >+############################################################################### >+ >+Project: "RABindings"=".\RABindings.dsp" - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Global: >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<3> >+{{{ >+}}} >+ >+############################################################################### >+ >Index: src-native-new/src/agents/native/java_profiler/stack.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/stack.h >diff -N src-native-new/src/agents/native/java_profiler/stack.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/stack.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: stack.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __STACK_H__ >+#define __STACK_H__ 1 >+ >+ >+#include "segmentedValue.h" >+ >+ >+#endif >Index: src-native-new/src/agents/perfmon/resutils/system.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/system.h >diff -N src-native-new/src/agents/perfmon/resutils/system.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/system.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,472 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: system.h,v 1.5 2006/05/23 16:21:24 gchristelis Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+/*********************************************************************** >+ * >+ * File: system.h >+ * Overview: system abstraction header file >+ * >+ ***********************************************************************/ >+ >+#ifndef __XSYSTEM_H__ >+#define __XSYSTEM_H__ >+ >+#include <stdio.h> >+#include <stdlib.h> >+#include <stdarg.h> >+#include <memory.h> >+#include <string.h> >+#include <limits.h> >+#include <float.h> >+ >+#ifdef WIN32 >+ #define XSNPrintf _snprintf >+#else >+ #define XSNPrintf snprintf >+#endif >+ >+#ifdef _DEBUG >+ >+ #define _CRTDBG_MAP_ALLOC // include Microsoft memory leak detection procedures >+ #define _INC_MALLOC // exclude standard memory alloc procedures >+ >+ #include <crtdbg.h> >+#endif >+ >+#ifdef _DEBUG >+#ifndef DEBUG >+#define DEBUG >+#endif >+#endif >+ >+#ifdef WIN32 >+//#include <winsock2.h> /* Bug 134924 */ >+#include <windows.h> >+#include <winbase.h> >+#include <process.h> >+#include <signal.h> >+#endif >+ >+#if defined(SOLARIS) || defined(LINUX) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+#include <unistd.h> >+#include <sys/types.h> >+#include <sys/wait.h> >+#include <sys/socket.h> >+#include <sys/timeb.h> >+#include <pthread.h> >+#include <netdb.h> >+#include <netinet/in.h> >+#include <pwd.h> >+#include <signal.h> >+#include <time.h> >+#include <sys/time.h> >+#include <dlfcn.h> >+#include <errno.h> >+#include <fcntl.h> >+#include <syslog.h> >+ >+#ifdef AIX >+#include <sys/ldr.h> >+#endif >+ >+#endif >+ >+#ifdef _DEBUG >+ >+ #define _CRTDBG_MAP_ALLOC // include Microsoft memory leak detection procedures >+ #define _INC_MALLOC // exclude standard memory alloc procedures >+ >+ #include <crtdbg.h> >+#endif >+/** >+static FILE* ALOG = NULL; >+#define malloc(s) malloc(s);if(ALOG==NULL){ALOG=fopen("C:\\ALLOC_LOG.txt","w");}fprintf(ALOG,"ALLOC %s,%d %d bytes\n",__FILE__, __LINE__,s) >+#define realloc(o,s) realloc(o,s);if(ALOG==NULL){ALOG=fopen("C:\\ALLOC_LOG.txt","w");}fprintf(ALOG,"REALLOC %s,%d %d bytes\n",__FILE__, __LINE__,s) >+**/ >+ >+/*---------------------------------------- >+ * Usefuls section >+ *----------------------------------------*/ >+ >+#ifndef TRUE >+#define TRUE (1) >+#endif >+#ifndef FALSE >+#define FALSE (0) >+#endif >+#ifndef NONE >+#define NONE (-1) >+#endif >+#ifndef BOOL >+#define BOOL int >+#endif >+ >+#define SUCCESS (FALSE) >+#define FAILURE (NONE) >+ >+/*---------------------------------------- >+ * Limits section >+ *----------------------------------------*/ >+ >+#define XFILE_NAME_LIMIT (1023) >+#define XFILE_NAME_ALLOC ((XFILE_NAME_LIMIT) + 1) >+ >+#define XARGUMENT_LIMIT (511) >+#define XARGUMENT_ALLOC ((XARGUMENT_LIMIT) + 1) >+ >+#define XCOMMAND_LIMIT (1023) >+#define XCOMMAND_ALLOC ((XCOMMAND_LIMIT) + 1) >+ >+#define XHOST_NAME_LIMIT (255) >+#define XHOST_NAME_ALLOC ((XHOST_NAME_LIMIT) + 1) >+ >+#define XPORT_NAME_LIMIT (7) >+#define XPORT_NAME_ALLOC ((XPORT_NAME_LIMIT) + 1) >+ >+#define XKIND_NAME_LIMIT (7) >+#define XKIND_NAME_ALLOC ((XKIND_NAME_LIMIT) + 1) >+ >+#define XUSER_NAME_LIMIT (31) >+#define XUSER_NAME_ALLOC ((XUSER_NAME_LIMIT) + 1) >+ >+#define XPASS_WORD_LIMIT (31) >+#define XPASS_WORD_ALLOC ((XPASS_WORD_LIMIT) + 1) >+ >+#define XSTRING_LIMIT (2047) >+#define XSTRING_ALLOC ((XSTRING_LIMIT) + 1) >+ >+/*---------------------------------------- >+ * Datatypes section >+ *----------------------------------------*/ >+ >+typedef signed char XINT8; >+typedef unsigned char XUINT8; >+typedef unsigned short XUINT16; >+typedef signed short XINT16; >+typedef unsigned int XUINT32; >+typedef signed int XINT32; >+#ifdef WIN32 >+typedef ULONGLONG XUINT64; >+typedef LONGLONG XINT64; >+#else >+typedef unsigned long long XUINT64; >+typedef signed long long XINT64; >+#endif >+typedef float XFLOAT; >+typedef double XDOUBLE; >+ >+typedef XINT8 XBYTE; /* alias for INT8 */ >+typedef XINT16 XSHORT; /* alias for INT16 */ >+typedef XINT32 XINT; /* alias for INT16 */ >+typedef XINT64 XLONG; /* alias for INT64 */ >+typedef XUINT32 XBOOL; /* alias for UINT32 */ >+ >+#define XBYTE_MIN ((XBYTE)(SCHAR_MIN)) >+#define XBYTE_MAX ((XBYTE)(SCHAR_MAX)) >+ >+#define XSHORT_MIN ((XSHORT)(SHRT_MIN)) >+#define XSHORT_MAX ((XSHORT)(SHRT_MAX)) >+ >+#define XINT_MIN ((XINT)(INT_MIN)) >+#define XINT_MAX ((XINT)(INT_MAX)) >+ >+#ifdef WIN32 >+#define XLONG_MIN ((XLONG)(0X8000000000000000I64)) >+#define XLONG_MAX ((XLONG)(0X7FFFFFFFFFFFFFFFI64)) >+#else >+#define XLONG_MIN ((XLONG)(LLONG_MIN)) >+#define XLONG_MAX ((XLONG)(LLONG_MAX)) >+#endif >+ >+#define XFLOAT_MIN (FLT_MIN) >+#define XFLOAT_MAX (FLT_MAX) >+ >+#define XDOUBLE_MIN (DBL_MIN) >+#define XDOUBLE_MAX (DBL_MAX) >+ >+#define XDT_ENDIAN_LITTLE (0) >+#define XDT_ENDIAN_BIG (1) >+ >+#define XDT_FLOATING_IEEE (0) >+#define XDT_FLOATING_VAX (1) >+#define XDT_FLOATING_CRAY (2) >+#define XDT_FLOATING_IBM (3) >+ >+#define XDT_CHARACTER_ASCII (0) >+#define XDT_CHARACTER_EBCDIC (1) >+ >+#define XDT_NO_MEMORY_ALIGNMENT (0) >+#define XDT_SPECIAL_MEMORY_ALIGNMENT (1) >+ >+#ifdef WIN32 >+#define XDT_ENDIAN_LOCAL (XDT_ENDIAN_LITTLE) >+#define XDT_MEMORY_ALIGNMENT (XDT_NO_MEMORY_ALIGNMENT) >+#endif >+#ifdef LINUX >+#define XDT_ENDIAN_LOCAL (XDT_ENDIAN_LITTLE) >+#define XDT_MEMORY_ALIGNMENT (XDT_NO_MEMORY_ALIGNMENT) >+#endif >+#ifdef LINUX_S390 >+#define XDT_ENDIAN_LOCAL (XDT_ENDIAN_BIG) >+#define XDT_MEMORY_ALIGNMENT (XDT_NO_MEMORY_ALIGNMENT) >+#endif >+#ifdef SOLARIS_I386 >+#define XDT_ENDIAN_LOCAL (XDT_ENDIAN_LITTLE) >+#define XDT_MEMORY_ALIGNMENT (XDT_SPECIAL_MEMORY_ALIGNMENT) >+#define XDT_ALIGNMENT_16 (2) >+#define XDT_ALIGNMENT_32 (4) >+#define XDT_ALIGNMENT_64 (8) >+#endif >+#ifdef SOLARIS >+#define XDT_ENDIAN_LOCAL (XDT_ENDIAN_BIG) >+#define XDT_MEMORY_ALIGNMENT (XDT_SPECIAL_MEMORY_ALIGNMENT) >+#define XDT_ALIGNMENT_16 (2) >+#define XDT_ALIGNMENT_32 (4) >+#define XDT_ALIGNMENT_64 (8) >+#endif >+#ifdef AIX >+#define XDT_ENDIAN_LOCAL (XDT_ENDIAN_BIG) >+#define XDT_MEMORY_ALIGNMENT (XDT_NO_MEMORY_ALIGNMENT) >+#define PTHREAD_INIT_NEEDED >+#define XDT_THREAD_SAFE_MALLOC >+#endif >+#if defined(USS) || defined(HPUX) >+#error Byte endianness not defined for this platform, please define in system.h >+#endif >+ >+#define XDT_FLOATING_LOCAL (XDT_FLOATING_IEEE) >+#define XDT_CHARACTER_LOCAL (XDT_CHARACTER_ASCII) >+ >+#ifdef XDT_ENDIAN_LOCAL >+#if (XDT_ENDIAN_LOCAL != XDT_ENDIAN_LITTLE) >+#define XDT_REVERSE_BYTE_ORDER >+#endif >+#endif >+ >+#ifdef XDT_FLOATING_LOCAL >+#if (XDT_FLOATING_LOCAL != XDT_FLOATING_IEEE) >+#error "UNSUPPORTED FLOATING FORMAT (NOT IEEE)" >+#endif >+#endif >+ >+#if (XDT_CHARACTER_LOCAL != XDT_CHARACTER_ASCII) >+#error "UNSUPPORTED CHARACTER FORMAT (NOT ASCII)" >+#endif >+ >+ >+/*---------------------------------------- >+ * BEGIN ALL FUNCTION CALL PROTOTYPES >+ * WE DO EXTERN "C" ROUND ALL FUNCTIONS >+ *----------------------------------------*/ >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+extern void XDTByteToNative(void *data); >+extern void XDTShortToNative(void *data); >+extern void XDTIntToNative(void *data); >+extern void XDTLongToNative(void *data); >+extern void XDTFloatToNative(void *data); >+extern void XDTDoubleToNative(void *data); >+extern void XDTStringToNative(void *data); >+ >+extern void XDTByteToNeutral(void *data); >+extern void XDTShortToNeutral(void *data); >+extern void XDTIntToNeutral(void *data); >+extern void XDTLongToNeutral(void *data); >+extern void XDTFloatToNeutral(void *data); >+extern void XDTDoubleToNeutral(void *data); >+extern void XDTStringToNeutral(void *data); >+ >+extern XSHORT XDTShortToAligned(XSHORT*, void* data); >+extern XINT XDTIntToAligned(XINT*, void* data); >+extern XFLOAT XDTFloatToAligned(XFLOAT*, void* data); >+extern XLONG XDTLongToAligned(XLONG*, void* data); >+extern XDOUBLE XDTDoubleToAligned(XDOUBLE*, void* data); >+ >+/*---------------------------------------- >+ * System section >+ *----------------------------------------*/ >+ >+#define XSYSTEM_ERROR ((0XFF000000) + (0XF00000)) >+ >+#ifdef WIN32 >+#define XPATH_SEPARATOR "\\" >+#define XPATH_SEPARATOR_CHAR '\\' >+#define XDISK_SEPARATOR ":" >+#define XLINE_SEPARATOR "\r\n" >+#define XLIBRARY_PREFIX "" >+#define XLIBRARY_EXTENSION "dll" >+#define XLONG_FMT "I64" >+#define XTHREADSPERPROCESS (128) >+ >+#define strcasecmp stricmp >+#define atoll atoi64 >+ >+#endif >+ >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+#define XPATH_SEPARATOR "/" >+#define XPATH_SEPARATOR_CHAR '/' >+#define XDISK_SEPARATOR "" >+#define XLINE_SEPARATOR "\n" >+#define XLIBRARY_PREFIX "lib" >+#define XLIBRARY_EXTENSION "so" >+#define XLONG_FMT "ll" >+#define XTHREADSPERPROCESS (128) >+ >+#endif >+ >+ >+/*---------------------------------------- >+ * Clock section >+ *----------------------------------------*/ >+ >+#define XCLOCK_ERROR ((XSYSTEM_ERROR) + (0X20000)) >+#define XCLOCK_ERROR_UNKNOWN ((XCLOCK_ERROR) + (0X00000)) >+ >+#define XCLOCK_PRECISION (10) >+ >+typedef struct >+{ >+ XINT64 initial; >+} XClock; >+ >+extern int XClockMillis(XINT64 *d); >+extern int XClockCreate(XClock *clock); >+extern int XClockDelete(XClock *clock); >+extern int XClockAdjust(XClock *clock, XINT64 adj); >+extern int XClockRead(XClock *clock, XINT64 *ticks); >+extern int XClockWait(XClock *clock, XINT64 until); >+ >+/*---------------------------------------- >+ * Mutex section >+ *----------------------------------------*/ >+ >+#define XMUTEX_ERROR ((XSYSTEM_ERROR) + (0X40000)) >+#define XMUTEX_ERROR_CREATE ((XMUTEX_ERROR) + (0X00000)) >+#define XMUTEX_ERROR_CLAIM ((XMUTEX_ERROR) + (0X00001)) >+#define XMUTEX_ERROR_RELEASE ((XMUTEX_ERROR) + (0X00002)) >+#define XMUTEX_ERROR_DELETE ((XMUTEX_ERROR) + (0X00003)) >+#define XMUTEX_ERROR_UNKNOWN ((XMUTEX_ERROR) + (0X00004)) >+ >+typedef struct >+{ >+#ifdef WIN32 >+#undef MUTEX_HANDLE >+#ifdef MUTEX_HANDLE >+ HANDLE handle; >+#else >+ CRITICAL_SECTION cs; >+#endif >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ pthread_mutex_t mutex; >+#endif >+} XMutex; >+ >+extern int XMutexCreate(XMutex *mutex); >+extern int XMutexClaim(XMutex *mutex); >+extern int XMutexRelease(XMutex *mutex); >+extern int XMutexDelete(XMutex *mutex); >+ >+/*---------------------------------------- >+ * Thread section >+ *----------------------------------------*/ >+ >+#define XTHREAD_ERROR ((XSYSTEM_ERROR) + (0X50000)) >+#define XTHREAD_ERROR_CREATE ((XTHREAD_ERROR) + (0X00000)) >+#define XTHREAD_ERROR_EXIT ((XTHREAD_ERROR) + (0X00001)) >+#define XTHREAD_ERROR_WAIT ((XTHREAD_ERROR) + (0X00002)) >+#define XTHREAD_ERROR_ABORT ((XTHREAD_ERROR) + (0X00003)) >+#define XTHREAD_ERROR_UNKNOWN ((XTHREAD_ERROR) + (0X00004)) >+ >+#define XTHREAD_STACKSZ (4 * 1024) >+ >+typedef void (XThreadFunction)(void *); >+ >+typedef struct >+{ >+#ifdef WIN32 >+ HANDLE handle; >+ DWORD id; >+ XThreadFunction *function; >+ void *argument; >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ XThreadFunction *function; >+ void *argument; >+ pthread_t pthread; >+#endif >+} XThread; >+ >+extern int XThreadStartup(); >+extern int XThreadMakeAbortable(); >+extern int XThreadCreate(XThreadFunction *function, void *argument, XThread *thread); >+extern void XThreadExit(XUINT32 code); >+extern int XThreadWait(XThread *thread, XUINT32 *code); >+extern int XThreadAbort(XThread *thread); >+extern int XThreadGetIdentifier(XINT32 *tid); >+ >+/*---------------------------------------- >+ * Library section >+ *----------------------------------------*/ >+ >+#define XLIBRARY_ERROR ((XSYSTEM_ERROR) + (0X60000)) >+#define XLIBRARY_ERROR_CREATE ((XLIBRARY_ERROR) + (0X00000)) >+#define XLIBRARY_ERROR_SYMBOL ((XLIBRARY_ERROR) + (0X00001)) >+#define XLIBRARY_ERROR_DELETE ((XLIBRARY_ERROR) + (0X00002)) >+#define XLIBRARY_ERROR_UNKNOWN ((XLIBRARY_ERROR) + (0X00003)) >+ >+typedef struct >+{ >+#ifdef WIN32 >+ HINSTANCE instance; >+#endif >+#if defined(LINUX) || defined(SOLARIS) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ void *handle; >+#endif >+} XLibrary; >+ >+extern int XLibraryCreate(XLibrary *library, char *filename); >+extern int XLibrarySymbol(XLibrary *library, char *symbol, void **address); >+extern int XLibraryDelete(XLibrary *library); >+ >+/*---------------------------------------- >+ * Random section >+ *----------------------------------------*/ >+ >+#define XRANDOM_ERROR ((XSYSTEM_ERROR) + (0XA0000)) >+#define XRANDOM_ERROR_UNKNOWN ((XENVIRONMENT_ERROR) + (0X00001)) >+ >+extern void XRandomSeed(XINT s); >+extern XDOUBLE XRandomUniform(void); >+extern XDOUBLE XRandomNormal(void); >+ >+extern int StrEq(char* a, char* b); >+ >+/*---------------------------------------- >+ * END ALL FUNCTION CALL PROTOTYPES >+ * WE DO EXTERN "C" ROUND ALL FUNCTIONS >+ *----------------------------------------*/ >+ >+#ifdef __cplusplus >+} >+#endif >+ >+ >+#endif >+/*********************************************************************** >+ * EOF >+ ***********************************************************************/ >+ >Index: src-native-new/src/agents/perfmon/resutils/streq.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/streq.c >diff -N src-native-new/src/agents/perfmon/resutils/streq.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/streq.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,38 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: streq.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+#include "system.h" >+ >+int StrEq(char* a, char* b) { >+ int index = 0; >+ char ch_a, ch_b; >+ >+ if (a == NULL) { >+ return -1; >+ } else if (b == NULL) { >+ return -1; >+ } >+ >+ while (0==0) { >+ ch_a = a[index]; >+ ch_b = b[index]; >+ >+ if (ch_a != ch_b) return index+1; >+ >+ //could get rid of the OR here? >+ if (ch_a == '\0' || ch_b == '\0') { >+ return 0; >+ } >+ >+ index++; >+ } >+} >Index: src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsp >=================================================================== >RCS file: src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsp >diff -N src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/WinBuild/HCLauncher.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,161 @@ >+# Microsoft Developer Studio Project File - Name="HCLaunch" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=HCLaunch - Win32 Debug >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "HCLauncher.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "HCLauncher.mak" CFG="HCLaunch - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "HCLaunch - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "HCLaunch - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "HCLaunch - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "HCLaunch___Win32_Release" >+# PROP BASE Intermediate_Dir "HCLaunch___Win32_Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\lib" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\transport\RACommon" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /YX /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /fo"Release/hclaunch.res" /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\hclaunch.dll" >+# SUBTRACT LINK32 /nodefaultlib >+ >+!ELSEIF "$(CFG)" == "HCLaunch - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 1 >+# PROP BASE Output_Dir "HCLaunch___Win32_Debug" >+# PROP BASE Intermediate_Dir "HCLaunch___Win32_Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 1 >+# PROP Output_Dir "..\..\..\lib" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\transport\RACommon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /YX /FD /GZ /c >+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "_DEBUG" >+# ADD RSC /l 0x409 /fo"Debug/hclaunch.res" /d "_DEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\hclaunch.dll" /pdbtype:sept >+# SUBTRACT LINK32 /nodefaultlib >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "HCLaunch - Win32 Release" >+# Name "HCLaunch - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\hclaunch.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\..\transport\RACommon\java.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\launcher_common.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\launcher_md.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\launcher_os400.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\..\transport\RACommon\RAComm.c >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\hclaunch.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\launcher_common.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\launcher_error.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\launcher_md.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\launcher_os400.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\..\transport\RACommon\RAError.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\..\transport\RACommon\resource.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.cpp >=================================================================== >RCS file: src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.cpp >diff -N src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.cpp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.cpp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,822 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: PerfmonAgent.cpp,v 1.12 2006/05/23 16:21:26 gchristelis Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+#include "PerfmonAgent.h" >+ >+#ifdef WIN32 >+//#include <winsock2.h> /* Bug 134924 */ >+#include <windows.h> >+#endif >+ >+#include <stdio.h> >+#include <stdlib.h> >+ >+#include "hashtable.h" >+#include "system.h" >+#include "DataTransferInterface.h" >+#include "DataCollectionInterface.h" >+ >+ >+int PRINT_XML = FALSE; >+int VERBOSE = FALSE; >+int LOG_TO_FILE = FALSE; >+ >+int BATCH_XML_MESSAGES = TRUE; >+ >+HashTable* hasht_request; >+HashTable* hasht_filters; >+HashTable* hasht_variables; >+HashTable* hasht_tree; >+ >+// Message Buffer Info >+int buf_ptr = 0; >+int buf_len = 204800; >+char* buf; //20k buffer >+ >+char digits[] = { >+'0' , '1' , '2' , '3' , '4' , '5' , >+'6' , '7' , '8' , '9' , 'a' , 'b' , >+'c' , 'd' , 'e' , 'f' , 'g' , 'h' , >+'i' , 'j' , 'k' , 'l' , 'm' , 'n' , >+'o' , 'p' , 'q' , 'r' , 's' , 't' , >+'u' , 'v' , 'w' , 'x' , 'y' , 'z' >+}; >+ >+static FILE* f = NULL; >+ >+static char filename[] = "PerfmonAgent.log"; >+ >+void logToFile(const char*, ...); >+ >+void logToFile(const char* temp, ...) >+{ >+ if (LOG_TO_FILE) >+ { >+ if (f == NULL) >+ f = fopen(filename, "w"); >+ va_list ap; >+ va_start (ap, temp); >+ vfprintf (f, temp, ap); >+// printf(temp,ap); >+ va_end (ap); >+ fflush(f); >+ } >+} >+ >+void longToString(XINT64 i, char* str) >+{ >+ int radix = 10; >+ char buf[65]; >+ >+ int charPos = 64; >+ int negative = (i < 0); >+ >+ if (!negative) { >+ i = -i; >+ } >+ >+ while (i <= -radix) >+ { >+ buf[charPos--] = digits[(int)(-(i % radix))]; >+ i = i / radix; >+ } >+ buf[charPos] = digits[(int)(-i)]; >+ >+ if (negative) { >+ buf[--charPos] = '-'; >+ } >+ >+ memcpy(str,&(buf[charPos]),(65 - charPos)); >+} >+ >+int increaseBufferSize(char** buf, int* buflen) { >+ //double the size of the buffer >+ int newlen = *buflen * 2; >+ char* newbuf = (char*)malloc(newlen); >+ >+ memcpy(newbuf,*buf,*buflen); >+ free(*buf); >+ >+ *buf = newbuf; >+ *buflen = newlen; >+ >+ return newlen; >+} >+ >+void clearData(char** array, int count) >+{ >+ for (int i =0 ;i<count;i++) { >+ free(array[i]); >+ } >+ free(array); >+} >+ >+void fetchTree(LPGETTREE getTree, LPCOMSENDMESSAGE comSendMessage) >+{ >+ char** treedata; >+ int numstrings=0; >+ int i=0, ret=0; >+ int buf_ptr = 0; >+ int total_dat; >+ >+ ////////////////////////////////////////////// >+ // TREE BUILDING - descriptors // >+ ////////////////////////////////////////////// >+ // >+ // Get the names of all the counters, treedata contains the names, numstrings the number... >+ // >+ >+ logToFile("Retrieving tree data..\n"); >+ treedata = getTree(&numstrings); >+ logToFile("Parsing tree data.. Got %d strings \n", numstrings); >+ // >+ // go through each of the strings and create XML >+ // >+ for (i = 0; i < numstrings; i++) >+ { >+ char* dat[6]; >+ char* currdat = treedata[i]; >+ >+ int keyindex = 1; >+ int datindex = 0; >+ >+ logToFile("Parsing %d of %d\n", i, numstrings); >+ >+ //dat[0] = pid, dat[1] = id, dat[2] = name, dat[3] = help, dat[4] = suffix (not used) >+ //check to see if this is the child of a requested parent >+ if ((tableGet(hasht_variables,REGET_CHILDREN) && currdat[0] == '\0') || (tableGet(hasht_tree,currdat) == 1) ) >+ { >+ logToFile("This has been requested"); >+ // check if buffer size is > 5 or 10k here and send it back as >+ // one message if it is - rather than sending a 4000k message >+ if (BATCH_XML_MESSAGES) >+ if (buf_ptr > 10240) >+ { >+ ret = comSendMessage(buf, 0, buf_ptr); >+ total_dat += buf_ptr; >+ buf_ptr = 0; >+ } >+ >+ // >+ // Parse out all the strings for this counter >+ // >+ dat[0] = currdat; >+ >+ while (TRUE) >+ { >+ //filter out non-XML characters >+ if (currdat[datindex] == '\"' || currdat[datindex] == '\'') >+ currdat[datindex] = '_'; >+ if (currdat[datindex] < 0) >+ currdat[datindex] = ' '; >+ if (currdat[datindex] == '\0') >+ { >+ if (keyindex == 6) >+ break; //this means we check all the strings >+ dat[keyindex++] = &currdat[datindex+1]; >+ } >+ datindex++; >+ } >+ >+ if (tableGet(hasht_request,dat[1]) == 0) >+ { >+ tablePut(hasht_request,dat[1],1); >+ >+ logToFile("%s, %s, %s, (help), %s\n",dat[0],dat[1],dat[2],dat[4]); >+ >+ while (TRUE) >+ { >+ if (dat[0][0] == '\0') >+ { >+ //no help = no description >+ if (dat[3][0] == '\0') >+ { >+ //not sending back help strings drops data from 3.7M to 1.2M >+ //new IDs should drop it down to around 800k with no help strings >+ if (dat[5][0] == '0') >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<Descriptor id=\"%s\" name=\"%s\" />\n",dat[1],dat[2],dat[3]); >+ else >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<CounterDescriptor id=\"%s\" name=\"%s\" />\n",dat[1],dat[2],dat[3]); >+ } >+ else >+ { >+ if (dat[5][0] == '0') >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<Descriptor id=\"%s\" name=\"%s\" >\n<description>%s</description>\n</Descriptor>\n",dat[1],dat[2],dat[3]); >+ else >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<CounterDescriptor id=\"%s\" name=\"%s\" >\n<description>%s</description>\n</CounterDescriptor>\n",dat[1],dat[2],dat[3]); >+ } >+ >+ } >+ else >+ { >+ //no help = no description >+ if (dat[3][0] == '\0') >+ { >+ //not sending back help strings drops data from 3.7M to 1.2M >+ //new IDs should drop it down to around 800k with no help strings >+ if (dat[5][0] == '0') >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<Descriptor parent=\"%s\" id=\"%s\" name=\"%s\" />\n",dat[0],dat[1],dat[2],dat[3]); >+ else >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<CounterDescriptor parent=\"%s\" id=\"%s\" name=\"%s\" />\n",dat[0],dat[1],dat[2],dat[3]); >+ } >+ else >+ { >+ if (dat[5][0] == '0') >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<Descriptor parent=\"%s\" id=\"%s\" name=\"%s\" >\n<description>%s</description>\n</Descriptor>\n",dat[0],dat[1],dat[2],dat[3]); >+ else >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<CounterDescriptor parent=\"%s\" id=\"%s\" name=\"%s\" >\n<description>%s</description>\n</CounterDescriptor>\n",dat[0],dat[1],dat[2],dat[3]); >+ } >+ } >+ >+ if (ret < 0) >+ increaseBufferSize(&buf,&buf_len); >+ else >+ { >+ buf_ptr += ret; >+ break; >+ } >+ >+ } >+ >+ >+ if (!BATCH_XML_MESSAGES) >+ { >+ ret = comSendMessage(buf, 0, buf_ptr); >+ total_dat += buf_ptr; >+ buf_ptr = 0; >+ } >+ >+ if (PRINT_XML) logToFile("XML = %s\n\n",buf); >+ } >+ } >+ } >+ >+ tablePut(hasht_variables, REGET_CHILDREN,(XINT64) 0); >+ // >+ // print out how many messages we sent and the total number of bytes we sent >+ // >+ logToFile("%d descriptors, total bytes = %d bytes\n\n",numstrings,total_dat); >+ >+ // >+ // deallocate the strings >+ // >+ clearData(treedata,numstrings); >+ // >+ // Send any remaining buffer data >+ // >+ if (BATCH_XML_MESSAGES) >+ { >+ logToFile("Sending data back to the workbench...\n"); >+ >+ ret = comSendMessage(buf, 0, buf_ptr); >+ >+ total_dat += buf_ptr; >+ buf_ptr = 0; >+ } >+ >+ >+ if (PRINT_XML) >+ logToFile("XML = %s\n\n",buf); >+} >+ >+void setVariables(HashTable* hasht_variables) >+{ >+ //variables hashtable initialisation >+ tablePut(hasht_variables,DC_KEY_MONITORING,DC_VAL_FALSE); >+ tablePut(hasht_variables,DC_KEY_FINISHED,DC_VAL_FALSE); >+ tablePut(hasht_variables,DC_KEY_WAITTIME,(XINT64)1000); >+ tablePut(hasht_variables,DC_KEY_TREE_REQUESTED,DC_VAL_FALSE); >+} >+ >+ >+int manageResources(LPSTARTUP resStartup, LPSHUTDOWN resShutdown, LPGETTREE getTree, LPGETRESULTS getResults, >+ LPCOMSTARTUP comStartup, LPCOMSHUTDOWN comShutdown, LPCOMSENDMESSAGE comSendMessage) >+{ >+ XClock x_clock; >+ int memdiff = 5; >+ char** results; >+ XINT64 ctime; >+ int ret,i; >+ >+ // Time Buffer Info >+ char timebuf[64]; //print time into here >+ XINT64 javatime; >+ int total_dat = 0, numresults=0; >+ >+ hasht_request = tableCreate(); >+ hasht_filters = tableCreate(); >+ hasht_variables = tableCreate(); >+ hasht_tree = tableCreate(); >+ >+ setVariables(hasht_variables); >+ >+ // >+ // Startup the COMM and RES >+ // >+ ret = comStartup( hasht_variables, hasht_filters, hasht_tree ); >+ if (ret != 0) >+ { >+ logToFile("Failed to start up Communications\n"); >+ return -1; >+ } >+ resStartup( hasht_variables, hasht_filters, hasht_tree); >+ >+ // >+ // Set up the XML buffer >+ // >+ logToFile("Allocating buffer\n"); >+ buf = (char*)malloc(sizeof(char) * buf_len); >+ >+ // >+ // Create our x_clock >+ // >+ XClockCreate(&x_clock); >+ XClockRead(&x_clock,&ctime); >+ >+ // >+ //finished when an agent detaches from us >+ // Bug 99153 >+ while (!tableGet(hasht_variables,DC_KEY_FINISHED) && !tableGet(hasht_variables,DC_AGENT_CONTROLLER_STOPPED)) >+ { >+ XINT64 ctime_tmp = 0; >+ XINT64 ctime_max = 0; >+ >+ XINT32 WAIT_TIME = (XINT32)tableGet(hasht_variables,DC_KEY_WAITTIME); >+ XINT32 TREE_REQUESTED = (XINT32)tableGet(hasht_variables,DC_KEY_TREE_REQUESTED); >+ >+ // >+ // Clean up the XML buffer >+ // >+ memset(buf,'\0',buf_len); >+ buf_ptr = 0; >+ >+ ctime_max = ctime + WAIT_TIME; >+ XClockRead(&x_clock,&ctime_tmp); >+ >+ while ((ctime_max - ctime_tmp > 0) && !tableGet(hasht_variables,DC_KEY_FINISHED)) >+ { >+ ctime_tmp += 50; >+ XClockWait(&x_clock,ctime_tmp); >+ >+ WAIT_TIME = (XINT32)tableGet(hasht_variables,DC_KEY_WAITTIME); >+ ctime_max = ctime + WAIT_TIME; >+ >+ // Lets return the tree as soon as we can >+ if (tableGet(hasht_variables, DC_KEY_MONITORING)) >+ { >+ TREE_REQUESTED = (XINT32)tableGet(hasht_variables,DC_KEY_TREE_REQUESTED); >+ if (TREE_REQUESTED) >+ { >+ fetchTree(getTree, comSendMessage); >+ TREE_REQUESTED = FALSE; >+ tablePut(hasht_variables,DC_KEY_TREE_REQUESTED,TREE_REQUESTED); >+ } >+ } >+ } >+ >+ if (tableGet(hasht_variables,DC_KEY_FINISHED)) >+ break; >+ >+ ctime += WAIT_TIME; >+ >+ // >+ // Wait for a bit >+ // >+ XClockWait(&x_clock,ctime); >+ XClockRead(&x_clock,&ctime); >+ >+ if (!tableGet(hasht_variables,DC_KEY_MONITORING)) >+ { >+ logToFile("No agent monitoring yet (freq:%dms)\n",tableGet(hasht_variables,DC_KEY_WAITTIME)); >+ tablePut(hasht_variables, REGET_CHILDREN,(XINT64) 1); >+ TREE_REQUESTED = TRUE; >+ tablePut(hasht_variables,DC_KEY_TREE_REQUESTED,TREE_REQUESTED); >+ >+ // We clear this so that we send back ALL the tree information again... >+ tableClear(hasht_request); >+ >+ continue; >+ } >+ // >+ // Get the current time in java System.currentTimeMillis() format >+ // >+ >+ if (TREE_REQUESTED) >+ { >+ fetchTree(getTree, comSendMessage); >+ TREE_REQUESTED = FALSE; >+ tablePut(hasht_variables,DC_KEY_TREE_REQUESTED,TREE_REQUESTED); >+ } >+ >+ XClockMillis(&javatime); >+ memset(timebuf,'\0',64); >+ longToString(javatime,timebuf); >+ >+ results = getResults(&numresults); >+ logToFile("NUMRESULTS = %d, results=%08X\n",numresults,results); >+ // >+ // go through each of the strings and create and create an XML >+ // >+ for (i = 0; results!=NULL && i < numresults; i++) >+ { >+ >+ char* dat[2]; >+ char* currdat = results[i]; >+ >+ int keyindex = 1; >+ int datindex = 0; >+ >+ // >+ // check if buffer size is > 5 or 10k here and send it back as >+ // one message if it is - rather than sending a 4000k message >+ // >+ >+ if (BATCH_XML_MESSAGES) { >+ if (buf_ptr > 10240) >+ { >+ ret = comSendMessage(buf, 0, buf_ptr); >+ total_dat += buf_ptr; >+ buf_ptr = 0; >+ } >+ >+ if (PRINT_XML) logToFile("XML = %s\n\n",buf); >+ } >+ >+ >+ // >+ // Parse out all the strings for this counter >+ // >+ dat[0] = currdat; >+ while (TRUE) >+ { >+ //filter out non-XML characters >+ if (currdat[datindex] == '\"' || currdat[datindex] == '\'') >+ currdat[datindex] = '_'; >+ if (currdat[datindex] < 0) >+ currdat[datindex] = ' '; >+ if (currdat[datindex] == '\0') >+ { >+ if (keyindex == 2) >+ break; //this means we check all the strings >+ dat[keyindex++] = &currdat[datindex+1]; >+ } >+ datindex++; >+ } >+ >+ //dat[0] = id >+ //dat[1] = value (string) >+ >+ logToFile("--[%s,%s]--\n",dat[0],dat[1]); >+ >+ while (TRUE) >+ { >+ ret = XSNPrintf( &buf[buf_ptr], buf_len-buf_ptr, "<ContiguousObservation memberDescriptor=\"%s\" time=\"%s\" value=\"%s\" />\n",dat[0],timebuf,dat[1]); >+ >+ if (ret < 0) >+ increaseBufferSize(&buf,&buf_len); >+ else >+ { >+ buf_ptr += ret; >+ break; >+ } >+ } >+ >+ if (!BATCH_XML_MESSAGES) >+ { >+ ret = comSendMessage(buf, 0, buf_ptr); >+ total_dat += buf_ptr; >+ buf_ptr = 0; >+ } >+ >+ if (PRINT_XML) >+ logToFile("XML = %s\n\n",buf); >+ } >+ >+ // >+ // Send any remaining buffer data >+ // >+ >+ if (BATCH_XML_MESSAGES) >+ { >+ ret = comSendMessage(buf, 0, buf_ptr); >+ total_dat += buf_ptr; >+ buf_ptr = 0; >+ } >+ >+ if (PRINT_XML) >+ logToFile("XML = %s\n\n",buf); >+ } >+ >+ // >+ // We are finished - shutdown the RES and COM and unload the libraries >+ // >+ resShutdown(); >+ ret = comShutdown(); >+ if (ret != 0) >+ { >+ logToFile("Failed to shut down Communications agent\n"); >+ return -1; >+ } >+ >+ // >+ // Cleanup stuff we allocated >+ // >+ tableDelete(hasht_request); >+ tableDelete(hasht_filters); >+ tableDelete(hasht_variables); >+ tableDelete(hasht_tree); >+ >+ free(buf); >+ return 0; >+} >+ >+void showInfo() >+{ >+ logToFile("PerfmonAgent\n\n"); >+ logToFile("Usage: PerfmonAgent.exe [-v] [Resource DLL] [Communications DLL]\n"); >+ logToFile("Default: PerfmonAgent.exe sysperf.dll rac.dll\n"); >+ logToFile("\n-v\t: Enable verbose output\n"); >+} >+ >+// >+// Load the DLL functions for the resource gatherer and communciator. >+// If successful, pass these functions to the manageresource method. >+// >+int process(char* resDLLname, char* commDLLname) >+{ >+ LPSTARTUP resStartup; >+ LPSHUTDOWN resShutdown; >+ LPGETTREE getTree; >+ LPGETRESULTS getResults; >+ LPGETAGENTNAME getAgentName = NULL; >+ int rt; >+ >+ LPCOMSTARTUP COMStartup; >+ LPCOMSHUTDOWN COMShutdown; >+ LPCOMSENDMESSAGE COMSendMessage; >+ LPCOMSETAGENTNAME COMSetAgentName = NULL; >+ >+#ifdef LINUX >+ const char *error; >+ void *resmodule; >+ void *commodule; >+ >+ // First lets try and open the two libraries >+ logToFile("trying to open resource library %s\n",resDLLname); >+ resmodule = dlopen(resDLLname, RTLD_LAZY); >+ if (!resmodule) >+ { >+ fprintf(stderr, "Couldn't open reslibrary: %s\n",dlerror()); >+ logToFile("Couldn't open reslibrary: %s\n",dlerror()); >+ exit(1); >+ } >+ printf("trying to open communiction library %s\n",commDLLname); >+ >+ commodule = dlopen(commDLLname, RTLD_LAZY); >+ if (!commodule) >+ { >+ dlclose(resmodule); >+ fprintf(stderr, "Couldn't open commlibrary: %s\n",dlerror()); >+ logToFile("Couldn't open commlibrary: %s\n",dlerror()); >+ exit(1); >+ } >+ >+ logToFile("Address %08x\n",commodule); >+ >+ //Okay, we must now try and get all the methods we need! >+ >+ dlerror(); >+ resStartup = (LPSTARTUP) dlsym(resmodule, "DC_CollectionStartup"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_CollectionStartup: %s\n", error); >+ logToFile("Couldn't find DC_CollectionStartup: %s\n", error); >+ exit(1); >+ } >+ dlerror(); >+ resShutdown = (LPSHUTDOWN) dlsym(resmodule, "DC_CollectionShutdown"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_CollectionShutdown: %s\n", error); >+ logToFile("Couldn't find DC_CollectionShutdown: %s\n", error); >+ exit(1); >+ } >+ dlerror(); >+ getTree = (LPGETTREE) dlsym(resmodule, "DC_CollectionGetTree"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_CollectionGetTree: %s\n", error); >+ logToFile("Couldn't find DC_CollectionGetTree: %s\n", error); >+ exit(1); >+ } >+ dlerror(); >+ getResults = (LPGETRESULTS) dlsym(resmodule, "DC_CollectionGetResults"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_CollectionGetResults: %s\n", error); >+ logToFile("Couldn't find DC_CollectionGetResults: %s\n", error); >+ exit(1); >+ } >+ dlerror(); >+ getAgentName = (LPGETAGENTNAME) dlsym(resmodule, "DC_CollectionGetAgentName"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_CollectionGetAgentName: %s\n", error); >+ logToFile("Couldn't find DC_CollectionGetAgentName: %s\n", error); >+ exit(1); >+ } >+ >+ COMStartup = (LPCOMSTARTUP) dlsym(commodule, "DC_TransferStartup"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_TransferStartup: %s\n", error); >+ logToFile("Couldn't find DC_TransferStartup: %s\n", error); >+ exit(1); >+ } >+ >+ COMShutdown = (LPCOMSHUTDOWN) dlsym(commodule, "DC_TransferShutdown"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_TransferShutdown: %s\n", error); >+ logToFile("Couldn't find DC_TransferShutdown: %s\n", error); >+ exit(1); >+ } >+ COMSendMessage = (LPCOMSENDMESSAGE) dlsym(commodule, "DC_SendMessage"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_SendMessage: %s\n", error); >+ logToFile("Couldn't find DC_SendMessage: %s\n", error); >+ exit(1); >+ } >+ >+ COMSetAgentName = (LPCOMSETAGENTNAME) dlsym(commodule, "DC_TransferSetAgentName"); >+ if ((error = dlerror())) >+ { >+ dlclose(resmodule); >+ dlclose(commodule); >+ >+ fprintf(stderr, "Couldn't find DC_SetAgentName: %s\n", error); >+ logToFile("Couldn't find DC_SetAgentName: %s\n", error); >+ exit(1); >+ } >+ >+ // Lets pass on the agentname from the collection dLL to the resource DLL >+ char* agentName = getAgentName(); >+ COMSetAgentName(agentName); >+ >+ // Perform processing >+ rt = manageResources(resStartup, resShutdown, getTree, getResults,COMStartup,COMShutdown,COMSendMessage); >+ >+ /* All done, close things cleanly */ >+ dlclose(resmodule); >+ dlclose(commodule); >+ return 0; >+ >+#else >+ >+ HINSTANCE hResDLL; >+ HINSTANCE hCommDLL; >+ >+ >+ // LOAD THE RESOURCE DLL FUNCTIONS >+ hResDLL = LoadLibrary(resDLLname); >+ if (hResDLL == NULL) >+ { >+ logToFile("Error encountered: %s is not a valid DLL\n",resDLLname); >+ MessageBox(NULL,"Error Loading resourceDLL","Error Loading resourceDLL",MB_OK); >+ return -1; >+ } >+ >+ resStartup = (LPSTARTUP) GetProcAddress(hResDLL, "DC_CollectionStartup"); >+ resShutdown = (LPSHUTDOWN) GetProcAddress(hResDLL, "DC_CollectionShutdown"); >+ getTree = (LPGETTREE) GetProcAddress(hResDLL, "DC_CollectionGetTree"); >+ getResults = (LPGETRESULTS)GetProcAddress(hResDLL, "DC_CollectionGetResults"); >+ getAgentName = (LPGETAGENTNAME) GetProcAddress(hResDLL, "DC_CollectionGetAgentName"); >+ >+ if (!resStartup) >+ logToFile("resStartup\n"); >+ if (!resShutdown) >+ logToFile("resShutdown\n"); >+ if (!getTree) >+ logToFile("getTree\n"); >+ if (!getResults) >+ logToFile("getResults\n"); >+ if (!getAgentName) >+ logToFile("getAgentName\n"); >+ >+ if (!resStartup || !resShutdown || !getTree || !getResults || !getAgentName) >+ { >+ // handle the error >+ FreeLibrary(hResDLL); >+ logToFile("Unable to load function(s) from Resource DLL.\n"); >+ MessageBox(NULL,"Error Loading Functions (RESOURCEDLL)","Error Loading Functions (RESOURCEDLL)",MB_OK); >+ return -1; >+ } >+ >+ // LOAD THE COMM DLL FUNCTIONS >+ hCommDLL = LoadLibrary(commDLLname); >+ if (hCommDLL == NULL) >+ { >+ FreeLibrary(hResDLL); >+ logToFile("Error encountered: %s is not a valid DLL\n",commDLLname); >+ MessageBox(NULL,"Error Loading commDLL","Error Loading commDLL",MB_OK); >+ return -1; >+ } >+ >+ COMStartup = (LPCOMSTARTUP) GetProcAddress(hCommDLL, "DC_TransferStartup"); >+ COMShutdown = (LPCOMSHUTDOWN) GetProcAddress(hCommDLL, "DC_TransferShutdown"); >+ COMSendMessage = (LPCOMSENDMESSAGE) GetProcAddress(hCommDLL, "DC_SendMessage"); >+ COMSetAgentName = (LPCOMSETAGENTNAME) GetProcAddress(hCommDLL, "DC_TransferSetAgentName"); >+ >+ if (!COMStartup || !COMShutdown || !COMSendMessage || !COMSetAgentName) >+ { >+ // handle the error >+ FreeLibrary(hResDLL); >+ FreeLibrary(hCommDLL); >+ logToFile("Unable to load function(s) from Communications DLL.\n"); >+ MessageBox(NULL,"Error Loading Functions (COMDLL)","Error Loading Functions (COMDLL)",MB_OK); >+ return -1; >+ } >+ >+ // Lets pass on the agentname from the collection dLL to the resource DLL >+ char* agentName = getAgentName(); >+ logToFile("PerfmonAgent received agentname of %s\n",agentName); >+ COMSetAgentName(agentName); >+ >+ rt = manageResources(resStartup, resShutdown, getTree, getResults,COMStartup,COMShutdown,COMSendMessage); >+ >+ FreeLibrary(hResDLL); >+ FreeLibrary(hCommDLL); >+ return rt; >+#endif >+} >+ >+// >+// Main Agent Method : Parse the command line arguments and set DLL names >+// >+int main(int argc, char** argv) >+{ >+ char* resDLLname = NULL; >+ char* commDLLname = NULL; >+ >+ for (int i = 1; i < argc; i++) >+ { >+ if (argv[i][0] == '\0') >+ continue; >+ if (strcmp(argv[i],"-v")==0) >+ VERBOSE = TRUE; >+ else if ((strcmp(argv[i],"--help")==0) || (strcmp(argv[i],"/?")==0) || (strcmp(argv[i],"-h")==0)) >+ { >+ showInfo(); >+ return 0; >+ } >+ else if (resDLLname == NULL) >+ { >+ resDLLname = argv[i]; >+ } >+ else if (commDLLname == NULL) >+ { >+ commDLLname = argv[i]; >+ } >+ } >+ if (resDLLname == NULL) resDLLname = DEFAULT_RES; >+ if (commDLLname == NULL) commDLLname = DEFAULT_COM; >+ >+ logToFile("Using Resource DLL \"%s\", Communications DLL \"%s\"\n",resDLLname, commDLLname); >+ return process(resDLLname, commDLLname); >+} >+ >+ >Index: src-native-new/src/agents/java/WinBuild/WinBuild.dsw >=================================================================== >RCS file: src-native-new/src/agents/java/WinBuild/WinBuild.dsw >diff -N src-native-new/src/agents/java/WinBuild/WinBuild.dsw >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/WinBuild/WinBuild.dsw 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,29 @@ >+Microsoft Developer Studio Workspace File, Format Version 6.00 >+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! >+ >+############################################################################### >+ >+Project: "log_agent"=.\log_agent.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Global: >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<3> >+{{{ >+}}} >+ >+############################################################################### >+ >Index: src-native-new/src/agents/native/java_profiler/stack.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/stack.c >diff -N src-native-new/src/agents/native/java_profiler/stack.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/stack.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,401 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: stack.c,v 1.10 2006/05/16 22:09:53 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <assert.h> >+#include "stack.h" >+#include "RADataTransfer.h" >+#include "RAComm.h" >+#include "options.h" >+#include "utility.h" >+#include "JvmpiWriter.h" >+ >+extern void getStackFrameStructureLock(); /* for pre-aggregation. Belongs in a header file */ >+extern void releaseStackFrameStructureLock(); /* for pre-aggregation. Belongs in a header file */ >+ >+static unsigned long _staticThreadIdCount = 0; >+ >+/* Allocates an entry in the symbol table for the object */ >+HashEntry * jvmpiAgent_CreateStack(JNIEnv * env_id) >+{ >+ HashEntry *hashEntry; >+ ThreadPrivateStorage *tps = (ThreadPrivateStorage *)jvmpiAgent_Calloc(sizeof(ThreadPrivateStorage)); >+ jvmpiAgent_initializeSegmentedValue(&tps->ticket, 0); >+ tps->currentStackSize = ORIGINAL_STACK_SIZE; >+ tps->tos = 0; >+ tps->threadStartEventSeen = 0; >+ tps->staticThreadId = ++_staticThreadIdCount; >+ tps->env=env_id; >+ tps->threadStackKnown=0; >+ tps->boundaryDepth=-1; >+ >+ /*##MW There is a race condition between the increment and the copy that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ jvmpiAgent_copySegmentedValue(&tps->collation, &_jvmpiAgent_collation); >+ >+ tps->stackEntry = (StackEntry *)jvmpiAgent_Calloc(tps->currentStackSize * sizeof(StackEntry)); >+ tps->buffer=(char *)ra_allocateMessageBlock(ORIGINAL_MESSAGE_BUFFER_SIZE); >+#ifdef __OS400__ >+ tps->buffer2=(char *)ra_allocateMessageBlock(ORIGINAL_MESSAGE_BUFFER_SIZE+1); >+#endif >+ hashEntry = jvmpiAgent_CreateThreadSymbol(env_id); >+ hashEntry->entry = tps; >+ return hashEntry; >+} >+ >+/** DESTROY_STACK ************************************************************ >+ * >+ */ >+void jvmpiAgent_DestroyStack(JNIEnv *env_id) { >+ ThreadLocalStorage *tps; >+ tps = jvmpiAgent_getThreadLocalStorage(env_id); >+ if (tps) >+ { >+ HashEntry *hashEntry; >+ hashEntry = jvmpiAgent_FindThreadSymbol(env_id); >+ free(tps->stackEntry); >+ ra_freeMessageBlock((unsigned char *)tps->buffer); >+#ifdef __OS400__ >+ ra_freeMessageBlock((unsigned char *)tps->buffer2); >+#endif >+ jvmpiAgent_DeleteSymbol(hashEntry, Thread_t); >+ } >+} >+ >+/** PUSH *********************************************************************** >+ */ >+StackEntry * jvmpiAgent_Push(ThreadPrivateStorage *tps, JNIEnv *env_id, HashEntry *methodHashEntry, HashEntry * objectHashEntry, timestamp_t timestamp, timestamp_t cpu_timestamp) >+{ >+ if (!tps) return 0; >+ tps->tos++; >+ >+ /* If the Stack is full, increment it's size by STACK_INCREMENT_SIZE */ >+ if(tps->tos == tps->currentStackSize) >+ { >+ StackEntry *oldStack=tps->stackEntry; >+ int newStackSize=tps->currentStackSize+STACK_INCREMENT_SIZE; >+ tps->stackEntry=(StackEntry *)jvmpiAgent_Calloc(newStackSize * sizeof(StackEntry)); >+ memcpy(tps->stackEntry, oldStack, tps->currentStackSize * sizeof(StackEntry)); >+ free(oldStack); >+ tps->currentStackSize=newStackSize; >+ } >+ >+ jvmpiAgent_incrementSegmentedValue(&tps->ticket, 0); >+ jvmpiAgent_copySegmentedValue(&(tps->stackEntry[tps->tos].ticket), &tps->ticket); >+ tps->stackEntry[tps->tos].objectHashEntry = objectHashEntry; >+ >+ if (tps->stackEntry[tps->tos].methodHashEntry = methodHashEntry) /* Note: Intentional assignment rather than compare */ >+ { >+ METHOD_ENTRY(methodHashEntry)->methodCount++; >+ } >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ tps->stackEntry[tps->tos].timestamp = timestamp; >+ } >+ if(_jvmpiAgent_Options.cpuTime) { >+ tps->stackEntry[tps->tos].cpuTime=cpu_timestamp; >+ } >+ else { >+ tps->stackEntry[tps->tos].cpuTime=0; >+ } >+ tps->stackEntry[tps->tos].printed = 0; >+ tps->stackEntry[tps->tos].tps = tps; >+ tps->stackEntry[tps->tos].entryEventSeen=1; >+ >+ /* If pre-aggregating, initialize the StackEntry's preagg fields */ >+ if(_jvmpiAgent_Options.compressLevel==CompressAggregate) { >+ StackEntry* new_entry = &tps->stackEntry[tps->tos]; >+ new_entry->baseTime = 0; >+ new_entry->baseCPUTime = 0; >+ new_entry->lastEntryTime = 0; >+ new_entry->lastEntryCPUTime = 0; >+ new_entry->realFrame = 0; >+ new_entry->stackFrame = NULL; /* 136721 (permanent) */ >+ } >+ >+ if(tps->tos==1) { >+ tps->stackEntry[tps->tos].currentBoundaryDepth=0; >+ } >+ else { >+ if(tps->stackEntry[tps->tos-1].currentBoundaryDepth==0) { >+ tps->stackEntry[tps->tos].currentBoundaryDepth=0; >+ } >+ else { >+ tps->stackEntry[tps->tos].currentBoundaryDepth=tps->stackEntry[tps->tos-1].currentBoundaryDepth-1; >+ } >+ } >+ if(_jvmpiAgent_Options.compressLevel==CompressAggregate) /* 136721 (permanent) */ >+ { >+ /* pre-aggregation: initialize the StackFrame of this StackEntry. >+ * >+ * This code sets things up for a frame that's filtered out: >+ * stackFrame is set to NULL for the first StackEntry on a stack, >+ * or to the same frame that the previous StackEntry points to. >+ * In either case, realFrame is set to zero (false). >+ * >+ * A StackEntry whose stackFrame points to its caller's stackFrame >+ * and whose "realFrame" flag is zero indicates a frame that's filtered out. >+ * >+ * If the entry being pushed is NOT filtered out, the caller of Push >+ * (usually handleMethodEntry) will call CreateStackFrame to change >+ * these pointers and values. >+ */ >+ >+ if (tps->tos == 1) { >+ /* The newly-pushed frame is the only frame on the stack */ >+ tps->stackEntry[tps->tos].stackFrame = NULL; >+ } >+ else { >+ /* There is a previous entry, a caller */ >+ StackEntry * caller = &tps->stackEntry[tps->tos - 1]; >+ tps->stackEntry[tps->tos].stackFrame = caller->stackFrame; >+ } >+ tps->stackEntry[tps->tos].realFrame = 0; >+ } >+ >+ return &tps->stackEntry[tps->tos]; >+} >+ >+/* for pre-aggregation (that is, CompressAggregate) */ >+/* >+ * Execute a "pop" for the aggregated method information. >+ * This is called from jvmpiAgent_Pop (normal method exit). >+ * It is also called from thread death, JVM shutdown, and >+ * suspendTracing processing: in those cases, we have to >+ * account for the time in frames that are currently live >+ * at thread death time or JVM shutdown time. >+ * >+ * Before calling this, the caller (especially the >+ * thread-death and shutdown callers) need to update >+ * baseTime of each stackEntry on the live stack(s). >+ * >+ * Note that a stackEntry can only be agPop'ed once. If it >+ * is agPop'ed a second time, nothing happens. This is forced >+ * by clearing the stackEntry->stackFrame field. This is a >+ * good practice generally and is used particularly in >+ * suspendTracing where an agRollUpStack is done followed by >+ * a stackCleaner, both of which trigger agPops directly or >+ * indirectly respectively. (bug 134635) >+ * >+ * If I weren't such a chicken, I'd change the thread-death >+ * and JVM shutdown handlers to simulate method-exit for all >+ * active frames, and let that automatically handle the >+ * bookkeeping. But I don't want to expose myself to breakage >+ * because of (e.g.) method calls that arrive after thread death >+ * or shutdown notification (from VMs with bad JVMPI impls). >+ */ >+ >+void jvmpiAgent_agPop(StackEntry* stackEntry) >+{ >+ StackFrame* frame = stackEntry->stackFrame; >+ if (frame != NULL) { >+ timestamp_t baseTime = stackEntry->baseTime; >+ timestamp_t baseCPUTime = stackEntry->baseCPUTime; >+ if (stackEntry->realFrame) { >+ /* This is a "real" frame, one for a non-filtered method. */ >+ /* Update the times for this method along this call chain. */ >+ timestamp_t totalBaseTime ; >+ timestamp_t totalBaseCPUTime ; >+ >+ /* >+ * Do not acquire stackFrameStructureLock here, despite the >+ * possibility that another thread is dumping data right now. >+ * It's just too expensive, and the risk of damage >+ * is limited to improper rolled-up data; you won't crash. >+ */ >+ totalBaseTime = frame->filteredMethodsBaseTime + baseTime; >+ DBG_CHK_AND_REPORT_TIME_OVERFLOW(totalBaseTime, "Time overflowed?! (agPop: totalBaseTime)\n"); /* 134577 */ >+ >+ if (frame->maxTime < totalBaseTime ) >+ frame->maxTime = totalBaseTime ; >+ if (frame->minTime == 0 || frame->minTime > totalBaseTime ) >+ frame->minTime = totalBaseTime ; >+ >+ frame->baseTime += totalBaseTime ; >+ DBG_CHK_AND_REPORT_TIME_OVERFLOW(frame->baseTime, "Time overflowed?! (agPop: frame->baseTime)\n"); /* 134577 */ >+ >+ frame->filteredMethodsBaseTime = 0; >+ >+ /* Do it again for CPU time - just base time, no min/max */ >+ totalBaseCPUTime = frame->filteredMethodsBaseCPUTime + baseCPUTime; >+ frame->baseCPUTime += totalBaseCPUTime; >+ frame->filteredMethodsBaseCPUTime = 0; >+ frame->numCalls ++ ; >+ } >+ else { >+ /* This is a filtered method. Accumulate basetime >+ into the filteredMethodsBaseTime of this non-real frame >+ so we can roll it up to the real frame when we reach one. */ >+ frame->filteredMethodsBaseTime += baseTime; >+ DBG_CHK_AND_REPORT_TIME_OVERFLOW(frame->filteredMethodsBaseTime, >+ "Time overflowed?! (agPop: frame->filteredMethodsBaseTime)\n"); /* 134577 */ >+ frame->filteredMethodsBaseCPUTime += baseCPUTime; >+ } >+ stackEntry->stackFrame = NULL; /* 134635 */ >+ } >+} >+ >+/** POP ************************************************************************ >+ */ >+void jvmpiAgent_Pop(ThreadPrivateStorage *tps) >+{ >+ if (tps != NULL && tps->tos == 0) { >+ /* RKD: We are underflowing here. Mark the stack as invalid and return */ >+ tps->threadStackKnown=0; >+ return; >+ } >+ assert(tps && tps->tos); >+#ifdef SEGMENTED_VALUE_MULTIWORD >+ free(tps->stackEntry[tps->tos].ticket.values); >+#endif >+ >+ /* if pre-aggregating, roll up this frame's data to its StackFrame */ >+ if(_jvmpiAgent_Options.compressLevel==CompressAggregate) >+ jvmpiAgent_agPop(&tps->stackEntry[tps->tos]); >+ >+ tps->tos--; >+} >+ >+/********************************************************** >+ jvmpiAgent_CreateStackFrame() >+ Creates a stack frame for a stack entry. Called if this method is being >+ tracked, then it searches the caller's stack frames, if not found >+ creates a new entry. Marks the StackEntry "real" to say it >+ represents a tracked method, not one that's filtered out. >+ >+***************************************************************/ >+void jvmpiAgent_CreateStackFrame(ThreadPrivateStorage * tps, >+ HashEntry* methodHashEntry, >+ StackEntry* caller) >+{ >+ >+ StackFrame * callerStackFrame = NULL; >+ StackFrame * frame = NULL; >+ StackFrame * it = NULL; >+ StackFrame** base = NULL; >+ StackFrame** prev = NULL; >+ >+ /* >+ * Search through the caller's stackframes to see if we already have >+ * a matching one. The "caller" might be the thread itself if the thread >+ * stack is empty. >+ * >+ * During this search, set "base" to point to the "calledList" that the >+ * frame if found on, or the one it belongs on if it's not found. >+ * >+ * Also, set "prev" to point to the "next" pointer that pointed to the >+ * found frame, if one is found; we use this to unlink the frame >+ * and move it to the base of the list it is on, as an optimization. >+ */ >+ >+ if( caller == NULL || caller->stackFrame == NULL) { >+ /* no caller; use the thread's list of top-level functions */ >+ callerStackFrame = NULL; >+ base = &(tps->calledList); >+ prev = base; >+ it = *base; >+ } >+ else { >+ /* There is a caller: use that frame's list of called functions */ >+ callerStackFrame = caller->stackFrame; >+ base = &(callerStackFrame->calledList); >+ prev = base; >+ it = *base; >+ } >+ >+ /* now "it" is the first entry on the proper calledList */ >+ >+ while ( it != NULL ) { >+ if( it->methodHashEntry == methodHashEntry ) { >+ /* we've seen this call before: re-use the existing frame */ >+ frame = it; >+ /* Optimization opportunity here: >+ * if the "it" frame isn't first, make it first, on the theory >+ * that the caller might call the same callee again soon, >+ * and it will make the search time shorter. >+ * Tradeoff: it will mean acquiring stackFrameStructureLock, >+ * which might wipe out the benefit. See notes elsewhere >+ * about stackFrameStructureLock, talking about why it's needed >+ * and what the no-lock alternatives might be. >+ */ >+ break; >+ } >+ >+ /* no match. update "prev" and "it" to walk to the next link in the chain */ >+ prev = &(it->next); >+ it = *prev; >+ } >+ >+ if ( frame == NULL ) { >+ /* This is a new child of its caller; create a stack frame */ >+ >+ /* Optimization opportunity: use a chunky allocator for StackFrame objects. >+ * They persist without being freed until they all get freed at once when this thread dies. >+ * Then again, malloc is usually pretty optimized, and jvmpiAgent_Calloc attempts some >+ * out-of-memory error reporting. >+ */ >+ frame = (StackFrame *)jvmpiAgent_Calloc(sizeof(StackFrame)); >+ frame->methodHashEntry = methodHashEntry; >+ >+ /* >+ * Prepend this new frame to the proper calledList. >+ * Remember, "base" is a pointer to either tps->calledList or >+ * the caller's calledList. We prepend because it's quicker and >+ * because it could be a slight optimization for locality, >+ * making searches shorter. (Imagine a function call in a loop.) >+ * >+ * Get stackFrameStructureLock here because another thread might be >+ * dumping a snapshot right now. We only use this when adding a new >+ * unique frame, not on every entry/exit. See notes elsewhere >+ * about no-lock alternatives to stackFrameStructureLock. >+ */ >+ getStackFrameStructureLock(); >+ { >+ frame->caller = callerStackFrame; >+ frame->next = *base; >+ *base = frame; >+ } >+ releaseStackFrameStructureLock(); >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("jvmpiAgent_CreateStackFrame: tps, &stackframe, &methodHashEntry, MethodIdRef= %8x, %8x, %8x, %5d\n", >+ (void *)tps, (void *)frame, (void*)methodHashEntry, (jint)((METHOD_ENTRY(methodHashEntry))->static_id)); >+ fflush(stdout); >+#endif >+ } >+ >+ tps->stackEntry[tps->tos].stackFrame = frame; >+ tps->stackEntry[tps->tos].realFrame = 1; >+} >+ >+ >+/** PEEK *********************************************************************** >+ */ >+StackEntry * jvmpiAgent_Peek(ThreadPrivateStorage *tps, int offset) >+{ >+ assert(tps); >+ if((int)tps->tos <= offset) >+ return NULL; >+ return &tps->stackEntry[tps->tos-offset]; >+} >+ >+/** TOP_OF_STACK *************************************************************** >+ */ >+unsigned long jvmpiAgent_TOS(ThreadPrivateStorage *tps) >+{ >+ return tps ? tps->tos : 0; >+} >+ >+/** STACK_DEPTH *************************************************************** >+ */ >+unsigned long jvmpiAgent_StackDepth(ThreadPrivateStorage *tps) { >+ return tps->tos; >+} >Index: src-native-new/src/agents/RABindings/WinBuild/RABindings.dsp >=================================================================== >RCS file: src-native-new/src/agents/RABindings/WinBuild/RABindings.dsp >diff -N src-native-new/src/agents/RABindings/WinBuild/RABindings.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/WinBuild/RABindings.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,131 @@ >+# Microsoft Developer Studio Project File - Name="RABinding" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=RABinding - Win32 Debug >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "RABinding.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "RABinding.mak" CFG="RABinding - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "RABinding - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "RABinding - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "RABinding - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "RABinding___Win32_Release" >+# PROP BASE Intermediate_Dir "RABinding___Win32_Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /Ob0 /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /YX /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /fo"Release/hcbnd.res" /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib hcclco.lib /nologo /version:0.1 /dll /pdb:none /machine:I386 /out:"..\..\..\..\bin\hcbnd.dll" /libpath:"..\..\..\..\lib" >+ >+!ELSEIF "$(CFG)" == "RABinding - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 1 >+# PROP BASE Output_Dir "RABinding___Win32_Debug" >+# PROP BASE Intermediate_Dir "RABinding___Win32_Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 1 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /YX /FD /GZ /c >+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "_DEBUG" >+# ADD RSC /l 0x409 /fo"Debug/hcbnd.res" /d "_DEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib hcclco.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\..\bin\hcbnd.dll" /pdbtype:sept /libpath:"..\..\..\..\lib" >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "RABinding - Win32 Release" >+# Name "RABinding - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\lock3.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\RABindings.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\RABindings.def >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\lock3.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\RABindings.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resource.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.h >diff -N src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,56 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: StatelessHeapSnapshotManager_C.h,v 1.4 2005/04/06 19:15:49 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef STATELESS_HEAP_SNAPSHOT_MANAGER_C_H >+#define STATELESS_HEAP_SNAPSHOT_MANAGER_C_H >+ >+#include <jvmpi.h> >+ >+/* Error Codes */ >+#define RA_OPT_HEAP_DISK_FULL 1 >+#define RA_OPT_HEAP_COULD_NOT_CREATE_FILE 2 >+ >+#ifdef __cplusplus >+extern "C" >+#endif >+int StatelessHeapSnapshotManager_handleHeapSnapshot_FromC(JNIEnv* env, >+ int dump_level, >+ char* begin, >+ char* end); >+ >+#ifdef __cplusplus >+extern "C" >+#endif >+void StatelessHeapSnapshotManager_setup_FromC(JVMPI_Interface *jvmpi, >+ BOOL classInfoCallback); >+ >+#ifdef __cplusplus >+extern "C" >+#endif >+void StatelessHeapSnapshotManager_classInfoCallback(const char* className, >+ int numInterfaces, >+ int numStaticFields, >+ JVMPI_Field* statics); >+ >+#ifdef __OS400__ >+#ifdef __cplusplus >+extern "C" >+#endif >+void StatelessHeapSnapshotManager_objectDumpCallbackMethod(JVMPI_Event *event); >+#endif >+/* Bug 64476 */ >+#ifdef __cplusplus >+extern "C" >+#endif >+void StatelessHeapSnapshotManager_optHeapCallBack(char* filename) ; >+ >+#endif /* STATELESS_HEAP_SNAPSHOT_MANAGER_C_H */ >Index: src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.h >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.h >diff -N src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/StatelessHeapSnapshotManager.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,54 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: StatelessHeapSnapshotManager.h,v 1.6 2005/10/03 19:30:59 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef STATELESS_HEAP_SNAPSHOT_MANAGER_H >+#define STATELESS_HEAP_SNAPSHOT_MANAGER_H >+ >+#include "AbstractHeapSnapshotManager.h" >+ >+#if defined MVS /* Bug 110369 */ >+#ifndef true >+typedef unsigned int bool; >+#define true 1 >+#define false 0 >+#endif >+#endif >+ >+class StatelessHeapSnapshotManager : public AbstractHeapSnapshotManager { >+ public: >+ StatelessHeapSnapshotManager(SnapshotFiller* filler, >+ SnapshotAgentInterface* agent, >+ JVMPI_Interface* jvmpi, >+ bool optHeapDebug, >+ FILE * debugOut); >+ >+ void handleHeapSnapshot(JNIEnv* env, >+ int dump_level, >+ char* begin, >+ char* end, >+ HeapDumpMode heapDumpMode); >+ char isStateless() const; >+ >+ protected: >+ void *prof_dump_read_ptr(char **current) const; >+ char getClassInfos(char* begin, char* end) const; >+ void parseClassDump(unsigned int object_dump_len, >+ char *object_dump_data, int numInterfaces, >+ int numStaticReferenceFields, >+ unsigned int *instanceSize, jobjectID** classRefs) const; >+ >+ private: >+ bool _optHeapDebug; >+ FILE* _debugOut; >+}; >+ >+#endif /* STATELESS_HEAP_SNAPSHOT_MANAGER_H */ >Index: src-native-new/src/HCLauncher/launcher_error.h >=================================================================== >RCS file: src-native-new/src/HCLauncher/launcher_error.h >diff -N src-native-new/src/HCLauncher/launcher_error.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/launcher_error.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,34 @@ >+/********************************************************************** >+Copyright (c) 2005 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: launcher_error.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+ >+/* Error code */ >+#define ERROR_JNI_ENV -100 >+ >+#define ERROR_JNI_LAUNCH_EXE_CLS -101 >+#define ERROR_JNI_LAUNCH_EXE_OBJ_ID -102 >+#define ERROR_JNI_LAUNCH_EXE_OBJ -103 >+#define ERROR_JNI_LAUNCH_EXE_NAME -104 >+#define ERROR_JNI_LAUNCH_CMD_LINE -105 >+#define ERROR_JNI_LAUNCH_LOCATION -106 >+ >+#define ERROR_JNI_LAUNCH_ENV_OBJ_ID -201 >+#define ERROR_JNI_LAUNCH_ENV_OBJARRAY_ID -202 >+#define ERROR_JNI_LAUNCH_PROP_CLASSS -203 >+#define ERROR_JNI_LAUNCH_ENV_OBJARRAY -204 >+#define ERROR_JNI_LAUNCH_ENV_NAME_ID -205 >+#define ERROR_JNI_LAUNCH_ENV_VALUE_ID -206 >+#define ERROR_JNI_LAUNCH_ENV_NAME -207 >+#define ERROR_JNI_LAUNCH_ENV_VALUE -208 >+ >+#define ERROR_JNI_LISTENER_CLS -301 >+#define ERROR_JNI_LISTENER_OBJ_ID -302 >+#define ERROR_JNI_LISTENER_OBJ -303 >Index: src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.cpp >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.cpp >diff -N src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.cpp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/StatelessHeapSnapshotManager_C.cpp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,752 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: StatelessHeapSnapshotManager_C.cpp,v 1.8 2006/05/11 22:20:00 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <string.h> >+#include <time.h> >+#include <stdlib.h> >+#include "options.h" >+#include "JvmpiWriter.h" >+#include "StatelessHeapSnapshotManager_C.h" >+#include "performance.h" // Uint64, _ticksPerMicrosecond >+ >+#include "../heapsnapshots/HeapSnapshotManager.h" >+#include "../heapsnapshots/StatelessHeapSnapshotManager.h" >+#include "../heapsnapshots/SnapshotFiller.h" >+#include "../heapsnapshots/SnapshotAgentInterface.h" >+ >+ >+#ifdef _WIN32 >+#include <winsock2.h> /* Bug 134924 */ >+#include <windows.h> >+#include <process.h> >+ /* typedef int PID; */ >+#else >+#include <unistd.h> >+ /* typedef pid_t PID; */ >+#endif >+ >+static bool optHeapDebug = false; >+static FILE *debugOut = stderr; >+ >+/* Modification History */ >+/*Bugzilla 82214 - The code has been cleaned to remove the moves and free handling >+*/ >+ >+/* Bug Number 73480 */ >+#ifdef __OS400__ >+/** CALLOC ************************************************************* >+ * Allocate some memory from the heap. If there is no more memory left >+ * the VM will exit gracefully. >+ */ >+static void* jvmpiAgent_Calloc(unsigned int size) { >+ void *p=malloc(size); >+ if(p==NULL) { >+ fprintf(stderr, "FATAL ERROR: Out of memory...JVM Exiting\n"); >+ fflush(stderr); >+ _jvmpiAgent_jvmpiInterface->ProfilerExit((jint)-1); >+ } >+ memset(p, 0, size); >+ return p; >+} >+ >+ >+/** CREATE_SYMBOL ************************************************************* >+ * >+ */ >+static HashEntry * jvmpiAgent_CreateSymbol(void *id) >+{ >+ /* Create a new hash entry and then insert it into the hash table */ >+ HashEntry * hashEntry = (HashEntry *)jvmpiAgent_Calloc(sizeof(HashEntry)); >+ hashEntry->id=id; >+ hashEntry->printed=0; >+ hashEntry->deleted= 0; >+ hashEntry->toBeFreed=0; >+ hashEntry->next=NULL; >+ return hashEntry; >+} >+ >+ >+void StatelessHeapSnapshotManager_createClassSymbol(jobjectID classId, >+ const char* className, >+ int numInterfaces, >+ int numStaticFields >+ ) { >+ //HashEntry *classObjectEntry; >+ //classObjectEntry=jvmpiAgent_FindObjectSymbol(classId); >+ ClassEntry *classEntry; >+ HashEntry *hashEntry; >+ ClassHashKey *k; >+ /* AM: This block of code will ensure that a class symbol is not created more than once for the same class */ >+ hashEntry = jvmpiAgent_FindClassSymbol (classId) ; >+ if (!hashEntry) { >+ k = (ClassHashKey *)jvmpiAgent_Calloc(sizeof(ClassHashKey)); >+ k->id=classId; >+ hashEntry = jvmpiAgent_CreateSymbol((void *)k); >+ /* Allocate and copy the event data into the symbol table structure */ >+ hashEntry->entry = (ClassEntry*)jvmpiAgent_Calloc(sizeof(ClassEntry)); >+ classEntry = CLASS_ENTRY(hashEntry); >+ if(className) { >+ STRDUP(classEntry->className, className); >+ } >+ classEntry->numInterfaces = numInterfaces; >+ classEntry->numStaticFields = numStaticFields; >+ insertClassOptSymbol(hashEntry); >+ } >+} >+#endif >+ >+ >+/* Piyush Bug 58049 */ >+class FillerException { >+ private : >+ int e ; >+ public : >+ FillerException ( int error ) :e(error) {} >+ int getErrorCode () { return e ; } >+ >+} ; >+ >+ >+class HyadesSnapshotFiller : public SnapshotFiller { >+ public: >+ HyadesSnapshotFiller(unsigned int objectMoveBatchSize, unsigned int objectFreeBatchSize) >+ { >+ } >+ ~HyadesSnapshotFiller() { >+ } >+ >+ void makeFileName(char *buf) { >+ PID pid; >+ time_t currentTime; >+ struct tm ltime, *pMemoryLeak=NULL; >+ char* hdfilename = '\0' ; >+ char pidString[10] ; >+ int lenPidString ; >+ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ /* start from dir name */ >+ *buf = '\0'; >+#ifdef MVS >+__atoe(_jvmpiAgent_Options.workDir) ; >+#endif >+ strcpy(buf, _jvmpiAgent_Options.workDir); >+#ifdef MVS >+__etoa(_jvmpiAgent_Options.workDir) ; >+#endif >+ buf += strlen(_jvmpiAgent_Options.workDir); >+#ifdef _WIN32 >+ *buf = '\\'; /* file delim in Windows */ >+#else >+ *buf = '/'; /* file delim in Unix */ >+#endif >+ buf += 1; *buf = '\0'; >+ hdfilename = buf ; >+ /* Applend the file prefix */ >+#ifdef MVS >+__atoe(_jvmpiAgent_Options.heapInfoFilePrefix) ; >+#endif >+ strcat(buf, _jvmpiAgent_Options.heapInfoFilePrefix); >+#ifdef MVS >+__etoa(_jvmpiAgent_Options.heapInfoFilePrefix) ; >+#endif >+ /* buf always points to the end, where things can be appended */ >+ buf += strlen(_jvmpiAgent_Options.heapInfoFilePrefix); >+ >+ /* Get the time and date */ >+ time(¤tTime); >+ /* ToDo: localtime_r() is not in Windows, otherwise that is better suited. >+ * Not deleting pLocalTimeBreakup, because not sure who owns it, so it is >+ * very small one time leak, but we should fix it. >+ */ >+ >+ /*Piyush Bug 82214 */ >+ /* We have changed the naming of files so that every name will have new time. */ >+ pMemoryLeak = localtime(¤tTime); >+ ltime = *pMemoryLeak; >+ /* free (pMemLeak); can I free it here? */ >+ sprintf(_headerTimeStamp, ".%.4d%.2d%.2d.%.2d%.2d%.2d \n", >+ 1900+ltime.tm_year, 1+ltime.tm_mon, ltime.tm_mday, >+ ltime.tm_hour, ltime.tm_min, ltime.tm_sec); >+ _headerTimeStamp[17] = '\0' ; >+ >+ /* Use the stored timestamp */ >+ strcpy(buf,_headerTimeStamp) ; >+ buf += 16; /* .YYYYMMDD.HHMMSS = 12 bytes */ >+ >+ /* get process id */ >+ pid = getpid(); >+ >+#ifdef _WIN32 >+ itoa((int)pid,pidString,10) ; >+ sprintf(buf, ".%d", (int) pid); >+ lenPidString = strlen(pidString) + 1 ; >+#else >+ /* Here the "." is included in sprintf so the lenPidString = strlen(pidString) +1 >+ which is similar to the one above */ >+ lenPidString = sprintf(buf, ".%d", (int) pid); >+#endif >+ buf += lenPidString ; >+ >+ /* append cycle etc */ >+ sprintf(buf, ".trcopt"); >+ strcpy(_hdFileName,hdfilename) ; >+ hdfilename = NULL ; >+ >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ } >+ void FillJinsightHeader() { >+#if 0 >+ struct event { >+ char traceFormatTag; /* 'o' */ >+ int traceVersion; /* 10 */ >+ int platformTag; >+ int numberOfEvents; >+ int maxThread; >+ int maxClass; >+ int ticksPerMicrosecond; >+ Uint64 connectionTime_in_ticks; >+ int processStartTime_in_ms; >+ int connectionTime_in_ms; >+ int parentJVMOverhead; >+ }; >+ struct event e = {'o', 10, 44, 0, 0x100, 0x4000, 0, 0, 0, 0, 0}; >+ fillerfwrite(&e, sizeof(event), 1, _snappieFile); >+#endif >+ >+ const int BINARY_HEAP_DUMP_VERSION = 12; >+ >+ time_t connectionStartTime; >+ time(&connectionStartTime); >+ >+#if defined(__OS400__) >+#pragma convert(819) >+#endif >+ traceWriteByte('o'); >+#if defined(__OS400__) >+#pragma convert(0) >+#endif >+ traceWriteInt32LittleEndian(BINARY_HEAP_DUMP_VERSION); >+ traceWritePlatformLittleEndian(); >+ traceWriteInt32LittleEndian(0); // UNUSED: number of events >+ traceWriteInt32LittleEndian(0); // UNUSED: max thread id >+ traceWriteInt32LittleEndian(0); // UNUSED: max class id >+ traceWriteInt32LittleEndian(_ticksPerMicrosecond); >+ traceWriteTimestampLittleEndian(0); >+ traceWriteInt32LittleEndian(0); >+ traceWriteInt32LittleEndian(connectionStartTime); >+ traceWriteInt32LittleEndian(0); >+ >+ fflush(_snappieFile); >+ } >+ void traceWriteByte(char b){ >+ fillerfwrite(&b, sizeof(char), 1, _snappieFile); >+ } >+ void traceWriteOID(jobjectID oid) { >+ fillerfwrite(&oid, sizeof(jobjectID), 1, _snappieFile); >+ } >+ void traceWriteOIDArray(jobjectID* oids, unsigned int num) { >+ fillerfwrite(oids, sizeof(jobjectID), num, _snappieFile); >+ } >+ void traceWritePlatformLittleEndian() { >+ >+#if defined(_WIN32) >+ traceWriteInt32LittleEndian(11); >+#elif defined(_AIX) >+ traceWriteInt32LittleEndian(22); >+#elif defined(MVS) >+ traceWriteInt32LittleEndian(33); >+#elif defined(__linux__) && defined(__i386__) >+ traceWriteInt32LittleEndian(44); >+#elif defined(__linux__) && defined(__s390__) >+ traceWriteInt32LittleEndian(55); >+#elif defined(_SOLARIS) >+ traceWriteInt32LittleEndian(66); >+#elif defined(_HPUX) >+ traceWriteInt32LittleEndian(77); >+#elif defined(__OS400__) >+ traceWriteInt32LittleEndian(88); >+#elif defined(__linux__) && defined(__powerpc64__) || defined(_WIN64) /*ts. bug 120479*/ >+ /* traceWriteInt32LittleEndian(99); */ >+#else >+#error "unknown platform" >+#endif >+ } >+ void traceWriteInt16LittleEndian(unsigned short id) { >+ traceWriteByte(id&0xff); >+ traceWriteByte((id&0xff00)>>8); >+ } >+ void traceWriteInt16(unsigned short id) { >+ fillerfwrite(&id, sizeof(unsigned short), 1, _snappieFile); >+ } >+ void traceWriteInt32LittleEndian(unsigned int id) { >+ traceWriteByte(id&0xff); >+ traceWriteByte((id&0xff00)>>8); >+ traceWriteByte((id&0xff0000)>>16); >+ traceWriteByte((id&0xff000000)>>24); >+ } >+ void traceWriteInt32(unsigned int id) { >+ fillerfwrite(&id, sizeof(unsigned int), 1, _snappieFile); >+ } >+ void traceWriteString(const char* bytes, unsigned int numBytes) { >+ traceWriteInt16(numBytes); >+ fillerfwrite(bytes, sizeof(char), numBytes, _snappieFile); >+ } >+ void traceWriteTimestampLittleEndian(Uint64 id) { >+#ifdef IBM_OE >+ unsigned long long mask; >+#else >+ Uint64 mask; >+#endif // IBM_OE >+ >+ mask = 0xff; >+ char byte1 = (char)(id&mask); >+ traceWriteByte(byte1); >+ >+ mask = mask << 8; >+ char byte2 = (char)((id&mask)>>8); >+ traceWriteByte(byte2); >+ >+ mask = mask << 8; >+ char byte3 = (char)((id&mask)>>16); >+ traceWriteByte(byte3); >+ >+ mask = mask << 8; >+ char byte4 = (char)((id&mask)>>24); >+ traceWriteByte(byte4); >+ >+ mask = mask << 8; >+ char byte5 = (char)((id&mask)>>32); >+ traceWriteByte(byte5); >+ >+ mask = mask << 8; >+ char byte6 = (char)((id&mask)>>40); >+ traceWriteByte(byte6); >+ >+ mask = mask << 8; >+ char byte7 = (char)((id&mask)>>48); >+ traceWriteByte(byte7); >+ >+ mask = mask << 8; >+ char byte8 = (char)((id&mask)>>56); >+ traceWriteByte(byte8); >+ } >+ void traceWriteTimestamp(Uint64 id) { >+ fillerfwrite(&id, sizeof(Uint64), 1, _snappieFile); >+ } >+ void FillClassInfo(jobjectID classID, >+ const char* className, >+ int numStaticReferenceFields, >+ int numInterfaces, >+#if defined(__OS400__) >+ int instanceSize, >+ jobjectID* classRefs) { >+#else >+ int instanceSize) { >+#endif >+#if 0 >+ struct event1 { >+ char eventTag; >+ jobjectID classID; >+ short classNameNumBytes; >+ }; >+ struct event2 { >+ int numStaticReferenceFields; >+ int numInterfaces; >+ }; >+ int classNameNumBytes = strlen(className); >+ struct event1 e1 = {81, classID, classNameNumBytes}; >+ struct event2 e2 = {numStaticReferenceFields, numInterfaces}; >+ fillerfwrite(&e1, sizeof(event1), 1, _snappieFile); >+ fillerfwrite(className, sizeof(char), classNameNumBytes, _snappieFile); >+ fillerfwrite(&e2, sizeof(event2), 1, _snappieFile); >+#endif >+ >+ traceWriteByte(81); >+#if defined(__OS400__) >+ traceWriteOID(classID); >+#else >+ traceWriteInt32((int)classID); >+#endif >+ traceWriteString(className, strlen(className)); >+ traceWriteInt32(numStaticReferenceFields); >+ traceWriteInt32(numInterfaces); >+ traceWriteInt32(instanceSize); >+#if defined(__OS400__) >+ if (classRefs) { >+ traceWriteInt32(numStaticReferenceFields); >+ traceWriteOIDArray(classRefs, numStaticReferenceFields); >+ } else { >+ traceWriteInt32(0); >+ } >+#endif >+ } >+ void FillJvmpiSnapshot(char* begin, char* end) { >+#if 0 >+ struct event { >+ char eventTag; >+ Uint64 timestamp; >+ int sizeofVoidStar; >+ int numBytesInSnapshot; >+ }; >+ struct event e = {80, 0, sizeof(void*), end-begin}; >+ fillerfwrite(&e, sizeof(event), 1, _snappieFile); >+#endif >+ >+ traceWriteByte(80); >+ traceWriteTimestamp(0); >+ traceWriteInt32(sizeof(void*)); >+ traceWriteInt32(end-begin); >+ fillerfwrite(begin, sizeof(char), end-begin, _snappieFile); >+ fflush(_snappieFile); >+ } >+ >+ >+ >+ void writeHeader() >+ { >+ FillJinsightHeader(); >+ } >+ >+ void closeHeapDumpFile() >+ { >+ fclose(_snappieFile) ; >+ /* Moved the callback method here so that it is called only after the heap dump is created */ >+ StatelessHeapSnapshotManager_optHeapCallBack(_hdFileName) ; >+ >+ } >+ >+ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ void createHeapDumpFile() >+ { >+ char filename[511]; >+ makeFileName(filename); >+ >+ _snappieFile = fopen(filename, "wb"); >+ >+ /* check if fopen() failed */ >+ if(_snappieFile == NULL) { >+ if (_jvmpiAgent_Options.standalone) { >+ fprintf(stderr, "*** Could not open output file \"%s\". Exiting JVM. ***\n", filename); >+ fflush(stderr); >+ _jvmpiAgent_jvmpiInterface->ProfilerExit((jint)-1); >+ } >+ throw FillerException(RA_OPT_HEAP_COULD_NOT_CREATE_FILE) ;/* Piyush 58049 */ >+ } >+ } >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+ /* Piyush Bug 58049 */ >+ void fillerfwrite(const void* buffer, size_t size, size_t count, FILE* stream) { >+ size_t result = 0 ; >+ int error = 0 ; >+ result = fwrite(buffer, size, count, stream); >+ error = ferror(stream) ; >+ if ( error || result != count ) >+ { >+ throw FillerException(RA_OPT_HEAP_DISK_FULL) ; >+ } >+ } >+ >+// Multiple File Support >+ private: >+ FILE* _snappieFile; >+ char _hdFileName[511]; >+ char _headerTimeStamp[17] ; >+}; >+ >+class HyadesSnapshotAgentInterface : public SnapshotAgentInterface { >+ public: >+ HyadesSnapshotAgentInterface(JVMPI_Interface* jvmpi, BOOL classInfoCallback) >+ : _jvmpi(jvmpi), _classInfoCallback(classInfoCallback) >+ { >+ } >+ void classInfoCallback(const char* className, >+ int numInterfaces, >+ int numStaticFields, >+ JVMPI_Field* statics) { >+ int i; >+ int numStaticReferenceFields = 0; >+ for (i=0; i<numStaticFields; i++) { >+ char prim = statics[i].field_signature[0]; >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ if (prim == '[' || prim == 'L') { >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ numStaticReferenceFields++; >+ } >+ } >+ >+ _stashedClassName = strdup(className); >+ _stashedNumInterfaces = numInterfaces; >+ _stashedNumStaticReferenceFields = numStaticReferenceFields; >+ } >+ >+#ifdef __OS400__ >+ void objectDumpCallbackMethod(JVMPI_Event *event) { >+ _stashedObjectDumpLen = event->u.object_dump.data_len; >+ _stashedObjectDumpData = (char *)jvmpiAgent_Calloc(_stashedObjectDumpLen); >+ memcpy(_stashedObjectDumpData,event->u.object_dump.data,_stashedObjectDumpLen); >+ } >+#endif >+ >+ char getClassInfo(jobjectID classID, >+ char** className_outvar, >+ char* className_freeMe, >+ int* numInterfaces_outvar, >+ int* numStaticReferenceFields_outvar) { >+ >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ int status = 0; >+ /* 96198 Return all the values, even if the class is already >+ in the table >+ */ >+ if (jvmpiAgent_FindClassSymbol(classID)) status = 1; >+#endif >+ >+ BOOL tmp = _classInfoCallback; /* backup the original value */ >+ _classInfoCallback = (BOOL) TRUE; /* change it for requesting next event */ >+ REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, classID); >+ _classInfoCallback = tmp; /* restore */ >+ >+ /* _stashedClassName is already a copy - caller to free*/ >+ *className_outvar = _stashedClassName; >+ *className_freeMe = 1; >+ *numInterfaces_outvar = _stashedNumInterfaces; >+ *numStaticReferenceFields_outvar = _stashedNumStaticReferenceFields; >+ if (optHeapDebug) { >+ fprintf(debugOut, >+ "Return from JVMPI_EVENT_CLASS_LOAD for cls_id=0x%x, cls_name=%s, numInterfaces=%d, numStatics=%d.\n", >+ classID, (_stashedClassName ? _stashedClassName : "NULL"), >+ _stashedNumInterfaces, _stashedNumStaticReferenceFields); >+ fflush(debugOut); >+ } >+ >+/* Bug Number 73480 */ >+#ifdef __OS400__ >+ if (status == 0) { >+ StatelessHeapSnapshotManager_createClassSymbol(classID,_stashedClassName, >+ _stashedNumInterfaces,_stashedNumStaticReferenceFields) ; >+ } >+ return status; >+#else >+ >+ return 0; >+#endif >+ } >+ >+#ifdef __OS400__ >+ char getOS400ClassInfo(jobjectID classID, >+ char** className_outvar, >+ char* className_freeMe, >+ int* numInterfaces_outvar, >+ int* numStaticReferenceFields_outvar, >+ unsigned int* object_dump_len, >+ char** object_dump_data) { >+ >+ if (jvmpiAgent_FindClassSymbol(classID)) return 1; >+ >+ BOOL tmp = _classInfoCallback; /* backup the original value */ >+ _classInfoCallback = (BOOL) TRUE; /* change it for requesting next event */ >+ REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, classID); >+ REQUEST_EVENT2(JVMPI_EVENT_OBJECT_DUMP, classID); >+ _classInfoCallback = tmp; /* restore */ >+ >+ /* _stashedClassName is already a copy - caller to free*/ >+ *className_outvar = _stashedClassName; >+ *className_freeMe = 1; >+ *numInterfaces_outvar = _stashedNumInterfaces; >+ *numStaticReferenceFields_outvar = _stashedNumStaticReferenceFields; >+ *object_dump_len = _stashedObjectDumpLen; >+ /* _stashedObjectDumpData is already a copy - caller to free*/ >+ *object_dump_data = _stashedObjectDumpData; >+ >+ StatelessHeapSnapshotManager_createClassSymbol(classID,_stashedClassName, >+ _stashedNumInterfaces,_stashedNumStaticReferenceFields) ; >+ >+ return 0; >+ } >+#endif >+ >+ char stillAlive() { >+ return 1; >+ } >+ char stillTracing() { >+ return stillAlive(); /*&& file/socket not closed? */ >+ } >+ char shouldIReportHeapSnapshotDuration() { >+ return 1; >+ } >+ short swap16(short n) { >+ return ntohs(n); >+ } >+ int swap32(int n) { >+ return ntohl(n); >+ } >+ char dump_read_u1(char* cursor) { >+ unsigned char u1; >+ memcpy(&u1, cursor, sizeof(char)); >+ return u1; >+ } >+ short dump_read_u2(char* cursor) { >+ unsigned short u2; >+ memcpy(&u2, cursor, sizeof(short)); >+ return u2; >+ } >+ int dump_read_u4(char* cursor) { >+ unsigned int u4; >+ memcpy(&u4, cursor, sizeof(int)); >+ return u4; >+ } >+ jobjectID dump_read_jobjectID(char* cursor) { >+ // Anandi 25 May 2004 - Change this so it works for 64-bit jobjectIDs >+ jobjectID ptr; >+ memcpy(&ptr, cursor, sizeof(jobjectID)); >+ return ptr; >+ } >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ void status(const char* message) { >+ if (optHeapDebug) { >+ fprintf(debugOut, "snapshot status: %s\n", message); >+ fflush(debugOut); >+ } >+ } >+ void status(const char* message, int message2) { >+ if (optHeapDebug) { >+ fprintf(debugOut, "snapshot status: %s %d\n", message, message2); >+ fflush(debugOut); >+ } >+ } >+ void error(const char* message) { >+ if (optHeapDebug) { >+ fprintf(debugOut, "snapshot error: %s\n", message); >+ fflush(debugOut); >+ } >+ } >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+ private: >+ JVMPI_Interface* _jvmpi; >+ BOOL _classInfoCallback; >+ char* _stashedClassName; >+ int _stashedNumInterfaces; >+ int _stashedNumStaticReferenceFields; >+#ifdef __OS400__ >+ unsigned int _stashedObjectDumpLen; >+ char *_stashedObjectDumpData; >+#endif >+}; >+ >+HeapSnapshotManager* _manager; >+HyadesSnapshotAgentInterface* _agent; >+HyadesSnapshotFiller* _filler; >+ >+extern "C" >+void StatelessHeapSnapshotManager_classInfoCallback(const char* className, >+ int numInterfaces, >+ int numStaticFields, >+ JVMPI_Field* statics) >+{ >+ _agent->classInfoCallback(className, >+ numInterfaces, >+ numStaticFields, >+ statics); >+} >+ >+#ifdef __OS400__ >+void StatelessHeapSnapshotManager_objectDumpCallbackMethod(JVMPI_Event *event) >+{ >+ _agent->objectDumpCallbackMethod(event); >+} >+ >+/* Bug Number 73480 */ >+/** DELETE_HASH_ENTRY ********************************************************* >+ * >+ */ >+int deleteHashEntry(HashEntry *entry, >+ void *param) { >+ jvmpiAgent_DeleteSymbol(entry, (*(enum EntryType*)param)); >+ return 0; >+} >+#endif >+ >+ >+extern "C" >+void StatelessHeapSnapshotManager_setup_FromC(JVMPI_Interface *jvmpi, >+ BOOL classInfoCallback) >+{ >+ char *debugOptHeap = getenv("DEBUGOPTHEAP"); >+ if (debugOptHeap && strcmp(debugOptHeap, "TRUE")) optHeapDebug = true; >+ _filler = new HyadesSnapshotFiller(1000, 1000); >+ _agent = new HyadesSnapshotAgentInterface(jvmpi, classInfoCallback); >+ _manager = new StatelessHeapSnapshotManager(_filler, _agent, jvmpi, optHeapDebug, debugOut); >+} >+ >+extern "C" >+int StatelessHeapSnapshotManager_handleHeapSnapshot_FromC(JNIEnv* env, >+ int dump_level, >+ char* begin, >+ char* end) >+{ >+ int errorCode = 0 ; >+ try { >+ >+ /*Piyush Bug 82214*/ >+ /* Write the header in the heap dump file */ >+ _filler->createHeapDumpFile() ; >+ _filler->writeHeader() ; >+ >+ _manager->handleHeapSnapshot(env, dump_level, begin, end, askingForDumpReferences); >+ >+ _filler->closeHeapDumpFile() ; >+ >+ } catch ( FillerException ex) { >+ /* Piyush Bug 58049 */ >+ errorCode = ex.getErrorCode() ; >+#ifdef _DEBUG >+ fprintf(stderr,"Caught Exception in handleHeapSnapShot : Error Code %d\n",errorCode) ; >+ fflush(stderr); >+#endif >+ } >+#ifdef __OS400__ >+/* Bug Number 73480 */ >+ enum EntryType type; >+ /* Delete each of the classes */ >+ type=Class_t; >+ jvmpiAgent_ForAll(Class_t, deleteHashEntry, &type); >+ type = Class_t ; >+#endif >+ return errorCode ; >+} >+ >+/* Bug 64476 - Wrapper method added for name mangling*/ >+extern "C" >+void StatelessHeapSnapshotManager_optHeapCallBack(char* filename) { >+ _jvmpiAgent_optHeapCallBack.ohdcb(filename) ; >+} >+ >Index: src-native-new/src/agents/native/WinBuild/WinBuild.dsw >=================================================================== >RCS file: src-native-new/src/agents/native/WinBuild/WinBuild.dsw >diff -N src-native-new/src/agents/native/WinBuild/WinBuild.dsw >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/WinBuild/WinBuild.dsw 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,52 @@ >+Microsoft Developer Studio Workspace File, Format Version 6.00 >+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! >+ >+############################################################################### >+ >+Project: "heapsnapshots"=.\heapsnapshots.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+ begin source code control >+ heapsnapshots >+ .. >+ end source code control >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Project: "java_profiler"=.\java_profiler.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+ begin source code control >+ java_profiler >+ .. >+ end source code control >+}}} >+ >+Package=<4> >+{{{ >+ Begin Project Dependency >+ Project_Dep_Name heapsnapshots >+ End Project Dependency >+}}} >+ >+############################################################################### >+ >+Global: >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<3> >+{{{ >+}}} >+ >+############################################################################### >+ >Index: src-native-new/src/agents/native/WinBuild/java_profiler.mak >=================================================================== >RCS file: src-native-new/src/agents/native/WinBuild/java_profiler.mak >diff -N src-native-new/src/agents/native/WinBuild/java_profiler.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/WinBuild/java_profiler.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,501 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on java_profiler.dsp >+!IF "$(CFG)" == "" >+CFG=java_profiler - Win32 Debug >+!MESSAGE No configuration specified. Defaulting to java_profiler - Win32 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "java_profiler - Win32 Release" && "$(CFG)" != "java_profiler - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "java_profiler.mak" CFG="java_profiler - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "java_profiler - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "java_profiler - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\piAgent.dll" >+ >+!ELSE >+ >+ALL : "heapsnapshots - Win32 Release" "$(OUTDIR)\piAgent.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"heapsnapshots - Win32 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\agentDebug.obj" >+ -@erase "$(INTDIR)\filters.obj" >+ -@erase "$(INTDIR)\hash.obj" >+ -@erase "$(INTDIR)\JvmpiWriter.obj" >+ -@erase "$(INTDIR)\options.obj" >+ -@erase "$(INTDIR)\performance.obj" >+ -@erase "$(INTDIR)\piagent.res" >+ -@erase "$(INTDIR)\print.obj" >+ -@erase "$(INTDIR)\segmentedValue.obj" >+ -@erase "$(INTDIR)\stack.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" >+ -@erase "$(INTDIR)\utility.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\piAgent.dll" >+ -@erase "$(OUTDIR)\piAgent.exp" >+ -@erase "$(OUTDIR)\piAgent.lib" >+ -@erase ".\Release\piAgent.map" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP_PROJ=/nologo /MT /W3 /GX /O2 /Ob2 /I "..\..\..\framework\RABindings" /I "..\..\..\framework\RACommon" /I "..\..\..\framework\RADataTransfer" /I "..\..\..\framework\RASharedMemory" /I "..\..\..\framework\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /Fp"$(INTDIR)\java_profiler.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\piagent.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\java_profiler.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib rpcrt4.lib ws2_32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /version:0.1 /dll /pdb:none /map:"$(INTDIR)\piAgent.map" /machine:I386 /out:"$(OUTDIR)\piAgent.dll" /implib:"$(OUTDIR)\piAgent.lib" /libpath:"..\..\..\framework\WinBuild\bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\agentDebug.obj" \ >+ "$(INTDIR)\filters.obj" \ >+ "$(INTDIR)\hash.obj" \ >+ "$(INTDIR)\JvmpiWriter.obj" \ >+ "$(INTDIR)\options.obj" \ >+ "$(INTDIR)\performance.obj" \ >+ "$(INTDIR)\print.obj" \ >+ "$(INTDIR)\segmentedValue.obj" \ >+ "$(INTDIR)\stack.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" \ >+ "$(INTDIR)\utility.obj" \ >+ "$(INTDIR)\piagent.res" \ >+ "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)\piAgent.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\piAgent.dll" "$(OUTDIR)\java_profiler.bsc" >+ >+!ELSE >+ >+ALL : "heapsnapshots - Win32 Debug" "$(OUTDIR)\piAgent.dll" "$(OUTDIR)\java_profiler.bsc" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"heapsnapshots - Win32 DebugCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\agentDebug.obj" >+ -@erase "$(INTDIR)\agentDebug.sbr" >+ -@erase "$(INTDIR)\filters.obj" >+ -@erase "$(INTDIR)\filters.sbr" >+ -@erase "$(INTDIR)\hash.obj" >+ -@erase "$(INTDIR)\hash.sbr" >+ -@erase "$(INTDIR)\JvmpiWriter.obj" >+ -@erase "$(INTDIR)\JvmpiWriter.sbr" >+ -@erase "$(INTDIR)\options.obj" >+ -@erase "$(INTDIR)\options.sbr" >+ -@erase "$(INTDIR)\performance.obj" >+ -@erase "$(INTDIR)\performance.sbr" >+ -@erase "$(INTDIR)\piagent.res" >+ -@erase "$(INTDIR)\print.obj" >+ -@erase "$(INTDIR)\print.sbr" >+ -@erase "$(INTDIR)\segmentedValue.obj" >+ -@erase "$(INTDIR)\segmentedValue.sbr" >+ -@erase "$(INTDIR)\stack.obj" >+ -@erase "$(INTDIR)\stack.sbr" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager_C.sbr" >+ -@erase "$(INTDIR)\utility.obj" >+ -@erase "$(INTDIR)\utility.sbr" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\java_profiler.bsc" >+ -@erase "$(OUTDIR)\piAgent.dll" >+ -@erase "$(OUTDIR)\piAgent.exp" >+ -@erase "$(OUTDIR)\piAgent.ilk" >+ -@erase "$(OUTDIR)\piAgent.lib" >+ -@erase "$(OUTDIR)\piAgent.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\framework\RABindings" /I "..\..\..\framework\RACommon" /I "..\..\..\framework\RADataTransfer" /I "..\..\..\framework\RASharedMemory" /I "..\..\..\framework\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JAVA_PROFILER_EXPORTS" /D "_INTEL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\java_profiler.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\piagent.res" /d "_DEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\java_profiler.bsc" >+BSC32_SBRS= \ >+ "$(INTDIR)\agentDebug.sbr" \ >+ "$(INTDIR)\filters.sbr" \ >+ "$(INTDIR)\hash.sbr" \ >+ "$(INTDIR)\JvmpiWriter.sbr" \ >+ "$(INTDIR)\options.sbr" \ >+ "$(INTDIR)\performance.sbr" \ >+ "$(INTDIR)\print.sbr" \ >+ "$(INTDIR)\segmentedValue.sbr" \ >+ "$(INTDIR)\stack.sbr" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager_C.sbr" \ >+ "$(INTDIR)\utility.sbr" >+ >+"$(OUTDIR)\java_profiler.bsc" : "$(OUTDIR)" $(BSC32_SBRS) >+ $(BSC32) @<< >+ $(BSC32_FLAGS) $(BSC32_SBRS) >+<< >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib rpcrt4.lib ws2_32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\piAgent.pdb" /debug /machine:I386 /out:"$(OUTDIR)\piAgent.dll" /implib:"$(OUTDIR)\piAgent.lib" /pdbtype:sept /libpath:"..\..\..\framework\WinBuild\bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\agentDebug.obj" \ >+ "$(INTDIR)\filters.obj" \ >+ "$(INTDIR)\hash.obj" \ >+ "$(INTDIR)\JvmpiWriter.obj" \ >+ "$(INTDIR)\options.obj" \ >+ "$(INTDIR)\performance.obj" \ >+ "$(INTDIR)\print.obj" \ >+ "$(INTDIR)\segmentedValue.obj" \ >+ "$(INTDIR)\stack.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager_C.obj" \ >+ "$(INTDIR)\utility.obj" \ >+ "$(INTDIR)\piagent.res" \ >+ "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)\piAgent.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("java_profiler.dep") >+!INCLUDE "java_profiler.dep" >+!ELSE >+!MESSAGE Warning: cannot find "java_profiler.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" || "$(CFG)" == "java_profiler - Win32 Debug" >+SOURCE=..\java_profiler\agentDebug.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\agentDebug.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\agentDebug.obj" "$(INTDIR)\agentDebug.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\filters.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\filters.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\filters.obj" "$(INTDIR)\filters.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\hash.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\hash.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\JvmpiWriter.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\JvmpiWriter.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\JvmpiWriter.obj" "$(INTDIR)\JvmpiWriter.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\options.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\options.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\options.obj" "$(INTDIR)\options.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\performance.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\performance.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\performance.obj" "$(INTDIR)\performance.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\print.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\print.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\print.obj" "$(INTDIR)\print.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\segmentedValue.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\segmentedValue.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\segmentedValue.obj" "$(INTDIR)\segmentedValue.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\stack.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\stack.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\stack.obj" "$(INTDIR)\stack.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\StatelessHeapSnapshotManager_C.cpp >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\StatelessHeapSnapshotManager_C.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\StatelessHeapSnapshotManager_C.obj" "$(INTDIR)\StatelessHeapSnapshotManager_C.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\utility.c >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\utility.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\utility.obj" "$(INTDIR)\utility.sbr" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+!ENDIF >+ >+SOURCE=..\java_profiler\version.rc >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+ >+"$(INTDIR)\piagent.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\piagent.res" /i "\eclipse\workspace\org.eclipse.hyades.datacollection\collection\collectors\native\java_profiler" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+ >+"$(INTDIR)\piagent.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\piagent.res" /i "\eclipse\workspace\org.eclipse.hyades.datacollection\collection\collectors\native\java_profiler" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+!IF "$(CFG)" == "java_profiler - Win32 Release" >+ >+"heapsnapshots - Win32 Release" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak CFG="heapsnapshots - Win32 Release" >+ cd "." >+ >+"heapsnapshots - Win32 ReleaseCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak CFG="heapsnapshots - Win32 Release" RECURSE=1 CLEAN >+ cd "." >+ >+!ELSEIF "$(CFG)" == "java_profiler - Win32 Debug" >+ >+"heapsnapshots - Win32 Debug" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak CFG="heapsnapshots - Win32 Debug" >+ cd "." >+ >+"heapsnapshots - Win32 DebugCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F .\heapsnapshots.mak CFG="heapsnapshots - Win32 Debug" RECURSE=1 CLEAN >+ cd "." >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/WinBuild/resutils.mak64 >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/resutils.mak64 >diff -N src-native-new/src/agents/perfmon/WinBuild/resutils.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/resutils.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,394 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on resutils.dsp >+!IF "$(CFG)" == "" >+CFG=resutils - IA64 Release >+!MESSAGE No configuration specified. Defaulting to resutils - IA64 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "resutils - IA64 Release" && "$(CFG)" != "resutils - IA64 Debug" && "$(CFG)" != "resutils - X64 Release" && "$(CFG)" != "resutils - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "resutils.mak64" CFG="resutils - IA64 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "resutils - IA64 Release" >+!MESSAGE "resutils - IA64 Debug" >+!MESSAGE "resutils - X64 Release" >+!MESSAGE "resutils - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "resutils - IA64 Release" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\resutils.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\clock.obj" >+ -@erase "$(INTDIR)\hashtable.obj" >+ -@erase "$(INTDIR)\library.obj" >+ -@erase "$(INTDIR)\mutex.obj" >+ -@erase "$(INTDIR)\random.obj" >+ -@erase "$(INTDIR)\streq.obj" >+ -@erase "$(INTDIR)\thread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\resutils.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\resutils.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\resutils.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\clock.obj" \ >+ "$(INTDIR)\hashtable.obj" \ >+ "$(INTDIR)\library.obj" \ >+ "$(INTDIR)\mutex.obj" \ >+ "$(INTDIR)\random.obj" \ >+ "$(INTDIR)\streq.obj" \ >+ "$(INTDIR)\thread.obj" >+ >+"$(OUTDIR)\resutils.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "resutils - IA64 Debug" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\resutils.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\clock.obj" >+ -@erase "$(INTDIR)\hashtable.obj" >+ -@erase "$(INTDIR)\library.obj" >+ -@erase "$(INTDIR)\mutex.obj" >+ -@erase "$(INTDIR)\random.obj" >+ -@erase "$(INTDIR)\streq.obj" >+ -@erase "$(INTDIR)\thread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\resutils.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\resutils.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\resutils.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\clock.obj" \ >+ "$(INTDIR)\hashtable.obj" \ >+ "$(INTDIR)\library.obj" \ >+ "$(INTDIR)\mutex.obj" \ >+ "$(INTDIR)\random.obj" \ >+ "$(INTDIR)\streq.obj" \ >+ "$(INTDIR)\thread.obj" >+ >+"$(OUTDIR)\resutils.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "resutils - X64 Release" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\resutils.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\clock.obj" >+ -@erase "$(INTDIR)\hashtable.obj" >+ -@erase "$(INTDIR)\library.obj" >+ -@erase "$(INTDIR)\mutex.obj" >+ -@erase "$(INTDIR)\random.obj" >+ -@erase "$(INTDIR)\streq.obj" >+ -@erase "$(INTDIR)\thread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\resutils.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\resutils.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\resutils.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\clock.obj" \ >+ "$(INTDIR)\hashtable.obj" \ >+ "$(INTDIR)\library.obj" \ >+ "$(INTDIR)\mutex.obj" \ >+ "$(INTDIR)\random.obj" \ >+ "$(INTDIR)\streq.obj" \ >+ "$(INTDIR)\thread.obj" >+ >+"$(OUTDIR)\resutils.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "resutils - X64 Debug" >+ >+OUTDIR=..\..\..\..\lib >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\lib >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\resutils.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\clock.obj" >+ -@erase "$(INTDIR)\hashtable.obj" >+ -@erase "$(INTDIR)\library.obj" >+ -@erase "$(INTDIR)\mutex.obj" >+ -@erase "$(INTDIR)\random.obj" >+ -@erase "$(INTDIR)\streq.obj" >+ -@erase "$(INTDIR)\thread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\resutils.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\resutils.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\resutils.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\clock.obj" \ >+ "$(INTDIR)\hashtable.obj" \ >+ "$(INTDIR)\library.obj" \ >+ "$(INTDIR)\mutex.obj" \ >+ "$(INTDIR)\random.obj" \ >+ "$(INTDIR)\streq.obj" \ >+ "$(INTDIR)\thread.obj" >+ >+"$(OUTDIR)\resutils.lib" : "$(OUTDIR)" $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "resutils - IA64 Release" || "$(CFG)" == "resutils - IA64 Debug" || "$(CFG)" == "resutils - X64 Release" || "$(CFG)" == "resutils - X64 Debug" >+SOURCE=..\resutils\clock.c >+ >+"$(INTDIR)\clock.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\hashtable.c >+ >+"$(INTDIR)\hashtable.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\library.c >+ >+"$(INTDIR)\library.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\mutex.c >+ >+"$(INTDIR)\mutex.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\random.c >+ >+"$(INTDIR)\random.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\streq.c >+ >+"$(INTDIR)\streq.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\thread.c >+ >+"$(INTDIR)\thread.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+ >+!ENDIF >+ >Index: src-native-new/src/transport/RADataTransfer/RADataTransfer.mak64 >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/RADataTransfer.mak64 >diff -N src-native-new/src/transport/RADataTransfer/RADataTransfer.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/RADataTransfer.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,582 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on RADataTransfer.dsp >+!IF "$(CFG)" == "" >+CFG=RADataTransfer - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to RADataTransfer - IA64 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "RADataTransfer - IA64 Release" && "$(CFG)" != "RADataTransfer - IA64 Debug" && "$(CFG)" != "RADataTransfer - X64 Release" && "$(CFG)" != "RADataTransfer - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "RADataTransfer.mak64" CFG="RADataTransfer - IA64 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "RADataTransfer - IA64 Release" >+!MESSAGE "RADataTransfer - IA64 Debug" >+!MESSAGE "RADataTransfer - X64 Release" >+!MESSAGE "RADataTransfer - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "RADataTransfer - IA64 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hccldt.dll" >+ >+!ELSE >+ >+ALL : "RASocket - IA64 Release" "RASharedMemory - IA64 Release" "RACommon - IA64 Release" "$(OUTDIR)\hccldt.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - IA64 ReleaseCLEAN" "RASharedMemory - IA64 ReleaseCLEAN" "RASocket - IA64 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hccldt.res" >+ -@erase "$(INTDIR)\RADataTransfer.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hccldt.dll" >+ -@erase "$(OUTDIR)\..\lib\hccldt.exp" >+ -@erase "$(OUTDIR)\..\lib\hccldt.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\RACommon" /I "..\RASharedMemory" /I "..\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RADataTransfer.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccldt.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RADataTransfer\RADataTransfer.def" /out:"$(OUTDIR)\hccldt.dll" /implib:"$(OUTDIR)\..\lib\hccldt.lib" /libpath:".\bin" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\RADataTransfer.obj" \ >+ "$(INTDIR)\hccldt.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hccldt.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - IA64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hccldt.dll" >+ >+!ELSE >+ >+ALL : "RASocket - IA64 Debug" "RASharedMemory - IA64 Debug" "RACommon - IA64 Debug" "$(OUTDIR)\hccldt.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - IA64 DebugCLEAN" "RASharedMemory - IA64 DebugCLEAN" "RASocket - IA64 DebugCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hccldt.res" >+ -@erase "$(INTDIR)\RADataTransfer.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hccldt.dll" >+ -@erase "$(OUTDIR)\..\lib\hccldt.exp" >+ -@erase "$(OUTDIR)\..\lib\hccldt.ilk" >+ -@erase "$(OUTDIR)\..\lib\hccldt.lib" >+ -@erase "$(OUTDIR)\..\lib\hccldt.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /I "..\RASharedMemory" /I "..\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RADataTransfer.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccldt.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hccldt.pdb" /debug /def:"..\RADataTransfer\RADataTransfer.def" /out:"$(OUTDIR)\hccldt.dll" /implib:"$(OUTDIR)\..\lib\hccldt.lib" /libpath:".\bin" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\RADataTransfer.obj" \ >+ "$(INTDIR)\hccldt.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hccldt.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Release" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hccldt.dll" >+ >+!ELSE >+ >+ALL : "RASocket - X64 Release" "RASharedMemory - X64 Release" "RACommon - X64 Release" "$(OUTDIR)\hccldt.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - X64 ReleaseCLEAN" "RASharedMemory - X64 ReleaseCLEAN" "RASocket - X64 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hccldt.res" >+ -@erase "$(INTDIR)\RADataTransfer.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hccldt.dll" >+ -@erase "$(OUTDIR)\..\lib\hccldt.exp" >+ -@erase "$(OUTDIR)\..\lib\hccldt.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\RACommon" /I "..\RASharedMemory" /I "..\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RADataTransfer.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccldt.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RADataTransfer\RADataTransfer.def" /out:"$(OUTDIR)\hccldt.dll" /implib:"$(OUTDIR)\..\lib\hccldt.lib" /libpath:".\bin" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\RADataTransfer.obj" \ >+ "$(INTDIR)\hccldt.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hccldt.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Debug" >+ >+OUTDIR=..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hccldt.dll" >+ >+!ELSE >+ >+ALL : "RASocket - X64 Debug" "RASharedMemory - X64 Debug" "RACommon - X64 Debug" "$(OUTDIR)\hccldt.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - X64 DebugCLEAN" "RASharedMemory - X64 DebugCLEAN" "RASocket - X64 DebugCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hccldt.res" >+ -@erase "$(INTDIR)\RADataTransfer.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hccldt.dll" >+ -@erase "$(OUTDIR)\..\lib\hccldt.exp" >+ -@erase "$(OUTDIR)\..\lib\hccldt.ilk" >+ -@erase "$(OUTDIR)\..\lib\hccldt.lib" >+ -@erase "$(OUTDIR)\..\lib\hccldt.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\RACommon" /I "..\RASharedMemory" /I "..\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RADATATRANSFER_EXPORTS" /D "ENW" /D "SQLWINT" /Fp"$(INTDIR)\RADataTransfer.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hccldt.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hccldt.pdb" /debug /def:"..\RADataTransfer\RADataTransfer.def" /out:"$(OUTDIR)\hccldt.dll" /implib:"$(OUTDIR)\..\lib\hccldt.lib" /libpath:".\bin" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\RADataTransfer.obj" \ >+ "$(INTDIR)\hccldt.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hcclsm.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hccldt.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "RADataTransfer - IA64 Release" || "$(CFG)" == "RADataTransfer - IA64 Debug" || "$(CFG)" == "RADataTransfer - X64 Release" || "$(CFG)" == "RADataTransfer - X64 Debug" >+SOURCE=..\RADataTransfer\RADataTransfer.c >+ >+"$(INTDIR)\RADataTransfer.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\RADataTransfer\version.rc >+ >+!IF "$(CFG)" == "RADataTransfer - IA64 Release" >+ >+ >+"$(INTDIR)\hccldt.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccldt.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RADataTransfer" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - IA64 Debug" >+ >+ >+"$(INTDIR)\hccldt.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccldt.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RADataTransfer" /d "_DEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Release" >+ >+ >+"$(INTDIR)\hccldt.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccldt.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RADataTransfer" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Debug" >+ >+ >+"$(INTDIR)\hccldt.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hccldt.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RADataTransfer" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+!IF "$(CFG)" == "RADataTransfer - IA64 Release" >+ >+"RACommon - IA64 Release" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" >+ cd "..\RADataTransfer" >+ >+"RACommon - IA64 ReleaseCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Release" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - IA64 Debug" >+ >+"RACommon - IA64 Debug" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Debug" >+ cd "..\RADataTransfer" >+ >+"RACommon - IA64 DebugCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - IA64 Debug" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Release" >+ >+"RACommon - X64 Release" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" >+ cd "..\RADataTransfer" >+ >+"RACommon - X64 ReleaseCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Release" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Debug" >+ >+"RACommon - X64 Debug" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" >+ cd "..\RADataTransfer" >+ >+"RACommon - X64 DebugCLEAN" : >+ cd "..\RACommon" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak64" CFG="RACommon - X64 Debug" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ENDIF >+ >+!IF "$(CFG)" == "RADataTransfer - IA64 Release" >+ >+"RASharedMemory - IA64 Release" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Release" >+ cd "..\RADataTransfer" >+ >+"RASharedMemory - IA64 ReleaseCLEAN" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Release" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - IA64 Debug" >+ >+"RASharedMemory - IA64 Debug" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Debug" >+ cd "..\RADataTransfer" >+ >+"RASharedMemory - IA64 DebugCLEAN" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - IA64 Debug" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Release" >+ >+"RASharedMemory - X64 Release" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Release" >+ cd "..\RADataTransfer" >+ >+"RASharedMemory - X64 ReleaseCLEAN" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Release" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Debug" >+ >+"RASharedMemory - X64 Debug" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Debug" >+ cd "..\RADataTransfer" >+ >+"RASharedMemory - X64 DebugCLEAN" : >+ cd "..\RASharedMemory" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASharedMemory.mak64" CFG="RASharedMemory - X64 Debug" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ENDIF >+ >+!IF "$(CFG)" == "RADataTransfer - IA64 Release" >+ >+"RASocket - IA64 Release" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" >+ cd "..\RADataTransfer" >+ >+"RASocket - IA64 ReleaseCLEAN" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Release" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - IA64 Debug" >+ >+"RASocket - IA64 Debug" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Debug" >+ cd "..\RADataTransfer" >+ >+"RASocket - IA64 DebugCLEAN" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - IA64 Debug" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Release" >+ >+"RASocket - X64 Release" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Release" >+ cd "..\RADataTransfer" >+ >+"RASocket - X64 ReleaseCLEAN" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Release" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ELSEIF "$(CFG)" == "RADataTransfer - X64 Debug" >+ >+"RASocket - X64 Debug" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Debug" >+ cd "..\RADataTransfer" >+ >+"RASocket - X64 DebugCLEAN" : >+ cd "..\RASocket" >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak64" CFG="RASocket - X64 Debug" RECURSE=1 CLEAN >+ cd "..\RADataTransfer" >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/PerfmonAgent/version.rc >=================================================================== >RCS file: src-native-new/src/agents/perfmon/PerfmonAgent/version.rc >diff -N src-native-new/src/agents/perfmon/PerfmonAgent/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/PerfmonAgent/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION 3,1,0,0 >+ PRODUCTVERSION 3,1,0,0 >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", "ECLIPSE\0" >+ VALUE "FileDescription", "Performance Monitor Agent\0" >+ VALUE "FileVersion", "3, 1, 0, 0\0" >+ VALUE "InternalName", "\0" >+ VALUE "LegalCopyright", "© Copyright International Business Machines Corporation, 2003\0" >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "PerfmonAgent.exe\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", "3, 1, 0, 0\0" >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/agents/native/java_profiler/version.rc >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/version.rc >diff -N src-native-new/src/agents/native/java_profiler/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,110 @@ >+#include "../../../../include/tptp/version.h" >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION _VERSION_WIN >+ PRODUCTVERSION _VERSION_WIN >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", _COMPANY_NAME >+ VALUE "FileDescription", "Java Profiling Agent\0" >+ VALUE "FileVersion", _VERSION >+ VALUE "InternalName", "piAgent\0" >+ VALUE "LegalCopyright", _COPYRIGHT >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "piAgent.dll\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", _VERSION >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.dsp >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.dsp >diff -N src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,119 @@ >+# Microsoft Developer Studio Project File - Name="PerfmonAgent" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Console Application" 0x0103 >+ >+CFG=PerfmonAgent - Win32 Release >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "PerfmonAgent.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "PerfmonAgent.mak" CFG="PerfmonAgent - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "PerfmonAgent - Win32 Release" (based on "Win32 (x86) Console Application") >+!MESSAGE "PerfmonAgent - Win32 Debug" (based on "Win32 (x86) Console Application") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "PerfmonAgent - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "PerfmonAgent___Win32_Release" >+# PROP BASE Intermediate_Dir "PerfmonAgent___Win32_Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\bin" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\lib" >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "PerfmonAgent___Win32_Debug" >+# PROP BASE Intermediate_Dir "PerfmonAgent___Win32_Debug" >+# PROP BASE Ignore_Export_Lib 0 >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\bin" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /subsystem:console /machine:I386 /libpath:"bin" >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\lib" >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "PerfmonAgent - Win32 Release" >+# Name "PerfmonAgent - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\PerfmonAgent\PerfmonAgent.cpp >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\PerfmonAgent\cominterface.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\PerfmonAgent\PerfmonAgent.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\PerfmonAgent\resinterface.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\PerfmonAgent\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/perfmon/sysperf/version.rc >=================================================================== >RCS file: src-native-new/src/agents/perfmon/sysperf/version.rc >diff -N src-native-new/src/agents/perfmon/sysperf/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/sysperf/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION 3,1,0,0 >+ PRODUCTVERSION 3,1,0,0 >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", "ECLIPSE\0" >+ VALUE "FileDescription", "Performance Monitor Library\0" >+ VALUE "FileVersion", "3, 1, 0, 0\0" >+ VALUE "InternalName", "\0" >+ VALUE "LegalCopyright", "© Copyright International Business Machines Corporation, 2003\0" >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "sysperf.dll\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", "3, 1, 0, 0\0" >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/agents/perfmon/perflin/perflin.make >=================================================================== >RCS file: src-native-new/src/agents/perfmon/perflin/perflin.make >diff -N src-native-new/src/agents/perfmon/perflin/perflin.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/perflin/perflin.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+ >+################################################################################ >+# >+# makefile: perflin project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libperflin >+TARGETDIR := ../../../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../resutils >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl resutils >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DLINUX >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/agents/native/java_profiler/print.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/print.h >diff -N src-native-new/src/agents/native/java_profiler/print.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/print.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,386 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: print.h,v 1.6 2006/04/09 21:42:24 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __PRINT_H__ >+#define __PRINT_H__ 1 >+ >+#include "RAComm.h" >+#include <jvmpi.h> >+#include "hash.h" >+#include "stack.h" >+#include "filters.h" >+#include "performance.h" >+#include "JvmpiWriter.h" >+#include "RABindings.h" >+ >+/* TYPES >+ */ >+#ifdef _WIN32 /* _WIN32 */ >+ #define TIMEB struct _timeb >+ #define FTIME(param) _ftime(param) >+ typedef unsigned __int64 Uint64; >+#else /* else */ >+ #define TIMEB struct timeb >+ #define FTIME(param) ftime(param) >+#endif /* endif */ >+ >+enum FieldType {Static, Instance}; /* Indicates whether a field is a static field or an object instance field */ >+typedef enum FieldType FieldType_t; >+ >+/* GLOBALS >+ */ >+extern RA_HANDLE _jvmpiAgent_outFile; >+extern int _jvmpiAgent_suspendIO; /* TRUE = suspend output, FALSE = produce output */ >+ >+/** INITIALIZE_STANDALONE_IO ************************************************** >+ * Must be called when tracing in standalone mode to create IO buffers and >+ * asynchronous IO support (if enabled). >+ */ >+void jvmpiAgent_initializeStandaloneIO(); >+ >+ >+/** CLEANUP_STANDALONE_IO ***************************************************** >+ * Must be called when tracing in standalone to flush/close all the IO buffers. >+ */ >+void jvmpiAgent_cleanupStandaloneIO(); >+ >+ >+/** PRINT ******************************************************************** >+ * Transmit/print the raw data to the median. >+ * @param buffer - the buffer to write to the median. >+ * @param length - number of bytes to write >+ */ >+void jvmpiAgent_print(ThreadPrivateStorage *tps, >+ char *buffer, >+ unsigned short length); >+ >+ >+/** PRINT_CLASS ************************************************************** >+ * Handles the output of the CLASS_LOAD element and attributes >+ */ >+void jvmpiAgent_printClass(HashEntry *classHashEntry, >+ ThreadPrivateStorage *tps); >+ >+ >+/** PRINT_FIELDS ************************************************************* >+ * Handles the output of all the STATIC_FIELD or INSTANCE_FIELD elements >+ * and attributes for a class. >+ */ >+void jvmpiAgent_printFields(ThreadPrivateStorage *tps, >+ PI_Field *fp, >+ int count, >+ FieldType_t fieldType); >+ >+ >+/** PRINT_METHODS ************************************************************ >+ * Handles the output of all the METHOD elements and attributes for a class. >+ */ >+void jvmpiAgent_printMethods(HashEntry **mp, >+ int count, >+ ThreadPrivateStorage *tps); >+ >+ >+/** PRINT_METHOD ************************************************************* >+ */ >+void jvmpiAgent_printMethod(MethodEntry *methodEntry, >+ ThreadPrivateStorage *buffer); >+ >+/** PRINT_METHOD_ENTRY_EVENT ************************************************* >+ * >+ */ >+void jvmpiAgent_printMethodEntryEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ StackEntry *se, >+ unsigned long stackDepth); >+ >+ >+/** PRINT_METHOD_EXIT_EVENT ************************************************** >+ * >+ */ >+void jvmpiAgent_printMethodExitElement(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ HashEntry *methodHashEntry, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp); >+ >+/** PRINT_AG_METHOD_ENTRY_EVENT **************************preAgg/135437******* >+ * >+ */ >+void jvmpiAgent_printAgMethodEntryEvent(ThreadPrivateStorage * tps, >+ StackFrame * call); >+ >+ >+/** PRINT_AG_METHOD_EXIT_ELEMENT *************************preAgg/135437******* >+ * >+ */ >+void jvmpiAgent_printAgMethodExitElement(ThreadPrivateStorage * tps, >+ StackFrame * call); >+ >+ >+/** PRINT_EXCEPTION_ELEMENT ************************************************** >+ * >+ */ >+void jvmpiAgent_printExceptionElement(JNIEnv *env, >+ ThreadLocalStorage *tps, >+ enum ThrowOrCatch type, >+ HashEntry *methodHashEntry, >+ jobjectID objId, >+ jthrowable e); >+ >+/** PRINT_LINE_ELEMENT ******************************************************* >+ * >+ */ >+void jvmpiAgent_printLineElement(JNIEnv *env, >+ ThreadLocalStorage *tps, >+ HashEntry *methodHashEntry, >+ unsigned short lineNumber); >+ >+ >+/** PRINT_THREAD_END_ELEMENT ************************************************* >+ */ >+void jvmpiAgent_printThreadEndElement(JNIEnv *env_id, >+ ThreadLocalStorage *tps); >+ >+/** PRINT_OBJ_MOVE_ELEMENT *************************************************** >+ * Handles the output of OBJ_MOVE. >+ */ >+void jvmpiAgent_printObjMoveElement(JVMPI_Event *event, >+ HashEntry *objectHashEntry); >+ >+/** PRINT_OBJ_FREE_ELEMENT *************************************************** >+ * Handles the output of OBJ_FREE. >+ */ >+void jvmpiAgent_printObjFreeElement(ThreadLocalStorage *tps, >+ HashEntry *objectHashEntry); >+ >+ >+/** PRINT_CLASS_UNLOAD_ELEMENT *********************************************** >+ * >+ * PRECONDITIONS: classHashEntry must be valid. >+ */ >+void jvmpiAgent_printClassUnloadElement(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ HashEntry *classHashEntry); >+ >+ >+void jvmpiAgent_printJvmInitDoneElement(JVMPI_Event *event); >+void jvmpiAgent_printJvmShutdownElement(JVMPI_Event *event); >+ >+void jvmpiAgent_printGcStartElement(JVMPI_Event *event); >+void jvmpiAgent_printGcFinishElement(JVMPI_Event *event); >+ >+/** PRINT_MONITOR_WAIT_ELEMENT ***************************************************** >+ * >+ * Print the <monWait> element to the trace indicating JVMPI_EVENT_MONITOR_WAIT occurred. >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the MONITOR_WAIT event as reported by JVMPI >+ * timestamp - when the MONITOR_WAIT event occurred >+ * isThreadSleep - 0 indicates regular monitor, 1 indicates wait occurred >+ * within Thread.sleep() >+ */ >+void >+jvmpiAgent_printMonitorWaitElement(HashEntry *objectHashEntry, JVMPI_Event *event, >+ timestamp_t timestamp, int isThreadSleep); >+ >+/** PRINT_MONITOR_WAITED_ELEMENT ***************************************************** >+ * >+ * Print the <monWaited> element to the trace indicating JVMPI_EVENT_MONITOR_WAITED occurred. >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the MONITOR_WAITED event as reported by JVMPI >+ * timestamp - when the MONITOR_WAITED event occurred >+ * isThreadSleep - 0 indicates regular monitor, 1 indicates wait occurred >+ * within Thread.sleep() >+ */ >+void >+jvmpiAgent_printMonitorWaitedElement(HashEntry *objectHashEntry, JVMPI_Event *event, >+ timestamp_t timestamp, int isThreadSleep); >+ >+ >+/** PRINT_MONITOR_STILL_OWNED_ELEMENT ************************************************ >+ * >+ * Print the <monStillOwned> element to the trace indicating >+ * a thread is still owning a monitor at the moment we checked >+ * It is potentially sent on JVMPI_EVENT_MONITOR_CONTENDED_ENTER >+ * just before a <monContendedEnter> element where the >+ * thread is the contended thread >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the JVMPI_EVENT_MONITOR_CONTENDED_ENTER event as reported by JVMPI >+ */ >+void >+jvmpiAgent_printMonitorStillOwnedElement(HashEntry *objectHashEntry, JVMPI_Event *event); >+ >+/** PRINT_MONITOR_CONTENDED_ENTER_ELEMENT ************************************************ >+ * >+ * Print the <monContendedEnter> element to the trace indicating >+ * JVMPI_EVENT_MONITOR_CONTENDED_ENTER occurred. >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the MONITOR_WAITED event as reported by JVMPI >+ * thread_owner - the current owner thread of the monitor object >+ * timestamp - when the MONITOR_WAITED event occurred >+ */ >+void >+jvmpiAgent_printMonitorContendedEnterElement(HashEntry *objectHashEntry, JVMPI_Event *event, >+ unsigned long thread_owner, timestamp_t timestamp); >+ >+/** PRINT_MONITOR_CONTENDED_ENTERED_ELEMENT ************************************************ >+ * >+ * Print the <monContendedEntered> element to the trace indicating >+ * JVMPI_EVENT_MONITOR_CONTENDED_ENTERED occurred. >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the MONITOR_WAITED event as reported by JVMPI >+ * timestamp - when the MONITOR_WAITED event occurred >+ */ >+void >+jvmpiAgent_printMonitorContendedEnteredElement(HashEntry *objectHashEntry, JVMPI_Event *event, >+ timestamp_t timestamp); >+ >+/** PRINT_OBJ_ALLOC_ELEMENT ************************************************** >+ * Print OBJ_ALLOC to handle an object allocation. >+ */ >+void jvmpiAgent_printObjAllocElement(HashEntry *objectHashEntry, >+ JNIEnv *env_id, >+ timestamp_t timestamp); >+ >+/* REALLOCATE memory if the buffer size insufficient******************************* >+ * Check buffer size and realloc memory to prevent >+ * buffer overflow. >+ * >+ */ >+void >+jvmpiAgent_checkMemorySize(ThreadPrivateStorage *tps, >+ int in_value, >+ unsigned short current); >+ >+/** PRINT_THREAD_START_ELEMENT *********************************************** >+ * >+ */ >+void jvmpiAgent_printThreadStartElement(JNIEnv *env_id, >+ HashEntry *threadHashEntry); >+ >+/** PRINT_FILTER ************************************************************* >+ * Outputs a FILTER element >+ */ >+void jvmpiAgent_printFilter(ThreadLocalStorage *tps, >+ Filter *filter); >+ >+/** PRINT_OPTION ************************************************************* >+ * Outputs an OPTION element >+ */ >+void jvmpiAgent_PrintOption(ThreadLocalStorage *tps, >+ char *key, >+ char *value); >+ >+char * jvmpiAgent_formatName(char *name); >+ >+/** PRINT_TRACE_START_ELEMENT ************************************************ >+ */ >+void jvmpiAgent_printTraceStartElement(ThreadLocalStorage *tps, >+ char *options); >+ >+/** PRINT_TRACE_STOP_ELEMENT ************************************************* >+ */ >+void jvmpiAgent_printTraceStopElement(ThreadLocalStorage *tps); >+ >+void jvmpiAgent_printTraceEndElement(ThreadLocalStorage *tps); >+ >+/** PRINT_STANDALONE_TRACE_TAG_OPEN ****************************************** >+ */ >+void jvmpiAgent_printStandaloneTraceTagOpen(ThreadLocalStorage *tps); >+ >+/** PRINT_STANDALONE_TRACE_TAG_CLOSE ***************************************** >+ */ >+void jvmpiAgent_printStandaloneTraceTagClose(ThreadLocalStorage *tps); >+ >+/** PRINT_NODE_ELEMENT ******************************************************* >+ */ >+void jvmpiAgent_printNodeElement(ThreadLocalStorage *tps); >+ >+/** PRINT_PROCESS_CREATE_ELEMENT ********************************************* >+ */ >+void jvmpiAgent_printProcessCreateElement(ThreadLocalStorage *tps); >+ >+/** PRINT_AGENT_CREATE_ELEMENT *********************************************** >+ */ >+void jvmpiAgent_printAgentCreateElement(ThreadLocalStorage *tps, >+ char *options); >+/** PRINT_OBJECTREFERENCE_ELEMENT ******************************************** >+ */ >+void jvmpiAgent_printObjectArrayReferenceElement(ThreadLocalStorage *tps, >+ unsigned long obj_id, >+ unsigned int index, >+ jint objRef_id, >+ unsigned int firstSeen); >+ >+void jvmpiAgent_printObjectInstanceReferenceElement(ThreadLocalStorage *tps, >+ unsigned long obj_id, >+ unsigned int index, >+ jint objRef_id, >+ unsigned int firstSeen, >+ unsigned long fieldId); >+ >+void jvmpiAgent_printStaticReferenceElement(ThreadLocalStorage *tps, >+ unsigned long class_id, >+ unsigned int index, >+ jint objRef_id, >+ unsigned long fieldId); >+ >+/** PRINT_HEAP_DUMP START ELEMENT ********************************************* >+*/ >+void jvmpiAgent_printHDStartElement(ThreadLocalStorage *tps, >+ char* heapDefName); >+ >+/** PRINT_AGENT_DESTROY_ELEMENT ********************************************** >+ */ >+void jvmpiAgent_printAgentDestroyElement(ThreadLocalStorage *tps); >+ >+ >+/** PRINT_AGENT_DESTROY_ELEMENT ********************************************** >+ */ >+unsigned short jvmpiAgent_printTicketAttribute(SegmentedValue_t *ticket, >+ char *buffer, >+ unsigned short current); >+ >+/** PRINT_XML_START_ELEMENT ************************************************** >+ * Place the standard XML file start entry in the specified buffer. >+ * @param buffer - the buffer that will be loaded with the string (beginning) >+ */ >+void jvmpiAgent_printXMLStartElement(ThreadLocalStorage *tps); >+ >+/** PRINT_VM_SUSPEND ********************************************************* >+ * Loads the memory address specified by 'buffer' with a Suspend entity including >+ * timestamp. >+ */ >+extern void jvmpiAgent_printVMSuspend(ThreadLocalStorage *tps); >+ >+/** PRINT_VM_RESUME ********************************************************** >+ * Loads the memory address specified by 'buffer' with a Resume entity including >+ * timestamp. >+ */ >+extern void jvmpiAgent_printVMResume(ThreadLocalStorage *tps); >+ >+ >+/** PRINT GC_ROOT ************************************************************* >+ */ >+void jvmpiAgent_printGcRootElement(JVMPI_Event *event, unsigned long id, char* type); >+ >+ >+#endif >Index: src-native-new/src/agents/native/java_profiler/utility.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/utility.h >diff -N src-native-new/src/agents/native/java_profiler/utility.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/utility.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,125 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: utility.h,v 1.3 2006/04/24 13:29:35 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __UTILITY_H__ >+#define __UTILITY_H__ 1 >+ >+#ifdef _WIN32 >+ #include <winsock2.h> /* Bug 134924 */ >+ #include <Windows.h> >+ #include <Winbase.h> >+ #ifndef PATH_MAX >+ #define PATH_MAX (10 * _MAX_PATH) >+ char *realpath(const char* fileName, char * buf) ; >+ #endif >+#elif defined(__OS400__) >+ char *realpath(const char* fileName, char * buf) ; >+#endif >+ >+#ifndef PATH_MAX >+#define PATH_MAX 2048 >+#endif >+ >+#if defined __cplusplus && defined _HPUX >+ #define ENV(e) e >+ #define ENVPARM(e) >+#else >+ #define ENV(e) (*e) >+ #define ENVPARM(e) e, >+#endif >+ >+/** Macros used to simplify the use of JNI *************************/ >+ >+ >+/* Calling instance methods */ >+#define CALL_OBJ_METHOD0(env, classInstance, methodId) (jstring)(ENV(env)->CallObjectMethod(ENVPARM(env) classInstance, methodId)) >+#define CALL_OBJ_METHOD1(env, classInstance, methodId, param1) (jstring)(ENV(env)->CallObjectMethod(ENVPARM(env) classInstance, methodId, param1)) >+#define CALL_OBJ_METHOD2(env, classInstance, methodId, param1, param2) (jstring)(ENV(env)->CallObjectMethod(ENVPARM(env) classInstance, methodId, param1, param2)) >+ >+/* Calling static methods */ >+#define CALL_OBJ_SMETHOD0(env, classAssociated, methodId) (jstring)(ENV(env)->CallStaticObjectMethod(ENVPARM(env) classAssociated, methodId)) >+#define CALL_OBJ_SMETHOD1(env, classAssociated, methodId, param1) (jstring)(ENV(env)->CallStaticObjectMethod(ENVPARM(env) classAssociated, methodId, param1)) >+ >+ >+#define CREATE_JSTRING(env, text) ENV(env)->NewStringUTF(ENVPARM(env) text) >+#define FIND_CLASS(env, className) ENV(env)->FindClass(ENVPARM(env) className) >+ >+/* Get ID operations */ >+#define GET_METHODID(env, classAssociated, methodName, methodSig) ENV(env)->GetMethodID(ENVPARM(env) classAssociated, methodName, methodSig) >+#define GET_SMETHODID(env, classAssociated, methodName, methodSig) ENV(env)->GetStaticMethodID(ENVPARM(env) classAssociated, methodName, methodSig) >+#define GET_FIELDID(env, classAssociated, name, signature) ENV(env)->GetFieldID(ENVPARM(env) classAssociated, name, signature) >+#define GET_SFIELDID(env, classAssociated, name, signature) ENV(env)->GetStaticFieldID(ENVPARM(env) classAssociated, name, signature) >+ >+ >+#define GET_SFIELD(env, classAssociated, fieldId) ENV(env)->GetStaticObjectField(ENVPARM(env) classAssociated, fieldId) >+#define NEW_ARRAY(env, size, classAssociated, initialValue) ENV(env)->NewObjectArray(ENVPARM(env) size, classAssociated, initialValue) >+#define GET_ARRAY_SIZE(env, array) ENV(env)->GetArrayLength(ENVPARM(env) array) >+#define GET_ARRAY_ELEM(env, array, index) ENV(env)->GetObjectArrayElement(ENVPARM(env) array, index) >+#define ADD_TO_ARRAY(env, array, index, obj) ENV(env)->SetObjectArrayElement(ENVPARM(env) array, index, obj) >+ >+/* String operations */ >+#define CONVERT_TO_UTF(env, jstr) ENV(env)->GetStringUTFChars(ENVPARM(env) (jstring)jstr, NULL) >+#define RELEASE_UTF_CHARS(env, jstr, chrs) ENV(env)->ReleaseStringUTFChars(ENVPARM(env) (jstring)jstr, chrs) >+ >+ >+/* Exception checks and clears */ >+#if defined __cplusplus && defined _HPUX >+ #define CHECK_EXCEPTION(env) ENV(env)->ExceptionOccurred() >+#else >+ #define CHECK_EXCEPTION(env) ENV(env)->ExceptionOccurred(env) >+#endif >+ >+ >+#if defined __cplusplus && defined _HPUX >+ #define CLEAR_EXCEPTIONS(env) ENV(env)->ExceptionClear() >+#else >+ #define CLEAR_EXCEPTIONS(env) ENV(env)->ExceptionClear(env) >+#endif >+ >+ >+/** CALLOC ************************************************************* >+ * Allocate some memory from the heap. If there is no more memory left >+ * the VM will exit gracefully. >+ */ >+extern void* jvmpiAgent_Calloc(unsigned int size); >+ >+/******************************************************** >+ * strcpyrealloc() >+ * >+ * Copy one string to the other, first reallocating the >+ * space pointed to by the destination so that the src >+ * can comfortably fit in it. >+ * @param dest pointer to pointer to destination >+ * @param src the source string >+ * @return 0 if successful, -1 otherwise >+ */ >+ >+int strcpyrealloc(char **dest, const char *src); >+ >+/********************************************************* >+ * double2string() >+ * >+ * Take a value of type double and convert it into a string, >+ * using '.' (period) as the decimal symbol (i.e. ignore what >+ * the locale setting uses for a decimal place). >+ * >+ * The method further assumes val is non-negative. >+ * >+ * @param val the double value to be converted into a string (non-negative value) >+ * @param buffer the buffer into which the string should be put >+ * @param offset the offset into the buffer where to start writing >+ * @param precision the number of digits to appear after the decimal place >+ * @return the offset just past the last written position in buffer >+ */ >+unsigned short double2string(double val, char *buffer, unsigned short offset, int precision); >+ >+#endif >Index: src-native-new/src/agents/native/java_profiler/print.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/print.c >diff -N src-native-new/src/agents/native/java_profiler/print.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/print.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3656 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: print.c,v 1.12 2006/06/05 23:12:42 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifdef _JVMPI__ASYNCRONOUS_IO >+#ifdef _WIN32 >+ #include <winsock2.h> /* Bug 134924 */ >+ #include <windows.h> >+#else >+ #include <aio.h> >+#endif >+#endif >+ >+#ifndef _WIN32 >+ #include <fcntl.h> >+ #include <sys/stat.h> /* 199558 */ >+ #ifdef _HPUX >+ #include <unistd.h> >+ #endif >+#endif >+ >+#include "utility.h" >+#include "print.h" >+#include "options.h" >+#include "RASocket.h" >+#include "RADataTransfer.h" >+#include "RABindings.h" >+#include "JvmpiWriter.h" >+#include "eventmask.h" >+#include "strings.h" >+#include "assert.h" >+ >+#ifdef BINARY_TRACE >+#include "binary_print.h" >+#endif /* BINARY_TRACE */ >+ >+/* CPU timestamp granularity for each plaform */ >+#ifdef _WIN32 /* _WIN32 */ >+ #include <process.h> >+ #define THREADCPUPRECISION 7 >+ #define THREADCPUGRANULARITY 10000000 >+#else /* else */ >+ #define THREADCPUPRECISION 6 >+ #define THREADCPUGRANULARITY 1000000 >+#endif /* endif */ >+ >+#define TIMESTAMPPRECISION 6 >+ >+#ifdef _JVMPI__ASYNCRONOUS_IO >+ #define SEGMENT_SIZE 1024 /*1048576*/ >+ #define SEGMENT_COUNT 16 >+#endif >+ >+int REALLOCATED_BUFFER_SIZE = 1024; >+ >+static char *DOW[7]= {"Sun", "Mon", "Tue", "Wed", >+ "Thu", "Fri", "Sat"}; >+ >+static char *MOY[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", >+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; >+ >+RA_HANDLE _jvmpiAgent_outFile = RA_HANDLE_NULL; /* The output file */ >+ >+int _jvmpiAgent_suspendIO = 1; /* TRUE = suspend output, FALSE = produce output */ >+ >+ >+#ifdef _JVMPI__ASYNCRONOUS_IO >+#ifdef _WIN32 >+typedef struct { >+ int count; >+ int offset; >+ BOOL flushPending; >+ OVERLAPPED overlap; >+ char buffer[SEGMENT_SIZE]; >+}IOSegment_t; >+ >+#else >+#ifdef _AIX >+ #define AIO_WRITE(fildes, aiocb) aio_write(fildes, aiocb) >+#else >+ #define AIO_WRITE(fildes, aiocb) aio_write(aiocb) >+#endif >+ >+typedef struct { >+ int count; >+ int offset; >+ BOOL flushPending; >+ struct aiocb aiocb; >+ char buffer[SEGMENT_SIZE]; >+}IOSegment_t; >+ >+#endif >+ >+ >+IOSegment_t _ioBuffers[SEGMENT_COUNT]; /* The buffers for IO */ >+int _ioSegment=0; /* The currently active IO segment */ >+long _fileOffset=0; /* The offset in the file */ >+ >+ >+static int getSegment() >+{ >+ int oldCount; >+ int currentSegment=_ioSegment; >+ /* Increment the count on the current segment */ >+ oldCount=_ioBuffers[currentSegment].count; >+ while(!ra_atomicCAS((int*)&_ioBuffers[currentSegment].count, (int*)&oldCount, (int)(oldCount+1))); >+ return currentSegment; >+} >+ >+static void releaseSegment(int currentSegment, int segmentOffset) >+{ >+ int oldCount; >+ >+ /* Decrement the count on the segment */ >+ oldCount=_ioBuffers[currentSegment].count; >+ while(!ra_atomicCAS((int*)&_ioBuffers[currentSegment].count, (int*)&oldCount, (int)(oldCount-1))); >+ >+ /* If we were the last element in the segment does it need to be flushed? */ >+ if(oldCount==1) { >+ int currentFileOffset; >+ int bytesWritten; >+ >+ if(_ioBuffers[currentSegment].flushPending) >+ { >+ /* Increment the file pointer for the next IO operation */ >+ currentFileOffset=_fileOffset; >+ while(!ra_atomicCAS(&_fileOffset, ¤tFileOffset, currentFileOffset+segmentOffset)); >+ >+ >+#ifdef _WIN32 >+ _ioBuffers[currentSegment].overlap.Offset=currentFileOffset; >+startWrite: >+ /* Ensure it has finished flushing from the last time it was full */ >+ WaitForSingleObject(_ioBuffers[currentSegment].overlap.hEvent, 0); >+ if(!WriteFile(_jvmpiAgent_outFile, _ioBuffers[currentSegment].buffer, _ioBuffers[currentSegment].offset, &bytesWritten, &_ioBuffers[currentSegment].overlap)) >+ { >+ DWORD error=GetLastError(); >+ if(error!=ERROR_IO_PENDING) >+ { >+ switch(error) >+ { >+ case ERROR_NOT_ENOUGH_MEMORY: >+ case ERROR_INVALID_USER_BUFFER: >+ case ERROR_NOT_ENOUGH_QUOTA: >+ case ERROR_WORKING_SET_QUOTA: >+ goto startWrite; >+ default: >+ printf("Severe error pushing IO\n"); >+ fflush(stdout); >+ } >+ } >+ } >+#else >+ _ioBuffers[currentSegment].aiocb.aio_offset=currentFileOffset; >+ _ioBuffers[currentSegment].aiocb.aio_nbytes=_ioBuffers[currentSegment].offset; >+startWrite: >+ printf("Flushing buffer\n"); >+ fflush(stdout); >+ if(AIO_WRITE(_jvmpiAgent_outFile, &_ioBuffers[currentSegment].aiocb)) >+ { >+ printf(" Flushing failed\n"); >+ fflush(stdout); >+ >+ } >+#endif >+ >+ /* Reset the offset of this segment to zero */ >+ /* while(!ra_atomicCAS(&_ioBuffers[currentSegment].offset, ¤tBufferOffset, 0)); */ >+ _ioBuffers[currentSegment].offset=0; >+ _ioBuffers[currentSegment].flushPending=FALSE; >+ } >+ } >+ >+} >+#endif /* _JVMPI__ASYNCRONOUS_IO */ >+ >+ >+ >+void jvmpiAgent_initializeStandaloneIO() { >+#ifdef _WIN32 >+ _jvmpiAgent_outFile=CreateFile(_jvmpiAgent_Options.outputFileName, >+ GENERIC_WRITE, >+ FILE_SHARE_READ, >+ NULL, >+ CREATE_ALWAYS, >+ FILE_ATTRIBUTE_NORMAL >+#ifdef _JVMPI__ASYNCRONOUS_IO >+ | FILE_FLAG_OVERLAPPED >+#endif >+ , >+ NULL); >+ >+#else >+/* 199373 - added permissions */ >+ _jvmpiAgent_outFile = open(_jvmpiAgent_Options.outputFileName, >+ O_WRONLY|O_CREAT|O_TRUNC, >+ S_IRUSR | S_IWUSR | S_IRGRP ); >+#endif >+ >+ >+ /* Check the file descriptor to ensure it is valid */ >+ >+ if(_jvmpiAgent_outFile >+#ifdef _WIN32 >+ == INVALID_HANDLE_VALUE) >+#else >+ < 0) >+#endif >+ { >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ fprintf(stderr, "*** Could not open profile output file \"%s\". Exiting JVM. ***\n", _jvmpiAgent_Options.outputFileName); >+ fflush(stderr); >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ _jvmpiAgent_jvmpiInterface->ProfilerExit((jint)-1); >+ } >+ >+ >+ >+#ifdef _JVMPI__ASYNCRONOUS_IO >+ int i; >+ for(i=0; i<SEGMENT_COUNT; i++) >+ { >+ _ioBuffers[i].offset=0; >+#ifdef _WIN32 >+ _ioBuffers[i].overlap.hEvent=CreateEvent(NULL, FALSE, FALSE, NULL); >+ _ioBuffers[i].overlap.Offset=0; >+ _ioBuffers[i].overlap.OffsetHigh=0; >+#else >+#ifndef _AIX >+ _ioBuffers[i].aiocb.aio_fildes=_jvmpiAgent_outFile; /* output file */ >+#else >+ _ioBuffers[i].aiocb.aio_offset=0; /* file offset */ >+ _ioBuffers[i].aiocb.aio_buf=_ioBuffers[i].buffer; /* i/o buffer */ >+ _ioBuffers[i].aiocb.aio_reqprio=0; /* request priority offset */ >+#ifdef _AIX >+ /*_ioBuffers[i].aiocb.aio_event); */ /* signal number and value */ >+#else >+ /*_ioBuffers[i].aiocb.aio_sigevent= */ /* signal number and value */ >+#endif >+ /*_ioBuffers[i].aiocb.aio_lio_opcode=LIO_WRITE; */ /* operation to be preformed */ >+#endif >+#endif >+ _ioBuffers[i].flushPending=FALSE; >+ } >+#endif /* _JVMPI__ASYNCRONOUS_IO */ >+} >+ >+void jvmpiAgent_cleanupStandaloneIO() >+{ >+#ifdef _JVMPI__ASYNCRONOUS_IO >+ int segment=getSegment(); >+ _ioBuffers[segment].flushPending=TRUE; >+ releaseSegment(segment, _ioBuffers[segment].offset); >+#endif /* _JVMPI__ASYNCRONOUS_IO */ >+ CLOSE_RA_HANDLE(_jvmpiAgent_outFile); >+} >+ >+ >+/** PRINT ********************************************************************** >+ * Transmit/print the raw data to the median. >+ * @param buffer - the buffer to write to the median. >+ * @param length - number of bytes to write >+ */ >+void jvmpiAgent_print(ThreadPrivateStorage *tps, char *s, unsigned short length) >+{ >+ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ if (!_jvmpiAgent_Options.standalone) >+ { >+ /* Insert the length of the data in the buffer and transmit */ >+#ifdef __OS400__ >+ if (s) { >+ /* need to reassign the result back to tps->buffer2 because iconv modified tps->buffer2 */ >+ tps->buffer2 = as400_etoa_tobuffer(s, tps->buffer2); >+ ra_writeMessageBlock(&_jvmpiAgent_Options.targetHdl, RA_BINARY_DATA, (unsigned char *)tps->buffer2, length); /* 232010 */ >+ } >+#else >+ ra_writeMessageBlock(&_jvmpiAgent_Options.targetHdl, RA_BINARY_DATA, (unsigned char *)s, length); >+#endif >+ } >+ else >+ { >+ int currentBufferOffset; >+ BOOL success=FALSE; >+ >+ if(!_jvmpiAgent_Options.jinsightFormat) { >+ s[length++]='\n'; >+ } >+ >+#ifndef _JVMPI__ASYNCRONOUS_IO >+ >+#ifdef _WIN32 >+ WriteFile(_jvmpiAgent_outFile, s, length, ¤tBufferOffset, NULL); >+#else >+#ifdef MVS /* 174190 */ >+ if(!_jvmpiAgent_Options.jinsightFormat) { >+ s[length]='\0'; /* need to make the string null terminated for atoe conversion */ >+ __atoe(s); >+ } >+#endif >+ write(_jvmpiAgent_outFile, s, length); >+#endif >+#else /* _JVMPI__ASYNCRONOUS_IO */ >+ >+ /* Always work with the same segment */ >+ currentSegment=getSegment(); >+ >+ /* Grab some space within this segment */ >+ currentBufferOffset=_ioBuffers[currentSegment].offset; >+ while(!ra_atomicCAS((int*)&_ioBuffers[currentSegment].offset, (int*)¤tBufferOffset, (int)(currentBufferOffset+length))); >+ >+ /* If there is room in this segment copy our data in. Otherwise mark >+ this buffer to be flushed and increment the segment counter */ >+ if(currentBufferOffset+length<SEGMENT_SIZE) >+ { >+#ifdef MVS /* 174190 */ >+ if(!_jvmpiAgent_Options.jinsightFormat) { >+ s[length]='\0'; /* need to make the string null terminated for atoe conversion */ >+ __atoe(s); >+ } >+#endif >+ memcpy(&_ioBuffers[currentSegment].buffer[currentBufferOffset], s, length); >+ success=TRUE; >+ } >+ else { >+ /* printf("Flush pending\n"); */ >+ _ioBuffers[currentSegment].flushPending=TRUE; >+ >+ /* Increment the segment pointer */ >+ while(!ra_atomicCAS((int*)&_ioSegment, (int*)¤tSegment, (int)((currentSegment+1)%16))); >+ } >+ >+ releaseSegment(currentSegment, currentBufferOffset); >+ >+ /* If we failed to transfer our data we need to try again */ >+ if(!success) >+ { >+ jvmpiAgent_print(tps, s, length); >+ } >+#endif /* _JVMPI__ASYNCRONOUS_IO */ >+ >+ } >+ } >+} >+ >+/* REALLOCATE memory if the buffer size insufficient******************************* >+ * Check buffer size and realloc memory to prevent >+ * buffer overflow. >+ * >+ */ >+void >+jvmpiAgent_checkMemorySize(ThreadPrivateStorage *tps, >+ int in_value, >+ unsigned short current) >+{ >+ if(in_value > REALLOCATED_BUFFER_SIZE){ >+ char *p = (char *)ra_allocateMessageBlock((ra_uint_t)(in_value+1) * sizeof(char)); >+ #ifdef __OS400__ >+ char *p2 = (char *)ra_allocateMessageBlock((ra_uint_t)(in_value+1) * sizeof(char)); >+ #endif >+ if(p != NULL && tps->buffer != NULL){ >+ memcpy(p, tps->buffer, current); >+ p[current] = '\0'; >+ ra_freeMessageBlock((unsigned char *)tps->buffer); >+ tps->buffer = (char *)p; >+ REALLOCATED_BUFFER_SIZE = in_value+1; >+ #ifdef __OS400__ >+ memcpy(p2, tps->buffer2, current); >+ p2[current] = '\0'; >+ ra_freeMessageBlock((unsigned char *)tps->buffer2); >+ tps->buffer2 = (char *)p2; >+ REALLOCATED_BUFFER_SIZE = in_value+1; >+ #endif >+ } >+ } >+} >+ >+/** INSERT_ELEMENT_START ******************************************************** >+ * Creates an XML entry tag and places it immediately following the data header >+ * of the provided buffer. DOES NO BOUNDS CHECKING. >+ * with the name specified. This function >+ * @param elementName - The XML tage name >+ * @param elementNameLength - the length of the element name >+ * @param buffer - The buffer to place the tag in (at the beginning) >+ * @returns >0 - the next index in the buffer free for writing. >+ * 0 - >+ */ >+static unsigned short >+jvmpiAgent_insertElementStart(const char *elementName, >+ unsigned short elementNameLength, >+ ThreadPrivateStorage *tps) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ tps->buffer[0]='<'; >+ memcpy(&tps->buffer[1], elementName, elementNameLength); >+ return elementNameLength+1; >+ } >+ return 0; >+} >+static unsigned short >+jvmpiAgent_appendInt16(char *buffer, >+ unsigned short offset, >+ unsigned short value) { >+ buffer[offset++]=(unsigned char)value>>8 & 0x00ff; >+ buffer[offset++]=(unsigned char)value; >+ return offset; >+} >+ >+static unsigned short >+jvmpiAgent_appendInt32(char *buffer, >+ unsigned short offset, >+ unsigned long value) { >+ buffer[offset++]=(unsigned char)value>>24 & 0x000000ff; >+ buffer[offset++]=(unsigned char)value>>16 & 0x000000ff; >+ buffer[offset++]=(unsigned char)value>>8 & 0x000000ff; >+ buffer[offset++]=(unsigned char)value; >+ return offset; >+} >+ >+ >+/** APPEND_INTEGER_ATTRIBUTE ********************************************************** >+ */ >+static unsigned short >+jvmpiAgent_appendIntegerAttribute(const char *attributeName, >+ unsigned short attributeNameLength, >+ unsigned short offset, >+ int value, >+ char *buffer) >+{ >+#ifdef _WIN32 >+ buffer[offset++]=' '; >+ memcpy(&buffer[offset], attributeName, attributeNameLength); >+ offset+=attributeNameLength; >+ buffer[offset++]='='; >+ buffer[offset++]='\"'; >+ /* We could optimize this conversion by writing assembley language >+ and keepin track of the offset, instead we will convert using itoa >+ and then add the length of this string to the offset */ >+ itoa(value, &buffer[offset], 10); >+ offset+=strlen(&buffer[offset]); >+ buffer[offset++]='\"'; >+ return offset; >+#else >+ int length; >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+ char intstr[20]; >+ length=sprintf(intstr,"=\"%d\"",value); >+ __etoa(intstr); >+ length=sprintf(&buffer[offset], "%c%s%s", 0x20, attributeName, intstr); >+#pragma convlit(resume) >+#else >+ length=sprintf(&buffer[offset], " %s=\"%d\"", attributeName, value); >+#endif >+ return offset+length; >+#endif >+} >+ >+ >+ >+/** APPEND_INTEGER_64_ATTRIBUTE ********************************************************** >+ */ >+static unsigned short >+jvmpiAgent_appendInteger64Attribute(const char *attributeName, >+ unsigned short attributeNameLength, >+ unsigned short offset, >+ Uint64 value, >+ char *buffer) >+{ >+#ifdef _WIN32 >+ buffer[offset++]=' '; >+ memcpy(&buffer[offset], attributeName, attributeNameLength); >+ offset+=attributeNameLength; >+ buffer[offset++]='='; >+ buffer[offset++]='\"'; >+ /* This is a Microsoft specific conversion routine */ >+ _ui64toa(value, &buffer[offset], 10); >+ offset+=strlen(&buffer[offset]); >+ buffer[offset++]='\"'; >+ return offset; >+#else >+ int length; >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+ char intstr[50]; >+ length=sprintf(intstr,"=\"%lu\"",value); /*fix 89008*/ >+ __etoa(intstr); >+ length=sprintf(&buffer[offset], "%c%s%s", 0x20, attributeName, intstr); >+#pragma convlit(resume) >+#else >+ length=sprintf(&buffer[offset], " %s=\"%lu\"", attributeName, value); /*fix 89008*/ >+#endif >+ return offset+length; >+#endif >+} >+ >+ >+/** APPEND_LONG_ATTRIBUTE ********************************************************** >+ */ >+static unsigned short >+jvmpiAgent_appendLongAttribute(const char *attributeName, >+ unsigned short attributeNameLength, >+ unsigned short offset, >+ long value, >+ char *buffer) >+{ >+#ifdef _WIN32 >+ buffer[offset++]=' '; >+ memcpy(&buffer[offset], attributeName, attributeNameLength); >+ offset+=attributeNameLength; >+ buffer[offset++]='='; >+ buffer[offset++]='\"'; >+ /* We could optimize this conversion by writing assembley language >+ and keepin track of the offset, instead we will convert using itoa >+ and then add the length of this string to the offset */ >+ ltoa(value, &buffer[offset], 10); >+ offset+=strlen(&buffer[offset]); >+ buffer[offset++]='\"'; >+ return offset; >+#else >+ int length; >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+ char intstr[50]; >+ length=sprintf(intstr,"=\"%ld\"",value); /*fix 89008*/ >+ __etoa(intstr); >+ length=sprintf(&buffer[offset], "%c%s%s", 0x20, attributeName, intstr); >+#pragma convlit(resume) >+#else >+ length=sprintf(&buffer[offset], " %s=\"%ld\"", attributeName, value); /*fix 89008*/ >+#endif >+ return offset+length; >+#endif >+} >+ >+static unsigned short >+jvmpiAgent_appendUnsignedLongAttribute(const char *attributeName, >+ unsigned short attributeNameLength, >+ unsigned short offset, >+ unsigned long value, >+ char *buffer) >+{ >+#ifdef _WIN32 >+ buffer[offset++]=' '; >+ memcpy(&buffer[offset], attributeName, attributeNameLength); >+ offset+=attributeNameLength; >+ buffer[offset++]='='; >+ buffer[offset++]='\"'; >+ /* We could optimize this conversion by writing assembley language >+ and keepin track of the offset, instead we will convert using itoa >+ and then add the length of this string to the offset */ >+ ultoa(value, &buffer[offset], 10); >+ offset+=strlen(&buffer[offset]); >+ buffer[offset++]='\"'; >+ return offset; >+#else >+ int length; >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+ char intstr[50]; >+ length=sprintf(intstr,"=\"%lu\"",value); /*fix 89008*/ >+ __etoa(intstr); >+ length=sprintf(&buffer[offset], "%c%s%s", 0x20, attributeName, intstr); >+#pragma convlit(resume) >+#else >+ length=sprintf(&buffer[offset], " %s=\"%lu\"", attributeName, value); /*fix 89008*/ >+#endif >+ return offset+length; >+#endif >+} >+ >+static unsigned short >+jvmpiAgent_appendListInteger(unsigned short offset, >+ int value, >+ char *buffer) >+{ >+#ifdef _WIN32 >+ /* Overwrite the previously appended space */ >+ buffer[offset-1]=','; >+ ltoa(value, &buffer[offset], 10); >+ offset+=strlen(&buffer[offset]); >+ buffer[offset++]='\"'; >+ return offset; >+#else >+ int length; >+ buffer[offset-1]=','; >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+#endif >+ length=sprintf(&buffer[offset], "%d\"", value); >+#ifdef MVS /* 174190 */ >+ buffer[offset+length]='\0'; >+#pragma convlit(resume) >+ __etoa(buffer+offset); >+#endif >+ return offset+length; >+#endif >+} >+ >+static unsigned short >+jvmpiAgent_appendListUnsignedLong(unsigned short offset, >+ unsigned long value, >+ char *buffer) >+{ >+#ifdef _WIN32 >+ /* Overwrite the previously appended space */ >+ buffer[offset-1]=','; >+ ultoa(value, &buffer[offset], 10); >+ offset+=strlen(&buffer[offset]); >+ buffer[offset++]='\"'; >+ return offset; >+#else >+ int length; >+ buffer[offset-1]=','; >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+#endif >+ length=sprintf(&buffer[offset], "%u\"", value); >+#ifdef MVS /* 174190 */ >+ buffer[offset+length]='\0'; >+#pragma convlit(resume) >+ __etoa(buffer+offset); >+#endif >+ return offset+length; >+#endif >+} >+ >+ >+/** APPEND_STRING_ATTRIBUTE ********************************************************** >+ */ >+ >+/* 50273 >+ * KC: Certain characters occurring in string attributes must be escaped >+ * to make them palatabale to XML. For example, '>' better show up as >+ * '>'. The code below is in support of these conversions, on behalf >+ * of jvmpiAgent_appendStringAttribute. >+ */ >+#ifndef MAX >+#define MAX(a,b) ((a) >= (b) ? (a) : (b)) >+#endif >+ >+#define MAX_ESCAPED_STRING_SIZE 7 >+typedef struct escape_seq >+{ >+ char s[MAX_ESCAPED_STRING_SIZE]; >+ int len; >+} escape_seq_t; >+ >+/* ordering in escapees must match that in escape_str table */ >+ >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ >+const char escapees[] = "<>&\"'"; >+static const escape_seq_t escape_str[] = >+ { >+ {/* < */ "<", sizeof("<") - 1}, >+ {/* > */ ">", sizeof(">") - 1}, >+ {/* & */ "&", sizeof("&") - 1}, >+ {/* " */ """, sizeof(""") - 1}, >+ {/* ' */ "'", sizeof("'") - 1}, >+ {"", 0} >+ }; >+ >+#ifdef __OS400__ /* 239987 starts */ >+#pragma convert(0) >+#endif >+ >+/* To accomodate escape strings, we need to alloc some extra space. >+ * Do it in chunks instead of one string at a time, to minimize >+ * the allocation thrash. */ >+#define XML_ESCAPE_CHUNK_SIZE 128 >+ >+ >+typedef struct range { >+ unsigned char lower; >+ unsigned char upper; >+} Range; >+ >+ >+/* This table of values is based on Table 3-6 "Well-formed UTF-8 >+Byte Sequences", available at >+http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf >+ >+Entries with 0x00 as the upper part of the range are NOT part of >+the expected byte sequence in a well-formed utf-8 byte sequence. >+For example, for utf8Table[1], the first character seen in the valid >+byte sequence is between 0xC2 and 0xDF, and the next must be between 0x80 >+and 0xBF. Since utf8Table[1][2].upper is 0x00, the next character beyond this >+is considered to be part of the "next" byte sequence. >+*/ >+ >+Range utf8Table[][4] = >+{ >+ { {0x00,0x7F},{0x00,0x00},{0x00,0x00}, {0x00,0x00} }, >+ { {0xC2,0xDF},{0x80,0xBF},{0x00,0x00}, {0x00,0x00} }, >+ { {0xE0,0xE0},{0xA0,0xBF},{0x80,0xBF}, {0x00,0x00} }, >+ { {0xE1,0xEC},{0x80,0xBF},{0x80,0xBF}, {0x00,0x00} }, >+ { {0xED,0xED},{0x80,0x9F},{0x80,0xBF}, {0x00,0x00} }, >+ { {0xEE,0xEF},{0x80,0xBF},{0x80,0xBF}, {0x00,0x00} }, >+ { {0xF0,0xF0},{0x90,0xBF},{0x80,0xBF}, {0x80,0xBF} }, >+ { {0xF1,0xF3},{0x80,0xBF},{0x80,0xBF}, {0x80,0xBF} }, >+ { {0xF4,0xF4},{0x80,0x8F},{0x80,0xBF}, {0x80,0xBF} } >+}; >+ >+ >+ >+/* stripControls(const char *inbuf, char **outBuf) >+ >+ Strip invalid UTF-8 characters. >+ >+ This function strips invalid UTF-8 characters by verifying that the >+ byte sequences within the buffer provided (inbuf) are valid according >+ to the "Well-formed UTF-8 Byte Sequences" table. >+ >+ @param inbuf the buffer to strip of invalid utf-8 characters >+ @param outBuf the buffer into which to put the stripped version of inbuf >+ @return outBuf if any characters were stripped from inbuf, NULL otherwise. >+*/ >+static char* >+stripControls(const unsigned char *inbuf, unsigned char **outBuf) { >+ const unsigned char * end; >+ unsigned char *offset=NULL; >+ unsigned char *current=(unsigned char*)inbuf; >+ end=inbuf+strlen((const char *)inbuf); >+ while(current<end) { >+ int idx, row = -1, numCharsToStrip = 0, numCharsToPass = 1; >+ >+ /* we first determine the row of the UTF-8 table that we are dealing >+ with. This will allow us to examine the byte sequence to see >+ if the individual bytes fall within the expected range as laid out in >+ the table. */ >+ for (idx = 0; idx < 9; idx++) { >+ if (*current >= utf8Table[idx][0].lower && >+ *current <= utf8Table[idx][0].upper) { >+ row = idx; >+ break; >+ } >+ } >+ >+ >+ /* If we were unable to determine the row, then this character >+ comprises an ill-formed byte-sequence and should be stripped */ >+ if (row == -1) { >+ numCharsToStrip = 1; >+ } >+ >+ /* If we are dealing with the first row, then this is a standard ASCII >+ character and we must check if there are any control characters >+ to be stripped */ >+ else if (row == 0) { >+ if (*current < 0x20) { >+ switch (*current) { >+ case 0x9: /* Horizontal TAB */ >+ case 0xA: /* New line */ >+ case 0xD: /* Carriage return */ >+ break; /* do not strip the character */ >+ default: >+ numCharsToStrip = 1; /* strip the character */ >+ break; >+ } >+ } >+ } >+ >+ /* Otherwise verify that each byte in the byte-sequence >+ falls within the required range as dictated by the utf-8 table */ >+ else { >+ for (idx = 1; idx < 4 && current+idx < end && >+ utf8Table[row][idx].upper != 0x00; idx++) { >+ if (*(current+idx) < utf8Table[row][idx].lower || >+ *(current+idx) > utf8Table[row][idx].upper) { >+ /* We have detected an invalid byte in the >+ byte sequence. We can safely strip the >+ bytes up to but not including the >+ current byte we are examining. */ >+ numCharsToStrip = idx; >+ break; >+ } >+ else { >+ numCharsToPass++; >+ } >+ } >+ /* If we fell off the end before the byte-sequence was expected >+ to finish then we should strip the characters */ >+ if (current + idx >= end && idx < 4 >+ && utf8Table[row][idx].upper != 0x00) { >+ numCharsToStrip = idx; >+ } >+ >+ /* Code points U+FFFE and U+FFFF are not valid XML -- we need >+ the following special case to check for the UTF-8 encodings of these >+ code points and strip them */ >+ if (numCharsToStrip == 0 && row == 5 && idx == 3) { >+ /* check for code points U+FFFE or U+FFFF */ >+ if ( (*current == 0xEF) && >+ (*(current+1) == 0xBF) && >+ ( (*(current+2) == 0xBE) || (*(current+2) == 0xBF) ) ) { >+ numCharsToStrip = 3; >+ } >+ } >+ } >+ >+ if (numCharsToStrip > 0) { >+ /* if necessary create the new buffer into which we put >+ the stripped version of the original buffer */ >+ if(!offset) { >+ offset=(unsigned char*)malloc(strlen((const char *)inbuf)); >+ memcpy(offset, inbuf, current-inbuf); >+ *outBuf=offset; >+ offset+=current-inbuf; >+ } >+ current += numCharsToStrip; >+ } >+ else if(offset) { >+ if (numCharsToPass == 1) { >+ /* we don't bother with the overhead calling the memcpy >+ function in the most frequent case */ >+ *offset++ = *current++; >+ } >+ else { >+ memcpy(offset,current,numCharsToPass); >+ offset += numCharsToPass; >+ current += numCharsToPass; >+ } >+ } >+ else { >+ current += numCharsToPass; >+ } >+ } >+ >+ >+ if(offset) { >+ *offset='\0'; >+ return (char *)*outBuf; >+ } >+ return NULL; >+ >+} >+ >+/* The basic idea is to locate and quickly copy the substrings >+ * within inbuf that do not require escaping, then do something more >+ * costly for handling the special characters. An assumption is made >+ * that special chars will be few and far between, so the code is >+ * optimized first for the case where there are no special chars >+ * and then for large substrings of "normal" chars. */ >+static char* >+escape_for_xml(const char *inbuf, char **outbuf) >+{ >+ size_t span; /* span of substr not requiring escape */ >+ char *op; /* current loc in output buffer */ >+ char *start_op; /* beginning of output buffer */ >+ char *end_op; /* end of alloc'd output buffer */ >+ size_t out_len; /* size of alloc'd output buffer */ >+ const char *ip; /* current loc in inbuf */ >+ const char *end_ip; /* ptr to terminating null in inbuf */ >+ size_t in_len = strlen(inbuf); >+ >+ >+ /* Check the green path first */ >+ span = strcspn(inbuf, escapees); >+ if (span == in_len) { >+ /* No chars require escaping. We're outta here. */ >+ return NULL; >+ } >+ >+ /* There are one or more escapable characters. */ >+ ip = inbuf; >+ end_ip = inbuf + in_len; >+ >+ out_len = in_len + XML_ESCAPE_CHUNK_SIZE; >+ start_op = (char*) malloc(out_len); >+ end_op = start_op + out_len; >+ op = start_op; >+ >+ while (ip < end_ip) >+ { >+ int i; >+ >+ /* do we need more space in output buffer? */ >+ if (op + span + MAX_ESCAPED_STRING_SIZE >= end_op) >+ { >+ size_t used = op - start_op; >+ >+ out_len += MAX(span+MAX_ESCAPED_STRING_SIZE, >+ XML_ESCAPE_CHUNK_SIZE); >+ start_op = (char*) realloc(start_op, out_len); >+ op = start_op + used; /* reset curr ptr in new buffer */ >+ end_op = start_op + out_len; >+ } >+ >+ /* handle unescaped portion with straight copy */ >+ if (span > 0) { >+ memcpy(op, ip, span); >+ op += span; >+ ip += span; >+ } >+ >+ /* handle char requiring escaping */ >+ for (i = 0; escape_str[i].len > 0; i++) { >+ if ( *ip == escapees[i] ) { >+ memcpy(op, escape_str[i].s, escape_str[i].len); >+ op += escape_str[i].len; >+ ip++; >+ break; >+ } >+ } >+ >+ /* are there any more chars requiring escaping? */ >+ span = strcspn(ip, escapees); >+ } >+ *op = '\0'; >+ *outbuf = start_op; >+ >+ return start_op; >+} >+ >+static unsigned short >+jvmpiAgent_appendStringAttribute(const char *attributeName, >+ unsigned short attributeNameLength, >+ unsigned short offset, >+ const char *in_value, >+ ThreadPrivateStorage *tps) >+{ >+ int valLength; >+ int addToBuffer; >+ >+ valLength= in_value ? strlen(in_value) : 0; >+ >+ addToBuffer = offset + 4 + attributeNameLength + valLength + 1; >+ jvmpiAgent_checkMemorySize(tps, addToBuffer, offset); >+ >+ tps->buffer[offset++]=' '; >+ memcpy(&tps->buffer[offset], attributeName, attributeNameLength); >+ offset+=attributeNameLength; >+ tps->buffer[offset++]='='; >+ tps->buffer[offset++]='\"'; >+ if(valLength>0) >+ { >+ const char *value; >+ const char *strippedValue=NULL; >+ >+ /* Strip invalid control characters from the string. These will mess up the XML */ >+ >+#ifdef __OS400__ >+ if( !strcmp(attributeName, APPLICATION_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, GROUP_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, NAME_ATTRIBUTE) || >+ !strcmp(attributeName, PARENT_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, SOURCE_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, SIGNATURE_ATTRIBUTE) || >+ !strcmp(attributeName, THREAD_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, PATTERN_ATTRIBUTE) || >+ !strcmp(attributeName, METHOD_PATTERN_ATTRIBUTE)) { >+#endif >+ if(stripControls((unsigned char *)in_value, (unsigned char**)&strippedValue)) { >+ valLength = strlen(strippedValue); >+ } >+ else { >+ strippedValue=in_value; >+ } >+#ifdef __OS400__ >+ } >+ else { >+ strippedValue = in_value; >+ } >+#endif >+ >+ if (escape_for_xml(strippedValue, (char**)&value)) { /* 50273 */ >+ /* we had to add escape sequences to input string */ >+ valLength = strlen(value); >+ } else { >+ /* nothing changed, use orig input, don't reset length */ >+ value = strippedValue; >+ } >+ >+#ifdef __OS400__ /* 236501 */ >+ if( !strcmp(attributeName, APPLICATION_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, GROUP_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, NAME_ATTRIBUTE) || >+ !strcmp(attributeName, PARENT_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, SOURCE_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, SIGNATURE_ATTRIBUTE) || >+ !strcmp(attributeName, THREAD_NAME_ATTRIBUTE) || >+ !strcmp(attributeName, PATTERN_ATTRIBUTE) || >+ !strcmp(attributeName, METHOD_PATTERN_ATTRIBUTE)) { >+ memcpy(&tps->buffer[offset], as400_atoe((char*)value), valLength); /* 232010 */ >+ } >+ else { >+ memcpy(&tps->buffer[offset], (char*)value, valLength); /* 232010 */ >+ } >+#else >+ memcpy(&tps->buffer[offset], value, valLength); >+ >+#endif >+ >+ if(strippedValue!=in_value) { >+ free((void*)strippedValue); >+ } >+ >+ if (value != strippedValue) { /* 50273 */ >+ /* pointing to buffer alloc'd by escape_for_xml */ >+ free((void*)value); >+ } >+ >+ } >+ offset+=valLength; >+ tps->buffer[offset++]='\"'; >+ >+ return offset; >+} >+ >+ >+/** APPEND_ELEMENT_END ******************************************************** >+ * Creates an XML closing tag and places in at the end of the provided buffer. >+ * If the elementName is NULL the entire buffer is appended with the closing >+ * tag. If it is non-NULL the buffer is loaded with a closing tag with the >+ * specified name. NOTE: When a elementName is specified the buffer is trampled >+ * @param elementName - The XML tag name, NULL for empty tag >+ * @param elementNameLength - length of the XML tag name, ignored if elementName=NULL >+ * @param offset - the offset in the buffer to place the closing tag >+ * @param buffer - The buffer to place the tag ending >+ * @returns >0 - the length of the entire element >+ */ >+static unsigned short >+jvmpiAgent_appendElementEnd(const char *elementName, >+ unsigned short elementNameLength, >+ unsigned short offset, >+ ThreadPrivateStorage *tps) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ if(elementName!=NULL) >+ { >+ memcpy(&tps->buffer[offset], elementName, elementNameLength); >+ offset+=elementNameLength; >+ } >+ memcpy(&tps->buffer[offset], "/>", 2); >+ } >+ return offset+2; >+} >+ >+ >+ >+/* >+ * Used to start a new empty element >+ */ >+static unsigned short >+jvmpiAgent_insertEmptyEventHeader(JNIEnv *env_id, >+ ThreadPrivateStorage *tps, >+ const char *eventName, >+ unsigned short eventNameLength) >+{ >+ unsigned short current=0; >+ if (!_jvmpiAgent_suspendIO) >+ { >+ current=jvmpiAgent_insertElementStart(eventName, eventNameLength, tps); >+ if (jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_THREAD_IDREF_ATTRIBUTE, >+ STRLEN_STATIC_THREAD_IDREF_ATTRIBUTE, >+ current, >+ tps->staticThreadId, >+ tps->buffer); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(THREAD_IDREF_ATTRIBUTE, >+ STRLEN_THREAD_IDREF_ATTRIBUTE, >+ current, >+ (jint)env_id, >+ tps->buffer); >+ } >+ } >+ return current; >+} >+ >+/* >+ * Used to start a new empty element >+ */ >+static unsigned short >+jvmpiAgent_insertEmptyEventHeader1(JNIEnv *env_id, >+ ThreadPrivateStorage *tps, >+ const char *eventName, >+ unsigned short eventNameLength) >+{ >+ unsigned short current=0; >+ if (!_jvmpiAgent_suspendIO) >+ { >+ current=jvmpiAgent_insertElementStart(eventName, eventNameLength, tps); >+ if (jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_THREAD_ID_ATTRIBUTE, >+ STRLEN_STATIC_THREAD_ID_ATTRIBUTE, >+ current, >+ tps->staticThreadId, >+ tps->buffer); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(THREAD_ID_ATTRIBUTE, >+ STRLEN_THREAD_ID_ATTRIBUTE, >+ current, >+ (jint)env_id, >+ tps->buffer); >+ } >+ } >+ return current; >+} >+ >+static unsigned short >+jvmpiAgent_printTraceIdrefAttribute(ThreadPrivateStorage *tps, >+ unsigned short current) >+{ >+ if (_jvmpiAgent_Options.traceIdrefs) >+ { >+ return jvmpiAgent_appendStringAttribute(TRACE_IDREF_ATTRIBUTE, STRLEN_TRACE_IDREF_ATTRIBUTE, current, _jvmpiAgent_trace_id , tps); >+ } >+ else >+ { >+ return current; >+ } >+} >+ >+ >+/** APPEND__LABELED_TIMESTAMP **************************************************** >+ * >+ */ >+static unsigned short >+jvmpiAgent_appendLabeledTimestamp(char *buffer, >+ unsigned short offset, >+ const char *attributeName, >+ unsigned short attributeNameLength, >+ timestamp_t time, >+ BOOL asInterval) { >+#ifdef MVS /* 174190 */ >+ int mycurr; >+#endif >+ >+ >+ buffer[offset++]=' '; >+ memcpy(&buffer[offset], attributeName, attributeNameLength); >+ offset+=attributeNameLength; >+ buffer[offset++]='='; >+ buffer[offset++]='\"'; >+ >+#ifdef MVS /* 174190 */ >+ mycurr = offset; >+#pragma convlit(suspend) >+#endif >+ >+ /* convert the time to a string using helper method that is locale-insensitive */ >+ offset = double2string(ticksToTime2(time, asInterval),buffer,offset,9); >+ >+ buffer[offset++]='\"'; >+#ifdef MVS /* 174190 */ >+ buffer[offset]='\0'; >+#pragma convlit(resume) >+ __etoa(buffer+mycurr); >+#endif >+ return offset; >+} >+ >+/** APPEND_TIMESTAMP **************************************************** >+ * >+ */ >+static unsigned short >+jvmpiAgent_appendTimestamp(char *buffer, >+ unsigned short offset, >+ timestamp_t time) >+{ >+ return jvmpiAgent_appendLabeledTimestamp(buffer, offset, TIME_ATTRIBUTE, STRLEN_TIME_ATTRIBUTE, time, FALSE); >+} >+ >+ >+static unsigned short >+jvmpiAgent_appendOverhead(char *buffer, >+ unsigned short offset, >+ Uint64 time) >+{ >+ return jvmpiAgent_appendLabeledTimestamp(buffer, offset, OVERHEAD_ATTRIBUTE, STRLEN_OVERHEAD_ATTRIBUTE, time, TRUE); >+} >+ >+/** APPEND_TIMESTAMP **************************************************** >+ * >+ */ >+static unsigned short >+jvmpiAgent_appendString(char *buffer, >+ unsigned short offset, >+ const char *value) >+{ >+ int length=strlen(value); >+ memcpy(&buffer[offset], value, length+1); >+ return offset+length+1; >+} >+ >+ >+ >+ >+/** PRINT_COLLATION_VALUE_ATTRIBUTE ********************************************** >+ */ >+static unsigned short >+jvmpiAgent_printCollationValueAttribute(char *buffer, >+ unsigned short current, >+ SegmentedValue_t *collationValue) >+{ >+ if (_jvmpiAgent_Options.collationValues) >+ { >+#ifdef SEGMENTED_VALUE_MULTIWORD >+ unsigned long i; >+ current=jvmpiAgent_appendUnsignedLongAttribute(COLLATION_VALUE_ATTRIBUTE, STRLEN_COLLATION_VALUE_ATTRIBUTE, current, collationValue->values[0], buffer); >+ for (i = 1; i < collationValue->numberOfWords; i++) >+ { >+ current=jvmpiAgent_appendListUnsignedLong(current, collationValue->values[i], buffer); >+ } >+#else >+ current=jvmpiAgent_appendUnsignedLongAttribute(COLLATION_VALUE_ATTRIBUTE, STRLEN_COLLATION_VALUE_ATTRIBUTE, current, collationValue->value, buffer); >+#endif >+ } >+ return current; >+} >+ >+/* >+ * Handles the output of a METHOD_COUNT element and attributes. >+ */ >+static int >+jvmpiAgent_printMethodCount(HashEntry *hashEntry, void * parm) >+{ >+ >+ if (!_jvmpiAgent_suspendIO && CLASS_ENTRY(METHOD_ENTRY(hashEntry)->classHashEntry)->traceFlag >+ && METHOD_ENTRY(hashEntry)->traceFlag) >+ { >+ ThreadPrivateStorage *tps=(ThreadPrivateStorage*)parm; >+ unsigned short current=0; >+ jvmpiAgent_outputMethodDeclaration(hashEntry, tps); >+ current=jvmpiAgent_insertElementStart(METHOD_COUNT_ELEMENT, STRLEN_METHOD_COUNT_ELEMENT, tps); >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_METHOD_IDREF_ATTRIBUTE, STRLEN_STATIC_METHOD_IDREF_ATTRIBUTE, current, METHOD_ENTRY(hashEntry)->static_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(COUNT_ATTRIBUTE, STRLEN_COUNT_ATTRIBUTE, current, METHOD_ENTRY(hashEntry)->methodCount, tps->buffer); >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ return 0; >+} >+ >+ >+/** PRINT_OPTION ********************************************************** >+ * Outputs an OPTION element >+ */ >+void >+jvmpiAgent_PrintOption(ThreadPrivateStorage *tps, >+ char *key, >+ char *value) >+{ >+ unsigned short current=0; >+ if (!_jvmpiAgent_suspendIO) >+ { >+ current=jvmpiAgent_insertElementStart(OPTION_ELEMENT, STRLEN_OPTION_ELEMENT, tps); >+ current=jvmpiAgent_appendStringAttribute(KEY_ATTRIBUTE, >+ STRLEN_KEY_ATTRIBUTE, >+ current, >+ key, >+ tps); >+ current=jvmpiAgent_appendStringAttribute(VALUE_ATTRIBUTE, >+ STRLEN_VALUE_ATTRIBUTE, >+ current, >+ value, >+ tps); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+unsigned short jvmpiAgent_appendCurrentTimeStamp(char *buffer, >+ unsigned short offset) >+{ >+ timestamp_t timestamp; >+ jvmpiAgent_getCurrentTime(×tamp); >+ return jvmpiAgent_appendTimestamp(buffer, offset, timestamp); >+} >+ >+ >+ >+ >+/* Append the Thread CPU time. >+ >+ This function appends the cumulative cpuTime into the trace. It assumes the time value >+ passed in is in nanoseconds (the JVMPI method GetCurrentThreadCPUTime() returns >+ values in units of nanoseconds). >+ >+ @param buffer the buffer to write to >+ @param offset the offset into the buffer where we're writing >+ @param time the cumulative cpu time to put into the trace element (in nanoseconds) >+*/ >+ >+static unsigned short >+jvmpiAgent_appendThreadCPUTime(char *buffer, >+ unsigned short offset, >+ Uint64 time) >+{ >+ >+ /* convert the time into a double value. This allows us to use our >+ utility function double2string to properly output the timestamp */ >+#ifdef _WIN32 >+ double ts_double = ((double) (signed __int64)time) / ((double)1000000000); >+#else >+ double ts_double = ((double)time) / ((double)1000000000); >+#endif >+ >+ >+#ifdef MVS /* 174190 */ >+ int mycurr; >+#endif >+ >+ buffer[offset++]=' '; >+ memcpy(&buffer[offset], THREAD_CPU_TIME_ATTRIBUTE, STRLEN_THREAD_CPU_TIME_ATTRIBUTE); >+ offset+=STRLEN_THREAD_CPU_TIME_ATTRIBUTE; >+ buffer[offset++]='='; >+ buffer[offset++]='\"'; >+ >+#ifdef MVS /* 174190 */ >+ mycurr = offset; >+#pragma convlit(suspend) >+#endif >+ >+ /* convert the time to a string using helper method that is locale-insensitive */ >+offset = double2string(ts_double,buffer,offset,9); >+ >+ buffer[offset++]='\"'; >+#ifdef MVS /* 174190 */ >+ buffer[offset]='\0'; >+#pragma convlit(resume) >+ __etoa(buffer+mycurr); >+#endif >+ return offset; >+} >+ >+ >+/** PRINT_FILTER ********************************************************** >+ * Outputs a FILTER element >+ */ >+void >+jvmpiAgent_printFilter(ThreadPrivateStorage *tps, >+ Filter *filter) { >+ if (!_jvmpiAgent_suspendIO) { >+ >+ unsigned short current=0; >+ char *startPattern; >+ >+ current=jvmpiAgent_insertElementStart(FILTER_ELEMENT, STRLEN_FILTER_ELEMENT, tps); >+ startPattern=tps->buffer+current; >+ current=jvmpiAgent_appendStringAttribute(PATTERN_ATTRIBUTE, STRLEN_PATTERN_ATTRIBUTE, current, filter->pattern, tps); >+ >+ *(tps->buffer + current) = '\0'; >+ >+ /* RKD: If the pattern contains any '/' replace these with '.' */ >+ while((startPattern=strchr(startPattern, '/'))) { >+ *startPattern=(char)'.'; >+ } >+ >+ if (jvmpiAgent_getClassFilterMode(filter) == INCLUDE) { >+ current=jvmpiAgent_appendStringAttribute(CLASS_MODE_ATTRIBUTE, STRLEN_CLASS_MODE_ATTRIBUTE, current, INCLUDE_VALUE, tps); >+ } >+ else { >+ current=jvmpiAgent_appendStringAttribute(CLASS_MODE_ATTRIBUTE, STRLEN_CLASS_MODE_ATTRIBUTE, current, EXCLUDE_VALUE, tps); >+ } >+ if (filter->genericPattern == NONE) { >+ current=jvmpiAgent_appendStringAttribute(GENERICPATTERN_ATTRIBUTE, STRLEN_GENERICPATTERN_ATTRIBUTE, current, NONE_VALUE, tps); >+ } >+ else if (filter->genericPattern == PREFIX) { >+ current=jvmpiAgent_appendStringAttribute(GENERICPATTERN_ATTRIBUTE, STRLEN_GENERICPATTERN_ATTRIBUTE, current, PREFIX_VALUE, tps); >+ } >+ else { >+ current=jvmpiAgent_appendStringAttribute(GENERICPATTERN_ATTRIBUTE, STRLEN_GENERICPATTERN_ATTRIBUTE, current, SUFFIX_VALUE, tps); >+ } >+ >+ if(filter->methodDetailCount>0) { >+ unsigned int i; >+ for(i=0; i<filter->methodDetailCount;i++) { >+ unsigned short offset=current; >+ offset=jvmpiAgent_appendStringAttribute(METHOD_PATTERN_ATTRIBUTE, STRLEN_METHOD_PATTERN_ATTRIBUTE, offset, filter->methodDetails[i].pattern, tps); >+ >+ if (filter->methodDetails[i].mode == INCLUDE) >+ { >+ offset=jvmpiAgent_appendStringAttribute(METHOD_MODE_ATTRIBUTE, STRLEN_METHOD_MODE_ATTRIBUTE, offset, INCLUDE_VALUE, tps); >+ } >+ else >+ { >+ offset=jvmpiAgent_appendStringAttribute(METHOD_MODE_ATTRIBUTE, STRLEN_METHOD_MODE_ATTRIBUTE, offset, EXCLUDE_VALUE, tps); >+ } >+ >+ if (filter->methodDetails[i].genericPattern == NONE) { >+ offset=jvmpiAgent_appendStringAttribute(METHOD_GENERICPATTERN_ATTRIBUTE, STRLEN_METHOD_GENERICPATTERN_ATTRIBUTE, offset, NONE_VALUE, tps); >+ } >+ else if (filter->methodDetails[i].genericPattern == PREFIX) { >+ offset=jvmpiAgent_appendStringAttribute(METHOD_GENERICPATTERN_ATTRIBUTE, STRLEN_METHOD_GENERICPATTERN_ATTRIBUTE, offset, PREFIX_VALUE, tps); >+ } >+ else { >+ offset=jvmpiAgent_appendStringAttribute(METHOD_GENERICPATTERN_ATTRIBUTE, STRLEN_METHOD_GENERICPATTERN_ATTRIBUTE, offset, SUFFIX_VALUE, tps); >+ } >+ >+ offset=jvmpiAgent_printTraceIdrefAttribute(tps, offset); >+ offset=jvmpiAgent_appendElementEnd(NULL, 0, offset, tps); >+ jvmpiAgent_print(tps, tps->buffer, offset); >+ } >+ } >+ else { >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+/* >+ This function ensures that the string name can be legally output as XML by translating any >+ '<' or '>" characters to '-'. >+*/ >+char * jvmpiAgent_formatName(char *name) >+{ >+ int i; >+ if (name) >+ { >+ for (i=strlen(name)-1; i >=0; i--) >+ { >+#ifdef __OS400__ >+#pragma convert(819) /* 236501 */ >+#endif >+ if (name[i] == '<' || name[i] == '>') name[i] = '-'; >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ } >+ } >+ return name; >+} >+ >+ >+/** PRINT_METHOD ********************************************************** >+ * Handles the output of a METHOD element and attributes >+ */ >+void jvmpiAgent_printMethod(MethodEntry *methodEntry, >+ ThreadPrivateStorage *tps) >+{ >+ if (!_jvmpiAgent_suspendIO && (_jvmpiAgent_Options.stackInfo > StackInfoNone || _jvmpiAgent_Options.methodCounts)) >+ { >+ unsigned short current=0; >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printMethodDefine(tps->buffer, methodEntry); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ current=jvmpiAgent_insertElementStart(METHOD_ELEMENT, STRLEN_METHOD_ELEMENT, tps); >+ current=jvmpiAgent_appendStringAttribute(NAME_ATTRIBUTE, STRLEN_NAME_ATTRIBUTE, current, jvmpiAgent_formatName(methodEntry->methodData.method_name), tps); >+ current=jvmpiAgent_appendStringAttribute(SIGNATURE_ATTRIBUTE, STRLEN_SIGNATURE_ATTRIBUTE, current, methodEntry->methodData.method_signature, tps); >+ >+ /* A.M: Print the method detail attribute if the proper option is set */ >+ if (_jvmpiAgent_Options.methodDetails) >+ { >+ /* Visibility */ >+ if(methodEntry->isPrivate) { >+ current=jvmpiAgent_appendStringAttribute(VISIBILITY_ATTRIBUTE, STRLEN_VISIBILITY_ATTRIBUTE, current, "private", tps); >+ } >+ else if(methodEntry->isProtected) { >+ current=jvmpiAgent_appendStringAttribute(VISIBILITY_ATTRIBUTE, STRLEN_VISIBILITY_ATTRIBUTE, current, "protected", tps); >+ } >+ else if(methodEntry->isPublic) { >+ current=jvmpiAgent_appendStringAttribute(VISIBILITY_ATTRIBUTE, STRLEN_VISIBILITY_ATTRIBUTE, current, "public", tps); >+ } >+ >+ /* isNative? */ >+ current=jvmpiAgent_appendStringAttribute(IS_NATIVE_ATTRIBUTE, STRLEN_IS_NATIVE_ATTRIBUTE, current, (methodEntry->isNative ? "true" : "false"), tps); >+ /* isAbstract? */ >+ current=jvmpiAgent_appendStringAttribute(IS_ABSTRACT_ATTRIBUTE, STRLEN_IS_ABSTRACT_ATTRIBUTE, current, (methodEntry->isAbstract ? "true" : "false"), tps); >+ /* isStatic? */ >+ current=jvmpiAgent_appendStringAttribute(IS_STATIC_ATTRIBUTE, STRLEN_IS_STATIC_ATTRIBUTE, current, (methodEntry->isStatic ? "true" : "false"), tps); >+ /* isSynchronized? */ >+ current=jvmpiAgent_appendStringAttribute(IS_SYNCHRONIZED_ATTRIBUTE, STRLEN_IS_SYNCHRONIZED_ATTRIBUTE, current, (methodEntry->isSynchronized ? "true" : "false"), tps); >+ >+ /* Exceptions */ >+ if (methodEntry->exceptions != (int)NULL && strlen(methodEntry->exceptions) != (int)NULL) { >+ current=jvmpiAgent_appendStringAttribute(EXCEPTIONS_ATTRIBUTE, STRLEN_EXCEPTIONS_ATTRIBUTE, current, methodEntry->exceptions, tps); >+ } >+ >+ } >+ >+ if (methodEntry->methodData.start_lineno != -1) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(START_LINENO_ATTRIBUTE, STRLEN_START_LINENO_ATTRIBUTE, current, methodEntry->methodData.start_lineno, tps->buffer); >+ } >+ if (methodEntry->methodData.end_lineno != -1) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(END_LINENO_ATTRIBUTE, STRLEN_END_LINENO_ATTRIBUTE, current, methodEntry->methodData.end_lineno, tps->buffer); >+ } >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_METHOD_ID_ATTRIBUTE, STRLEN_STATIC_METHOD_ID_ATTRIBUTE, current, methodEntry->static_id, tps->buffer); >+ } >+ if(jvmpiAgent_isPrintMethodId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(METHOD_ID_ATTRIBUTE, STRLEN_METHOD_ID_ATTRIBUTE, current, (jint)(methodEntry->methodData.method_id), tps->buffer); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(CLASS_IDREF_ATTRIBUTE, STRLEN_CLASS_IDREF_ATTRIBUTE, current, (jint)(CLASS_ENTRY(methodEntry->classHashEntry)->classId), tps->buffer); >+ } >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_CLASS_IDREF_ATTRIBUTE, STRLEN_STATIC_CLASS_IDREF_ATTRIBUTE, current, (jint)(CLASS_ENTRY(methodEntry->classHashEntry)->static_id), tps->buffer); >+ } >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &methodEntry->collation); >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+/** PRINT_METHOD_ENTRY_EVENT ********************************************** >+ * Handles the output of a METHOD_ENTRY, METHOD_CALL element and attributes >+ */ >+void jvmpiAgent_printMethodEntryEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ StackEntry *stackEntry, >+ unsigned long stackDepth) { >+ unsigned short current=0; >+ >+ /* Print the information */ >+ stackEntry->printed = 1; /* Indicate that this entry is printed */ >+ jvmpiAgent_outputMethodDeclaration(stackEntry->methodHashEntry, tps); >+ >+ /* Make sure that the objAlloc is printed if necessary. >+ The following conditions ensure that if either the attribute transientObjIdRef, >+ or objIdRef is printed in the methodEntry element, the objAlloc >+ will have been printed first. (The conditions come directly from those used >+ for testing whether to print the attribute -- see below.) >+ bugzilla_46357 >+ */ >+ >+ if( stackEntry->objectHashEntry && >+ ( (jvmpiAgent_isPrintObjId() && _jvmpiAgent_Options.mode==TraceModeFull) || >+ jvmpiAgent_isPrintStaticId())) { >+ >+ if (!stackEntry->objectHashEntry->printed) { >+ jvmpiAgent_printObjAllocElement(stackEntry->objectHashEntry,event->env_id, 0); >+ } >+ } >+ >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printMethodEnter(tps->buffer, stackEntry); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ /* RKD: There is no longer a need for differentiating between method entry and method call events >+ in the profiler as we are not supporting multiple process tracing correlation. If we ever >+ do go down that route we will need to differntiate. >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, CLASS_ENTRY(METHOD_ENTRY(stackEntry->methodHashEntry)->classHashEntry)->traceFlag ? METHOD_ENTRY_ATTRIBUTE : METHOD_CALL_ATTRIBUTE, (unsigned short)(CLASS_ENTRY(METHOD_ENTRY(stackEntry->methodHashEntry)->classHashEntry)->traceFlag ? STRLEN_METHOD_ENTRY_ATTRIBUTE : STRLEN_METHOD_CALL_ATTRIBUTE)); >+ */ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, METHOD_ENTRY_ATTRIBUTE, STRLEN_METHOD_ENTRY_ATTRIBUTE ); >+ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, stackEntry->timestamp ); >+ } >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_METHOD_IDREF_ATTRIBUTE, STRLEN_STATIC_METHOD_IDREF_ATTRIBUTE, current, (jint)(METHOD_ENTRY(stackEntry->methodHashEntry)->static_id), tps->buffer); >+ } >+ if(jvmpiAgent_isPrintMethodId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(METHOD_IDREF_ATTRIBUTE, STRLEN_METHOD_IDREF_ATTRIBUTE, current, (jint)( ((MethodHashKey *)stackEntry->methodHashEntry->id)->id), tps->buffer); >+ } >+ >+ >+ /* Only print the object information when in FULL TraceMode and when requested */ >+ if(jvmpiAgent_isPrintObjId() && _jvmpiAgent_Options.mode==TraceModeFull) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, STRLEN_OBJ_IDREF_ATTRIBUTE, current, stackEntry->objectHashEntry ? (jint)((ObjectHashKey*)stackEntry->objectHashEntry->id)->id : 0, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(CLASS_IDREF_ATTRIBUTE, STRLEN_CLASS_IDREF_ATTRIBUTE, current, (jint)((ClassHashKey*)METHOD_ENTRY(stackEntry->methodHashEntry)->classHashEntry->id)->id, tps->buffer); >+ } >+ if (stackEntry->objectHashEntry && jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, stackEntry->objectHashEntry ? OBJECT_ENTRY(stackEntry->objectHashEntry)->static_id : 0 , tps->buffer); >+ } >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_CLASS_IDREF_ATTRIBUTE, STRLEN_STATIC_CLASS_IDREF_ATTRIBUTE, current, CLASS_ENTRY(METHOD_ENTRY(stackEntry->methodHashEntry)->classHashEntry)->static_id, tps->buffer); >+ } >+ >+ if(_jvmpiAgent_Options.ticket) >+ { >+ current=jvmpiAgent_printTicketAttribute(&stackEntry->ticket,tps->buffer, current); >+ } >+ current=jvmpiAgent_appendIntegerAttribute(STACK_DEPTH_ATTRIBUTE, STRLEN_STACK_DEPTH_ATTRIBUTE, current, stackDepth, tps->buffer); >+ if (_jvmpiAgent_Options.contextFlow) >+ { >+ /*## Values of context flow information not implemented yet. */ >+ current=jvmpiAgent_appendIntegerAttribute(SEQUENCE_COUNTER_ATTRIBUTE, STRLEN_SEQUENCE_COUNTER_ATTRIBUTE, current, 0, tps->buffer); >+ current=jvmpiAgent_appendStringAttribute(CONTEXT_DATA_ATTRIBUTE, STRLEN_CONTEXT_DATA_ATTRIBUTE, current, "##not implemented yet##", tps); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ >+} >+ >+/** PRINT_AG_METHOD_ENTRY_EVENT **************************preagg/135437******* >+ * >+ * Handles the output of a AG_METHOD_ENTRY element and attributes >+ */ >+void jvmpiAgent_printAgMethodEntryEvent(ThreadPrivateStorage * tps, StackFrame * call) { >+ >+ unsigned short current=0; >+ >+ /* Note that tps->env is passed in place of event->env_id passed elsewhere and should be equivalent in the preAgg case. */ >+ current=jvmpiAgent_insertEmptyEventHeader(tps->env, tps, AG_METHOD_ENTRY_ELEMENT, STRLEN_AG_METHOD_ENTRY_ELEMENT); >+ >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_METHOD_IDREF_ATTRIBUTE, STRLEN_STATIC_METHOD_IDREF_ATTRIBUTE, current, >+ (jint)(METHOD_ENTRY(call->methodHashEntry)->static_id), tps->buffer); >+ >+ current=jvmpiAgent_appendLabeledTimestamp(tps->buffer, current, BASETIME1_ATTRIBUTE, STRLEN_BASETIME1_ATTRIBUTE, call->baseTime, TRUE); >+ current=jvmpiAgent_appendLabeledTimestamp(tps->buffer, current, MINTIME_ATTRIBUTE, STRLEN_MINTIME_ATTRIBUTE, call->minTime, TRUE); >+ current=jvmpiAgent_appendLabeledTimestamp(tps->buffer, current, MAXTIME_ATTRIBUTE, STRLEN_MAXTIME_ATTRIBUTE, call->maxTime, TRUE); >+ >+ current=jvmpiAgent_appendIntegerAttribute(COUNT_ATTRIBUTE, STRLEN_COUNT_ATTRIBUTE, current, call->numCalls, tps->buffer); >+ >+ if (_jvmpiAgent_Options.cpuTime) { >+ current=jvmpiAgent_appendThreadCPUTime(tps->buffer, current, (Uint64)(call->baseCPUTime)); >+ } >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+/** PRINT_THREAD_START_ELEMENT ******************************************** >+ * >+ */ >+void >+jvmpiAgent_printThreadStartElement(JNIEnv *env_id, >+ HashEntry *threadHashEntry) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ unsigned short current=0; >+ HashEntry *objectHashEntry = 0; >+ ThreadLocalStorage *tps = THREAD_ENTRY(threadHashEntry); >+ timestamp_t now; >+ >+ threadHashEntry->printed = 1; >+ jvmpiAgent_getCurrentTime(&now); >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printThreadStart(tps->buffer, tps); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ /* The thread object is found using a special function */ >+ jobjectID threadObject=_jvmpiAgent_jvmpiInterface->GetThreadObject(env_id); >+ >+ /* Ensure our thread object has been declared */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocate(threadObject, env_id); >+ >+ >+ current=jvmpiAgent_insertEmptyEventHeader1(((ThreadHashKey*)threadHashEntry->id)->id, tps, THREAD_START_ELEMENT, STRLEN_THREAD_START_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, now ); >+ } >+ current=jvmpiAgent_appendStringAttribute(THREAD_NAME_ATTRIBUTE, STRLEN_THREAD_NAME_ATTRIBUTE, current, jvmpiAgent_formatName(tps->threadName), tps); >+ current=jvmpiAgent_appendStringAttribute(GROUP_NAME_ATTRIBUTE, STRLEN_GROUP_NAME_ATTRIBUTE, current, jvmpiAgent_formatName(tps->groupName), tps); >+ current=jvmpiAgent_appendStringAttribute(PARENT_NAME_ATTRIBUTE, STRLEN_PARENT_NAME_ATTRIBUTE, current, jvmpiAgent_formatName(tps->parentName), tps); >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, STRLEN_OBJ_IDREF_ATTRIBUTE, current, (jint)threadObject, tps->buffer); >+ } >+ >+ /* Since we don't see an OBJ_ALLOC for some of the system threads we can only output a 0 for the static object id */ >+ /* ##MW Perhaps we could internally manufacture an object and use that to hold a unique static id */ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, objectHashEntry ? OBJECT_ENTRY(objectHashEntry)->static_id : 0, tps->buffer); >+ } >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &tps->collation); >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+ >+/** PRINT_OBJ_FREE_ELEMENT ************************************************ >+ * Handles the output of OBJ_FREE. >+ */ >+void >+jvmpiAgent_printObjFreeElement(ThreadLocalStorage *tps, >+ HashEntry *objectHashEntry) >+{ >+ HashEntry *classHashEntry=OBJECT_ENTRY(objectHashEntry)->classHashEntry; >+ >+ if (!_jvmpiAgent_suspendIO && classHashEntry && (_jvmpiAgent_Options.gc != GcNone)) >+ { >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printObjectFree(tps->buffer, objectHashEntry); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ unsigned short current=0; >+ >+ jvmpiAgent_outputClassDeclaration(classHashEntry, tps); >+ >+ current=jvmpiAgent_insertEmptyEventHeader(tps->env, tps, OBJ_FREE_ELEMENT, STRLEN_OBJ_FREE_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if (_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ if (jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, OBJECT_ENTRY(objectHashEntry)->static_id, tps->buffer); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, STRLEN_OBJ_IDREF_ATTRIBUTE, current, (jint)((ObjectHashKey*)objectHashEntry->id)->id, tps->buffer); >+ } >+ if (_jvmpiAgent_Options.contextFlow) >+ { >+ /*## Values of context flow information not implemented yet. */ >+ current=jvmpiAgent_appendIntegerAttribute(SEQUENCE_COUNTER_ATTRIBUTE, STRLEN_SEQUENCE_COUNTER_ATTRIBUTE, current, 0, tps->buffer); >+ current=jvmpiAgent_appendStringAttribute(CONTEXT_DATA_ATTRIBUTE, STRLEN_CONTEXT_DATA_ATTRIBUTE, current, "##not implemented yet##", tps); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+ >+void jvmpiAgent_printJvmInitDoneElement(JVMPI_Event *event) >+{ >+ if(_jvmpiAgent_Options.jinsightFormat && !_jvmpiAgent_Options.standalone) { >+ return; >+ } >+ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ ThreadPrivateStorage *tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ unsigned short current=0; >+ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, JVM_INIT_DONE_ELEMENT, STRLEN_JVM_INIT_DONE_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ >+ if(_jvmpiAgent_Options.jinsightFormat && _jvmpiAgent_Options.standalone) { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printEndOfXMLHeader(tps->buffer); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+} >+ >+ >+void jvmpiAgent_printGcStartElement(JVMPI_Event *event) >+{ >+ if (!_jvmpiAgent_suspendIO && _jvmpiAgent_Options.gc != GcNone) >+ { >+ ThreadPrivateStorage *tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ unsigned short current=0; >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printGcStart(tps->buffer); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, GC_START_ELEMENT, STRLEN_GC_START_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+ >+void jvmpiAgent_printGcFinishElement(JVMPI_Event *event) >+{ >+ if (!_jvmpiAgent_suspendIO && _jvmpiAgent_Options.gc != GcNone) >+ { >+ ThreadPrivateStorage *tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ unsigned short current=0; >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printGcFinish(tps->buffer); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, GC_FINISH_ELEMENT, STRLEN_GC_FINISH_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+#ifdef __OS400__ >+ current=jvmpiAgent_appendInteger64Attribute(USED_OBJECTS_ATTRIBUTE, STRLEN_USED_OBJECTS_ATTRIBUTE, current, (event->u.gc_info.used_objects).unsigned_ll, tps->buffer); >+ current=jvmpiAgent_appendInteger64Attribute(USED_OBJECT_SPACE_ATTRIBUTE, STRLEN_USED_OBJECT_SPACE_ATTRIBUTE, current, (event->u.gc_info.used_object_space).unsigned_ll, tps->buffer); >+ current=jvmpiAgent_appendInteger64Attribute(TOTAL_OBJECT_SPACE_ATTRIBUTE, STRLEN_TOTAL_OBJECT_SPACE_ATTRIBUTE, current, (event->u.gc_info.total_object_space).unsigned_ll, tps->buffer); >+#else >+ current=jvmpiAgent_appendInteger64Attribute(USED_OBJECTS_ATTRIBUTE, STRLEN_USED_OBJECTS_ATTRIBUTE, current, event->u.gc_info.used_objects, tps->buffer); >+ current=jvmpiAgent_appendInteger64Attribute(USED_OBJECT_SPACE_ATTRIBUTE, STRLEN_USED_OBJECT_SPACE_ATTRIBUTE, current, event->u.gc_info.used_object_space, tps->buffer); >+ current=jvmpiAgent_appendInteger64Attribute(TOTAL_OBJECT_SPACE_ATTRIBUTE, STRLEN_TOTAL_OBJECT_SPACE_ATTRIBUTE, current, event->u.gc_info.total_object_space, tps->buffer); >+#endif >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+ >+/** PRINT_GC_ROOT_ELEMEMT ******************************************************* >+ * >+ */ >+void >+jvmpiAgent_printGcRootElement(JVMPI_Event *event, >+ unsigned long id, >+ char* type) >+{ >+ if(!_jvmpiAgent_suspendIO && _jvmpiAgent_Options.gc != GcNone) >+ { >+ unsigned short current=0; >+ ThreadPrivateStorage *tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ /* BINARY_TRACE */ >+#endif >+ } >+ else >+ { >+ current=jvmpiAgent_insertElementStart(GC_ROOT_ELEMENT, STRLEN_GC_ROOT_ELEMENT, tps); >+ >+ if(strcmp(type, "STICKY_CLASS") == 0) >+ { >+ current = jvmpiAgent_appendIntegerAttribute(STATIC_CLASS_IDREF_ATTRIBUTE, STRLEN_STATIC_CLASS_IDREF_ATTRIBUTE, current, id, tps->buffer); >+ } >+/* >+ else if(strcmp(type, "THREAD_BLOCK") == 0) >+ { >+ current = jvmpiAgent_appendIntegerAttribute(STATIC_THREAD_IDREF_ATTRIBUTE, STRLEN_STATIC_THREAD_IDREF_ATTRIBUTE, current, id, tps->buffer); >+ } >+*/ >+ else >+ { >+ current = jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, id, tps->buffer); >+ } >+ >+ current = jvmpiAgent_appendStringAttribute(GC_ROOT_TYPE_ATTRIBUTE, STRLEN_GC_ROOT_TYPE_ATTRIBUTE, current, type, tps); >+ >+ /* Finish up */ >+ current = jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+ >+ >+unsigned short >+jvmpiAgent_printThreadOwnerAttribute(char *buffer, unsigned short current, >+ unsigned long thread_owner) >+{ >+ return jvmpiAgent_appendUnsignedLongAttribute(THREAD_OWNER_ATTRIBUTE, >+ STRLEN_THREAD_OWNER_ATTRIBUTE, >+ current,thread_owner, buffer); >+} >+ >+unsigned short >+jvmpiAgent_printTimeoutAttribute(char *buffer, unsigned short current, >+ Uint64 timeout) >+{ >+ >+ return jvmpiAgent_appendInteger64Attribute(TIMEOUT_ATTRIBUTE, >+ STRLEN_TIMEOUT_ATTRIBUTE,current,timeout,buffer); >+} >+ >+ >+/** PRINT_MONITOR_WAIT_ELEMENT ***************************************************** >+ * >+ * Print the <monWait> element to the trace indicating JVMPI_EVENT_MONITOR_WAIT occurred. >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the MONITOR_WAIT event as reported by JVMPI >+ * timestamp - when the MONITOR_WAIT event occurred >+ * isThreadSleep - 0 indicates regular monitor, 1 indicates wait occurred >+ * within Thread.sleep() >+ */ >+void >+jvmpiAgent_printMonitorWaitElement(HashEntry *objectHashEntry, JVMPI_Event *event, >+ timestamp_t timestamp, int isThreadSleep) >+{ >+ >+ /* only print element if io is not suspended */ >+ if (!_jvmpiAgent_suspendIO) { >+ >+ unsigned short current=0; >+ ThreadPrivateStorage *tps; >+ >+ tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ >+ if(!timestamp) { >+ jvmpiAgent_getCurrentTime(×tamp); >+ } >+ >+ /* does there need to be any code handling binary trace/jinsight format? >+ (not dealt with for now) */ >+ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, MONITOR_WAIT_ELEMENT, >+ STRLEN_MONITOR_WAIT_ELEMENT); >+ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, timestamp); >+ } >+ >+ >+ /* Print the object identifier. Object identifier is -1 if in Thread.sleep() */ >+ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, >+ STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, >+ (isThreadSleep == 0 ? OBJECT_ENTRY(objectHashEntry)->static_id : -1), >+ tps->buffer); >+ } >+ >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, >+ STRLEN_OBJ_IDREF_ATTRIBUTE, current, >+ (isThreadSleep == 0 ? (jint)((ObjectHashKey*)objectHashEntry->id)->id : -1), >+ tps->buffer); >+ >+ } >+ >+ >+ /* print the timeout attribute */ >+#ifdef __OS400__ >+ current = jvmpiAgent_printTimeoutAttribute(tps->buffer,current, >+ (event->u.monitor_wait.timeout).unsigned_ll); >+#else >+ current = jvmpiAgent_printTimeoutAttribute(tps->buffer,current, >+ event->u.monitor_wait.timeout); >+#endif >+ >+ >+ /* The collation value */ >+ >+ >+ /*##MW There is a race condition between the increment and the print >+ that must be fixed */ >+ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, >+ &_jvmpiAgent_collation); >+ >+ /* The trace Id */ >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Finish up */ >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ >+} >+ >+ >+/** PRINT_MONITOR_WAITED_ELEMENT ***************************************************** >+ * >+ * Print the <monWaited> element to the trace indicating JVMPI_EVENT_MONITOR_WAITED occurred. >+ * >+ * args - >+ * objectHashEntry - hash entry corresponding to the monitor object >+ * event - the MONITOR_WAITED event as reported by JVMPI >+ * timestamp - when the MONITOR_WAITED event occurred >+ * isThreadSleep - 0 indicates regular monitor, 1 indicates wait occurred >+ * within Thread.sleep() >+ */ >+void >+jvmpiAgent_printMonitorWaitedElement(HashEntry* objectHashEntry, JVMPI_Event *event, >+ timestamp_t timestamp, int isThreadSleep) >+{ >+ >+ /* only print element if io is not suspended */ >+ if (!_jvmpiAgent_suspendIO) { >+ >+ unsigned short current=0; >+ ThreadPrivateStorage *tps; >+ >+ tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ >+ if(!timestamp) { >+ jvmpiAgent_getCurrentTime(×tamp); >+ } >+ >+ /* does there need to be any code handling binary trace/jinsight format? >+ (not dealt with for now) */ >+ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, MONITOR_WAITED_ELEMENT, >+ STRLEN_MONITOR_WAITED_ELEMENT); >+ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, timestamp); >+ } >+ >+ >+ /* Print the object identifier. Object identifier is -1 if in Thread.sleep() */ >+ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, >+ STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, >+ (isThreadSleep == 0 ? OBJECT_ENTRY(objectHashEntry)->static_id : -1), >+ tps->buffer); >+ } >+ >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, >+ STRLEN_OBJ_IDREF_ATTRIBUTE, current, >+ (isThreadSleep == 0 ? (jint)((ObjectHashKey *)objectHashEntry->id)->id : -1), >+ tps->buffer); >+ >+ } >+ >+ /* print the timeout attribute */ >+#ifdef __OS400__ >+ current = jvmpiAgent_printTimeoutAttribute(tps->buffer,current, >+ (event->u.monitor_wait.timeout).unsigned_ll); >+#else >+ current = jvmpiAgent_printTimeoutAttribute(tps->buffer,current, >+ event->u.monitor_wait.timeout); >+#endif >+ >+ /* The collation value */ >+ >+ >+ /*##MW There is a race condition between the increment and the print >+ that must be fixed */ >+ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, >+ &_jvmpiAgent_collation); >+ >+ /* The trace Id */ >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Finish up */ >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+/** PRINT_MONITOR_STILL_OWNED_ELEMENT ************************************************ >+ * >+ * Print the <monStillOwned> element to the trace indicating >+ * a thread is still owning a monitor at the moment we checked >+ * It is potentially sent on JVMPI_EVENT_MONITOR_CONTENDED_ENTER >+ * just before a <monContendedEnter> element where the >+ * thread is the contended thread >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the JVMPI_EVENT_MONITOR_CONTENDED_ENTER event as reported by JVMPI >+ */ >+void >+jvmpiAgent_printMonitorStillOwnedElement(HashEntry *objectHashEntry, JVMPI_Event *event) >+ >+{ >+ /* only print element if io is not suspended */ >+ if (!_jvmpiAgent_suspendIO) { >+ >+ unsigned short current=0; >+ ThreadPrivateStorage *tps; >+ >+ tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, >+ MONITOR_STILL_OWNED_EVENT, STRLEN_MONITOR_STILL_OWNED_EVENT); >+ >+ /* Print the object identifier. */ >+ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, >+ STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, >+ OBJECT_ENTRY(objectHashEntry)->static_id, >+ tps->buffer); >+ } >+ >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, >+ STRLEN_OBJ_IDREF_ATTRIBUTE, current, >+ (jint)((ObjectHashKey*)objectHashEntry->id)->id, tps->buffer); >+ >+ } >+ >+ >+ /* The collation value */ >+ >+ >+ /*##MW There is a race condition between the increment and the print >+ that must be fixed */ >+ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, >+ &_jvmpiAgent_collation); >+ >+ /* The trace Id */ >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Finish up */ >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ >+} >+ >+ >+/** PRINT_MONITOR_CONTENDED_ENTER_ELEMENT ************************************************ >+ * >+ * Print the <monContendedEnter> element to the trace indicating >+ * JVMPI_EVENT_MONITOR_CONTENDED_ENTER occurred. >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the MONITOR_WAITED event as reported by JVMPI >+ * thread_owner - the current thread that owns the monitor object >+ * timestamp - when the MONITOR_WAITED event occurred >+ */ >+void >+jvmpiAgent_printMonitorContendedEnterElement(HashEntry *objectHashEntry, JVMPI_Event *event, >+ unsigned long thread_owner, timestamp_t timestamp) >+ >+{ >+ /* only print element if io is not suspended */ >+ if (!_jvmpiAgent_suspendIO) { >+ >+ unsigned short current=0; >+ ThreadPrivateStorage *tps; >+ >+ tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ >+ if(!timestamp) { >+ jvmpiAgent_getCurrentTime(×tamp); >+ } >+ >+ /* does there need to be any code handling binary trace/jinsight format? >+ (not dealt with for now) */ >+ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, >+ MONITOR_CONTENDED_ENTER_ELEMENT, STRLEN_MONITOR_CONTENDED_ENTER_ELEMENT); >+ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, timestamp); >+ } >+ >+ >+ /* Print the object identifier. */ >+ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, >+ STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, >+ OBJECT_ENTRY(objectHashEntry)->static_id, >+ tps->buffer); >+ } >+ >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, >+ STRLEN_OBJ_IDREF_ATTRIBUTE, current, >+ (jint)((ObjectHashKey*)objectHashEntry->id)->id, tps->buffer); >+ >+ } >+ >+ >+ /* print the thread owner attribute */ >+ >+ current = jvmpiAgent_printThreadOwnerAttribute(tps->buffer,current, thread_owner); >+ >+ /* The collation value */ >+ >+ >+ /*##MW There is a race condition between the increment and the print >+ that must be fixed */ >+ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, >+ &_jvmpiAgent_collation); >+ >+ /* The trace Id */ >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Finish up */ >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ >+} >+ >+ >+/** PRINT_MONITOR_CONTENDED_ENTERED_ELEMENT ************************************************ >+ * >+ * Print the <monContendedEntered> element to the trace indicating >+ * JVMPI_EVENT_MONITOR_CONTENDED_ENTERED occurred. >+ * >+ * args - >+ * objectHashEntry - the hash entry corresponding to the monitor object >+ * event - the MONITOR_WAITED event as reported by JVMPI >+ * timestamp - when the MONITOR_WAITED event occurred >+ */ >+void >+jvmpiAgent_printMonitorContendedEnteredElement(HashEntry *objectHashEntry, JVMPI_Event *event, >+ timestamp_t timestamp) >+{ >+ /* only print element if io is not suspended */ >+ if (!_jvmpiAgent_suspendIO) { >+ >+ unsigned short current=0; >+ ThreadPrivateStorage *tps; >+ >+ tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ >+ if(!timestamp) { >+ jvmpiAgent_getCurrentTime(×tamp); >+ } >+ >+ /* does there need to be any code handling binary trace/jinsight format? >+ (not dealt with for now) */ >+ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, >+ MONITOR_CONTENDED_ENTERED_ELEMENT, STRLEN_MONITOR_CONTENDED_ENTERED_ELEMENT); >+ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, timestamp); >+ } >+ >+ /* Print the object identifier. */ >+ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, >+ STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, >+ OBJECT_ENTRY(objectHashEntry)->static_id, >+ tps->buffer); >+ } >+ >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, >+ STRLEN_OBJ_IDREF_ATTRIBUTE, current, >+ (jint)((ObjectHashKey*)objectHashEntry->id)->id, tps->buffer); >+ >+ } >+ >+ >+ >+ /* The collation value */ >+ >+ >+ /*##MW There is a race condition between the increment and the print >+ that must be fixed */ >+ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, >+ &_jvmpiAgent_collation); >+ >+ /* The trace Id */ >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Finish up */ >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+ >+ >+ >+ >+/** PRINT_OBJ_ALLOC_ELEMENT ***************************************************** >+ * >+ */ >+void >+jvmpiAgent_printObjAllocElement(HashEntry *objectHashEntry, >+ JNIEnv *env_id, >+ timestamp_t timestamp) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ unsigned short current=0; >+ ThreadPrivateStorage *tps = jvmpiAgent_getThreadLocalStorage(env_id); >+ HashEntry *classHashEntry = OBJECT_ENTRY(objectHashEntry)->classHashEntry; >+ >+ objectHashEntry->printed = 1; >+ >+ if(!timestamp) { >+ jvmpiAgent_getCurrentTime(×tamp); >+ } >+ >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printObjectAllocation(tps->buffer, >+ objectHashEntry, >+ classHashEntry); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ >+ /* Ensure our class declaration has been printed */ >+ jvmpiAgent_outputClassDeclaration(OBJECT_ENTRY(objectHashEntry)->classHashEntry, tps); >+ >+ current=jvmpiAgent_insertEmptyEventHeader(env_id, tps, OBJ_ALLOC_ELEMENT, STRLEN_OBJ_ALLOC_ELEMENT); >+ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, timestamp); >+ } >+ >+ /* Print the object identifier as well as the class identifier */ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_ID_ATTRIBUTE, STRLEN_STATIC_OBJ_ID_ATTRIBUTE, current, OBJECT_ENTRY(objectHashEntry)->static_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_CLASS_IDREF_ATTRIBUTE, STRLEN_STATIC_CLASS_IDREF_ATTRIBUTE, current, (jint)(classHashEntry ? CLASS_ENTRY(classHashEntry)->static_id : 0), tps->buffer); >+ } >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_ID_ATTRIBUTE, STRLEN_OBJ_ID_ATTRIBUTE, current, (jint)((ObjectHashKey*)objectHashEntry->id)->id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(CLASS_IDREF_ATTRIBUTE, STRLEN_CLASS_IDREF_ATTRIBUTE, current, (jint)(classHashEntry ? ((ClassHashKey*)classHashEntry->id)->id : 0), tps->buffer); >+ } >+ >+ >+ if(_jvmpiAgent_Options.objAllocIsArray) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(IS_ARRAY_ATTRIBUTE, STRLEN_IS_ARRAY_ATTRIBUTE, current, OBJECT_ENTRY(objectHashEntry)->is_array, tps->buffer); >+ } >+ >+ /* Print the size of this object */ >+#ifdef _LP64 >+ current=jvmpiAgent_appendLongAttribute(SIZE_ATTRIBUTE, STRLEN_SIZE_ATTRIBUTE, current, OBJECT_ENTRY(objectHashEntry)->size, tps->buffer); /*fix 89008*/ >+#else >+ current=jvmpiAgent_appendIntegerAttribute(SIZE_ATTRIBUTE, STRLEN_SIZE_ATTRIBUTE, current, OBJECT_ENTRY(objectHashEntry)->size, tps->buffer); >+#endif >+ >+ /* The collation value */ >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &OBJECT_ENTRY(objectHashEntry)->collation); >+ >+ /* The trace Id */ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Finish up */ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+/** PRINT_CLASS_UNLOAD_ELEMENT ******************************************** >+ * >+ */ >+void >+jvmpiAgent_printClassUnloadElement(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ HashEntry *classHashEntry) >+{ >+ if (!_jvmpiAgent_suspendIO && CLASS_ENTRY(classHashEntry)->traceFlag && (_jvmpiAgent_Options.gc != GcNone)) >+ { >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printClassUnload(tps->buffer, classHashEntry); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ unsigned short current=0; >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, CLASS_UNLOAD_ELEMENT, STRLEN_CLASS_UNLOAD_ELEMENT); >+ if(jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(CLASS_IDREF_ATTRIBUTE, STRLEN_CLASS_IDREF_ATTRIBUTE, current, (jint)(event->u.class_unload.class_id), tps->buffer); >+ } >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_CLASS_IDREF_ATTRIBUTE, STRLEN_STATIC_CLASS_IDREF_ATTRIBUTE, current, (jint)(CLASS_ENTRY(classHashEntry)->static_id), tps->buffer); >+ } >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+ } >+} >+ >+/** PRINT_OBJ_MOVE_ELEMENT ************************************************ >+ * Handles the output of OBJ_MOVE. >+ */ >+void jvmpiAgent_printObjMoveElement(JVMPI_Event *event, >+ HashEntry *objectHashEntry) >+{ >+ HashEntry *classHashEntry = OBJECT_ENTRY(objectHashEntry)->classHashEntry; >+ if (!_jvmpiAgent_suspendIO && classHashEntry) >+ { >+ ThreadPrivateStorage *tps = jvmpiAgent_getThreadLocalStorage(event->env_id); >+ unsigned short current=0; >+ >+ jvmpiAgent_outputClassDeclaration(classHashEntry, tps); >+ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, OBJ_MOVE_ELEMENT, STRLEN_OBJ_MOVE_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ if (jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, OBJECT_ENTRY(objectHashEntry)->static_id, tps->buffer); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, STRLEN_OBJ_IDREF_ATTRIBUTE, current, (jint)(event->u.obj_move.obj_id), tps->buffer); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(NEW_OBJ_ID_ATTRIBUTE, STRLEN_NEW_OBJ_ID_ATTRIBUTE, current, (jint)(event->u.obj_move.new_obj_id), tps->buffer); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+ >+/** PRINT_THREAD_END_ELEMENT ********************************************** >+ */ >+void jvmpiAgent_printThreadEndElement(JNIEnv *env_id, >+ ThreadLocalStorage *tps) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ unsigned short current=0; >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printThreadEnd(tps->buffer, tps); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ current=jvmpiAgent_insertEmptyEventHeader(env_id, tps, THREAD_END_ELEMENT, STRLEN_THREAD_END_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ >+ } >+ } >+} >+ >+ >+/** PRINT_METHOD_EXIT_EVENT *********************************************** >+ * Prints the METHOD_EXIT, METHOD_RETURN element >+ */ >+void >+jvmpiAgent_printMethodExitElement(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ HashEntry *methodHashEntry, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) >+{ >+ unsigned short current=0; >+ jobjectID object_id = 0; >+ jint static_id = 0; >+ HashEntry *objectHashEntry = jvmpiAgent_Peek(tps, 0)->objectHashEntry; >+ >+ if(_jvmpiAgent_Options.jinsightFormat) { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printMethodExit(tps->buffer, tps, >+ timeJustAfterGotControl); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ return; >+ } >+ >+ /* Object information will only be there if we are in FULL trace mode */ >+ if (objectHashEntry) >+ { >+ object_id = ((ObjectHashKey*)objectHashEntry->id)->id; >+ static_id = OBJECT_ENTRY(objectHashEntry)->static_id ; >+ } >+ assert(event); >+ assert(methodHashEntry); >+ assert(tps); >+ >+ >+ if (object_id && jvmpiAgent_isPrintStaticId()) >+ { >+ HashEntry *objectHashEntry = 0; >+ objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocate(object_id, event->env_id); >+ } >+ >+ /* RKD: We don't emit methidCall events any more. So remove the methodreturn peer. >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, CLASS_ENTRY(METHOD_ENTRY(methodHashEntry)->classHashEntry)->traceFlag ? METHOD_EXIT_ELEMENT : METHOD_RETURN_ELEMENT, >+ (unsigned short)(CLASS_ENTRY(METHOD_ENTRY(methodHashEntry)->classHashEntry)->traceFlag ? STRLEN_METHOD_EXIT_ELEMENT : STRLEN_METHOD_RETURN_ELEMENT)); >+ */ >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, METHOD_EXIT_ELEMENT, STRLEN_METHOD_EXIT_ELEMENT); >+ >+ >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_METHOD_IDREF_ATTRIBUTE, STRLEN_STATIC_METHOD_IDREF_ATTRIBUTE, current, (jint)(METHOD_ENTRY(methodHashEntry)->static_id), tps->buffer); >+ } >+ if(jvmpiAgent_isPrintMethodId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(METHOD_IDREF_ATTRIBUTE, STRLEN_METHOD_IDREF_ATTRIBUTE, current, (jint)(METHOD_ENTRY(methodHashEntry)->methodData.method_id), tps->buffer); >+ } >+ >+ >+ >+ if(object_id && jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, STRLEN_OBJ_IDREF_ATTRIBUTE, current, (jint)object_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(CLASS_IDREF_ATTRIBUTE, STRLEN_CLASS_IDREF_ATTRIBUTE, current,(jint)((ClassHashKey*) ((MethodEntry *)methodHashEntry->entry)->classHashEntry->id)->id, tps->buffer); >+ } >+ if (object_id && jvmpiAgent_isPrintStaticId()) >+ { >+ if (objectHashEntry) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, ((ObjectEntry*)objectHashEntry->entry)->static_id, tps->buffer); >+ } >+ } >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_CLASS_IDREF_ATTRIBUTE, STRLEN_STATIC_CLASS_IDREF_ATTRIBUTE, current, CLASS_ENTRY(METHOD_ENTRY(methodHashEntry)->classHashEntry)->static_id, tps->buffer); >+ } >+ if(_jvmpiAgent_Options.cpuTime) { >+ Uint64 cpu_exit_overhead, cpu_overheadSoFar, cpu_totalInvocationOverhead, cpu_cumulativeTime; >+ timestamp_t cpuNow; >+ >+ /* load the running sum of all overhead so far */ >+ cpu_overheadSoFar = tps->stackEntry[tps->tos].cumulative_cpu_overhead; >+ >+ /* determine the cumulative method time spent in this method */ >+ cpu_cumulativeTime = TIMESTAMP_SUB(cpu_timestamp,tps->stackEntry[tps->tos].cpuTime); >+ >+ /* subtract the overhead */ >+ cpu_cumulativeTime = TIMESTAMP_SUB(cpu_cumulativeTime,cpu_overheadSoFar); >+ >+ /* print the CPU cumulative time */ >+ current=jvmpiAgent_appendThreadCPUTime(tps->buffer, current, cpu_cumulativeTime); >+ >+ /* now we have to add the overhead so far to the >+ overhead in the call one up on the stack (overhead is cumulative in the call stack) */ >+ >+ /* acquire the timestamp as late as possible; note: anything after >+ this will be overhead that is blamed to the invoker, but it's >+ the best we can do for now */ >+ cpuNow = jvmpiAgent_getCurrentThreadCPUTime(); >+ >+ /* determine the current exit overhead */ >+ cpu_exit_overhead = TIMESTAMP_SUB(cpuNow,cpu_timestamp); >+ >+ /* add it to the running sum of all overhead for this invocation */ >+ cpu_totalInvocationOverhead = cpu_overheadSoFar+cpu_exit_overhead; >+ >+ /* now add it to the stack entry one up in the stack */ >+ if (tps->tos > 1) { >+ tps->stackEntry[tps->tos-1].cumulative_cpu_overhead += cpu_totalInvocationOverhead; >+ } >+ } >+ if(_jvmpiAgent_Options.ticket) >+ { >+ current=jvmpiAgent_printTicketAttribute(&jvmpiAgent_Peek(tps, 0)->ticket, tps->buffer, current); >+ } >+ if (_jvmpiAgent_Options.contextFlow) >+ { >+ /*## Values of context flow information not implemented yet. */ >+ current=jvmpiAgent_appendIntegerAttribute(SEQUENCE_COUNTER_ATTRIBUTE, STRLEN_SEQUENCE_COUNTER_ATTRIBUTE, current, 0, tps->buffer); >+ current=jvmpiAgent_appendStringAttribute(CONTEXT_DATA_ATTRIBUTE, STRLEN_CONTEXT_DATA_ATTRIBUTE, current, "##not implemented yet##", tps); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Print the timestamp (and overhead) information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ Uint64 exit_overhead, overheadSoFar, totalInvocationOverhead; >+ timestamp_t now; >+ >+ /* load the running sum of all overhead so far */ >+ overheadSoFar = tps->stackEntry[tps->tos].cumulative_overhead; >+ >+ /* acquire the timestamp as late as possible; note: anything after >+ this will be overhead that is blamed to the invoker, but it's >+ the best we can do for now */ >+ jvmpiAgent_getCurrentTime(&now); >+ >+ /* print the timestamp */ >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, now); >+ >+ /* determine the current exit overhead */ >+ exit_overhead = TIMESTAMP_SUB(now,timestamp); >+ >+ /* add it to the running sum of all overhead for this invocation */ >+ totalInvocationOverhead = overheadSoFar+exit_overhead; >+ current = jvmpiAgent_appendOverhead(tps->buffer, current, totalInvocationOverhead); >+ } >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+ >+/** PRINT_AG_METHOD_EXIT_ELEMENT **************************preAgg/135437******* >+ * >+ * Prints the METHOD_EXIT element >+ */ >+void jvmpiAgent_printAgMethodExitElement(ThreadPrivateStorage * tps, StackFrame * call) { >+ >+ unsigned short current=0; >+ >+ /* Note that tps->env is passed in place of event->env_id passed elsewhere and should be equivalent in the preAgg case. */ >+ current=jvmpiAgent_insertEmptyEventHeader(tps->env, tps, AG_METHOD_EXIT_ELEMENT, STRLEN_AG_METHOD_EXIT_ELEMENT); >+ >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_METHOD_IDREF_ATTRIBUTE, STRLEN_STATIC_METHOD_IDREF_ATTRIBUTE, current, >+ (jint)(METHOD_ENTRY(call->methodHashEntry)->static_id), tps->buffer); >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+/** PRINT_METHODS ********************************************************** >+ * Handles the output of all the METHOD elements and attributes for a class. >+ */ >+void >+jvmpiAgent_printMethods(HashEntry **mp, >+ int count, >+ ThreadPrivateStorage *tps) >+{ >+ if (!_jvmpiAgent_suspendIO && (_jvmpiAgent_Options.stackInfo > StackInfoNone || _jvmpiAgent_Options.methodCounts)) >+ { >+ int i; >+ for (i=0; i < count; i++) >+ { >+ if (METHOD_ENTRY(mp[i])->traceFlag) { >+ jvmpiAgent_printMethod(METHOD_ENTRY(mp[i]), tps); >+ mp[i]->printed = 1; >+ } >+ } >+ } >+} >+ >+ >+/** PRINT_FIELDS *********************************************************** >+ * Handles the output of all the STATIC_FIELD or INSTANCE_FIELD elements >+ * and attributes for a class. >+ */ >+void jvmpiAgent_printFields(ThreadPrivateStorage *tps, >+ PI_Field *fp, int count, >+ FieldType_t fieldType) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ int i; >+ for (i=0; i < count && fp; i++) >+ { >+ unsigned short current=0; >+ >+ if (fieldType == Static) >+ { >+ current=jvmpiAgent_insertElementStart(STATIC_FIELD_ELEMENT, STRLEN_STATIC_FIELD_ELEMENT, tps); >+ } >+ else >+ { >+ current=jvmpiAgent_insertElementStart(INSTANCE_FIELD_ELEMENT, STRLEN_INSTANCE_FIELD_ELEMENT, tps); >+ } >+ current=jvmpiAgent_appendStringAttribute(NAME_ATTRIBUTE, STRLEN_NAME_ATTRIBUTE, current, fp->field_name, tps); >+ current=jvmpiAgent_appendStringAttribute(SIGNATURE_ATTRIBUTE, STRLEN_SIGNATURE_ATTRIBUTE, current, fp->field_signature, tps); >+ current=jvmpiAgent_appendIntegerAttribute(FIELD_ID_ATTRIBUTE, STRLEN_FIELD_ID_ATTRIBUTE, current, fp->fieldId, tps->buffer); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ fp++; /* Skip to the next method */ >+ } >+ } >+} >+ >+ >+/** PRINT_CLASS **************************************************************** >+ * Handles the output of the CLASS_LOAD element and attributes >+ */ >+void >+jvmpiAgent_printClass(HashEntry *classHashEntry, >+ ThreadPrivateStorage *tps) >+{ >+ unsigned short current=0; >+ if (!_jvmpiAgent_suspendIO) >+ { >+ >+ classHashEntry->printed = 1; >+ >+ >+ if(_jvmpiAgent_Options.jinsightFormat) >+ { >+#ifdef BINARY_TRACE >+ ClassEntry *classEntry = CLASS_ENTRY(classHashEntry); >+ unsigned short numBytes; >+ >+ /* 1. "define" the class, which just defines the class id */ >+ numBytes = BINARYTRACE_printClassDefine(tps->buffer, classEntry); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+ >+ /* 2. "load" the class, which defines properies of class */ >+ numBytes = BINARYTRACE_printClassLoad(tps->buffer, classEntry); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+ >+ /* 3. instance fields */ >+ BINARYTRACE_printFields(tps, classEntry, classEntry->numInstanceFields, >+ 0, >+ classEntry->instances, FALSE); >+ >+ /* 4. static fields */ >+ BINARYTRACE_printFields(tps, classEntry, classEntry->numStaticFields, >+ classEntry->numInstanceFields, >+ classEntry->statics, TRUE); >+#endif /* BINARY_TRACE */ >+ } >+ else >+ { >+ ClassEntry *classEntry = CLASS_ENTRY(classHashEntry); >+ >+ current=jvmpiAgent_insertEmptyEventHeader(tps->env, tps, >+ CLASS_LOAD_ELEMENT, >+ STRLEN_CLASS_LOAD_ELEMENT); >+ >+ >+ current=jvmpiAgent_appendStringAttribute(NAME_ATTRIBUTE, STRLEN_NAME_ATTRIBUTE, current, classEntry->className, tps); >+ current=jvmpiAgent_appendStringAttribute(SOURCE_NAME_ATTRIBUTE, STRLEN_SOURCE_NAME_ATTRIBUTE, current, classEntry->sourceName, tps); >+ if (_jvmpiAgent_Options.classLoadDetails) >+ { >+ >+ /* Show the classloader of this entry (if one has been detected) */ >+ if (classEntry->classLoaderName && strlen(classEntry->classLoaderName) > 0) >+ current = jvmpiAgent_appendStringAttribute(CLASS_LOADER_NAME, STRLEN_CLASS_LOADER_NAME, current, classEntry->classLoaderName, tps); >+ >+ if (classEntry->superClassName && strlen(classEntry->superClassName) > 0) >+ current=jvmpiAgent_appendStringAttribute(SUPER_CLASS_NAME_ATTRIBUTE, STRLENT_SUPER_CLASS_NAME_ATTRIBUTE, current, classEntry->superClassName, tps); >+ >+ current=jvmpiAgent_appendIntegerAttribute(NUM_INTERFACES_ATTRIBUTE, STRLEN_NUM_INTERFACES_ATTRIBUTE, current, classEntry->numInterfaces, tps->buffer); >+ >+ /* Show the interface names only if there are any interfaces implemented */ >+ if (classEntry->nameOfInterfaces && strlen(classEntry->nameOfInterfaces) > 0) >+ current=jvmpiAgent_appendStringAttribute(INTERFACE_NAMES_ATTRIBUTE, STRLEN_INTERFACE_NAMES_ATTRIBUTE, current, classEntry->nameOfInterfaces, tps); >+ >+ current=jvmpiAgent_appendIntegerAttribute(NUM_METHODS_ATTRIBUTE, STRLEN_NUM_METHODS_ATTRIBUTE, current, classEntry->numMethods, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(NUM_STATIC_FIELDS_ATTRIBUTE, STRLEN_NUM_STATIC_FIELDS_ATTRIBUTE, current, classEntry->numStaticFields, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(NUM_INSTANCE_FIELDS_ATTRIBUTE, STRLEN_NUM_INSTANCE_FIELDS_ATTRIBUTE, current, classEntry->numInstanceFields, tps->buffer); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(CLASS_ID_ATTRIBUTE, STRLEN_CLASS_ID_ATTRIBUTE, current, (jint)classEntry->classId, tps->buffer); >+ } >+ if(jvmpiAgent_isPrintStaticId()) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_CLASS_ID_ATTRIBUTE, STRLEN_STATIC_CLASS_ID_ATTRIBUTE, current, (jint)classEntry->static_id, tps->buffer); >+ /* Give the objectID of our class object if we have it*/ >+ if(CLASS_ENTRY(classHashEntry)->classObject) { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, (jint)OBJECT_ENTRY(CLASS_ENTRY(classHashEntry)->classObject)->static_id, tps->buffer); >+ >+ } >+ } >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ /* In case we don't have a time for it (which is the case for primitives), this would be a good time to figure it out */ >+ if (classEntry->timestamp == 0) >+ { >+ jvmpiAgent_getCurrentTime(&classEntry->timestamp); >+ } >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, classEntry->timestamp); >+ } >+ if (_jvmpiAgent_Options.contextFlow) >+ { >+ /*## Values of context flow information not implemented yet. */ >+ current=jvmpiAgent_appendIntegerAttribute(SEQUENCE_COUNTER_ATTRIBUTE, STRLEN_SEQUENCE_COUNTER_ATTRIBUTE, current, 0, tps->buffer); >+ current=jvmpiAgent_appendStringAttribute(CONTEXT_DATA_ATTRIBUTE, STRLEN_CONTEXT_DATA_ATTRIBUTE, current, "##not implemented yet##", tps); >+ } >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &classEntry->collation); >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ >+ if (_jvmpiAgent_Options.classLoadDetails) >+ { >+ jvmpiAgent_printFields(tps, CLASS_ENTRY(classHashEntry)->statics, CLASS_ENTRY(classHashEntry)->numStaticFields, Static); >+ jvmpiAgent_printFields(tps, CLASS_ENTRY(classHashEntry)->instances, CLASS_ENTRY(classHashEntry)->numInstanceFields, Instance); >+ } >+ } >+ } >+} >+ >+void jvmpiAgent_printTraceEndElement(ThreadPrivateStorage *tps) >+{ >+ unsigned short current = 0; >+ current=jvmpiAgent_insertElementStart(TRACE_STOP_ELEMENT, STRLEN_TRACE_STOP_ELEMENT, tps); >+ current = jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+ >+unsigned short jvmpiAgent_printTicketAttribute(SegmentedValue_t *ticket, char *buffer, unsigned short current) >+{ >+#ifdef SEGMENTED_VALUE_MULTIWORD >+ unsigned long i; >+ current=jvmpiAgent_appendUnsignedLongAttribute(TICKET_ATTRIBUTE, STRLEN_TICKET_ATTRIBUTE, current, ticket->values[0], buffer); >+ for (i = 1; i < ticket->numberOfWords; i++) >+ { >+ current=jvmpiAgent_appendListUnsignedLong(current, ticket->values[i], buffer); >+ } >+#else >+ current=jvmpiAgent_appendUnsignedLongAttribute(TICKET_ATTRIBUTE, STRLEN_TICKET_ATTRIBUTE, current, ticket->value, buffer); >+#endif >+ return current; >+} >+ >+ >+void jvmpiAgent_printTraceStartElement(ThreadLocalStorage *tps, char *options) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ ra_string_t uuid; >+ ra_IPAddresses_t addresses; >+ timestamp_t startTime; >+ unsigned short current=0; >+ jvmpiAgent_getCurrentTime(&startTime); >+ >+ /* We need to free this later so set to null in case the API call fails that does malloc */ >+ addresses.addresses=NULL; >+ >+ /* Initialize the collation value sequence */ >+ jvmpiAgent_initializeSegmentedValue(&_jvmpiAgent_collation, 1); >+ >+ current=jvmpiAgent_insertElementStart(TRACE_START_ELEMENT, STRLEN_TRACE_START_ELEMENT, tps); >+ >+ ra_generateUUID(&uuid); >+#ifdef MVS >+ if (uuid.length != __etoa(uuid.data)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+#endif >+ _jvmpiAgent_trace_id=uuid.data; >+ >+ current=jvmpiAgent_appendStringAttribute(TRACE_ID_ATTRIBUTE, STRLEN_TRACE_ID_ATTRIBUTE, current, _jvmpiAgent_trace_id , tps); >+/* 199373 begin */ >+#ifdef MVS >+ uuid.length = strlen(ra_getAgentUUID(_jvmpiAgent_bindingStorage)); >+ uuid.data = (char *)malloc(uuid.length+1); >+ if (uuid.data == NULL) { >+#pragma convlit(suspend) >+ printf("Memory allocation failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ return; >+ } >+ strcpy(uuid.data, ra_getAgentUUID(_jvmpiAgent_bindingStorage)); >+ if (uuid.length != __etoa(uuid.data)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+ current=jvmpiAgent_appendStringAttribute(AGENT_IDREF_ATTRIBUTE, STRLEN_AGENT_IDREF_ATTRIBUTE, current, uuid.data, tps); >+ free(uuid.data); >+#else >+ current=jvmpiAgent_appendStringAttribute(AGENT_IDREF_ATTRIBUTE, STRLEN_AGENT_IDREF_ATTRIBUTE, current, ra_getAgentUUID(_jvmpiAgent_bindingStorage) , tps); >+#endif >+/* 199373 end */ >+ >+ if(_jvmpiAgent_Options.timestamp) { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, startTime); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+ >+static unsigned short printHostNameAttribute(ThreadPrivateStorage *tps, unsigned short current) >+{ >+ char hostNameBuffer[100]; >+ >+ if(ra_getLocalHostName(hostNameBuffer, sizeof(hostNameBuffer))==0) >+ { >+#ifdef MVS /* 174190 */ >+ __etoa(hostNameBuffer); >+#endif >+ current=jvmpiAgent_appendStringAttribute(HOSTNAME_ATTRIBUTE, STRLEN_HOSTNAME_ATTRIBUTE, current, hostNameBuffer, tps); >+ } >+ return current; >+} >+ >+ >+static unsigned short printIPAddressAttribute(ThreadPrivateStorage *tps, unsigned short current) >+{ >+ ra_IPAddresses_t addresses; >+ unsigned char *p; >+ int i; >+ >+ /* Get the network information and print it */ >+ if(ra_getLocalIPAddresses(&addresses)==0) >+ { >+#ifdef MVS /* 174190 */ >+ int mycurr = current; >+#pragma convlit(suspend) >+#endif >+ tps->buffer[current++]=' '; >+ memcpy(&tps->buffer[current], IPADDRESS_ATTRIBUTE, STRLEN_IPADDRESS_ATTRIBUTE); >+ current+=STRLEN_IPADDRESS_ATTRIBUTE; >+ tps->buffer[current++]='='; >+ tps->buffer[current++]='\"'; >+ for (p=addresses.addresses; *p; p+=addresses.addressLength) >+ { >+ /* If this isn't the first IP address add a comma */ >+ if(p!=addresses.addresses) >+ { >+ tps->buffer[current++]=','; >+ } >+ >+ /* the first number of the address */ >+#ifdef _WIN32 >+ itoa(p[0], &tps->buffer[current], 10); >+ current+=strlen(&tps->buffer[current]); >+#else >+ current+=sprintf(&tps->buffer[current], "%d", p[0]); >+#endif >+ >+ /* Subsequent "." separated address numbers */ >+ for (i=1; i < addresses.addressLength; i++) >+ { >+ tps->buffer[current++]='.'; >+#ifdef _WIN32 >+ itoa(p[i], &tps->buffer[current], 10); >+ current+=strlen(&tps->buffer[current]); >+#else >+ current+=sprintf(&tps->buffer[current], "%d", p[i]); >+#endif >+ } >+ } >+ /* Add closing quote */ >+ tps->buffer[current++]='\"'; >+#ifdef MVS /* 174190 */ >+ tps->buffer[current]='\0'; >+#pragma convlit(resume) >+ __etoa(tps->buffer+mycurr); >+#endif >+ } >+ else >+ { >+ /* Couldn't resolve the IP (probably no network) */ >+ current=jvmpiAgent_appendStringAttribute(IPADDRESS_ATTRIBUTE, STRLEN_IPADDRESS_ATTRIBUTE, current, UNAVAILABLE, tps); >+ } >+ /* The memory required for the addreses is allocated in the jvmpicommGetLocalIPAddresses >+ */ >+#ifndef _DEBUG >+ ra_free(addresses.addresses); /*ts. Bug 143342, changed from free to ra_free to match with ra_malloc */ >+#endif >+ return current; >+} >+ >+ >+void jvmpiAgent_printNodeElement(ThreadLocalStorage *tps) >+{ >+ unsigned short current = 0; >+ timestamp_t time; >+#ifdef MVS >+ char *uuid; >+ int uuidlen; >+#endif >+ jvmpiAgent_getProcessStartTime(&time); >+ current=jvmpiAgent_insertElementStart(NODE_ELEMENT, STRLEN_NODE_ELEMENT, tps); >+ >+#ifdef MVS >+ uuidlen = strlen(ra_getNodeUUID(_jvmpiAgent_bindingStorage)); >+ uuid = (char *)malloc(uuidlen+1); /* 192196 */ >+ if (uuid == NULL) { >+#pragma convlit(suspend) >+ printf("Memory allocation failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ return; >+ } >+ strcpy(uuid, ra_getNodeUUID(_jvmpiAgent_bindingStorage)); >+ if (uuidlen != __etoa(uuid)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+ current=jvmpiAgent_appendStringAttribute(NODE_ID_ATTRIBUTE, STRLEN_NODE_ID_ATTRIBUTE, current, uuid, tps); >+ free(uuid); >+#else >+ current=jvmpiAgent_appendStringAttribute(NODE_ID_ATTRIBUTE, STRLEN_NODE_ID_ATTRIBUTE, current, ra_getNodeUUID(_jvmpiAgent_bindingStorage) , tps); >+#endif >+ current=printHostNameAttribute(tps, current); >+ current=printIPAddressAttribute(tps, current); >+ current=jvmpiAgent_appendIntegerAttribute(TIMEZONE_ATTRIBUTE, STRLEN_TIMEZONE_ATTRIBUTE, current, jvmpiAgent_getTimezone(), tps->buffer); >+ if(_jvmpiAgent_Options.timestamp) { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, time); >+ } >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+ >+void jvmpiAgent_printProcessCreateElement(ThreadLocalStorage *tps) >+{ >+ unsigned short current = 0; >+ timestamp_t time; >+#ifdef MVS >+ char *uuid; >+ int uuidlen; >+#endif >+ jvmpiAgent_getProcessStartTime(&time); >+ >+ current=jvmpiAgent_insertElementStart(PROCESS_CREATE_ELEMENT, STRLEN_PROCESS_CREATE_ELEMENT, tps); >+#ifdef MVS >+ uuidlen = strlen(ra_getProcessUUID(_jvmpiAgent_bindingStorage)); >+ uuid = (char *)malloc(uuidlen+1); /* 192196 */ >+ if (uuid == NULL) { >+#pragma convlit(suspend) >+ printf("Memory allocation failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ return; >+ } >+ strcpy(uuid, ra_getProcessUUID(_jvmpiAgent_bindingStorage)); >+ if (uuidlen != __etoa(uuid)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+ current=jvmpiAgent_appendStringAttribute(PROCESS_ID_ATTRIBUTE, STRLEN_PROCESS_ID_ATTRIBUTE, current, uuid, tps); >+ free(uuid); >+#else >+ current=jvmpiAgent_appendStringAttribute(PROCESS_ID_ATTRIBUTE, STRLEN_PROCESS_ID_ATTRIBUTE, current, ra_getProcessUUID(_jvmpiAgent_bindingStorage) , tps); >+#endif >+ current=jvmpiAgent_appendIntegerAttribute(PID_ATTRIBUTE, STRLEN_PID_ATTRIBUTE, current, ra_getProcessId(), tps->buffer); >+#ifdef MVS >+ uuidlen = strlen(ra_getNodeUUID(_jvmpiAgent_bindingStorage)); >+ uuid = (char *)malloc(uuidlen+1); /* 192196 */ >+ if (uuid == NULL) { >+#pragma convlit(suspend) >+ printf("Memory allocation failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ return; >+ } >+ strcpy(uuid, ra_getNodeUUID(_jvmpiAgent_bindingStorage)); >+ if (uuidlen != __etoa(uuid)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+ current=jvmpiAgent_appendStringAttribute(NODE_IDREF_ATTRIBUTE, STRLEN_NODE_IDREF_ATTRIBUTE, current, uuid , tps); >+ free(uuid); >+#else >+ current=jvmpiAgent_appendStringAttribute(NODE_IDREF_ATTRIBUTE, STRLEN_NODE_IDREF_ATTRIBUTE, current, ra_getNodeUUID(_jvmpiAgent_bindingStorage) , tps); >+#endif >+ if(_jvmpiAgent_Options.timestamp) { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, time); >+ } >+/* 8884 */ >+/* current=jvmpiAgent_appendStringAttribute(APPLICATION_NAME_ATTRIBUTE, STRLEN_APPLICATION_NAME_ATTRIBUTE, current, ra_getProcessCommandLine() , tps->buffer); */ >+/* 8884 */ >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+ >+/** PRINT_EXCEPTION_ELEMENT *********************************************** >+ * >+ */ >+void jvmpiAgent_printExceptionElement(JNIEnv *env, >+ ThreadLocalStorage *tps, >+ enum ThrowOrCatch type, >+ HashEntry *methodHashEntry, >+ jobjectID objId, >+ jthrowable e) >+{ >+ HashEntry *objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocate(objId, env); >+ unsigned short current=0; >+ >+ current=jvmpiAgent_insertEmptyEventHeader(env, tps, type == Throw ? THROW_ELEMENT : CATCH_ELEMENT, (unsigned short) (type == Throw ? STRLEN_THROW_ELEMENT : STRLEN_CATCH_ELEMENT)); >+ >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ if (jvmpiAgent_isPrintObjId()) >+ { >+ if (objId) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_IDREF_ATTRIBUTE, STRLEN_OBJ_IDREF_ATTRIBUTE, current, (unsigned long)objId, tps->buffer); >+ } >+ else >+ { >+ current=jvmpiAgent_appendStringAttribute(OBJ_IDREF_ATTRIBUTE, STRLEN_OBJ_IDREF_ATTRIBUTE, current, UNAVAILABLE, tps); >+ } >+ } >+ if (jvmpiAgent_isPrintStaticId()) >+ { >+ if (objId && objectHashEntry) >+ { >+ current=jvmpiAgent_appendIntegerAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, ((ObjectEntry*)objectHashEntry->entry)->static_id, tps->buffer); >+ } >+ else >+ { >+ current=jvmpiAgent_appendStringAttribute(STATIC_OBJ_IDREF_ATTRIBUTE, STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE, current, UNAVAILABLE, tps); >+ } >+ } >+ current=jvmpiAgent_appendIntegerAttribute(OBJ_HANDLE_ATTRIBUTE, STRLEN_OBJ_HANDLE_ATTRIBUTE, current, (unsigned long)e, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(METHOD_IDREF_ATTRIBUTE, STRLEN_METHOD_IDREF_ATTRIBUTE, current, (jint)(((MethodEntry *)methodHashEntry->entry)->methodData.method_id), tps->buffer); >+ >+ if(_jvmpiAgent_Options.ticket) >+ { >+ current=jvmpiAgent_printTicketAttribute(&jvmpiAgent_Peek(tps,2)->ticket,tps->buffer, current); >+ } >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+/** PRINT_LINE_ELEMENT **************************************************** >+ * >+ */ >+void jvmpiAgent_printLineElement(JNIEnv *env, >+ ThreadLocalStorage *tps, >+ HashEntry *methodHashEntry, >+ unsigned short lineNumber) >+{ >+ unsigned short current=0; >+ >+ current=jvmpiAgent_insertEmptyEventHeader(env, tps, LINE_ELEMENT, STRLEN_LINE_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ >+ current=jvmpiAgent_appendIntegerAttribute(LINE_NUMBER_ATTRIBUTE, STRLEN_LINE_NUMBER_ATTRIBUTE, current, lineNumber, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(METHOD_IDREF_ATTRIBUTE, STRLEN_METHOD_IDREF_ATTRIBUTE, current, (jint)(((MethodEntry *)methodHashEntry->entry)->methodData.method_id), tps->buffer); >+ >+ /*##MW There is a race condition between the increment and the print that must be fixed */ >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+void jvmpiAgent_printAgentCreateElement(ThreadLocalStorage *tps, >+ char *options) >+{ >+ unsigned short current=0; >+#ifdef MVS >+ char *uuid; >+ int uuidlen; >+#endif >+ >+ current=jvmpiAgent_insertElementStart(AGENT_CREATE_ELEMENT, STRLEN_AGENT_CREATE_ELEMENT, tps); >+/* 199373 begin */ >+#ifdef MVS >+ uuidlen = strlen(ra_getAgentUUID(_jvmpiAgent_bindingStorage)); >+ uuid = (char *)malloc(uuidlen+1); /* 192196 */ >+ if (uuid == NULL) { >+#pragma convlit(suspend) >+ printf("Memory allocation failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ return; >+ } >+ strcpy(uuid, ra_getAgentUUID(_jvmpiAgent_bindingStorage)); >+ if (uuidlen != __etoa(uuid)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+ current=jvmpiAgent_appendStringAttribute(AGENT_ID_ATTRIBUTE, STRLEN_AGENT_ID_ATTRIBUTE, current, uuid, tps); >+ free(uuid); >+#else >+ current=jvmpiAgent_appendStringAttribute(AGENT_ID_ATTRIBUTE, STRLEN_AGENT_ID_ATTRIBUTE, current, ra_getAgentUUID(_jvmpiAgent_bindingStorage) , tps); >+#endif >+/* 199373 end */ >+ >+ current=jvmpiAgent_appendStringAttribute(AGENT_VERSION_ATTRIBUTE, STRLEN_AGENT_VERSION_ATTRIBUTE, current, AGENT_VERSION, tps); >+ >+#ifdef MVS >+ uuidlen = strlen(ra_getProcessUUID(_jvmpiAgent_bindingStorage)); >+ uuid = (char *)malloc(uuidlen+1); /* 192196 */ >+ if (uuid == NULL) { >+#pragma convlit(suspend) >+ printf("Memory allocation failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ return; >+ } >+ strcpy(uuid, ra_getProcessUUID(_jvmpiAgent_bindingStorage)); >+ if (uuidlen != __etoa(uuid)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+ current=jvmpiAgent_appendStringAttribute(PROCESS_IDREF_ATTRIBUTE, STRLEN_PROCESS_IDREF_ATTRIBUTE, current, uuid, tps); >+ free(uuid); >+#else >+ current=jvmpiAgent_appendStringAttribute(PROCESS_IDREF_ATTRIBUTE, STRLEN_PROCESS_IDREF_ATTRIBUTE, current, ra_getProcessUUID(_jvmpiAgent_bindingStorage) , tps); >+#endif >+ current=jvmpiAgent_appendStringAttribute(AGENT_NAME_ATTRIBUTE, STRLEN_AGENT_NAME_ATTRIBUTE, current, _jvmpiAgent_Options.processName , tps); >+ current=jvmpiAgent_appendStringAttribute(AGENT_TYPE_ATTRIBUTE, STRLEN_AGENT_TYPE_ATTRIBUTE, current, _jvmpiAgent_Options.processType , tps); >+ current=jvmpiAgent_appendStringAttribute(AGENT_PARAMETERS_ATTRIBUTE, STRLEN_AGENT_PARAMETERS_ATTRIBUTE, current, options , tps); >+ if(_jvmpiAgent_Options.timestamp) { >+ current=jvmpiAgent_appendTimestamp(tps->buffer, current, _startTimeAsTicks); >+ } >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >+ >+/* PR Object Ref */ >+void jvmpiAgent_printHDStartElement(ThreadLocalStorage *tps, >+ char* heapDefName) >+{ >+ if(_jvmpiAgent_Options.jinsightFormat) { >+ } else { >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(HD_START_ELEMENT, STRLEN_HD_START_ELEMENT, tps); >+ current=jvmpiAgent_appendIntegerAttribute(HEAPDUMP_ID_ATTRIBUTE, STRLEN_HEAPDUMP_ID_ATTRIBUTE, current, _heapDumpInfo.index, tps->buffer); >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendStringAttribute(NAME_ATTRIBUTE, STRLEN_NAME_ATTRIBUTE, current, heapDefName, tps); >+ current=jvmpiAgent_appendLabeledTimestamp(tps->buffer, current, BASETIME_ATTRIBUTE, STRLEN_BASETIME_ATTRIBUTE, _heapDumpInfo.lastGenerationTime, FALSE); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+/* Added "firstSeen" for bug 46785 */ >+void jvmpiAgent_printObjectArrayReferenceElement(ThreadLocalStorage *tps, >+ unsigned long obj_id, >+ unsigned int index, >+ jint objRef_id, >+ unsigned int firstSeen) >+{ >+ if(_jvmpiAgent_Options.jinsightFormat) { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printArrayReference(tps->buffer, obj_id, objRef_id); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } else { >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(OBJECT_REFERENCE_ATTRIBUTE, STRLEN_OBJECT_REFERENCE_ATTRIBUTE, tps); >+ current=jvmpiAgent_appendIntegerAttribute(OBJECT_OWNER_ATTRIBUTE, STRLEN_OBJECT_OWNER_ATTRIBUTE, current, obj_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(OBJECT_TARGET_ATTRIBUTE, STRLEN_OBJECT_TARGET_ATTRIBUTE, current, objRef_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(OBJECT_ARRAY_INDEX_ATTRIBUTE, STRLEN_OBJECT_ARRAY_INDEX_ATTRIBUTE, current, index, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(HEAPDUMP_IDREF_ATTRIBUTE, STRLEN_HEAPDUMP_IDREF_ATTRIBUTE, current, _heapDumpInfo.index, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(HEAPDUMP_FIRST_SEEN_ATTRIBUTE, STRLEN_HEAPDUMP_FIRST_SEEN_ATTRIBUTE, current, firstSeen, tps->buffer); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+/* Added "firstSeen" for bug 46785 */ >+void jvmpiAgent_printObjectInstanceReferenceElement(ThreadLocalStorage *tps, >+ unsigned long obj_id, >+ unsigned int index, >+ jint objRef_id, >+ unsigned int firstSeen, >+ unsigned long fieldIdRef) >+{ >+ if(_jvmpiAgent_Options.jinsightFormat) { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printObjectReference(tps->buffer, obj_id, objRef_id); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } else { >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(OBJECT_REFERENCE_ATTRIBUTE, STRLEN_OBJECT_REFERENCE_ATTRIBUTE, tps); >+ current=jvmpiAgent_appendIntegerAttribute(OBJECT_OWNER_ATTRIBUTE, STRLEN_OBJECT_OWNER_ATTRIBUTE, current, obj_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(OBJECT_TARGET_ATTRIBUTE, STRLEN_OBJECT_TARGET_ATTRIBUTE, current, objRef_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(FIELD_IDREF_ATTRIBUTE, STRLEN_FIELD_IDREF_ATTRIBUTE, current, fieldIdRef, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(HEAPDUMP_IDREF_ATTRIBUTE, STRLEN_HEAPDUMP_IDREF_ATTRIBUTE, current, _heapDumpInfo.index, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(HEAPDUMP_FIRST_SEEN_ATTRIBUTE, STRLEN_HEAPDUMP_FIRST_SEEN_ATTRIBUTE, current, firstSeen, tps->buffer); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+/* PR */ >+ >+void jvmpiAgent_printStaticReferenceElement(ThreadLocalStorage *tps, >+ unsigned long class_id, >+ unsigned int index, >+ jint objRef_id, >+ unsigned long fieldIdRef) { >+ if(_jvmpiAgent_Options.jinsightFormat) { >+#ifdef BINARY_TRACE >+ unsigned short numBytes = BINARYTRACE_printClassReference(tps->buffer, class_id, objRef_id); >+ jvmpiAgent_print(tps, tps->buffer, numBytes); >+#endif /* BINARY_TRACE */ >+ } else { >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(STATIC_REFERENCE_ATTRIBUTE, STRLEN_STATIC_REFERENCE_ATTRIBUTE, tps); >+ current=jvmpiAgent_appendIntegerAttribute(CLASS_OWNER_ATTRIBUTE, STRLEN_CLASS_OWNER_ATTRIBUTE, current, class_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(OBJECT_TARGET_ATTRIBUTE, STRLEN_OBJECT_TARGET_ATTRIBUTE, current, objRef_id, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(FIELD_IDREF_ATTRIBUTE, STRLEN_FIELD_IDREF_ATTRIBUTE, current, fieldIdRef, tps->buffer); >+ current=jvmpiAgent_appendIntegerAttribute(HEAPDUMP_IDREF_ATTRIBUTE, STRLEN_HEAPDUMP_IDREF_ATTRIBUTE, current, _heapDumpInfo.index, tps->buffer); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+void jvmpiAgent_printXMLStartElement(ThreadLocalStorage *tps) >+{ >+ if (!_jvmpiAgent_suspendIO) >+ { >+ unsigned short current=0; >+ char *data="?xml version=\"1.0\"?>"; >+ current=jvmpiAgent_insertElementStart(data, 20, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+ >+/** PRINT_VM_SUSPEND ************************************************************ >+ * Loads the memory address specified by 'buffer' with a Suspend entity including >+ * timestamp. >+ */ >+extern void jvmpiAgent_printVMSuspend(ThreadLocalStorage *tps) >+{ >+ if(!_jvmpiAgent_suspendIO) >+ { >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(PROCESS_SUSPEND_ELEMENT, STRLEN_PROCESS_SUSPEND_ELEMENT, tps); >+ /* Get the timestamp information if necessary */ >+ if (_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+ >+/** PRINT_VM_RESUME ************************************************************ >+ * Loads the memory address specified by 'buffer' with a Resume entity including >+ * timestamp. >+ */ >+extern void jvmpiAgent_printVMResume(ThreadLocalStorage *tps) >+{ >+ if(!_jvmpiAgent_suspendIO) >+ { >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(PROCESS_RESUME_ELEMENT, STRLEN_PROCESS_RESUME_ELEMENT, tps); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+ >+void jvmpiAgent_printStandaloneTraceTagOpen(ThreadLocalStorage *tps) >+{ >+ strcpy(tps->buffer, "<TRACE>"); >+ jvmpiAgent_print(tps, tps->buffer, (unsigned short)strlen(tps->buffer)); >+} >+ >+ >+void jvmpiAgent_printStandaloneTraceTagClose(ThreadLocalStorage *tps) >+{ >+ strcpy(tps->buffer, "</TRACE>"); >+ jvmpiAgent_print(tps, tps->buffer, (unsigned short)strlen(tps->buffer)); >+} >+ >+ >+void jvmpiAgent_printAgentDestroyElement(ThreadLocalStorage *tps) >+{ >+ if(!_jvmpiAgent_suspendIO) >+ { >+/* 199373 begin */ >+#ifdef MVS >+ char *uuid; >+ int uuidlen; >+#endif >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(AGENT_DESTROY_ELEMENT, STRLEN_AGENT_DESTROY_ELEMENT, tps); >+ >+#ifdef MVS >+ uuidlen = strlen(ra_getAgentUUID(_jvmpiAgent_bindingStorage)); >+ uuid = (char *)malloc(uuidlen+1); /* 192196 */ >+ if (uuid == NULL) { >+#pragma convlit(suspend) >+ printf("Memory allocation failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ return; >+ } >+ strcpy(uuid, ra_getAgentUUID(_jvmpiAgent_bindingStorage)); >+ if (uuidlen != __etoa(uuid)) { >+#pragma convlit(suspend) >+ printf("EBCDIC to ASCII conversion failure.\n"); >+ fflush(stdout); >+#pragma convlit(resume) >+ } >+ current=jvmpiAgent_appendStringAttribute(AGENT_IDREF_ATTRIBUTE, STRLEN_AGENT_IDREF_ATTRIBUTE, current, uuid, tps); >+ free(uuid); >+#else >+ current=jvmpiAgent_appendStringAttribute(AGENT_IDREF_ATTRIBUTE, STRLEN_AGENT_IDREF_ATTRIBUTE, current, ra_getAgentUUID(_jvmpiAgent_bindingStorage) , tps); >+#endif >+/* 199373 end */ >+ >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ } >+} >+ >+void jvmpiAgent_printJvmShutdownElement(JVMPI_Event *event) { >+ if (!_jvmpiAgent_suspendIO) >+ { >+ ThreadPrivateStorage *tps = jvmpiAgent_getThreadLocalStorage(0); >+ /* char * buffer = tps->buffer; Get the global work thread buffer */ >+ >+ if(_jvmpiAgent_Options.jinsightFormat) { >+#ifdef BINARY_TRACE >+ BINARYTRACE_printTraceEnd(tps); >+#endif /* BINARY_TRACE */ >+ } >+ else { >+ unsigned short current=0; >+ current=jvmpiAgent_insertEmptyEventHeader(event->env_id, tps, JVM_SHUT_DOWN_ELEMENT, STRLEN_JVM_SHUT_DOWN_ELEMENT); >+ /* Get the timestamp information if necessary */ >+ if(_jvmpiAgent_Options.timestamp) >+ { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ jvmpiAgent_incrementSegmentedValue(&_jvmpiAgent_collation, 0); >+ current=jvmpiAgent_printCollationValueAttribute(tps->buffer, current, &_jvmpiAgent_collation); >+ current=jvmpiAgent_printTraceIdrefAttribute(tps, current); >+ current=jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+ /* If a global method count was asked for, print it out */ >+ if (_jvmpiAgent_Options.methodCounts) >+ { >+ jvmpiAgent_ForAll(Method_t, jvmpiAgent_printMethodCount, tps); >+ } >+ >+ /* Print the closing tag */ >+ jvmpiAgent_printTraceEndElement(tps); >+ jvmpiAgent_printAgentDestroyElement(tps); >+ } >+ } >+} >+ >+void jvmpiAgent_printTraceStopElement(ThreadLocalStorage *tps) { >+ unsigned short current=0; >+ current=jvmpiAgent_insertElementStart(TRACE_STOP_ELEMENT, STRLEN_TRACE_STOP_ELEMENT, tps); >+ if(_jvmpiAgent_Options.timestamp) { >+ current=jvmpiAgent_appendCurrentTimeStamp(tps->buffer, current); >+ } >+ jvmpiAgent_appendElementEnd(NULL, 0, current, tps); >+ jvmpiAgent_print(tps, tps->buffer, current); >+} >Index: src-native-new/src/agents/native/java_profiler/utility.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/utility.c >diff -N src-native-new/src/agents/native/java_profiler/utility.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/utility.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,118 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: utility.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include "utility.h" >+#include "JvmpiWriter.h" >+#include <stdlib.h> >+ >+/******************************************************** >+ * strcpyrealloc() >+ * >+ * Copy one string to the other, first reallocating the >+ * space pointed to by the destination so that the src >+ * can comfortably fit in it. >+ * @param dest address of the destination buffer >+ * @param src the source string >+ * @return 0 if successful, -1 otherwise >+ */ >+ >+int strcpyrealloc(char **dest, const char *src) { >+ char *tmp; >+ if (*dest) { >+ /* if realloc fails, we don't want to overwrite *dest or we'll get >+ a memory leak */ >+ tmp = (char *)realloc(*dest,strlen(src)+1); >+ } else { >+ tmp = (char *)malloc(strlen(src)+1); >+ } >+ if (!tmp) { >+ return -1; >+ } else { >+ *dest = tmp; >+ } >+ strcpy(*dest,src); >+ return 0; >+} >+ >+/** CALLOC ************************************************************* >+ * Allocate some memory from the heap. If there is no more memory left >+ * the VM will exit gracefully. >+ */ >+extern void* jvmpiAgent_Calloc(unsigned int size) { >+ void *p=malloc(size); >+ if(p==NULL) { >+ fprintf(stderr, "FATAL ERROR: Out of memory...JVM Exiting\n"); >+ fflush(stderr); >+ _jvmpiAgent_jvmpiInterface->ProfilerExit((jint)-1); >+ } >+ memset(p, 0, size); >+ return p; >+} >+ >+ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+unsigned short double2string(double val, char *buffer, unsigned short offset, int precision) { >+ >+ int i; >+ Uint64 digits; >+ >+ digits = (Uint64) val; >+ >+ /* print the values that occur before the decimal */ >+ offset += sprintf(&buffer[offset], "%lld", digits); >+ >+ /* hard code the period '.' as the decimal symbol */ >+ buffer[offset++] = '.'; >+ /* get the digits to the right of the decimal */ >+#ifdef _WIN32 >+ val = val - (signed __int64)digits; >+#else >+ val = val - digits; >+#endif >+ /* move the digits to the right of the decimal to be to the left */ >+ /* the following loop essentially shifts each digit left, at which point we grab >+ it and add it to the string. */ >+ for (i = 0; i < precision; i++) { >+ val = val * 10; >+ /* get the next digit */ >+ digits = (Uint64) val; >+ buffer[offset++] = '0' + (char)digits; >+#ifdef _WIN32 >+ val = val - (signed __int64)digits; >+#else >+ val = val - digits; >+#endif >+ } >+ return offset; >+} >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+ >+#ifdef _WIN32 >+char *realpath(const char* fileName, char * buf) >+{ >+ LPTSTR foo; >+ >+ GetFullPathName (fileName, PATH_MAX, buf, &foo); >+ return buf; >+} >+#elif defined(__OS400__) >+char *realpath(const char* fileName, char * buf) >+{ >+ strcpy(buf, fileName); >+ return buf; >+} >+#endif >Index: src-native-new/src/agents/RABindings/version.rc >=================================================================== >RCS file: src-native-new/src/agents/RABindings/version.rc >diff -N src-native-new/src/agents/RABindings/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,110 @@ >+#include "../../../include/tptp/version.h" >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION _VERSION_WIN >+ PRODUCTVERSION _VERSION_WIN >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", _COMPANY_NAME >+ VALUE "FileDescription", "Agent Controller Agent Bindings Library\0" >+ VALUE "FileVersion", _VERSION >+ VALUE "InternalName", "hcbnd\0" >+ VALUE "LegalCopyright", _COPYRIGHT >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "hcbnd.dll\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", _VERSION >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/agents/perfmon/resutils/library.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/library.c >diff -N src-native-new/src/agents/perfmon/resutils/library.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/library.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,118 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: library.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+/*********************************************************************** >+ * >+ * File: Library.c >+ * >+ ***********************************************************************/ >+ >+#include "system.h" >+ >+/*********************************************************************** >+ * Function: XLibraryCreate >+ * Purpose: >+ * Parameters: >+ * Returns: >+ ***********************************************************************/ >+ >+int XLibraryCreate(XLibrary *library, char *filename) >+{ >+ //fprintf(stderr,"XLibraryCreate called for %s\n",filename); >+ char* newfilename; >+ newfilename = (char*) malloc(sizeof(char)*(strlen(filename)+7)); >+#ifdef WIN32 >+ if ((library->instance = LoadLibrary(filename)) == NULL) >+ { >+#ifdef DEBUG >+// XLoggerPrintf("LoadLibrary(\"%s\") failed [%d]\n", filename, GetLastError()); >+#endif >+ return XLIBRARY_ERROR_CREATE; >+ } >+#endif >+#if defined(SOLARIS) || defined(LINUX) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ sprintf(newfilename,"lib%s.so",filename); >+ >+ if ((library->handle = dlopen(newfilename, RTLD_LAZY)) == NULL) >+ { >+#ifdef DEBUG >+ const char *e; >+ while ((e = dlerror())) fprintf(stderr, "dlerror: %s\n", e); >+#endif >+ fprintf(stderr,"XLibraryCreate FAILED! (%s - %d)\n",filename,(int)library->handle); >+ free(newfilename); >+ return FAILURE; >+ } >+#endif >+ free(newfilename); >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XLibrarySymbol >+ * Purpose: >+ * Parameters: >+ ***********************************************************************/ >+ >+int XLibrarySymbol(XLibrary *library, char *symbol, void **address) >+{ >+#ifdef WIN32 >+ if ((*address = GetProcAddress(library->instance, symbol)) == NULL) >+ { >+#ifdef DEBUG >+// XLoggerPrintf("GetProcAddress(..., \"%s\") failed [%d]\n", symbol, GetLastError()); >+#endif >+ return XLIBRARY_ERROR_SYMBOL; >+ } >+#endif >+#if defined(SOLARIS) || defined(LINUX) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ if ((*address = dlsym(library->handle, symbol)) == NULL) >+ { >+#ifdef DEBUG >+ const char *e; >+// while ((e = dlerror())) XLoggerPrintf("dlerror: %s\n", e); >+// XLoggerPrintf("dlsym(..., %s\n", symbol); >+#endif >+ return FAILURE; >+ } >+#endif >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * Function: XLibraryDelete >+ * Purpose: >+ * Parameters: >+ ***********************************************************************/ >+ >+int XLibraryDelete(XLibrary *library) >+{ >+#ifdef WIN32 >+ if (FreeLibrary(library->instance) == FALSE) >+ { >+#ifdef DEBUG >+// XLoggerPrintf("FreeLibrary failed [%d]\n", GetLastError()); >+#endif >+ return XLIBRARY_ERROR_DELETE; >+ } >+#endif >+#if defined(SOLARIS) || defined(LINUX) || defined(AIX) || defined(USS) || defined(HPUX) || defined(LINUX_S390) || defined(SOLARIS_I386) >+ (void)dlclose(library->handle); >+#endif >+ >+ return SUCCESS; >+} >+ >+/*********************************************************************** >+ * EOF >+ ***********************************************************************/ >Index: src-native-new/src/agents/native/heapsnapshots/SnapshotAgentInterface.h >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/SnapshotAgentInterface.h >diff -N src-native-new/src/agents/native/heapsnapshots/SnapshotAgentInterface.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/SnapshotAgentInterface.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,47 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: SnapshotAgentInterface.h,v 1.3 2005/04/06 19:15:49 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef SNAPSHOT_AGENT_INTERFACE_H >+#define SNAPSHOT_AGENT_INTERFACE_H >+ >+class SnapshotAgentInterface { >+ public: >+ virtual char getClassInfo(jobjectID classID, >+ char** className_outvar, >+ char* className_freeMe, >+ int* numInterfaces_outvar, >+ int* numStaticReferenceFields_outvar) = 0; >+#ifdef __OS400__ >+ virtual char getOS400ClassInfo(jobjectID classID, >+ char** className_outvar, >+ char* className_freeMe, >+ int* numInterfaces_outvar, >+ int* numStaticReferenceFields_outvar, >+ unsigned int * object_dump_len, >+ char** object_dump_data) = 0; >+#endif >+ virtual char stillAlive() = 0; >+ virtual char stillTracing() = 0; >+ virtual char shouldIReportHeapSnapshotDuration() = 0; >+ virtual short swap16(short n) = 0; >+ virtual int swap32(int n) = 0; >+ virtual char dump_read_u1(char* cursor) = 0; >+ virtual short dump_read_u2(char* cursor) = 0; >+ virtual int dump_read_u4(char* cursor) = 0; >+ virtual jobjectID dump_read_jobjectID(char* cursor) = 0; >+ >+ virtual void status(const char* message) = 0; >+ virtual void status(const char* message, int message2) = 0; >+ virtual void error(const char* message) = 0; >+}; >+ >+#endif /* SNAPSHOT_AGENT_INTERFACE_H */ >Index: src-native-new/src/agents/RABindings/hcbnd.exp >=================================================================== >RCS file: src-native-new/src/agents/RABindings/hcbnd.exp >diff -N src-native-new/src/agents/RABindings/hcbnd.exp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/hcbnd.exp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,30 @@ >+#! librabnd.so exports >+ra_initializeBindings >+ra_finalizeBindings >+ra_startListener >+ra_stopListener >+ra_sendMessage >+ra_getProcessId >+ra_logErrorMessage >+ra_getNodeUUID >+ra_getProcessUUID >+ra_getAgentUUID >+ra_getDefaultConfiguration >+ra_getProcessCommandLine >+ra_requestPeerMonitor >+ra_requestPeerMonitor2 >+ra_initializeVMLock >+ra_setVMLock >+ra_releaseVMLock >+ra_testVMLock >+ra_getVMLockState >+ra_initializeLock >+ra_deleteLock >+ra_getWriteLock >+ra_releaseWriteLock >+ra_getReadLock >+ra_releaseReadLock >+ra_getPropertyValues >+ra_logErrorMessage_return >+ra_requestPeerMonitor_p >+ra_requestPeerMonitor2_p >Index: src-native-new/src/agents/thread/WinBuild/hcthread.dsw >=================================================================== >RCS file: src-native-new/src/agents/thread/WinBuild/hcthread.dsw >diff -N src-native-new/src/agents/thread/WinBuild/hcthread.dsw >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/WinBuild/hcthread.dsw 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,29 @@ >+Microsoft Developer Studio Workspace File, Format Version 6.00 >+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! >+ >+############################################################################### >+ >+Project: "hcthread"=".\hcthread.dsp" - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Global: >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<3> >+{{{ >+}}} >+ >+############################################################################### >+ >Index: src-native-new/src/agents/java/hcjbnd.h >=================================================================== >RCS file: src-native-new/src/agents/java/hcjbnd.h >diff -N src-native-new/src/agents/java/hcjbnd.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/hcjbnd.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,167 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hcjbnd.h,v 1.4 2005/04/26 19:37:30 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <jni.h> >+#include "RASocket.h" >+#include "RADataTransfer.h" >+#include "RABindings.h" >+/* Header for class Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton */ >+ >+#ifndef _Included_Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+#define _Included_Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+ >+typedef struct { >+ BOOL dirty; >+ BOOL monitored; >+ char *agent_name; >+ BOOL waitingServiceAvailMessage; >+ ra_data_target_hdl_t targetHdl; >+ jobject agent_logger; >+ RA_AGENT_HANDLE bindingStorage; >+ /* A customized command handler that can be used by native agents to register their own command handler */ >+ ra_commandHandler_t nativeCommandHandler; >+}logAgent_t; >+ >+extern ra_string_t* logAgent_getCurrentProcessId(); >+ >+/* 198066 - Thread ID's have different types on different platforms so we'll return >+ a TID as defined in RAComm.h >+*/ >+extern TID logAgent_getCurrentThreadId() ; >+ >+extern logAgent_t* logAgent_registerAgent(char *name, char *type); >+ >+extern void logAgent_deregisterAgent(logAgent_t *agent); >+ >+extern void logAgent_logMessage(logAgent_t *agent, char *messageBuffer, ra_uint_t length, ra_dataFormat_t format); >+extern long logAgent_logMessage_return(logAgent_t *agent, char *messageBuffer, ra_uint_t length, ra_dataFormat_t format); /* Bug 74367 */ >+/* Inaccessible static: _serviceAvailable */ >+/* Inaccessible static: _agentCount */ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: deregister0 >+ * Signature: (Ljava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_deregister0 >+ (JNIEnv *, jobject, jstring); >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: initializeEngine0 >+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_initializeEngine0 >+ (JNIEnv *, jobject, jstring, jstring); >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessage0 >+ * Signature: (Ljava/lang/String;[BII)J >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessage0__Ljava_lang_String_2_3BII >+ (JNIEnv *, jobject, jstring, jbyteArray, jint, jint); /* Bug 74367 */ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessage0 >+ * Signature: (Ljava/lang/String;Ljava/lang/String;)J >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessage0__Ljava_lang_String_2Ljava_lang_String_2 >+ (JNIEnv *, jobject, jstring, jstring); /* Bug 74367 */ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessageUTF80 >+ * Signature: (Ljava/lang/String;Ljava/lang/String;)J >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessageUTF80 >+ (JNIEnv *, jobject, jstring, jstring); /* Bug 74367 */ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessageUTF81 >+ * Signature: (Ljava/lang/String;[B)J >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessageUTF81 >+ (JNIEnv *, jobject, jstring, jbyteArray); /* Bug 74367 */ >+ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: sendMessage0 >+ * Signature: (Ljava/lang/String;J)J >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessage0__Ljava_lang_String_2J >+ (JNIEnv *, jobject, jstring, jlong); /* Bug 74367 */ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: sendMessage0 >+ * Signature: ([BIIJ)J >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessage0___3BIIJ >+ (JNIEnv *, jobject, jbyteArray, jint, jint, jlong); /* Bug 74367 */ >+ >+/* >+ * Class: org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: sendMessageBinary0 >+ * Signature: ([BIIJ)J >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessageBinary0 >+ (JNIEnv *, jobject, jbyteArray, jint, jint, jlong); /* Bug 74367 */ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: requestMonitorThroughPeer0 >+ * Signature: ([BLjava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0___3BLjava_lang_String_2 >+ (JNIEnv *, jobject, jbyteArray, jstring); >+/* Bug 77768 */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJLjava_lang_String_2 >+ (JNIEnv *, jobject, jbyteArray, jlong, jstring); >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: requestMonitorThroughPeer0 >+ * Signature: ([BJLjava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0___3BJLjava_lang_String_2 >+ (JNIEnv *, jobject, jbyteArray, jlong, jstring); >+/* Bug 77768 */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJJLjava_lang_String_2 >+ (JNIEnv *, jobject, jbyteArray, jlong, jlong, jstring); >+ >+/* >+ * Bug 79816 >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: getPID0 >+ * Signature: >+ */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_getPID0(JNIEnv *env, jobject obj); >+ >+/* >+ * Bug 79816 >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: generateUUID0 >+ * Signature: >+ */ >+JNIEXPORT jstring JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_generateUUID0(JNIEnv *env, jobject obj); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif >Index: src-native-new/src/agents/native/java_profiler/JVMPIException.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/JVMPIException.h >diff -N src-native-new/src/agents/native/java_profiler/JVMPIException.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/JVMPIException.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,74 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: JVMPIException.h,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <jni.h> >+/* Header for class com_ibm_etools_logging_tracing_agent_Callback */ >+ >+ >+#ifndef _Included_com_ibm_etools_logging_tracing_agent_Callback >+#define _Included_com_ibm_etools_logging_tracing_agent_Callback >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/* >+ * Class: com_ibm_etools_logging_tracing_agent_Profiler >+ * Method: initialize0 >+ * Signature: ()V >+ */ >+JNIEXPORT jint JNICALL Java_com_ibm_etools_logging_tracing_agent_Profiler_initialize0 >+ (JNIEnv *, jobject); >+ >+/* >+ * Class: com_ibm_etools_logging_tracing_agent_Profiler >+ * Method: startProfiling0 >+ * Signature: (ZI)I >+ */ >+JNIEXPORT jint JNICALL Java_com_ibm_etools_logging_tracing_agent_Profiler_startProfiling0 >+ (JNIEnv *, jobject, jboolean, jint); >+ >+/* >+ * Class: com_ibm_etools_logging_tracing_agent_Profiler >+ * Method: stopProfiling0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_com_ibm_etools_logging_tracing_agent_Profiler_stopProfiling0 >+ (JNIEnv *, jobject); >+ >+/* >+ * Class: com_ibm_etools_logging_tracing_agent_Profiler >+ * Method: markHeap0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_com_ibm_etools_logging_tracing_agent_Profiler_markHeap0 >+ (JNIEnv *, jobject); >+ >+/* >+ * Class: com_ibm_etools_logging_tracing_agent_Profiler >+ * Method: analyzeHeap0 >+ * Signature: (Ljava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL Java_com_ibm_etools_logging_tracing_agent_Profiler_analyzeHeap0 >+ (JNIEnv *, jobject, jstring); >+ >+/* >+ * Class: com_ibm_etools_logging_tracing_agent_Profiler >+ * Method: runGC0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_com_ibm_etools_logging_tracing_agent_Profiler_runGC0 >+ (JNIEnv*,jobject); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif >Index: src-native-new/src/agents/java/hcjbnd.c >=================================================================== >RCS file: src-native-new/src/agents/java/hcjbnd.c >diff -N src-native-new/src/agents/java/hcjbnd.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/hcjbnd.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2612 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hcjbnd.c,v 1.17 2007/03/09 14:58:44 jkubasta Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <stdlib.h> >+#include <assert.h> /* fix 89008: partial */ >+#include "RABindings.h" >+#include "RASocket.h" >+#include "RADataTransfer.h" >+#include "RAComm.h" >+#include "hcjbnd.h" >+ >+/* MACRO's to simplify the JNI code. */ >+#if defined __cplusplus && defined _HPUX >+ #define ENV(e) e >+ #define ENVPARM(e) >+#else >+ #define ENV(e) (*e) >+ #define ENVPARM(e) e, >+#endif >+ >+ >+/* MACRO to work with jlong on AS400 as it is a struct */ >+#ifndef __OS400__ >+ #define JLONG(value) value >+#else >+ #define JLONG(value) value.ll >+#endif >+ >+/* The size to grow the agent list by when it is full */ >+#define AGENT_LIST_INCREMENT 6 >+ >+static BOOL _firstInstance=TRUE; >+static ra_critsec_t _lock; >+ >+ >+/* The command handlers for each of the languages */ >+static void _java_notifyMessage(ra_command_t *command); >+static void _native_notifyMessage(ra_command_t *command); >+ >+/* Global reference to the JVM. */ >+static JavaVM *_agent_vm; >+ >+typedef logAgent_t agent_list_entry_t; >+ >+ >+typedef struct { >+ unsigned int size; >+ agent_list_entry_t **entries; >+}agent_list_t; >+ >+ >+static agent_list_t _agent_list; >+ >+#ifdef _DEBUG2 >+#include <stdio.h> >+static FILE *traceFile; >+#endif >+ >+/** GROW_AGENT_LIST *********************************************************** >+ * >+ */ >+static void growAgentList(int delta) { >+ int newSize=_agent_list.size+delta; >+ agent_list_entry_t **current=_agent_list.entries; >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: Resizing agent list\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ _agent_list.entries=(agent_list_entry_t**)malloc(sizeof(agent_list_entry_t*)*newSize); >+ BZERO(_agent_list.entries, newSize*sizeof(agent_list_entry_t*)); >+ if (current != NULL) { >+ memcpy(_agent_list.entries, current, _agent_list.size*sizeof(agent_list_entry_t*)); >+ } >+ _agent_list.size=newSize; >+ if (current != NULL) { >+ free(current); >+ } >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: Agent list resized to %d\n", _agent_list.size); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+} >+ >+/** FIND_AGENT **************************************************************** >+ * >+ */ >+static agent_list_entry_t *findAgent(char *name) { >+ agent_list_entry_t *result=NULL; >+ ra_mutexEnter(&_lock); >+ if(name) { >+ unsigned int i; >+ for(i=0; i<_agent_list.size; i++) { >+ if(_agent_list.entries[i] && _agent_list.entries[i]->dirty && _agent_list.entries[i]->agent_name &&strcmp(_agent_list.entries[i]->agent_name, name)==0) { >+ result=_agent_list.entries[i]; >+ break; >+ } >+ } >+ } >+ ra_mutexExit(&_lock); >+ return result; >+} >+ >+/** INSERT_AGENT ************************************************************** >+ * >+ */ >+static agent_list_entry_t *insertAgent(char *name) { >+ if(name) { >+ agent_list_entry_t *entry=findAgent(name); >+ if(!entry) { >+ unsigned int i; >+ ra_mutexEnter(&_lock); >+ for(i=0; i<_agent_list.size; i++) { >+ if(!_agent_list.entries[i] || !_agent_list.entries[i]->dirty) { >+ _agent_list.entries[i]=(agent_list_entry_t*)malloc(sizeof(agent_list_entry_t)); >+ _agent_list.entries[i]->dirty=TRUE; >+ _agent_list.entries[i]->monitored=FALSE; >+ _agent_list.entries[i]->agent_name=name; >+ entry=_agent_list.entries[i]; >+ break; >+ } >+ } >+ if(i==_agent_list.size) { >+ growAgentList(AGENT_LIST_INCREMENT); >+ _agent_list.entries[i]=(agent_list_entry_t*)malloc(sizeof(agent_list_entry_t)); >+ _agent_list.entries[i]->dirty=TRUE; >+ _agent_list.entries[i]->monitored=FALSE; >+ _agent_list.entries[i]->agent_name=name; >+ entry=_agent_list.entries[i]; >+ } >+ ra_mutexExit(&_lock); >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: insertAgent: inserted agent %s in position %d\n", name,i); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ return entry; >+ } >+ /* bugzilla 65470 start */ >+ else if (!entry->dirty) { >+ /* An entry was found with the same name but it is not active so we will insert the new agent here */ >+ entry->dirty = TRUE; >+ entry->monitored = FALSE; >+ entry->waitingServiceAvailMessage = FALSE; >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: insertAgent: agent %s was found in the list but it wasn't dirty\n", name); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ return entry; >+ } >+ /* bugzilla 65470 end */ >+ } >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: insertAgent: findAgent found an active agent with name %s\n", name); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Insert failed either because the name was empty or an active agent already exists in the list with the same name */ >+ return NULL; >+} >+ >+ >+/** GET_AGENT_OFFSET ********************************************************* >+ * >+ */ >+static int getAgentOffset(logAgent_t *agent) { >+ unsigned int i; >+ for(i=0; i<_agent_list.size; i++) { >+ if(_agent_list.entries[i] == agent) { >+ return i; >+ } >+ } >+ return -1; >+} >+ >+ >+ >+/** GET_CURRENT_PROCESS_ID **************************************************** >+ * >+ */ >+ra_string_t* logAgent_getCurrentProcessId( ) { >+ PID pid; >+ char tempString[256]; >+ >+ pid=ra_getProcessId(); >+ >+#ifdef _WIN32 >+ ltoa(pid,tempString,10); >+#else >+ sprintf(tempString, "%d", pid); >+#endif >+ return ra_createRASTRING2(tempString); >+} >+ >+ >+/** GET_CURRENT_THREAD_ID ***************************************************** >+ * Returns an integer thread id for the current thread. >+ */ >+ >+/* 198066 - Thread ID's have different types on different platforms so we'll return >+ a TID as defined in RAComm.h >+*/ >+TID logAgent_getCurrentThreadId() >+{ >+#ifdef WIN32 >+ return GetCurrentThreadId(); >+#else >+ return pthread_self(); >+#endif >+} >+ >+/** CLEANUP_AT_EXIT ********************************************************** >+ * The runtime calls this function when this dll is unloaded during application >+ * termination. This is our chance to clean up our resources. This function >+ * is actually pushed on the stack once per agent, yet cleans all the agents >+ * resources each time. This could possibly be optimized >+ */ >+void cleanupAtExit(void) { >+ unsigned int i; >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: Cleaning up\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ for(i=0; i<_agent_list.size; i++) { >+ if(_agent_list.entries[i] && _agent_list.entries[i]->dirty && _agent_list.entries[i]->monitored) { >+ if(_agent_list.entries[i]->targetHdl.dtarget==RA_SHAREDMEMORY >+ && _agent_list.entries[i]->monitored) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: Closing shared memory pipe\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ ra_stopFlushingShm(&_agent_list.entries[i]->targetHdl.dtargetHdl.shmHdl); >+ } >+ else if(_agent_list.entries[i]->targetHdl.dtarget==RA_SOCKET >+ && _agent_list.entries[i]->targetHdl.dtargetHdl.socketFD) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: Closing socket\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ /** On windows the socket layer is already disabled at this point */ >+#ifndef _WIN32 >+ ra_closeSocket(_agent_list.entries[i]->targetHdl.dtargetHdl.socketFD); >+#endif >+ } >+ /* Mark this agent as clean */ >+ _agent_list.entries[i]->dirty=FALSE; >+ _agent_list.entries[i]->monitored=FALSE; >+ } >+ } >+ #ifdef _DEBUG2 >+ if (traceFile != NULL) { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "LogAgent: Cleanup complete\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ fflush(traceFile); >+ fclose(traceFile); >+ traceFile = NULL; >+ } >+ #endif >+ >+ return; >+} >+ >+/** INITIALIZE_AGENT_TABLE ************************************************ >+ * Initialize the agent table to zero >+ */ >+static void initializeAgentTable() { >+ _agent_list.size=0; >+ _agent_list.entries=NULL; >+ ra_mutexCreate(&_lock); >+} >+ >+ >+void logAgent_deregisterAgent(logAgent_t *agent) { >+ >+ /* If someone is collecting data, close the connection */ >+ /* Close the appropriate logging mechanism */ >+ if(agent->targetHdl.dtarget==RA_SOCKET) { >+ ra_closeSocket(agent->targetHdl.dtargetHdl.socketFD); >+ >+ } >+ else if(agent->targetHdl.dtarget==RA_SHAREDMEMORY) { >+ ra_stopFlushingShm(&agent->targetHdl.dtargetHdl.shmHdl); >+ } >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "logAgent_deregisterAgent: About to stop listener thread\n"); >+ fflush(traceFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ ra_stopListener(agent->bindingStorage); >+ /* ra_finalizeBindings(agent->bindingStorage); */ /* bugzilla 68521 - causing crash >+ when RAC is not running */ >+ >+ agent->dirty=FALSE; >+/* free(agent->agent_name); */ /* Bug 168884 */ >+} >+ >+ >+/** DEREGISTER_AGENT ****************************************************** >+ * Clean up the resources associated with a single instance of a LogAgent. >+ >+ */ >+static void deregisterAgent(JNIEnv *env, >+ jobject obj) { >+ jclass cls; >+ jfieldID isRegisteredDecl; >+ jboolean isRegisteredInstance; >+ >+ /* Get the class object */ >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+ if (cls == 0) { >+ return; >+ } >+ >+ /* Get the registered field from the instance */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ isRegisteredDecl=ENV(env)->GetFieldID(ENVPARM(env) cls, "isRegistered", "Z"); >+ if (isRegisteredDecl == 0) { >+ return; >+ } >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ isRegisteredInstance=ENV(env)->GetBooleanField(ENVPARM(env) obj, isRegisteredDecl); >+ >+ >+ if(isRegisteredInstance) { >+ jlong jl_minus1; >+ jfieldID mechDecl; >+ jlong mech; >+ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) cls, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if (mechDecl == 0) { >+ return; >+ } >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ agent=_agent_list.entries[JLONG(mech)]; >+ >+ logAgent_deregisterAgent(agent); >+ >+ /* Set _isRegistered to FALSE */ >+ ENV(env)->SetBooleanField(ENVPARM(env) obj, isRegisteredDecl, (jboolean)FALSE); >+ /* Clear the mechanism BRP */ >+ >+ JLONG(jl_minus1)=-1; >+ ENV(env)->SetLongField(ENVPARM(env) obj, mechDecl, jl_minus1); >+ >+ /* Clean up the global ref */ >+ ENV(env)->DeleteGlobalRef(ENVPARM(env) agent->agent_logger); >+ } >+ } >+ >+ #ifdef _DEBUG2 >+ if (traceFile != NULL) { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "deregisterAgent: Agent was deregistered - close trace file.\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ fflush(traceFile); >+ fclose(traceFile); >+ traceFile = NULL; >+ } >+ #endif >+} >+ >+static logAgent_t* registerAgent(char *name, char*type, BOOL java, JNIEnv *env, jobject obj) { >+ logAgent_t *agent; >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Log Agent: In registerAgent\n"); >+ fflush(traceFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* If this is the first instance initialize the agent table */ >+ if(_firstInstance) { >+ atexit((void(*)())cleanupAtExit); >+ initializeAgentTable(); >+ _firstInstance=FALSE; >+ } >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: registerAgent: after initializing agent table\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ agent=insertAgent(name); >+ if(agent) { >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: registerAgent: insertAgent succeeded for agent %s and about to initialize Bindings\n", name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Set the command handler for the appropriate language */ >+ if(java) { >+ >+ /* Create a reference to the logging agent */ >+ agent->agent_logger = ENV(env)->NewGlobalRef(ENVPARM(env) obj); >+ >+ /* Initialize the bindings for "server" mode initially */ >+ agent->bindingStorage=ra_initializeBindings(name, >+ type, >+ _java_notifyMessage, >+ FALSE); >+ } >+ else { >+ agent->bindingStorage=ra_initializeBindings(name, >+ type, >+ _native_notifyMessage, >+ FALSE); >+ } >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Log Agent: registerAgent: starting Listener\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ ra_startListener(agent->bindingStorage, 0); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Log Agent: registerAgent: after starting Listener\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ agent->nativeCommandHandler = NULL; >+ return agent; >+ } >+ return NULL; >+} >+ >+ >+ >+logAgent_t* logAgent_registerAgent(char *name, char *type) { >+ /* Make our ouw copies of the strings */ >+ char *nameCopy, *typeCopy; >+ STRDUP(nameCopy, name); >+ STRDUP(typeCopy, type); >+ return registerAgent(nameCopy, typeCopy, FALSE, (JNIEnv*)NULL, (jobject)NULL); >+} >+ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: initializeEngine0 >+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_initializeEngine0(JNIEnv *env, >+ jobject obj, >+ jstring name, >+ jstring type) { >+ jclass cls; >+ jfieldID isRegisteredDecl, mechDecl; >+ jboolean isRegisteredInstance; >+ agent_list_entry_t *agent; >+ char *nameBytes, *typeBytes; >+ jlong agentIndex; >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ traceFile = fopen("logAgent.dbg", "w"); >+ fprintf(traceFile, "Log Agent: initializeEngine0: Inside Agent Intialization\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Copy the string bytes */ >+ if(name) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Copy the string bytes\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ nameBytes=copyJavaStringToNative(env, name); >+ } >+ else { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: No name to copy, return\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ return; >+ } >+ if(type) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Copy the type bytes\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ typeBytes=copyJavaStringToNative(env, type); >+ } >+ else { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: No type to copy, return\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ return; >+ } >+ >+ /* Get the class object */ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Get the class object\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+ >+ /* Get the registered field from the instance */ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Get the registered field from the instance: GetFieldID()\n"); >+ #endif >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ >+ isRegisteredDecl=ENV(env)->GetFieldID(ENVPARM(env) cls, "isRegistered", "Z"); >+ >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Get the registered field from the instance: GetBooleanField()\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ isRegisteredInstance=ENV(env)->GetBooleanField(ENVPARM(env) obj, isRegisteredDecl); >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Finished getting the registered field from the instance\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Log Agent: IsRegisteredInstance = %d\n", isRegisteredInstance); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Only run this method once */ >+ if(isRegisteredInstance) { >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: isRegisteredInstance = true, return\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ return; >+ } >+ >+ /* Resolve pointers back to relevent methods inside of JVM */ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Resolve pointer back to revelent methods inside of JVM\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ ENV(env)->GetJavaVM(ENVPARM(env) &_agent_vm); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Log Agent: about to register Agent name >%s< type >%s<\n", nameBytes, typeBytes); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Create a global reference of this object (this needs to removed later)*/ >+ agent=registerAgent(nameBytes, typeBytes, TRUE, env, obj); >+ if(agent) { >+ jmethodID setAgentUUID; >+ jstring agentUUID; >+ >+ /* Place the index of the agent in the Java layer for fast reference later */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) cls, "mechanism", "J"); >+ >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(mechDecl) { >+ JLONG(agentIndex)=getAgentOffset(agent); >+ if(JLONG(agentIndex)>-1) { >+ ENV(env)->SetLongField(ENVPARM(env) obj, mechDecl, agentIndex); >+ } >+ } >+ >+ /* Set the agentUUID back in the Java layer. >+ * RKD: This is only in the V5 or greater Java layer. We need to catch the exception. >+ */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ setAgentUUID=ENV(env)->GetMethodID(ENVPARM(env) cls, "setAgentUUID", "(Ljava/lang/String;)V"); >+ >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(setAgentUUID) { >+ agentUUID = getnewstrutf(env, agent -> bindingStorage -> agentUUID.data); >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, setAgentUUID, agentUUID); >+ } >+ >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: SetBooleanField\n"); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ /* bugzilla 65470 - moved this line here from above because before it was being set >+ * even when registration failed. Here we are sure registration succeeded. >+ * >+ * Done registering so set the isRegistered flag in the java object */ >+ ENV(env)->SetBooleanField(ENVPARM(env) obj, isRegisteredDecl, (jboolean)TRUE); >+ >+ } >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: deregister0 >+ * Signature: (Ljava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_deregister0(JNIEnv *env, >+ jobject obj, >+ jstring name) { >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "_deregister0: Java code is asking us to deregister the agent\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ deregisterAgent(env, obj); >+} >+ >+ >+/** LOGAGENT_LOG_MESSAGE ****************************************************** >+ * >+ */ >+/* Bug 74367 */ >+long logAgent_logMessage_return(logAgent_t *agent, char *messageBuffer, ra_uint_t length, ra_dataFormat_t format) { >+ unsigned char *copy; >+ long byteSent = 0; >+ >+ if(agent->monitored) { >+ copy=ra_allocateMessageBlock(length); >+ /* Copy the bytes */ >+ memcpy(copy, messageBuffer, length); >+ byteSent = (long)ra_writeMessageBlock(&agent->targetHdl, >+ format, >+ copy, >+ length); >+ ra_freeMessageBlock(copy); >+ } >+ >+#if _DEBUG >+ printf("logAgent_logMessage: %d byte sent\n", byteSent); >+#endif >+ >+ return byteSent; >+} >+ >+/* Bug 74367 */ >+void logAgent_logMessage(logAgent_t *agent, char *messageBuffer, ra_uint_t length, ra_dataFormat_t format) { >+ logAgent_logMessage_return(agent, messageBuffer, length, format); >+} >+ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logErrorMessage >+ * Signature: (Ljava/lang/String;Ljava/lang/String;I)V >+ * >+ * Description: The following JNI function is used to only log error messages to an active >+ * logging agent. >+ * >+ * @param message - The message to be logged >+ * messageId - The message ID corresponding to the error message >+ * severity - The level of severity of the message (e.g. default = DEBUG, 1 = INFORMATION, 2 = WARNING, 3 = SEVERE, 4 = MAX ERROR LEVEL) >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logErrorMessage( >+ JNIEnv *env, >+ jobject obj, >+ jstring message, >+ jstring messageId, >+ jint severity) { >+ >+ /* The 'mechanism' field of 'obj' will indicate the agent that was used to invoke this >+ * method */ >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ /* The error message and its corresponding ID */ >+ char *errMsg, *msgId; >+ >+ /* The severity of the message, which is DEBUG by default */ >+ RA_ERROR_LEVEL msgSeverity = RA_DEBUG; >+ >+ >+ #ifdef _DEBUG >+ printf ("Log Agent: Inside of the logErrorMessage function\n"); >+ #endif >+ >+ /* Resolve the 'jclass' of 'obj' */ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+ >+ >+ /* Making JNI calls requires that the mode to be changed */ >+ #ifdef __OS400__ >+ #pragma convert(819) >+ #endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+ #ifdef __OS400__ >+ #pragma convert(0) >+ #endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ >+ /* Get the appropriate agent and send the message */ >+ if(JLONG(mech) > -1 && JLONG(mech) < _agent_list.size) { >+ agent_list_entry_t *agent; >+ >+ agent=_agent_list.entries[JLONG(mech)]; >+ >+ /* Resolve the parameters passed in */ >+ errMsg = copyJavaStringToNative(env, message); >+ msgId = copyJavaStringToNative(env, messageId); >+ >+ if ((int)severity == 1) >+ {msgSeverity = RA_INFORMATION;} >+ else if ((int)severity == 2) >+ {msgSeverity = RA_WARNING;} >+ else if ((int)severity == 3) >+ {msgSeverity = RA_SEVERE;} >+ else if ((int)severity == 4) >+ {msgSeverity = RA_MAX_ERROR_LEVEL;} >+ >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+ JLONG(byteSent) = ra_logErrorMessage_return(agent->bindingStorage, msgSeverity, msgId, errMsg); >+ >+ } >+ >+#if _DEBUG >+ printf("JNI_logErrorMessage: %d byte sent\n", byteSent); >+#endif >+ >+ return byteSent; >+} >+ >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessage0 >+ * Signature: (Ljava/lang/String;[BII)V >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessage0__Ljava_lang_String_2_3BII(JNIEnv *env, >+ jobject obj, >+ jstring name, >+ jbyteArray msg, >+ jint offset, >+ jint length) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. >+ */ >+ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Logging Binary message\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ jbyte* bytes; >+ agent=_agent_list.entries[JLONG(mech)]; >+ bytes=ENV(env)->GetByteArrayElements(ENVPARM(env) msg, NULL); >+ >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+ JLONG(byteSent) = logAgent_logMessage_return(agent, (char*)bytes, length, RA_BINARY_DATA); >+ ENV(env)->ReleaseByteArrayElements(ENVPARM(env) msg, bytes, JNI_ABORT); >+ } >+ >+#if _DEBUG >+ printf("JNI_logMessage0: %d byte sent\n", byteSent); >+#endif >+ return byteSent; >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessage0 >+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessage0__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv *env, >+ jobject obj, >+ jstring name, >+ jstring msg) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf ("Log Agent: Inside of the logMessage0 function\n"); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ /* No need to search, we can just use the _mechanism field in the agent. >+ */ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ ra_uint_t length; >+ const jchar *bytes; >+ >+ agent=_agent_list.entries[JLONG(mech)]; >+ >+ length=(ENV(env)->GetStringLength(ENVPARM(env) msg)); >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf("Logging String message of length %d\n", length); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ bytes=ENV(env)->GetStringChars(ENVPARM(env) msg, NULL); >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+ JLONG(byteSent) = logAgent_logMessage_return(agent, (char*)bytes, length*2, RA_UNICODE_STRING_DATA); >+ ENV(env)->ReleaseStringChars(ENVPARM(env) msg, bytes); >+ >+ } >+ >+#if _DEBUG >+ printf("JNI_logMessage0: %d byte sent\n", byteSent); >+#endif >+ return byteSent; >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessageUTF80 >+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessageUTF80(JNIEnv *env, >+ jobject obj, >+ jstring name, >+ jstring msg) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. >+ */ >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf ("Log Agent: Inside of the logMessageUTF80 function\n"); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ ra_uint_t length; >+ const jchar *bytes; >+ unsigned char *copy; >+ ra_uint_t i; >+ >+ agent=_agent_list.entries[JLONG(mech)]; >+ >+ length=ENV(env)->GetStringLength(ENVPARM(env) msg); >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf("Logging UTF8 String message of length %d\n", length); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ bytes=ENV(env)->GetStringChars(ENVPARM(env) msg, NULL); >+ >+ /* Make a copy buffer for compression */ >+ copy=ra_allocateMessageBlock(length); >+ >+ for(i=0; i<length; i++) { >+ copy[i]=(unsigned char)bytes[i]; >+ } >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+ JLONG(byteSent) = ra_writeMessageBlock(&agent->targetHdl, RA_BINARY_DATA, copy, length); >+ >+ ENV(env)->ReleaseStringChars(ENVPARM(env) msg, bytes); >+ ra_freeMessageBlock(copy); >+ } >+ >+#if _DEBUG >+ printf("JNI_logMessageUTF80: %d byte sent\n", byteSent); >+#endif >+ return byteSent; >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: logMessageUTF80 >+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessageUTF81(JNIEnv *env, >+ jobject obj, >+ jstring name, >+ jbyteArray msg) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. >+ */ >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ printf ("Log Agent: Inside of the logMessageUTF81 function\n"); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ jsize length; >+ jbyte *bytes; >+ >+ agent=_agent_list.entries[JLONG(mech)]; >+ >+ length=ENV(env)->GetArrayLength(ENVPARM(env) msg); >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Logging UTF-81 message of length %d\n", length); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ bytes=ENV(env)->GetByteArrayElements(ENVPARM(env) msg, NULL); >+/* Reversed in 9434 logAgent_logMessage(agent, as400_atou((char*)bytes), length, RA_UTF8_STRING_DATA); 240091 */ >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+#ifdef _LP64 >+ assert(length<=UINT_MAX); /*partial fix 89008: flag any value too large for the uint target*/ >+#endif >+ JLONG(byteSent) = logAgent_logMessage_return(agent, (char*)bytes, length, RA_UTF8_STRING_DATA); >+ ENV(env)->ReleaseByteArrayElements(ENVPARM(env) msg, bytes, JNI_ABORT); >+ } >+ >+#if _DEBUG >+ printf("JNI_logMessageUTF81: %d byte sent\n", byteSent); >+#endif >+ return byteSent; >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: sendMessage0 >+ * Signature: (Ljava/lang/String;J)V >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessage0__Ljava_lang_String_2J(JNIEnv *env, >+ jobject obj, >+ jstring msg, >+ jlong contextId) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. >+ */ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "LogAgent: sendMessage0String - agent list size = %d\n", mech); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ ra_uint_t length; >+ char *bytes; >+ char *agentName_data; >+ int agentName_len; >+ ra_message_t *message; >+ ra_command_t *command; >+ ra_uint_t i; >+ agent = _agent_list.entries[JLONG(mech)]; >+ >+ length = ENV(env)->GetStringLength(ENVPARM(env) msg); >+ bytes = (char*)ENV(env)->GetStringUTFChars(ENVPARM(env) msg, NULL); >+ >+ agentName_len = unicode2native(&agentName_data, bytes, length); >+ >+ /* Create the message to send to the client side */ >+ message = ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ command = ra_addCommandToMessage(message, NULL); >+ >+ /* Load the data in the message */ >+ command->tag = RA_CUSTOM_COMMAND; >+ command->info.custom_command.processId = ra_getProcessId(); >+ >+ command->info.custom_command.context=(unsigned long)JLONG(contextId); >+ >+ ra_createRASTRING(&command->info.custom_command.agent, agent->agent_name); >+ ra_createRASTRING(&command->info.custom_command.message, (const char *)agentName_data); >+ >+ /* RKD: Why is the context reset to zero here? */ >+ command->info.custom_command.context=0; >+ >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+ JLONG(byteSent) = ra_sendMessage(agent->bindingStorage, message); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "LogAgent: sendMessage0String - sent Custom Command\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ ra_destroyMessage(message, TRUE); >+ ENV(env)->ReleaseStringUTFChars(ENVPARM(env) msg, bytes); >+ free(agentName_data); >+ } >+ >+#if _DEBUG >+ printf("JNI_sendMessage0: %d byte sent\n", byteSent); >+#endif >+ return byteSent; >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: sendMessage0 >+ * Signature: ([BIIJ)V >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessage0___3BIIJ(JNIEnv *env, >+ jobject obj, >+ jbyteArray msg, >+ jint offset, >+ jint length, >+ jlong contextId) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. This >+ Could be a problem on some platforms where the address size is not 4 bytes. >+ */ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "LogAgent: sendMessage0ByteArray - agent list size = %d\n", mech); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ jbyte *copy; >+ ra_message_t *message; >+ ra_command_t *command; >+ agent=_agent_list.entries[JLONG(mech)]; >+ >+ copy=(jbyte*)malloc((length)*sizeof(jbyte)); >+ ENV(env)->GetByteArrayRegion(ENVPARM(env) msg, offset, length, copy); >+ >+ >+ /* Create the message to send to the client side */ >+ message=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ command=ra_addCommandToMessage(message, NULL); >+ >+ /* Load the data in the message */ >+ command->tag = RA_CUSTOM_COMMAND; >+ command->info.custom_command.processId=ra_getProcessId(); >+ >+ command->info.custom_command.context=(unsigned long)JLONG(contextId); >+ >+ ra_createRASTRING(&command->info.custom_command.agent, agent->agent_name); >+ ra_createRASTRING3(&command->info.custom_command.message, (const char*)copy, length); >+ >+ /* RKD: Why is the context reset to zero here? */ >+ command->info.custom_command.context=0; >+ >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+ JLONG(byteSent) = ra_sendMessage(agent->bindingStorage, message); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "LogAgent: sendMessage0ByteArray - sent Custom Command\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ ra_destroyMessage(message, TRUE); >+ } >+ >+#if _DEBUG >+ printf("JNI_sendMessage0: %d byte sent\n", byteSent); >+#endif >+ return byteSent; >+} >+ >+ >+/* >+ * Class: org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: sendMessageBinary0 >+ * Signature: ([BIIJ)V >+ */ >+JNIEXPORT jlong JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessageBinary0(JNIEnv *env, >+ jobject obj, >+ jbyteArray msg, >+ jint offset, >+ jint length, >+ jlong contextId) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ jlong byteSent; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. This >+ Could be a problem on some platforms where the address size is not 4 bytes. >+ */ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "LogAgent: sendMessageBinary0 - agent list size = %d\n", mech); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ jbyte *copy; >+ ra_message_t *message; >+ ra_command_t *command; >+ agent=_agent_list.entries[JLONG(mech)]; >+ >+ copy=(jbyte*)malloc((length)*sizeof(jbyte)); >+ ENV(env)->GetByteArrayRegion(ENVPARM(env) msg, offset, length, copy); >+ >+ >+ /* Create the message to send to the client side */ >+ message=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ command=ra_addCommandToMessage(message, NULL); >+ >+ /* Load the data in the message */ >+ command->tag = RA_BINARY_CUSTOM_COMMAND; >+ command->info.custom_command.processId=ra_getProcessId(); >+ >+ command->info.custom_command.context=(unsigned long)JLONG(contextId); >+ >+ ra_createRASTRING(&command->info.custom_command.agent, agent->agent_name); >+ ra_createRASTRING3(&command->info.custom_command.message, (const char*)copy, length); >+ >+ /* RKD: Why is the context reset to zero here? */ >+ command->info.custom_command.context=0; >+ >+ /* Set it to zero first */ >+ JLONG(byteSent) = 0; >+ JLONG(byteSent) = ra_sendMessage(agent->bindingStorage, message); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "LogAgent: sendMessageBinary0 - sent Binary Custom Command\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ ra_destroyMessage(message, TRUE); >+ } >+ >+#if _DEBUG >+ printf("JNI_sendMessageBinary0: %d byte sent\n", byteSent); >+#endif >+ return byteSent; >+} >+ >+/* >+ * Bug 77768 >+ */ >+JNIEXPORT void JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0___3BJLjava_lang_String_2(JNIEnv *env, jobject obj, jbyteArray ipaddr, jlong pid, jstring agentName) { >+#ifdef __OS400__ >+ jlong port; >+ port.ll = 10002; >+#else >+ jlong port = 10002; >+#endif >+ Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJJLjava_lang_String_2(env, obj, ipaddr, port, pid, agentName); >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: requestMonitorThroughPeer0 >+ * Signature: ([BJLjava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJJLjava_lang_String_2(JNIEnv *env, jobject obj, jbyteArray ipaddr, jlong port, jlong pid, jstring agentName) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. This >+ Could be a problem on some platforms where the address size is not 4 bytes. >+ */ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ ra_ipaddr_t addr; >+ char *agentName_native; >+ agent = _agent_list.entries[JLONG(mech)]; >+ >+ /* Extract our JNI information */ >+ addr.addrLength = (unsigned char)ENV(env)->GetArrayLength(ENVPARM(env) ipaddr); >+ addr.addr = (unsigned char *)malloc(addr.addrLength * sizeof(unsigned char)); >+ ENV(env)->GetByteArrayRegion(ENVPARM(env) ipaddr, 0, addr.addrLength, (signed char *)addr.addr); >+ >+ /* Convert the Unicode string */ >+ agentName_native = copyJavaStringToNative(env, agentName); >+ >+ ra_requestPeerMonitor_p(agent->bindingStorage, &addr, (unsigned long)JLONG(port), (unsigned long)JLONG(pid), ra_createRASTRING2(agentName_native), 0); /* Bug 77768 */ >+ >+ /* Cleanup our mess */ >+ free(addr.addr); >+ free(agentName_native); >+ } >+} >+ >+/* >+ * Bug 77768 >+ */ >+JNIEXPORT void JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0___3BLjava_lang_String_2(JNIEnv *env, jobject obj, jbyteArray ipaddr, jstring agentUUID) { >+#ifdef __OS400__ >+ jlong port; >+ port.ll = 10002; >+#else >+ jlong port = 10002; >+#endif >+ Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJLjava_lang_String_2(env, obj, ipaddr, port, agentUUID); >+} >+ >+/* >+ * Class: Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton >+ * Method: requestMonitorThroughPeer0 >+ * Signature: ([BLjava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJLjava_lang_String_2(JNIEnv *env, jobject obj, jbyteArray ipaddr, jlong port, jstring agentUUID) { >+ jlong mech; >+ jfieldID mechDecl; >+ jclass clazz; >+ >+ /* No need to search, we can just use the _mechanism field in the agent. This >+ Could be a problem on some platforms where the address size is not 4 bytes. >+ */ >+ clazz=ENV(env)->GetObjectClass(ENVPARM(env) obj); >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ mechDecl=ENV(env)->GetFieldID(ENVPARM(env) clazz, "mechanism", "J"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ mech=ENV(env)->GetLongField(ENVPARM(env) obj, mechDecl); >+ >+ if(JLONG(mech) >-1 && JLONG(mech)<_agent_list.size) { >+ agent_list_entry_t *agent; >+ ra_ipaddr_t addr; >+ char *agentUUID_native; >+ agent = _agent_list.entries[JLONG(mech)]; >+ >+ /* Extract our JNI information */ >+ addr.addrLength=(unsigned char)ENV(env)->GetArrayLength(ENVPARM(env) ipaddr); >+ addr.addr=(unsigned char *)malloc(addr.addrLength*sizeof(unsigned char)); >+ ENV(env)->GetByteArrayRegion(ENVPARM(env) ipaddr, 0, addr.addrLength, (signed char *)addr.addr); >+ >+ /* Convert the Unicode string */ >+ agentUUID_native = copyJavaStringToNative(env, agentUUID); >+ >+ ra_requestPeerMonitor2_p(agent->bindingStorage, &addr, (unsigned long)JLONG(port), ra_createRASTRING2(agentUUID_native), 0); /* Bug 77768 */ >+ >+ /* Cleanup our mess */ >+ free(addr.addr); >+ free(agentUUID_native); >+ } >+ >+ >+ >+} >+ >+ >+/** JAVA_NOTIFY_MESSAGE ************************************************************ >+ * This function is called by the underlying controller mechanism to notify a particular >+ * logging agent to either start/stop monitoring or to forward configuration information >+ * via the RA_SET_NAME_VALUE_PAIR or RA_CUSTOM_COMMAND commands. >+ */ >+static void _java_notifyMessage(ra_command_t *command) { >+ JNIEnv *env; >+ jint result; >+ agent_list_entry_t *agent; >+ >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Java Log Agent: notifyMessage: Recieving message %d\n", command->tag); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ /* Attach the current thread to the JVM */ >+#if defined __cplusplus && defined _HPUX >+ result=ENV(_agent_vm)->AttachCurrentThread((void**)&env, NULL); >+#else >+ result=(*_agent_vm)->AttachCurrentThread(_agent_vm, (void**)&env, NULL); >+#endif >+ if(!result) { >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Java Log Agent: notifyMessage: Receiving message %d\n", command->tag); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ switch(command->tag) { >+ case RA_AGENT_CONTROLER_AVAILABLE: >+ agent=findAgent(command->info.agentName.data); >+ if(agent) { >+ jclass cls; >+ jmethodID agentControllerActive, setNodeUUID, setProcessUUID; >+ jstring nodeUUID, processUUID; >+ ra_agentConfigList_t *configuration; >+ >+ configuration=ra_getDefaultConfiguration(agent->bindingStorage); >+ >+ /* Find the class object */ >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ >+ /* Set the node UUID in the agent >+ * RKD: This is a V5 addition we better catch the exception if the method does not exist. >+ */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ setNodeUUID=ENV(env)->GetMethodID(ENVPARM(env) cls, "setNodeUUID", "(Ljava/lang/String;)V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(setNodeUUID) { >+ nodeUUID = getnewstrutf(env, agent -> bindingStorage -> agentUUID.data); >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, setNodeUUID, nodeUUID); >+ } >+ >+ /* Set the process UUID in the agent >+ * RKD: This is a V5 addition we better catch the exception if the method does not exist. >+ */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ setProcessUUID=ENV(env)->GetMethodID(ENVPARM(env) cls, "setJVMUUID", "(Ljava/lang/String;)V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(setProcessUUID) { >+ processUUID = getnewstrutf(env, agent -> bindingStorage -> processUUID.data); >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, setProcessUUID, processUUID); >+ } >+ >+ /* Iterate through the configuration and load the agent with the info. */ >+ if(configuration) { >+ jclass agentClass=ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Java Log Agent: We have a configuration - try to find the agent\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ if(agentClass) { >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ jmethodID factoryMethod=ENV(env)->GetMethodID(ENVPARM(env) agentClass, "createObjectInContextOfClassLoader", "(Ljava/lang/String;)Ljava/lang/Object;"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(factoryMethod) { >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ jstring classname=ENV(env)->NewStringUTF(ENVPARM(env) "org.eclipse.hyades.internal.execution.remote.AgentConfigurationEntry"); /* Bug 78628 */ >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ jobject agentConfigurationEntryObject=ENV(env)->CallObjectMethod(ENVPARM(env) agent->agent_logger, factoryMethod, classname); >+ if(agentConfigurationEntryObject) { >+ jclass agentConfigurationEntryClass=ENV(env)->GetObjectClass(ENVPARM(env) agentConfigurationEntryObject); >+ jmethodID addEntryToDefaultConfiguration, setName, setType, setValue; >+ ra_agentConfigListEntry_t *configListEntry; >+ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ addEntryToDefaultConfiguration=ENV(env)->GetMethodID(ENVPARM(env) cls, "addEntryToDefaultConfiguration", "(Lorg/eclipse/hyades/internal/execution/remote/AgentConfigurationEntry;)V"); >+ setType=ENV(env)->GetMethodID(ENVPARM(env) agentConfigurationEntryClass, "setType", "(Ljava/lang/String;)V"); >+ setName=ENV(env)->GetMethodID(ENVPARM(env) agentConfigurationEntryClass, "setName", "(Ljava/lang/String;)V"); >+ setValue=ENV(env)->GetMethodID(ENVPARM(env) agentConfigurationEntryClass, "setValue", "(Ljava/lang/String;)V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ configListEntry=configuration->head; >+ while(configListEntry) { >+ agentConfigurationEntryObject=ENV(env)->CallObjectMethod(ENVPARM(env) agent->agent_logger, factoryMethod, classname); >+ >+ if(agentConfigurationEntryObject) { >+ jstring javaName; >+ jstring javaType; >+ jstring javaValue; >+ char *ubName; /* UTF-8 bytes */ >+ char *ubType; /* UTF-8 bytes */ >+ char *ubValue; /* UTF-8 bytes */ >+ >+ native2unicode(&ubName, configListEntry->entry.name.data, configListEntry->entry.name.length); >+ native2unicode(&ubType, configListEntry->entry.type.data, configListEntry->entry.type.length); >+ native2unicode(&ubValue, configListEntry->entry.value.data, configListEntry->entry.value.length); >+ >+ javaName = ENV(env)->NewStringUTF(ENVPARM(env) ubName); >+ javaType = ENV(env)->NewStringUTF(ENVPARM(env) ubType); >+ javaValue = ENV(env)->NewStringUTF(ENVPARM(env) ubValue); >+ >+ ENV(env)->CallVoidMethod(ENVPARM(env) agentConfigurationEntryObject, setName, javaName); >+ ENV(env)->CallVoidMethod(ENVPARM(env) agentConfigurationEntryObject, setType, javaType); >+ ENV(env)->CallVoidMethod(ENVPARM(env) agentConfigurationEntryObject, setValue, javaValue); >+ >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, addEntryToDefaultConfiguration, agentConfigurationEntryObject); >+ } >+ configListEntry=configListEntry->next; >+ } >+ } >+ } >+ } >+ } >+ >+ /* If there are any pending exceptions clear them */ >+#if defined __cplusplus && defined _HPUX >+ ENV(env)->ExceptionClear(); >+#else >+ ENV(env)->ExceptionClear(env); >+#endif >+ >+ >+ /* Inform that the server is available */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ agentControllerActive=ENV(env)->GetMethodID(ENVPARM(env) cls, "agentControllerActive", "()V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, agentControllerActive); >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Java Log Agent: Agent Controller Available processing done and called agentControllerActive method.\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ break; >+ case RA_AGENT_CONTROLER_UNAVAILABLE: >+ agent=findAgent(command->info.agentName.data); >+ if(agent) { >+ jclass cls; >+ jmethodID agentControllerInactive; >+ /* Find the class object */ >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ if(cls) { >+ /* Inform that the server is available */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ agentControllerInactive=ENV(env)->GetMethodID(ENVPARM(env) cls, "agentControllerInactive", "()V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(agentControllerInactive) { >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, agentControllerInactive); >+ } >+ } >+ } >+ break; >+ case RA_DETACH_FROM_AGENT: >+ agent=findAgent(command->info.detach.agent.data); >+ if(agent) { >+ jclass cls; >+ jmethodID remoteClientExited; >+ /* Find the class object */ >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ if(cls) { >+ /* Inform that the client is no longer available */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ remoteClientExited=ENV(env)->GetMethodID(ENVPARM(env) cls, "remoteClientExited", "()V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(remoteClientExited) { >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, remoteClientExited); >+ } >+ } >+ >+ /* Close the appropriate data channel implementation if the agent is being monitored */ >+ if(agent->monitored) { >+ >+ if(agent->targetHdl.dtarget == RA_SOCKET) { >+ ra_closeSocket(agent->targetHdl.dtargetHdl.socketFD); >+ } >+ else if(agent->targetHdl.dtarget == RA_SHAREDMEMORY) { >+ ra_stopFlushingShm(&agent->targetHdl.dtargetHdl.shmHdl); >+ } >+ } >+ >+ agent->monitored = FALSE; >+ } >+ break; >+ >+ /* NOTE: This case is used on platforms that do not support shared memory data channel implementation. */ >+ >+ case RA_START_MONITORING_AGENT_REMOTE: >+ { >+ jclass cls; >+ jmethodID agent_setLogging; >+ >+ agent=findAgent(command->info.start_monitor_remote.agent.data); >+ >+ if(agent) { >+ >+ if (!agent->monitored) { >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: %s connecting to remote server\n", agent->agent_name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ agent->targetHdl.dtarget = RA_SOCKET; >+ >+ ra_connectToTCPServer(command->info.start_monitor_remote.ip, >+ (unsigned short)command->info.start_monitor_remote.port, >+ &agent->targetHdl.dtargetHdl.socketFD); >+ } >+ >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ >+ if(!cls) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - Find class failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ break; >+ } >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ agent_setLogging = ENV(env)->GetMethodID(ENVPARM(env)cls, "setLogging", "(Z)V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ >+ if(!agent_setLogging) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - GetMethodID failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ break; >+ } >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, agent_setLogging, (jboolean)1 ); >+ >+ agent->monitored=TRUE; >+ } >+ #ifdef _DEBUG >+ else { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Couldn't find agent %s", agent->agent_name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ } >+ #endif >+ break; >+ } >+ >+ /* NOTE: This case is used on platforms that support shared memory data channel implementation. */ >+ >+ case RA_START_MONITORING_AGENT_LOCAL: >+ { >+ jmethodID agent_setLogging; >+ jclass cls; >+ >+ agent=findAgent(command->info.start_monitor_remote.agent.data); >+ >+ if(agent){ >+ >+ if(!agent->monitored){ >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: %s connecting to shared memory pipe\n", agent->agent_name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ result = ra_attachToShm(command->info.start_monitor_local.file.data, >+ &agent->targetHdl.dtargetHdl.shmHdl); >+ if(result != 0) { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Error %d attaching to data channel.\n", result); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ break; >+ } >+ >+ agent->targetHdl.dtarget = RA_SHAREDMEMORY; >+ } >+ >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ >+ if(!cls) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - Find class failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ break; >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ agent_setLogging = ENV(env)->GetMethodID(ENVPARM(env) cls, "setLogging", "(Z)V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ >+ if(!agent_setLogging) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - GetMethodID failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ break; >+ } >+ >+ agent->monitored=TRUE; >+ >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, agent_setLogging, (jboolean)1 ); >+ } >+ #ifdef _DEBUG >+ else { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Couldn't find agent %s", agent->agent_name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ } >+ #endif >+ >+ break; >+ } >+ >+ /* NOTE: This case does not set the agent->monitored flag to 'FALSE' or close the data channel. */ >+ /* The agent->monitored flag is used to denote when the data channel is open. */ >+ /* The data channel is only closed when a client detaches from an agent. */ >+ >+ case RA_STOP_MONITORING_AGENT: >+ agent=findAgent(command->info.stop_monitor.agent.data); >+ if(agent && agent->monitored) { >+ jclass cls; >+ jmethodID agent_setLogging; >+ cls=ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ >+ if(!cls) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - Find Class failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ else { >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ agent_setLogging = ENV(env)->GetMethodID(ENVPARM(env) cls, "setLogging", "(Z)V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(!agent_setLogging) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - GetMethodID failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ else { >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, agent_setLogging, (jboolean)0 ); >+ } >+ } >+ } >+ break; >+ case RA_CUSTOM_COMMAND: >+ case RA_BINARY_CUSTOM_COMMAND: >+ { >+ BOOL isBinary = FALSE; >+ /* Data */ >+ char *data; >+ int length; >+ >+ /* String constants, need to perform conversion for EBCDIC systems */ >+#ifdef __OS400__ >+ #pragma convert(819) >+#endif >+ char *className_CustomCommand = "org.eclipse.hyades.internal.execution.local.common.CustomCommand"; >+ char *className_BinaryCustomCommand = "org.eclipse.hyades.internal.execution.local.common.BinaryCustomCommand"; >+ char *funcName_createObjectInContextOfClassLoader = "createObjectInContextOfClassLoader"; >+ char *funcSig_createObjectInContextOfClassLoader = "(Ljava/lang/String;)Ljava/lang/Object;"; >+ char *funcName_setData = "setData"; >+ char *funcSig_setData = "([B)V"; >+ char *funcName_incomingCommand = "incomingCommand"; >+ char *funcSig_incomingCommand = "(Lorg/eclipse/hyades/internal/execution/local/common/CommandElement;)V"; >+#ifdef __OS400__ >+ #pragma convert(0) >+#endif >+ /* Make sure data is in the correct format, based on the type of the message */ >+ if(command->tag == RA_CUSTOM_COMMAND) { /* This contains string. Need to perform a conversion */ >+ isBinary = FALSE; >+ length = native2unicode(&data, command->info.custom_command.message.data, command->info.custom_command.message.length); >+ } >+ else { /* This contains binary data, do not convert */ >+ isBinary = TRUE; >+ length = command->info.custom_command.message.length; >+ data = (char*)ra_malloc(sizeof(char*) * length); >+ memcpy(data, command->info.custom_command.message.data, length); >+ } >+ >+ agent = findAgent(command->info.custom_command.agent.data); >+ if(agent) { >+ jclass agentClass = ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ if(agentClass) { >+ jmethodID factoryMethod = ENV(env)->GetMethodID(ENVPARM(env) agentClass, funcName_createObjectInContextOfClassLoader, funcSig_createObjectInContextOfClassLoader); >+ if(factoryMethod) { >+ jstring classname; >+ jobject obj; >+ >+ if(isBinary) { >+ classname = ENV(env)->NewStringUTF(ENVPARM(env) className_BinaryCustomCommand); >+ } >+ else { >+ classname = ENV(env)->NewStringUTF(ENVPARM(env) className_CustomCommand); >+ } >+ >+ obj = ENV(env)->CallObjectMethod(ENVPARM(env) agent->agent_logger, factoryMethod, classname); >+ if(obj) { >+ jclass clazz = ENV(env)->GetObjectClass(ENVPARM(env) obj); >+ if(clazz) { >+ jmethodID setData = ENV(env)->GetMethodID(ENVPARM(env) clazz, funcName_setData, funcSig_setData); >+ if(setData) { >+ jclass cls; >+ jmethodID incomingCommand; >+ /* Call the setter on the Command object */ >+ jbyteArray dataBytes = ENV(env)->NewByteArray(ENVPARM(env) length); >+ ENV(env)->SetByteArrayRegion(ENVPARM(env) dataBytes, 0, length, (jbyte*)data); >+ ENV(env)->CallVoidMethod(ENVPARM(env) obj, setData, dataBytes); >+ /* Invoke incomingCommand on the agent instance */ >+ cls = ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ if(!cls) { >+ #ifdef _DEBUG2 >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Java LogAgent: notifyMessage - Find Class failed\n"); >+ fflush(traceFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ else { >+ incomingCommand = ENV(env)->GetMethodID(ENVPARM(env) cls, funcName_incomingCommand, funcSig_incomingCommand); >+ if(!incomingCommand) { >+ #ifdef _DEBUG2 >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Java LogAgent: notifyMessage - GetMethodID failed\n"); >+ fflush(traceFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ else { >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, incomingCommand, obj); >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ #ifdef _DEBUG >+ /* Note: This call causes the process to end on zOS */ >+ ENV(env)->ExceptionDescribe(env); >+ #endif >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Java LogAgent: notifyMessage - Custom Command processed\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Free up memory */ >+ ra_free(data); >+ >+ break; >+ } >+ case RA_SET_NAME_VALUE_PAIR: >+ { >+ /* The triplets, need conversion */ >+ char *name_data; >+ char *type_data; >+ char *value_data; >+ int name_len; >+ int type_len; >+ int value_len; >+ >+ /* String constants, need conversion */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ char *className_SetNVPairCommand = "SetNVPairCommand"; >+ char *funcName_createObjectInContextOfClassLoader = "createObjectInContextOfClassLoader"; >+ char *funcSig_createObjectInContextOfClassLoader = "(Ljava/lang/String;)Ljava/lang/Object;"; >+ char *funcName_setType = "setType"; >+ char *funcSig_setType = "(Ljava/lang/String;)V"; >+ char *funcName_setName = "setName"; >+ char *funcSig_setName = "(Ljava/lang/String;)V"; >+ char *funcName_setValue = "setVaue"; >+ char *funcSig_setValue = "(Ljava/lang/String;)V"; >+ char *funcName_incomingCommand = "incomingCommand"; >+ char *funcSig_incomingCommand = "(Lorg/eclipse/hyades/internal/execution/local/common/CommandElement;)V"; >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ >+ name_len = native2unicode(&name_data, command->info.set_nv_pair.name.data, command->info.set_nv_pair.name.length); >+ type_len = native2unicode(&type_data, command->info.set_nv_pair.type.data, command->info.set_nv_pair.type.length); >+ value_len = native2unicode(&value_data, command->info.set_nv_pair.value.data, command->info.set_nv_pair.value.length); >+ >+ agent = findAgent(command->info.set_nv_pair.agent.data); >+ if(agent) { >+ jclass agentClass = ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ if(agentClass) { >+ jmethodID factoryMethod = ENV(env)->GetMethodID(ENVPARM(env) agentClass, funcName_createObjectInContextOfClassLoader, funcSig_createObjectInContextOfClassLoader); >+ if(factoryMethod) { >+ jstring classname = ENV(env)->NewStringUTF(ENVPARM(env) className_SetNVPairCommand); >+ jobject obj = ENV(env)->CallObjectMethod(ENVPARM(env) agent->agent_logger, factoryMethod, classname); >+ if(obj) { >+ jclass clazz = ENV(env)->GetObjectClass(ENVPARM(env) obj); >+ if(clazz) { >+ jmethodID setType, setName, setValue; >+ setName = ENV(env)->GetMethodID(ENVPARM(env) clazz, funcName_setName, funcSig_setName); >+ setType = ENV(env)->GetMethodID(ENVPARM(env) clazz, funcName_setType, funcSig_setType); >+ setValue = ENV(env)->GetMethodID(ENVPARM(env) clazz, funcName_setValue, funcSig_setValue); >+ if(setType && setName && setValue) { >+ jclass cls; >+ jstring setTypeParam, setNameParam, setValueParam; >+ jmethodID incomingCommand; >+ char *name, *type, *value; >+ >+ /* Bug 83888 */ >+ >+ /* Verify the name */ >+ if(name_data == NULL) { /* name cannot be null */ >+ break; >+ } >+ >+ /* Verify the type */ >+ if(type_data == NULL) { >+ type_data = "\0"; >+ } >+ >+ /* Verify the value */ >+ if(value_data == NULL) { >+ value = "\0"; >+ } >+ >+ /* Call the setters on the Command object */ >+ setNameParam = ENV(env)->NewStringUTF(ENVPARM(env) name_data); /* Bug 83888 */ >+ ENV(env)->CallVoidMethod(ENVPARM(env) obj, setName, setNameParam ); >+ setTypeParam = ENV(env)->NewStringUTF(ENVPARM(env) type_data); /* Bug 83888 */ >+ ENV(env)->CallVoidMethod(ENVPARM(env) obj, setType, setTypeParam ); >+ setValueParam = ENV(env)->NewStringUTF(ENVPARM(env) value_data); /* Bug 83888 */ >+ ENV(env)->CallVoidMethod(ENVPARM(env) obj, setValue, setValueParam ); >+ >+ /* Invoke incomingCommand on the agent instance */ >+ cls = ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ >+ if(!cls) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - Find Class failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ else { >+ incomingCommand = ENV(env)->GetMethodID(ENVPARM(env) cls, funcName_incomingCommand, funcSig_incomingCommand); >+ if(!incomingCommand) { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("LogAgent: _agent_notifyMessage - GetMethodID failed\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ else { >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, incomingCommand, obj); >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ } >+ >+ ra_free(name_data); >+ ra_free(type_data); >+ ra_free(value_data); >+ >+ break; >+ } >+ case RA_PEER_UNREACHABLE: >+ agent = findAgent(command->info.peer_unreachable.agent.data); >+ if(agent) { >+ jmethodID peerUnreachable; >+ jclass cls; >+ /* Find the class object */ >+ cls = ENV(env)->GetObjectClass(ENVPARM(env) agent->agent_logger); >+ /* Inform the calling agent that the remote peer is unreachable >+ * RKD: This is a V5 addition we better catch the exception if the method does not exist. >+ */ >+#ifdef __OS400__ >+#pragma convert(819) /* 235033 */ >+#endif >+ peerUnreachable = ENV(env)->GetMethodID(ENVPARM(env) cls, "peerUnreachable", "()V"); >+#ifdef __OS400__ >+#pragma convert(0) /* 235033 */ >+#endif >+ if(peerUnreachable) { >+ ENV(env)->CallVoidMethod(ENVPARM(env) agent->agent_logger, peerUnreachable, NULL); >+ } >+ } >+ break; >+ } /* switch */ >+ >+ #ifdef _DEBUG2 >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ fprintf(traceFile, "Java Log Agent: notifyMessage: Completed message handling.\n"); >+ fflush(traceFile); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+#ifdef _DEBUG >+ /* Note: This call causes the process to end on zOS */ >+ ENV(env)->ExceptionDescribe(env); >+#endif >+ >+ /* If there are any pending exceptions clear them. >+ Detach the current thread from the JVM >+ */ >+#if defined __cplusplus && defined _HPUX >+ ENV(env)->ExceptionClear(); >+ ENV(_agent_vm)->DetachCurrentThread(); >+#else >+ ENV(env)->ExceptionClear(env); >+ (*_agent_vm)->DetachCurrentThread(_agent_vm); >+#endif >+ } >+ >+} >+ >+ >+/** NATIVE_NOTIFY_MESSAGE ************************************************************ >+ * This function is called by the underlying controller mechanism to notify a particular >+ * logging agent to either start/stop monitoring or to forward configuration information >+ * via the RA_SET_NAME_VALUE_PAIR or RA_CUSTOM_COMMAND commands. >+ */ >+static void _native_notifyMessage(ra_command_t *command) { >+ jint result; >+ agent_list_entry_t *agent; >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Native Log Agent: Recieving message 0x%x\n", command->tag); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ switch(command->tag) { >+ case RA_AGENT_CONTROLER_AVAILABLE: >+ agent=findAgent(command->info.agentName.data); >+ if(agent) { >+ } >+ break; >+ case RA_AGENT_CONTROLER_UNAVAILABLE: >+ agent=findAgent(command->info.agentName.data); >+ if(agent) { >+ } >+ break; >+ case RA_DETACH_FROM_AGENT: >+ agent=findAgent(command->info.detach.agent.data); >+ if(agent) { >+ } >+ break; >+ case RA_START_MONITORING_AGENT_REMOTE: >+ agent=findAgent(command->info.start_monitor_remote.agent.data); >+ if(agent && !agent->monitored) { >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: %s connecting to remote server\n", agent->agent_name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ agent->targetHdl.dtarget = RA_SOCKET; >+ >+ ra_connectToTCPServer(command->info.start_monitor_remote.ip, >+ (unsigned short)command->info.start_monitor_remote.port, >+ &agent->targetHdl.dtargetHdl.socketFD); >+ >+ agent->monitored=TRUE; >+ } >+ #ifdef _DEBUG >+ else { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Couldn't find agent %s", agent->agent_name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ } >+ #endif >+ break; >+ case RA_START_MONITORING_AGENT_LOCAL: >+ agent=findAgent(command->info.start_monitor_remote.agent.data); >+ if(agent && !agent->monitored) { >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: %s connecting to shared memory pipe\n", agent->agent_name); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ result = ra_attachToShm(command->info.start_monitor_local.file.data, >+ &agent->targetHdl.dtargetHdl.shmHdl); >+ if(result != 0) { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Error attaching to shared memory\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ } >+ >+ agent->targetHdl.dtarget = RA_SHAREDMEMORY; >+ >+ agent->monitored=TRUE; >+ } >+ #ifdef _DEBUG >+ else { >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Couldn't find agent %s", command->info.start_monitor_remote.agent.data); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ } >+ #endif >+ break; >+ case RA_STOP_MONITORING_AGENT: >+ agent=findAgent(command->info.stop_monitor.agent.data); >+ if(agent && agent->monitored) { >+ /* Close the appropriate logging mechanism */ >+ if(agent->targetHdl.dtarget==RA_SOCKET) { >+ ra_closeSocket(agent->targetHdl.dtargetHdl.socketFD); >+ >+ } >+ else if(agent->targetHdl.dtarget==RA_SHAREDMEMORY) { >+ ra_stopFlushingShm(&agent->targetHdl.dtargetHdl.shmHdl); >+ } >+ agent->monitored=FALSE; >+ } >+ break; >+ case RA_CUSTOM_COMMAND: >+ agent=findAgent(command->info.custom_command.agent.data); >+ /* create a CustomCommand and forward this to the Agent.incomingCommand() method */ >+ if(agent) { >+ } >+ break; >+ case RA_SET_NAME_VALUE_PAIR: >+ agent=findAgent(command->info.set_nv_pair.agent.data); >+ /* Create a CustomCommand and forward this to the Agent.incomingCommand() method */ >+ if(agent) { >+ } >+ break; >+ } >+ /* Forward the command to the agent handler registered with the native agent. The developer has the option of >+ * registering their own command handler using agent->nativeCommandHandler. */ >+ if (agent && agent->nativeCommandHandler) >+ { >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: About to forward command to the registered customized handler\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ agent->nativeCommandHandler(command); >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Forward of command to customized agent was successful\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+ } >+ >+ #ifdef _DEBUG >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(suspend) >+ #endif >+ printf("Log Agent: Completed message\n"); >+ #ifdef MVS /* 198066 */ >+ #pragma convlit(resume) >+ #endif >+ #endif >+} >+ >+/* Bug 79816 */ >+JNIEXPORT jlong JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_getPID0(JNIEnv *env, jobject obj) { >+ jlong pid; >+ >+#ifdef __OS400__ >+ pid.unsigned_ll = ra_getProcessId(); >+#else >+ pid = ra_getProcessId(); >+#endif >+ >+ return pid; >+} >+ >+/* Bug 79816 */ >+JNIEXPORT jstring JNICALL Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_generateUUID0(JNIEnv *env, jobject obj) { >+ ra_string_t *uuid; >+ jstring juuid; >+ >+ uuid = (ra_string_t*)malloc(sizeof(ra_string_t)); >+ ra_generateUUID(uuid); >+ >+ juuid = ENV(env)->NewStringUTF(ENVPARM(env) uuid->data); >+ free(uuid); >+ >+ return juuid; >+} >+ >+ >+/* RKD: This is not turned on yet and when it is it is Windows explicit. >+ */ >+#if 0 >+BOOL APIENTRY DllMain( HANDLE hModule, >+ DWORD ul_reason_for_call, >+ LPVOID lpReserved >+ ) >+{ >+ switch(ul_reason_for_call) { >+ case DLL_PROCESS_ATTACH: >+ break; >+ case DLL_THREAD_ATTACH: >+ break; >+ case DLL_THREAD_DETACH: >+ break; >+ case DLL_PROCESS_DETACH: >+ break; >+ } >+ return TRUE; >+} >+#endif >Index: src-native-new/src/agents/thread/WinBuild/hcthread.dsp >=================================================================== >RCS file: src-native-new/src/agents/thread/WinBuild/hcthread.dsp >diff -N src-native-new/src/agents/thread/WinBuild/hcthread.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/WinBuild/hcthread.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,117 @@ >+# Microsoft Developer Studio Project File - Name="hcthread" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=hcthread - Win32 Debug >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "hcthread.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "hcthread.mak" CFG="hcthread - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "hcthread - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "hcthread - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "hcthread - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "Release" >+# PROP BASE Intermediate_Dir "Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /FD /c >+# SUBTRACT CPP /YX >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcbnd.lib hcclco.lib hccldt.lib hcclsm.lib hccls.lib /nologo /dll /machine:I386 /libpath:"..\..\..\..\lib" /out:"..\..\..\..\bin\hcthread.dll" >+ >+!ELSEIF "$(CFG)" == "hcthread - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 1 >+# PROP BASE Output_Dir "Debug" >+# PROP BASE Intermediate_Dir "Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 1 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCTHREAD_EXPORTS" /FD /GZ /c >+# SUBTRACT CPP /YX >+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "_DEBUG" >+# ADD RSC /l 0x409 /d "_DEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcbnd.lib hcclco.lib hccldt.lib hcclsm.lib hccls.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\lib" /out:"..\..\..\..\bin\hcthread.dll" >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "hcthread - Win32 Release" >+# Name "hcthread - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\hcthread.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\hcthread.def >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\hcthread.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/RABindings/WinBuild/RABindings.mak64 >=================================================================== >RCS file: src-native-new/src/agents/RABindings/WinBuild/RABindings.mak64 >diff -N src-native-new/src/agents/RABindings/WinBuild/RABindings.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/WinBuild/RABindings.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,442 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on RABinding.dsp >+!IF "$(CFG)" == "" >+CFG=RABinding - IA64 Debug >+!MESSAGE No configuration specified. Defaulting to RABinding - IA64 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "RABinding - IA64 Release" && "$(CFG)" != "RABinding - IA64 Debug" && "$(CFG)" != "RABinding - X64 Release" && "$(CFG)" != "RABinding - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "RABinding.mak64" CFG="RABinding - IA64 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "RABinding - IA64 Release" >+!MESSAGE "RABinding - IA64 Debug" >+!MESSAGE "RABinding - X64 Release" >+!MESSAGE "RABinding - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "RABinding - IA64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ELSE >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN : >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hcbnd.res" >+ -@erase "$(INTDIR)\lock3.obj" >+ -@erase "$(INTDIR)\RABindings.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /Fp"$(INTDIR)\RABinding.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RABindings.def" /out:"$(OUTDIR)\hcbnd.dll" /implib:"$(OUTDIR)\..\lib\hcbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\lock3.obj" \ >+ "$(INTDIR)\RABindings.obj" \ >+ "$(INTDIR)\hcbnd.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hcbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RABinding - IA64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ELSE >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN : >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hcbnd.res" >+ -@erase "$(INTDIR)\lock3.obj" >+ -@erase "$(INTDIR)\RABindings.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.lib" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /Fp"$(INTDIR)\RABinding.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcbnd.pdb" /debug /def:"..\RABindings.def" /out:"$(OUTDIR)\hcbnd.dll" /implib:"$(OUTDIR)\..\lib\hcbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\lock3.obj" \ >+ "$(INTDIR)\RABindings.obj" \ >+ "$(INTDIR)\hcbnd.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hcbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RABinding - X64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ELSE >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN : >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hcbnd.res" >+ -@erase "$(INTDIR)\lock3.obj" >+ -@erase "$(INTDIR)\RABindings.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /EHsc /O2 /Ob0 /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /Fp"$(INTDIR)\RABinding.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /version:0.1 /dll /pdb:none /def:"..\RABindings.def" /out:"$(OUTDIR)\hcbnd.dll" /implib:"$(OUTDIR)\..\lib\hcbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\lock3.obj" \ >+ "$(INTDIR)\RABindings.obj" \ >+ "$(INTDIR)\hcbnd.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hcbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RABinding - X64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ELSE >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN : >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hcbnd.res" >+ -@erase "$(INTDIR)\lock3.obj" >+ -@erase "$(INTDIR)\RABindings.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcbnd.dll" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.exp" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.ilk" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.lib" >+ -@erase "$(OUTDIR)\..\lib\hcbnd.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /EHsc /Zi /Od /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /Fp"$(INTDIR)\RABinding.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "_DEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib bufferoverflowU.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcbnd.pdb" /debug /def:"..\RABindings.def" /out:"$(OUTDIR)\hcbnd.dll" /implib:"$(OUTDIR)\..\lib\hcbnd.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\lock3.obj" \ >+ "$(INTDIR)\RABindings.obj" \ >+ "$(INTDIR)\hcbnd.res" \ >+ "$(OUTDIR)\..\lib\hcclco.lib" \ >+ "$(OUTDIR)\..\lib\hccls.lib" >+ >+"$(OUTDIR)\hcbnd.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "RABinding - IA64 Release" || "$(CFG)" == "RABinding - IA64 Debug" || "$(CFG)" == "RABinding - X64 Release" || "$(CFG)" == "RABinding - X64 Debug" >+SOURCE=..\lock3.c >+ >+"$(INTDIR)\lock3.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\RABindings.c >+ >+"$(INTDIR)\RABindings.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\version.rc >+ >+!IF "$(CFG)" == "RABinding - IA64 Release" >+ >+ >+"$(INTDIR)\hcbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RABinding - IA64 Debug" >+ >+ >+"$(INTDIR)\hcbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "_DEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RABinding - X64 Release" >+ >+ >+"$(INTDIR)\hcbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RABinding - X64 Debug" >+ >+ >+"$(INTDIR)\hcbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/rac/version.rc >=================================================================== >RCS file: src-native-new/src/agents/perfmon/rac/version.rc >diff -N src-native-new/src/agents/perfmon/rac/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/rac/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION 3,1,0,0 >+ PRODUCTVERSION 3,1,0,0 >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", "ECLIPSE\0" >+ VALUE "FileDescription", "Performance Monitor RAC Library\0" >+ VALUE "FileVersion", "3, 1, 0, 0\0" >+ VALUE "InternalName", "\0" >+ VALUE "LegalCopyright", "© Copyright International Business Machines Corporation, 2004\0" >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "rac.dll\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", "3, 1, 0, 0\0" >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/agents/native/WinBuild/heapsnapshots.mak >=================================================================== >RCS file: src-native-new/src/agents/native/WinBuild/heapsnapshots.mak >diff -N src-native-new/src/agents/native/WinBuild/heapsnapshots.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/WinBuild/heapsnapshots.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,200 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on heapsnapshots.dsp >+!IF "$(CFG)" == "" >+CFG=heapsnapshots - Win32 Debug >+!MESSAGE No configuration specified. Defaulting to heapsnapshots - Win32 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "heapsnapshots - Win32 Release" && "$(CFG)" != "heapsnapshots - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "heapsnapshots.mak" CFG="heapsnapshots - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "heapsnapshots - Win32 Release" (based on "Win32 (x86) Static Library") >+!MESSAGE "heapsnapshots - Win32 Debug" (based on "Win32 (x86) Static Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "heapsnapshots - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\heapsnapshots.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\AbstractHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\heapsnapshots.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\heapsnapshots.bsc" >+BSC32_SBRS= \ >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\heapsnapshots.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\AbstractHeapSnapshotManager.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ >+"$(OUTDIR)\heapsnapshots.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "heapsnapshots - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\heapsnapshots.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\AbstractHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\heapsnapshots.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\heapsnapshots.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\heapsnapshots.bsc" >+BSC32_SBRS= \ >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\heapsnapshots.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\AbstractHeapSnapshotManager.obj" \ >+ "$(INTDIR)\StatelessHeapSnapshotManager.obj" >+ >+"$(OUTDIR)\heapsnapshots.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("heapsnapshots.dep") >+!INCLUDE "heapsnapshots.dep" >+!ELSE >+!MESSAGE Warning: cannot find "heapsnapshots.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "heapsnapshots - Win32 Release" || "$(CFG)" == "heapsnapshots - Win32 Debug" >+SOURCE=..\heapsnapshots\AbstractHeapSnapshotManager.cpp >+ >+"$(INTDIR)\AbstractHeapSnapshotManager.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\heapsnapshots\StatelessHeapSnapshotManager.cpp >+ >+"$(INTDIR)\StatelessHeapSnapshotManager.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/RABindings/RABindings.def >=================================================================== >RCS file: src-native-new/src/agents/RABindings/RABindings.def >diff -N src-native-new/src/agents/RABindings/RABindings.def >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/RABindings.def 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,31 @@ >+LIBRARY hcbnd >+DESCRIPTION "Services provided to all Agents" >+EXPORTS >+ ra_initializeBindings @1 >+ ra_finalizeBindings @2 >+ ra_startListener @3 >+ ra_stopListener @4 >+ ra_sendMessage @5 >+ ra_getProcessId @6 >+ ra_getNodeUUID @7 >+ ra_getProcessUUID @8 >+ ra_getAgentUUID @9 >+ ra_getDefaultConfiguration @10 >+ ra_getProcessCommandLine @11 >+ ra_logErrorMessage @12 >+ ra_requestPeerMonitor @13 >+ ra_requestPeerMonitor2 @14 >+ ra_initializeLock @15 >+ ra_deleteLock @16 >+ ra_getWriteLock @17 >+ ra_releaseWriteLock @18 >+ ra_getReadLock @19 >+ ra_releaseReadLock @20 >+ ra_initializeVMLock @21 >+ ra_setVMLock @22 >+ ra_releaseVMLock @23 >+ ra_testVMLock @24 >+ ra_getPropertyValues @25 >+ ra_logErrorMessage_return @26 >+ ra_requestPeerMonitor_p @27 >+ ra_requestPeerMonitor2_p @28 >Index: src-native-new/src/agents/java/hcjbnd.exp >=================================================================== >RCS file: src-native-new/src/agents/java/hcjbnd.exp >diff -N src-native-new/src/agents/java/hcjbnd.exp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/hcjbnd.exp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,22 @@ >+#! libhcjbnd.so exports >+logAgent_getCurrentProcessId >+logAgent_getCurrentThreadId >+logAgent_registerAgent >+logAgent_deregisterAgent >+logAgent_logMessage >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_deregister0 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_initializeEngine0 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessage0__Ljava_lang_String_2_3BII >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessage0__Ljava_lang_String_2Ljava_lang_String_2 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessageUTF80 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_logMessageUTF81 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessage0__Ljava_lang_String_2J >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessage0___3BIIJ >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_sendMessageBinary0 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0___3BLjava_lang_String_2 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0___3BJLjava_lang_String_2 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_getPID0 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_generateUUID0 >+logAgent_logMessage_return >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJLjava_lang_String_2 >+Java_org_eclipse_hyades_internal_execution_remote_RemoteComponentSkeleton_requestMonitorThroughPeer0p___3BJJLjava_lang_String_2 >Index: src-native-new/src/transport/RADataTransfer/version.rc >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/version.rc >diff -N src-native-new/src/transport/RADataTransfer/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,110 @@ >+#include "../../../include/tptp/version.h" >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION _VERSION_WIN >+ PRODUCTVERSION _VERSION_WIN >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", _COMPANY_NAME >+ VALUE "FileDescription", "Agent Controller Data Transfer Library\0" >+ VALUE "FileVersion", _VERSION >+ VALUE "InternalName", "hccldt\0" >+ VALUE "LegalCopyright", _COPYRIGHT >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "hccldt.dll\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", _VERSION >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.h >diff -N src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,34 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: PerfmonAgent.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+#ifndef __PERFMON__H__ >+#define __PERFMON__H__ >+ >+#ifdef LINUX >+#define DEFAULT_COM "librac.so" >+#define DEFAULT_RES "libperflin.so" >+#endif >+ >+#ifdef WIN32 >+ #define DEFAULT_COM "rac.dll" >+ #define DEFAULT_RES "sysperf.dll" >+#endif >+ >+ >+#include "cominterface.h" >+#include "resinterface.h" >+#include "DataTransferInterface.h" >+#include "DataCollectionInterface.h" >+ >+#endif >+ >Index: src-native-new/src/HCLauncher/hclaunch.make >=================================================================== >RCS file: src-native-new/src/HCLauncher/hclaunch.make >diff -N src-native-new/src/HCLauncher/hclaunch.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/hclaunch.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+ >+################################################################################ >+# >+# makefile: hclaunch project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libhclaunch >+TARGETDIR := ../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../../include ../transport/RACommon $(JAVA_HOME)/include $(JAVA_HOME)/include/linux >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl pthread hcclco >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/HCLauncher/launcher_os400.h >=================================================================== >RCS file: src-native-new/src/HCLauncher/launcher_os400.h >diff -N src-native-new/src/HCLauncher/launcher_os400.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/launcher_os400.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+/********************************************************************** >+Copyright (c) 2005 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: launcher_os400.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+ >+ >+/* >+ * Function prototypes >+ */ >+#ifdef __OS400__ >+ >+#define AS400_CLASSPATH_LENGTH 8192 >+#define MAX_FD 256 >+#include <spawn.h> >+ >+PID hc_launchProcess_OS400(char *exe, char *cmdline, char *location, char *env, RA_HANDLE consoleChild[]); >+void hc_initProcessStdioList(); >+void hc_addToProcessStdioList(PID pid, int in, int out, int err); >+void hc_removeFromProcessStdioList(PID pid); >+ >+#endif >Index: src-native-new/src/agents/java/version.rc >=================================================================== >RCS file: src-native-new/src/agents/java/version.rc >diff -N src-native-new/src/agents/java/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,110 @@ >+#include "../../../include/tptp/version.h" >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION _VERSION_WIN >+ PRODUCTVERSION _VERSION_WIN >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", _COMPANY_NAME >+ VALUE "FileDescription", "Logging Agent\0" >+ VALUE "FileVersion", _VERSION >+ VALUE "InternalName", "hcjbnd\0" >+ VALUE "LegalCopyright", _COPYRIGHT >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "hcjbnd.dll\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", _VERSION >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/HCLauncher/launcher_os400.c >=================================================================== >RCS file: src-native-new/src/HCLauncher/launcher_os400.c >diff -N src-native-new/src/HCLauncher/launcher_os400.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/launcher_os400.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,456 @@ >+/********************************************************************** >+Copyright (c) 2005 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: launcher_os400.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+ >+#ifdef __OS400__ /* 236501 */ >+ >+#include "launcher_common.h" >+#include "RAComm.h" >+ >+char* processAS400Arg2(char** parsedArgs, int numArgs); >+char* processAS400Arg3(char** environment, int numEnv); >+char* processAS400Arg4(char** parsedArgs, int* pNumArgs, int* intrepret, char** p_opt, char** p_chk); >+ >+ >+/* >+ * Launch a process >+ */ >+PID hc_launchProcess_OS400(char *exe, char *cmdline, char *location, char *env, RA_HANDLE consoleChild[]) { >+ PID childPID = 0; >+ struct inheritance inherit; >+ char *as400Args[9]; >+ int numAS400Args; /* Total number of AS/400 argumens, including JVM properties */ >+ int numAS400Env; /* Total number of environment variables */ >+ >+ char *parsedArgs[MAX_ARGS]; >+ char *environment[MAX_ENV+1]; >+ int fd_map[3]; >+ int *fdmap; >+ int fdcount = 3; >+ char *current, *next; >+ int i, count; >+ >+ if((cmdline == NULL) || (env == NULL)) { >+ return -1; >+ } >+ >+ current=cmdline; >+ >+ /* 178427 begin */ >+ /* Move past any leading blanks */ >+ while (*current == ' ') { >+ current++; >+ } >+ >+ /* Parse out the args */ >+ for(i=0; (next=(char*)strchr(current, ' '))!=NULL; i++) { >+ /* If this is a quoted arg we need to remove the quote and skip to the next quote */ >+ if(current[0]=='\"') { >+ current++; >+ next=(char*)strchr(current, '\"'); >+ if(next) { >+ *next='\0'; >+ } >+ } >+ else { >+ *next='\0'; >+ } >+ >+ parsedArgs[i]=current; >+ >+ /* move past blanks */ >+ do { >+ next++; >+ } while (*next == ' '); >+ current=next; >+ } >+ >+ /* check if there is another argument */ >+ if (strlen(current) > 0) { /* 178427 - handles case of blank at end of cmd line */ >+ >+ /* If this is a quoted arg we need to remove the quote and skip to the next quote */ >+ if(current[0]=='\"') { >+ current++; >+ next=(char*)strchr(current, '\"'); >+ if(next) { >+ *next='\0'; >+ } >+ } >+ >+ parsedArgs[i]=current; >+ parsedArgs[i+1]='\0'; >+ } >+ /* Else end the list of arguments */ >+ else { >+ parsedArgs[i]='\0'; >+ } >+ >+ numAS400Args = i+1; /* Total number of JVM arguments, including trailing NULL (-D or -X) */ >+ >+ /* 178427 end */ >+ /* Load the environment array */ >+ i=count=0; >+ do{ >+ environment[count]=&env[i]; >+ i+=strlen(&env[i])+1; >+ count++; >+ } while(env[i]!='\0' && count<MAX_ENV); >+ >+ if(count==MAX_ENV) { >+ exit(-1); >+ } >+ else { >+ environment[count]='\0'; >+ } >+ >+ numAS400Env = count; /* Total number of environment variables */ >+ >+ /* Set up file descriptor map for child process */ >+ if (consoleChild) { >+ if ((fd_map[0]=dup(consoleChild[0])) < 0) { /* child stdin is read end of pipe */ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_SEVERE, "Creating stdin for process failed. Platform specific error is %d", errno); >+ } >+ if ((fd_map[1]=dup(consoleChild[1])) < 0) { /* child stdout is write end of pipe */ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_SEVERE, "Creating stdout for process failed. Platform specific error is %d", errno); >+ } >+ if ((fd_map[2]=dup(consoleChild[2])) < 0) { /* child stderr is write end of pipe */ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_SEVERE, "Creating stderr for process failed. Platform specific error is %d", errno); >+ } >+ fdmap = fd_map; >+ } >+ else { >+ fdcount = 0; >+ fdmap = NULL; >+ } >+ >+#if 0 /* Bug 68899 */ >+ /* Change directory to the one specified in the config file */ >+ if(chdir(location)) { >+ childPID = 0; >+ return childPID; >+ } >+#endif >+ >+ if(strstr(parsedArgs[0], "Q5BVAJVM") != 0) { /* 239022 */ >+ int intrepret = FALSE; >+ char* opt = NULL; >+ char* chk = NULL; >+ >+ /* */ >+ /* Processing iSeries args */ >+ /* */ >+ as400Args[4] = processAS400Arg4(parsedArgs, &numAS400Args, &intrepret, &opt, &chk); /* Step 4 goes first to remove all -D and -X parameters */ >+ as400Args[0] = parsedArgs[0]; >+ as400Args[1] = parsedArgs[1]; /* class name */ >+ as400Args[2] = processAS400Arg2(parsedArgs, numAS400Args); >+ as400Args[3] = processAS400Arg3(environment, numAS400Env); >+ as400Args[5] = opt; /* Optimization */ >+ as400Args[6] = chk; /* Path check level */ >+ if(intrepret) >+ as400Args[7] = "*YES"; /* Interpret */ >+ else >+ as400Args[7] = "*NO"; /* Interpret */ >+ as400Args[8] = "\0"; >+ >+ environment[numAS400Env++] = "QIBM_USE_DESCRIPTOR_STDIO=Y"; >+ environment[numAS400Env++] = '\0'; >+ inherit.flags = SPAWN_SETTHREAD_NP; /* 232010 */ >+ >+ /* Launch the java process */ >+ childPID = spawnp(as400Args[0], fdcount, fdmap, &inherit, as400Args, environment); >+ >+ free(as400Args[2]); /* program param */ >+ free(as400Args[3]); /* classpath */ >+ free(as400Args[4]); /* jvm prop */ >+ } >+ else { >+ environment[numAS400Env++] = "QIBM_USE_DESCRIPTOR_STDIO=Y"; >+ environment[numAS400Env++] = '\0'; >+ inherit.flags = SPAWN_SETTHREAD_NP; >+ >+ /* Launch the process */ >+ childPID = spawnp(parsedArgs[0], fdcount, fdmap, &inherit, parsedArgs, environment); >+ } >+ >+ if(childPID < 0) { >+ childPID = -1; >+ } >+ >+ return childPID; >+} >+ >+ >+/* */ >+/* Processing arg 2 */ >+/* Command line arguments */ >+/* */ >+char* processAS400Arg2(char** parsedArgs, int numArgs) { >+ char* as400arg2; >+ int propLen = 0; /* Length of the string storing the command line args in AS/400 format */ >+ int i; >+ char len[3]; >+ int numParam = 0; /* 238048 Number of ACTUAL (non-null) command line arg passed to program */ >+ >+ if(numArgs > 2) { >+ /* Calculate the length of the array required */ >+ for(i = 2; (i < numArgs) && (parsedArgs[i] != NULL); i++) { /* 238048 */ >+ propLen += 3; /* the 3 digits "xxx" showing the length of the arg name */ >+ propLen += strlen(parsedArgs[i]); /* the length of the arg */ >+ numParam++; /* 238048 we got one more arg */ >+ } >+ propLen += 3; /* The 3 digit "nnn" show the number of JVM args */ >+ >+ as400arg2 = (char*)malloc(sizeof(char) * propLen); >+ BZERO(as400arg2, propLen); >+ sprintf(as400arg2, "%03d", numParam); /* 238048 Total number of args */ >+ for(i = 2; (i < numArgs) && (parsedArgs[i] != NULL); i++) { /* 238048 */ >+ sprintf(len, "%03d", strlen(parsedArgs[i])); >+ strcat(as400arg2, len); >+ strcat(as400arg2, parsedArgs[i]); >+ } >+ strcat(as400arg2, "\0"); /* add a null to the end */ >+ } >+ else { /* if(numAD400Args <= 2) */ >+ as400arg2 = "0"; >+ } >+ >+ return as400arg2; >+} >+ >+ >+/* */ >+/* Processing arg 3 */ >+/* CLASSPATH */ >+/* */ >+char* processAS400Arg3(char** environment, int numEnv) { >+ char* as400arg3; >+ int cplength = 0; /* classpath length */ >+ int i, j; >+ >+ as400arg3 = (char*)malloc(sizeof(char) * AS400_CLASSPATH_LENGTH); >+ BZERO(as400arg3, AS400_CLASSPATH_LENGTH); >+ >+ for(i = 0; i < numEnv; i++) { >+ if(!strncmp(environment[i], "CLASSPATH=", 10)) { >+ for(j = 10; j < strlen(environment[i]); j++) { >+ as400arg3[cplength++] = environment[i][j]; >+ } >+ as400arg3[cplength++] = ':'; >+ } >+ } >+ as400arg3[cplength-1] = '\0'; >+ >+ return as400arg3; >+} >+ >+ >+/* */ >+/* Processing arg 4 */ >+/* JVM properties */ >+/* */ >+char* processAS400Arg4(char** parsedArgs, int* pNumArgs, int* intrepret, char** p_opt, char** p_chk) { >+ char* as400arg4; >+ char* jvmPropBuf_X; /* 239249 */ >+ char* jvmPropBuf_D; >+ int propLen = 0; /* Length of the string storing the JVM props in AS/400 format */ >+ int numProp = 0; /* Number of JVM properties processed */ >+ int i, j; >+ BOOL endOfJvmArgs = FALSE; >+ >+ *p_opt = (char*)malloc(sizeof(char) * 3); >+ *p_chk = (char*)malloc(sizeof(char) * 3); >+ strcpy(*p_opt, "10"); /* default optimize level */ >+ strcpy(*p_chk, "10"); /* default path check level */ >+ >+ propLen = 3; /* The 3 digit "nnn" show the number of JVM args */ >+ propLen += 26; /* 217412 workaround, stdin prop "019os400.stdin.allowed0011" */ >+ propLen += 21; /* Bug 68899 "012java.version0031.4" */ >+ >+ /* Calculate the length of the array required */ >+ for(i = 0; (i < (*pNumArgs)) && (parsedArgs[i] != NULL); i++) { /* 238048 */ >+ propLen += 3; /* the 3 digits "xxx" showing the length of the property name */ >+ propLen += strlen(parsedArgs[i]); /* the length of the property */ >+ propLen += 3; /* the 3 digits "yyy" showing the length of the property value */ >+ } >+ >+ as400arg4 = (char*)malloc(sizeof(char) * propLen); /* Allocate */ >+ BZERO(as400arg4, propLen); >+ >+ jvmPropBuf_X = (char*)malloc(sizeof(char) * (propLen - 3)); /* Not counting "nnn" */ >+ BZERO(jvmPropBuf_X, (propLen - 3)); >+ >+ jvmPropBuf_D = (char*)malloc(sizeof(char) * (propLen - 3)); /* Not counting "nnn" */ >+ BZERO(jvmPropBuf_D, (propLen - 3)); >+ >+ /* Rearrange the JVM arguments in AS/400 format */ >+ for(i = 1; (i < (*pNumArgs)) && (parsedArgs[i] != NULL); i++) { /* do not parse the 1st one since it is the program name */ >+ if(((!strncmp(parsedArgs[i], "-D", 2)) || >+ (!strncmp(parsedArgs[i], "-X", 2)) || >+ (!strncmp(parsedArgs[i], "-opt", 4)) || >+ (!strncmp(parsedArgs[i], "-chkpath", 8)) || >+ (!strncmp(parsedArgs[i], "-interpret", 10))) && (!endOfJvmArgs)) { >+ if(!strncmp(parsedArgs[i], "-D", 2)) { >+ const char delimiters[] = "="; >+ char *value1, *value2; >+ char *tmpbuf = (char*)malloc(sizeof(char) * (strlen(parsedArgs[i]) + 6)); /* adding "xxx" and "yyy" */ >+ BZERO(tmpbuf, (strlen(parsedArgs[i]) + 6)); >+ >+ value1 = strtok(parsedArgs[i], delimiters); >+ value1 += 2; /* skipping the "-D" */ >+ value2 = strtok(NULL, delimiters); >+ if(value2 == NULL) { >+ sprintf(tmpbuf, "%03d-D%s=000", strlen(value1)+3, value1); /* 237157 */ /* 239249 */ >+ } >+ else { >+ sprintf(tmpbuf, "%03d%s%03d%s", strlen(value1), value1, strlen(value2), value2); >+ } >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_DEBUG, "iSeries JVM property \"%s\" encountered, convert it to \"%s\"", parsedArgs[i], tmpbuf); >+ strcat(jvmPropBuf_D, tmpbuf); >+ numProp++; >+ free(tmpbuf); >+ } >+ else if(!strncmp(parsedArgs[i], "-X", 2)) { >+ char *tmpbuf = (char*)malloc(sizeof(char) * (strlen(parsedArgs[i]) + 6)); /* adding "xxx" and "yyy" */ >+ BZERO(tmpbuf, (strlen(parsedArgs[i]) + 6)); >+ >+ sprintf(tmpbuf, "%03d%s000", strlen(parsedArgs[i]), parsedArgs[i]); /* Do not skip -X */ >+ //hc_logServiceMessage(__FILE__, __LINE__, RA_DEBUG, "iSeries JVM property \"%s\" encountered, convert it to \"%s\"", parsedArgs[i], tmpbuf); >+ strcat(jvmPropBuf_X, tmpbuf); >+ numProp++; >+ free(tmpbuf); >+ } >+ else if(!strncmp(parsedArgs[i], "-opt", 4)) { >+ free(*p_opt); >+ *p_opt = (char*)malloc(sizeof(char) * 3); >+ BZERO(*p_opt, 3); >+ strncpy(*p_opt, parsedArgs[i]+4, 2); /* skipping "-opt" */ >+ } >+ else if(!strncmp(parsedArgs[i], "-chkpath", 8)) { >+ free(*p_chk); >+ *p_chk = (char*)malloc(sizeof(char) * 3); >+ BZERO(*p_chk, 3); >+ strncpy(*p_chk, parsedArgs[i]+8, 2); /* skipping "-chkpath" */ >+ } >+ else if(!strncmp(parsedArgs[i], "-interpret", 10)) { >+ *intrepret = TRUE; >+ } >+ >+ /* free(parsedArgs[i]); */ /* JVM arg processes, remove it from the list */ >+ for(j = i; j < (*pNumArgs); j++) { >+ parsedArgs[j] = parsedArgs[j+1]; /* Move the string upward by 1 */ >+ } >+ (*pNumArgs)--; /* Remove 1 from the total number of arguments */ >+ i--; /* Move the counter back since we've removed the args */ >+ } >+ else if((!strncmp(parsedArgs[i], "-", 1)) && (!endOfJvmArgs)) { /* for "-verbose", "-noverify", etc. support */ >+ char *tmpbuf = (char*)malloc(sizeof(char) * (strlen(parsedArgs[i]) + 6)); /* adding "xxx" and "yyy" */ >+ BZERO(tmpbuf, (strlen(parsedArgs[i]) + 6)); >+ >+ sprintf(tmpbuf, "%03d%s000", strlen(parsedArgs[i]), parsedArgs[i]); >+ strcat(jvmPropBuf_X, tmpbuf); >+ numProp++; >+ free(tmpbuf); >+ >+ for(j = i; j < (*pNumArgs); j++) { >+ parsedArgs[j] = parsedArgs[j+1]; /* Move the string upward by 1 */ >+ } >+ (*pNumArgs)--; /* Remove 1 from the total number of arguments */ >+ i--; /* Move the counter back since we've removed the args */ >+ } >+ else { >+ endOfJvmArgs = TRUE; >+ } >+ } >+ >+ /* Workaround for defect 217412 "stdin problem on iSeries" */ >+ numProp++; /* 239022 */ >+ strcat(jvmPropBuf_D, "019os400.stdin.allowed0011"); /* 26 chars */ >+ /* Workaround ends */ >+ >+ /* Bug 68899 */ >+ numProp++; >+ strcat(jvmPropBuf_D, "012java.version0031.4"); /* 21 chars */ >+ /* Bug 68899 */ >+ >+ if(numProp == 0) { >+ as400arg4 = "0"; /* If no JVM arg then set to zero */ >+ } >+ else { >+ sprintf(as400arg4, "%03d", numProp); /* Print the number of JVM args */ >+ strcat(as400arg4, jvmPropBuf_X); /* Append the actual AS/400 formatted JVM args */ >+ strcat(as400arg4, jvmPropBuf_D); /* Append the actual AS/400 formatted JVM args */ >+ } >+ free(jvmPropBuf_X); >+ free(jvmPropBuf_D); >+ >+ return as400arg4; >+} >+ >+#if 0 /* Code to clean up file descriptors */ >+/* 239720 */ >+void hc_initProcessStdioList() { >+ int i; >+ for(i = 0; i < MAX_FD; i++) { >+ processStdioList[i].pid = -1; >+ processStdioList[i].in = -1; >+ processStdioList[i].out = -1; >+ processStdioList[i].err = -1; >+ } >+} >+ >+void hc_addToProcessStdioList(PID pid, int in, int out, int err) { >+ int i = 0; >+ BOOL done = FALSE; >+ >+ while((i < MAX_FD) && (!done)) { >+ if(processStdioList[i].pid == -1) { /* found an empty spot */ >+ processStdioList[i].pid = pid; >+ processStdioList[i].in = in; >+ processStdioList[i].out = out; >+ processStdioList[i].err = err; >+ done = TRUE; >+ } >+ i++; >+ } >+ if(!done) { >+ } >+ >+ return; >+} >+ >+void hc_removeFromProcessStdioList(PID pid) { >+ int i = 0; >+ BOOL done = FALSE; >+ >+ while((i < MAX_FD) && (!done)) { >+ if(processStdioList[i].pid == pid) { /* found the pid */ >+ close(processStdioList[i].in); >+ close(processStdioList[i].out); >+ close(processStdioList[i].err); >+ processStdioList[i].pid = -1; >+ processStdioList[i].in = -1; >+ processStdioList[i].out = -1; >+ processStdioList[i].err = -1; >+ done = TRUE; >+ } >+ i++; >+ } >+ if(!done) { >+ } >+ else { >+ } >+ >+ return; >+} >+/* 239720 */ >+#endif >+ >+#endif >Index: src-native-new/src/agents/perfmon/resutils/DataCollectionInterface.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/DataCollectionInterface.h >diff -N src-native-new/src/agents/perfmon/resutils/DataCollectionInterface.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/DataCollectionInterface.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: DataCollectionInterface.h,v 1.3 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+#ifndef __DATACOLLECTION_H__ >+#define __DATACOLLECTION_H__ >+ >+#include "system.h" >+#include "hashtable.h" >+ >+static char* DC_KEY_WAITTIME = "DC_WAITTIME"; >+static char* REGET_CHILDREN = "REGET_CHILDREN"; >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+#if defined(LINUX) || defined(SOLARIS) >+char* DC_CollectionGetAgentName(); >+char** DC_CollectionGetTree (int* numresults); >+char** DC_CollectionGetResults (int* numresults); >+int DC_CollectionStartup(HashTable* hasht_variables, HashTable* hasht_filters, HashTable* hasht_tree); >+int DC_CollectionShutdown(); >+#else >+__declspec(dllexport) char* DC_CollectionGetAgentName(); >+__declspec(dllexport) char** DC_CollectionGetTree (int* numresults); >+__declspec(dllexport) char** DC_CollectionGetResults (int* numresults); >+__declspec(dllexport) int DC_CollectionStartup(HashTable* hasht_variables, HashTable* hasht_filters, HashTable* hasht_tree); >+__declspec(dllexport) int DC_CollectionShutdown(); >+#endif >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif >Index: src-native-new/src/agents/perfmon/PerfmonAgent/cominterface.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/PerfmonAgent/cominterface.h >diff -N src-native-new/src/agents/perfmon/PerfmonAgent/cominterface.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/PerfmonAgent/cominterface.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,34 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: cominterface.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+////////////////////////////////////////////////////////////// >+// The function definitions for the communicationsDLL >+////////////////////////////////////////////////////////////// >+// >+// The four function defintions to be implemented by the custom >+// communications DLL. >+// >+////////////////////////////////////////////////////////////// >+ >+#ifndef __COM_INTERFACE__H__ >+#define __COM_INTERFACE__H__ >+ >+#include "system.h" >+#include "hashtable.h" >+ >+typedef int (*LPCOMSTARTUP)(HashTable*, HashTable*, HashTable*); >+typedef int (*LPCOMSHUTDOWN)(); >+typedef int (*LPCOMSENDMESSAGE)(char*, int, int); >+typedef int (*LPCOMSETAGENTNAME)(char*); >+ >+#endif >+ >Index: src-native-new/src/agents/perfmon/WinBuild/sysperf.dsp >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/sysperf.dsp >diff -N src-native-new/src/agents/perfmon/WinBuild/sysperf.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/sysperf.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,131 @@ >+# Microsoft Developer Studio Project File - Name="sysperf" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=sysperf - Win32 Release >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "sysperf.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "sysperf.mak" CFG="sysperf - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "sysperf - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "sysperf - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "sysperf - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "Release" >+# PROP BASE Intermediate_Dir "Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib rac.lib mpr.lib /nologo /dll /machine:I386 /libpath:"..\..\..\..\lib" /out:"..\..\..\..\bin\sysperf.dll" >+# SUBTRACT LINK32 /pdb:none >+ >+!ELSEIF "$(CFG)" == "sysperf - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "sysperf___Win32_Debug" >+# PROP BASE Intermediate_Dir "sysperf___Win32_Debug" >+# PROP BASE Ignore_Export_Lib 0 >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\resutils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYSPERF_EXPORTS" /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib rac.lib /nologo /dll /machine:I386 >+# SUBTRACT BASE LINK32 /pdb:none >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib rac.lib mpr.lib /nologo /dll /machine:I386 /libpath:"..\..\..\..\lib" /out:"..\..\..\..\bin\sysperf.dll" >+# SUBTRACT LINK32 /pdb:none >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "sysperf - Win32 Release" >+# Name "sysperf - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\sysperf\perfcalc.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\sysperf\perfcontrol.c >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\sysperf\perfcalc.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\sysperf\perfconstants.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\sysperf\perfcontrol.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\sysperf\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/native/java_profiler/filters.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/filters.h >diff -N src-native-new/src/agents/native/java_profiler/filters.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/filters.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,133 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: filters.h,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __FILTERS_H__ >+ #define __FILTERS_H__ 1 >+ >+ >+#define FILTER_LIST_INCREMENT 100 >+#define TRIGGER_LIST_INCREMENT 100 >+#define MAX_METHOD_FILTERS_PER_CLASS 5 >+ >+enum FilterMode {EXCLUDE = 0, INCLUDE = 1}; >+enum GenericPattern {NONE, PREFIX, SUFFIX}; >+ >+extern char _setPathDelimiter; >+ >+ >+typedef struct { >+ enum FilterMode mode; >+ enum GenericPattern genericPattern; >+ unsigned int patternLength; >+ char * pattern; >+}MethodFilter_t; >+ >+typedef struct { >+ enum GenericPattern genericPattern; >+ unsigned int methodDetailCount; >+ MethodFilter_t methodDetails[MAX_METHOD_FILTERS_PER_CLASS]; /* Initial limit of specific methods per class */ >+ unsigned int patternLength; >+ char * pattern; >+}Filter; >+ >+ >+typedef struct { >+ unsigned int methodnameLength; >+ char *methodname; >+ unsigned int classnameLength; >+ char *classname; >+ int count; >+}Trigger; >+ >+/* 174190 commented out because not necessary - not used in any other file >+extern Filter *_jvmpiAgent_Filters; >+*/ >+/* >+ This function is used in standalone mode to read and parse a file containing a set of filter >+ definitions. It uses the jvmpiAgent_AddFilter and jvmpiAgent_ApplyFilters functions to >+ actually set the active filter definitions for the agent. >+*/ >+int jvmpiAgent_processFilters(char * fileName); >+ >+/** jvmpiAgent_checkMethodFilters ***************************************************************** >+ * This function determines whether a method is to be INCLUDED or EXCLUDED. This can occur if >+ * the class filter has a matching method filter, or if the class filter itself is NULL, i.e., >+ * the class does not match any existing filter. >+ * >+ * @param mthd_name the method name to match >+ * @param cls_fltr the matching filter for this class >+ * @returns INCLUDE or EXCLUDE as is appropriate. >+ */ >+int jvmpiAgent_checkMethodFilters(char *mthd_name, Filter *cls_fltr); >+ >+/** jvmpiAgent_getFilter ************************************************************************** >+ * This function returns the first class filtering that matches the class and method names. >+ * >+ * @param cls_name the class name to match >+ * @param mthd_name the method name to match >+ * @returns the first matching class filter, or NULL if none is found. >+ */ >+Filter *jvmpiAgent_getFilter(char *cls_name, char *mthd_name); >+ >+/* >+ This function outputs the currently active filter definitions as elements in the trace. >+*/ >+void jvmpiAgent_printFilters(); >+ >+/* >+ This function is takes the filter definitions accumulated using the jvmpiAgent_AddFilter function, >+ and replaces the current set of active filter definitions. In addition, the accumlated filter definitions >+ are cleared. >+ Note: It is recommended that the JVM be suspended during the execution of this function in order >+ to avoid accessing the filter definitions while they are in an indeterminate state. >+*/ >+void jvmpiAgent_applyFilters(); >+ >+/** jvmpiAgent_addFilter ************************************************************************** >+ * This function appends a new filter using the class and method patterns with the filtering >+ * mode. The filters are saved in an ordered list, and the order in which they are inserted >+ * makes a difference. The filters will not be used until they are applied by calling >+ * jvmpiAgent_ApplyFilters(). NULL, empty strings, and '*'s are all treated as wildcard >+ * characters. >+ * >+ * @param cls_ptrn the pattern to match a class >+ * @param mthd_ptrn the method pattern to match >+ * @param mode whether the method will be INCLUDED or EXCLUDED >+ */ >+void jvmpiAgent_addFilter(char *classPattern, char *methodPattern, enum FilterMode mode); >+ >+/** jvmpiAgent_getClassFilterMode ***************************************************************** >+ * This function determines whether a class is to be INCLUDED or EXCLUDED. This can occur if >+ * the class filter has a wildcard method filter, or if the class filter itself is NULL, i.e., >+ * the class does not match any existing filter. >+ * >+ * @param cls_fltr the matching filter for this class >+ * @returns INCLUDE or EXCLUDE as is appropriate. >+ */ >+enum FilterMode jvmpiAgent_getClassFilterMode(Filter *cls_fltr); >+ >+/* Initialize the Filter data structures */ >+void jvmpiAgent_initializeFilters(char pathChar); >+ >+void jvmpiAgent_initializeTriggers(char pathChar); >+ >+void jvmpiAgent_changeDelimiter(void); >+ >+int jvmpiAgent_processTriggers(char *filename); >+ >+int jvmpiAgent_checkTrigger(char *className, char *methodName); >+ >+int jvmpiAgent_addTrigger(char *methodname, char *classname, int count); >+ >+void jvmpiAgent_applyTriggers(); >+ >+#endif >Index: src-native-new/src/agents/java/hcjbnd.def >=================================================================== >RCS file: src-native-new/src/agents/java/hcjbnd.def >diff -N src-native-new/src/agents/java/hcjbnd.def >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/hcjbnd.def 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,9 @@ >+LIBRARY hcjbnd >+DESCRIPTION "Externalized LogAgent API" >+EXPORTS >+ logAgent_getCurrentProcessId @1 >+ logAgent_getCurrentThreadId @2 >+ logAgent_registerAgent @3 >+ logAgent_deregisterAgent @4 >+ logAgent_logMessage @5 >+ logAgent_logMessage_return @6 >Index: src-native-new/src/agents/perfmon/WinBuild/resutils.mak >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/resutils.mak >diff -N src-native-new/src/agents/perfmon/WinBuild/resutils.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/resutils.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,249 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on resutils.dsp >+!IF "$(CFG)" == "" >+CFG=resutils - Win32 Release >+!MESSAGE No configuration specified. Defaulting to resutils - Win32 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "resutils - Win32 Release" && "$(CFG)" != "resutils - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "resutils.mak" CFG="resutils - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "resutils - Win32 Release" (based on "Win32 (x86) Static Library") >+!MESSAGE "resutils - Win32 Debug" (based on "Win32 (x86) Static Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "resutils - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\resutils.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\clock.obj" >+ -@erase "$(INTDIR)\hashtable.obj" >+ -@erase "$(INTDIR)\library.obj" >+ -@erase "$(INTDIR)\mutex.obj" >+ -@erase "$(INTDIR)\random.obj" >+ -@erase "$(INTDIR)\streq.obj" >+ -@erase "$(INTDIR)\thread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\resutils.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\resutils.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\resutils.bsc" >+BSC32_SBRS= \ >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\resutils.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\clock.obj" \ >+ "$(INTDIR)\hashtable.obj" \ >+ "$(INTDIR)\library.obj" \ >+ "$(INTDIR)\mutex.obj" \ >+ "$(INTDIR)\random.obj" \ >+ "$(INTDIR)\streq.obj" \ >+ "$(INTDIR)\thread.obj" >+ >+"$(OUTDIR)\resutils.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "resutils - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\resutils.lib" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\clock.obj" >+ -@erase "$(INTDIR)\hashtable.obj" >+ -@erase "$(INTDIR)\library.obj" >+ -@erase "$(INTDIR)\mutex.obj" >+ -@erase "$(INTDIR)\random.obj" >+ -@erase "$(INTDIR)\streq.obj" >+ -@erase "$(INTDIR)\thread.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\resutils.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\resutils.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\resutils.bsc" >+BSC32_SBRS= \ >+ >+LIB32=link.exe -lib >+LIB32_FLAGS=/nologo /out:"$(OUTDIR)\resutils.lib" >+LIB32_OBJS= \ >+ "$(INTDIR)\clock.obj" \ >+ "$(INTDIR)\hashtable.obj" \ >+ "$(INTDIR)\library.obj" \ >+ "$(INTDIR)\mutex.obj" \ >+ "$(INTDIR)\random.obj" \ >+ "$(INTDIR)\streq.obj" \ >+ "$(INTDIR)\thread.obj" >+ >+"$(OUTDIR)\resutils.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS) >+ $(LIB32) @<< >+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("resutils.dep") >+!INCLUDE "resutils.dep" >+!ELSE >+!MESSAGE Warning: cannot find "resutils.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "resutils - Win32 Release" || "$(CFG)" == "resutils - Win32 Debug" >+SOURCE=..\resutils\clock.c >+ >+"$(INTDIR)\clock.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\hashtable.c >+ >+"$(INTDIR)\hashtable.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\library.c >+ >+"$(INTDIR)\library.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\mutex.c >+ >+"$(INTDIR)\mutex.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\random.c >+ >+"$(INTDIR)\random.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\streq.c >+ >+"$(INTDIR)\streq.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\resutils\thread.c >+ >+"$(INTDIR)\thread.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/native/java_profiler/filters.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/filters.c >diff -N src-native-new/src/agents/native/java_profiler/filters.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/filters.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,657 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: filters.c,v 1.4 2005/03/24 17:42:29 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+/* >+ * >+ * Source File Name = filters.c >+ * >+ * Descriptive Name = Profiling Agent filter handling code >+ * >+ * Function: >+ * jvmpiAgent_initializeFilters >+ * jvmpiAgent_checkFilters >+ * parseFilterPattern >+ * jvmpiAgent_addFilter >+ * jvmpiAgent_applyFilters >+ * jvmpiAgent_processFilters >+ * jvmpiAgent_printFilters >+ * >+ * Defines: >+ * >+ * Dependencies: >+ * None >+ * >+ * Restrictions: >+ * None >+ * >+ * Change Activity: >+ * Defect Date Who Description >+ * ====== =========== === ============================================== >+ * 2001 rkd Initial drop >+ * 173995 May/15/2001 dns Fixed bugs causing heap corruption >+ * 174190 May/30/2001 dns 390 Porting changes >+ * >+ ******************************************************************************/ >+ >+ >+#if (defined _HPUX || defined _AIX || defined _SOLARIS) >+ #include <inttypes.h> >+#elif defined __linux__ >+ #include <stdint.h> >+#else >+ #define INT32_MAX 2147483647 >+#endif >+ >+ >+#include <string.h> >+#include <stdio.h> >+#include <stdlib.h> >+#include "filters.h" >+#include "JvmpiWriter.h" >+#include "print.h" >+#include "utility.h" >+ >+static Filter *_jvmpiAgent_Filters = NULL; /* Pointer to a list of active Filter elements 174190 made static */ >+static int _filterCount = 0; /* Number of active Filter elements in list */ >+static int _filterListSize = FILTER_LIST_INCREMENT; /* Current size (in # of Filter elements) of >+ the pending Filter element buffer */ >+static Filter *_filterListBuffer = 0; /* Pointer to a list of pending Filter elements */ >+static int _filterListBufferCount = 0; /* Number of pending Filter elements in list */ >+static char _pathDelimiter; >+ >+static Trigger *_jvmpiAgent_Triggers =NULL; >+static Trigger *_triggerListBuffer =0; >+static int _triggerListBufferCount =0; >+static int _triggerCount =0; >+static int _triggerListSize =TRIGGER_LIST_INCREMENT; >+ >+/* Start literal conversions from ebcdic to ascii for OS400 */ >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ >+/* >+ This function initializes the data structures used by the filter mechanism. >+*/ >+void jvmpiAgent_initializeFilters(char pathDelimiter) >+{ >+ _jvmpiAgent_Filters = (Filter *)jvmpiAgent_Calloc(sizeof(Filter)*FILTER_LIST_INCREMENT); >+ _filterListBuffer = (Filter *)jvmpiAgent_Calloc(sizeof(Filter)*FILTER_LIST_INCREMENT); >+ _pathDelimiter = pathDelimiter; >+} >+ >+ >+/** str_fits_ptrn ********************************************************************************* >+ * This function returns a non-zero value if the string matches the pattern, or a zero. The >+ * input pointers can be empty srings, but cannot be NULL. All strings and patterns, including >+ * the empty ones are handled properly. >+ * >+ * @param str the string to match the pattern >+ * @param ptrn the pattern to match the string >+ * @param ptrn_type the type of the pattern >+ * @param ptrn_len the length of the pattern >+ * @returns a non-zero value if the string fits into the pattern, or zero otherwise. >+ */ >+int str_fits_ptrn(const char* str, const char* ptrn, const int ptrn_type, const int ptrn_len) { >+ int off; /* the offset of the start of comparison in a prefix match */ >+ >+ if (str == 0 || ptrn == 0) { >+ return 0; >+ } >+ >+ /* A zero-length (empty) pattern matches all strings including the empty ones. Otherwise, an exact >+ match, prefix, or suffix match will be performed. The first case is really not really a special >+ case as it has already been coverted under the other three. So, this case is really included >+ for clarity purposes only. */ >+ return !ptrn_len || >+ (ptrn_type == NONE && !strcmp(ptrn, str)) || >+ (ptrn_type == PREFIX && (off = strlen(str) - ptrn_len) >= 0 && !strcmp(ptrn, str + off)) || >+ (ptrn_type == SUFFIX && !strncmp(ptrn, str, ptrn_len)); >+} >+ >+ >+/** match_mthd_fltr ******************************************************************************* >+ * This function returns the first method filter from the class filter list, matching the method >+ * name. >+ * >+ * @param mthd_fltr_lst the method filter list from which a match is searched >+ * @param mthd_fltr_lst_len the length of the above list >+ * @param mthd_name the method name to match >+ * @returns the first matching method filter, or NULL if none is found. >+ */ >+MethodFilter_t *match_mthd_fltr(MethodFilter_t *mthd_fltr_lst, const unsigned int mthd_fltr_lst_len, const char *mthd_name) { >+ unsigned int i; /* the loop control variable */ >+ MethodFilter_t *mthd_fltr; /* a method filter from a class filter */ >+ >+ /* Iterate through the method filter list to find the first matching method filter. */ >+ for (i = 0; i < mthd_fltr_lst_len; i++) { >+ >+ mthd_fltr = mthd_fltr_lst + i; >+ if (str_fits_ptrn(mthd_name, mthd_fltr -> pattern, mthd_fltr -> genericPattern, mthd_fltr -> patternLength)) { >+ return mthd_fltr; >+ } >+ } >+ return NULL; >+} >+ >+ >+/** match_cls_mthd_fltr *************************************************************************** >+ * This function returns the first class filter from the class filter list, matching the class >+ * and method names. If the method name supplied is an empty string, the first matching class >+ * filter with a wildcard method filter will be picked. >+ * >+ * @param cls_fltr_lst the class filter list from which a match is searched >+ * @param cls_fltr_lst_len the length of the above list >+ * @param cls_name the class name to match >+ * @param mthd_name the method name to match >+ * @returns the first matching class filter, or NULL if none is found. >+ */ >+Filter *match_cls_mthd_fltr(Filter *cls_fltr_lst, int cls_fltr_lst_len, char *cls_name, char *mthd_name) { >+ int i; /* the loop control variable */ >+ Filter *cls_fltr; /* a class filter from the filter list */ >+ MethodFilter_t *mthd_fltr; /* a method filter from a class filter */ >+ char *reg_cls_name; /* the class name without JNI style array notation */ >+ >+ /* bugzilla 70263 - remove the array notation from the front of a class name so we filter >+ array classes as well. For example, if the class name is '[[Ljava.lang.Thread', the >+ following code will set reg_cls_name to 'java.lang.Thread'. */ >+ >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ reg_cls_name = strrchr(cls_name,'['); /* returns the last occurence of '[' */ >+ if (reg_cls_name != NULL && reg_cls_name[1] == 'L') { >+ reg_cls_name += 2; /* skip to the point after the 'L' */ >+ } else { >+ reg_cls_name = cls_name; >+ } >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ >+ >+ /* Iterate through the class filter list to find the first filter matching the class and method names. */ >+ for (i = 0; i < cls_fltr_lst_len; i++) { >+ >+ cls_fltr = cls_fltr_lst + i; >+ if (!str_fits_ptrn(reg_cls_name, cls_fltr -> pattern, cls_fltr -> genericPattern, cls_fltr -> patternLength)) { >+ continue; >+ } >+ mthd_fltr = match_mthd_fltr(cls_fltr -> methodDetails, cls_fltr -> methodDetailCount, mthd_name); >+ if (mthd_fltr) { >+ return cls_fltr; >+ } >+ } >+ return NULL; >+} >+ >+ >+/** jvmpiAgent_getFilter ************************************************************************** >+ * This function returns the first class filter that matches the class and method names. >+ * >+ * @param cls_name the class name to match >+ * @param mthd_name the method name to match >+ * @returns the first matching class filter, or NULL if none is found. >+ */ >+Filter *jvmpiAgent_getFilter(char *cls_name, char *mthd_name) { >+ >+ return match_cls_mthd_fltr(_jvmpiAgent_Filters, _filterCount, cls_name, mthd_name); >+} >+ >+ >+/** jvmpiAgent_getClassFilterMode ***************************************************************** >+ * This function determines whether a class is to be INCLUDED or EXCLUDED. This can occur if >+ * the class filter has a wildcard method filter, or if the class filter itself is NULL, i.e., >+ * the class does not match any existing filter. >+ * >+ * @param cls_fltr the matching filter for this class >+ * @returns INCLUDE or EXCLUDE as is appropriate. >+ */ >+enum FilterMode jvmpiAgent_getClassFilterMode(Filter *cls_fltr) { >+ MethodFilter_t *mthd_fltr; /* the method filter for the default methods */ >+ >+ mthd_fltr = cls_fltr ? match_mthd_fltr(cls_fltr -> methodDetails, cls_fltr -> methodDetailCount, "") : NULL; >+ return mthd_fltr ? mthd_fltr -> mode : INCLUDE; >+} >+ >+ >+/** jvmpiAgent_checkMethodFilters ***************************************************************** >+ * This function determines whether a method is to be INCLUDED or EXCLUDED. This can occur if >+ * the class filter has a matching method filter, or if the class filter itself is NULL, i.e., >+ * the class does not match any existing filter. >+ * >+ * @param mthd_name the method name to match >+ * @param cls_fltr the matching filter for this class >+ * @returns INCLUDE or EXCLUDE as is appropriate. >+ */ >+int jvmpiAgent_checkMethodFilters(char *mthd_name, Filter *cls_fltr) { >+ MethodFilter_t *mthd_fltr; /* the method filter for the default methods */ >+ >+ mthd_fltr = cls_fltr ? match_mthd_fltr(cls_fltr -> methodDetails, cls_fltr -> methodDetailCount, mthd_name) : NULL; >+ return (mthd_fltr ? mthd_fltr -> mode : INCLUDE); >+} >+ >+ >+/* >+ This function takes a filterpattern and determines if it is a prefix (leading "*"), suffix (trailing "*"), or >+ exact match (no "*") type pattern. It returns the type and adjusts the pointer to the filterPattern buffer >+ to exclude the "*") >+*/ >+static enum GenericPattern parseFilterPattern(char ** filterPattern) >+{ >+ enum GenericPattern genericPattern; >+ >+ char *p = strchr(*filterPattern, '*'); >+ if(_setPathDelimiter) >+ { >+ _pathDelimiter = _setPathDelimiter; >+ } >+ if (p == NULL) >+ { >+ genericPattern = NONE; >+ } >+ else if (p == *filterPattern) >+ { >+ genericPattern = PREFIX; >+ (*filterPattern)++; /* Bump the buffer pointer past the "*" */ >+ } >+ else if (p == (*filterPattern + strlen(*filterPattern)-1)) >+ { >+ genericPattern = SUFFIX; >+ *p = '\0'; /* Truncate the buffer to eliminate the "*" */ >+ } >+ else >+ { >+ /* Error "*" found imbedded within pattern */ >+ genericPattern = NONE; >+ } >+ >+ /* >+ Translate the path delimiter character specified in the filterPattern to the path delimiter >+ character used by the current JVM (this value was specified during filter initialization. >+ */ >+ if (_pathDelimiter == '.') >+ { >+ int i; >+ for (i=strlen(*filterPattern)-1; i >= 0; i--) >+ { >+ if ((*filterPattern)[i] == '/') (*filterPattern)[i] = '.'; >+ } >+ } >+ else if (_pathDelimiter == '/') >+ { >+ int i; >+ for (i=strlen(*filterPattern)-1; i >= 0; i--) >+ { >+ if ((*filterPattern)[i] == '.') (*filterPattern)[i] = '/'; >+ } >+ } >+ return genericPattern; >+ >+} >+ >+ >+/** get_cls_fltr ********************************************************************************** >+ * This function returns a matching class filtering from the class filter list provided, >+ * or a NULL pointer if none is found. Matching filters must share the same filter pattern, >+ * type, and length. >+ * >+ * @param cls_fltr_lst the class filter list from which a match is searched >+ * @param cls_fltr_lst_len the length of the above list >+ * @param cls_ptrn the class pattern to match >+ * @param cls_ptrn_type the type of the class pattern to match >+ * @param cls_ptrn_len the length of the class pattern to match >+ */ >+Filter *get_cls_fltr(Filter *cls_fltr_lst, unsigned int cls_fltr_lst_len, >+ char *cls_ptrn, enum GenericPattern cls_ptrn_type, unsigned int cls_ptrn_len) { >+ unsigned int i; /* the loop control variable */ >+ Filter *cls_fltr; /* a class filter from the filter list */ >+ >+ for (i = 0; i < cls_fltr_lst_len; i++) { >+ >+ cls_fltr = cls_fltr_lst + i; >+ if (cls_fltr -> patternLength == cls_ptrn_len && >+ cls_fltr -> genericPattern == cls_ptrn_type && >+ !strcmp(cls_fltr -> pattern, cls_ptrn)) { >+ return cls_fltr; >+ } >+ } >+ return NULL; >+} >+ >+ >+/** get_mthd_fltr ********************************************************************************* >+ * This function returns a matching method filtering from the method filter list provided, >+ * or a NULL pointer if none is found. Matching filters must share the same filter pattern, >+ * type, and length. >+ * >+ * @param mthd_fltr_lst the method filter list from which a match is searched >+ * @param mthd_fltr_lst_len the length of the above list >+ * @param mthd_ptrn the method pattern to match >+ * @param mthd_ptrn_type the type of the method pattern to match >+ * @param mthd_ptrn_len the length of the method pattern to match >+ */ >+MethodFilter_t *get_mthd_fltr(MethodFilter_t *mthd_fltr_lst, unsigned int mthd_fltr_lst_len, >+ char *mthd_ptrn, enum GenericPattern mthd_ptrn_type, unsigned int mthd_ptrn_len) { >+ unsigned int i; /* the loop control variable */ >+ MethodFilter_t *mthd_fltr; /* a method filter from the filter list */ >+ >+ for (i = 0; i < mthd_fltr_lst_len; i++) { >+ mthd_fltr = mthd_fltr_lst + i; >+ if (mthd_fltr -> patternLength == mthd_ptrn_len && >+ mthd_fltr -> genericPattern == mthd_ptrn_type && >+ !strcmp(mthd_fltr -> pattern, mthd_ptrn)) { >+ return mthd_fltr; >+ } >+ } >+ return NULL; >+} >+ >+ >+/** jvmpiAgent_addFilter ************************************************************************** >+ * This function appends a new filter using the class and method patterns with the filtering >+ * mode. The filters are saved in an ordered list, and the order in which they are inserted >+ * makes a difference. The filters will not be used until they are applied by calling >+ * jvmpiAgent_ApplyFilters(). NULL, empty strings, and '*'s are all treated as wildcard >+ * characters. >+ * >+ * @param cls_ptrn the pattern to match a class >+ * @param mthd_ptrn the method pattern to match >+ * @param mode whether the method will be INCLUDED or EXCLUDED >+ */ >+void jvmpiAgent_addFilter(char *cls_ptrn, char *mthd_ptrn, enum FilterMode mode) { >+ Filter *cls_fltr; /* the class filter to add or modify */ >+ MethodFilter_t *mthd_fltr; /* the method filter to add or modify */ >+ enum GenericPattern cls_ptrn_type, mthd_ptrn_type; /* the class and method pattern types */ >+ unsigned int cls_ptrn_len, mthd_ptrn_len; /* the class and method pattern lengths */ >+ >+#ifdef MVS /* 174190 */ >+ if (cls_ptrn != NULL) { >+ __etoa(cls_ptrn); >+ } >+ if (mthd_ptrn != NULL) { >+ __etoa(mthd_ptrn); >+ } >+#elif __OS400__ >+ if (cls_ptrn != NULL) { >+ cls_ptrn = as400_etoa(cls_ptrn); >+ } >+ if (mthd_ptrn != NULL) { >+ mthd_ptrn = as400_etoa(mthd_ptrn); >+ } >+#endif >+ >+ /* Ensure that NULL pointers are replaced with empty strings to eliminate special cases. */ >+ if (cls_ptrn == NULL) { >+ cls_ptrn = ""; >+ } >+ if (mthd_ptrn == NULL) { >+ mthd_ptrn = ""; >+ } >+ >+ /* Try to locate an existing class filter. Create a new class filter if none found. */ >+ cls_ptrn_type = parseFilterPattern(&cls_ptrn); >+ cls_ptrn_len = strlen(cls_ptrn); >+ cls_fltr = get_cls_fltr(_filterListBuffer, _filterListBufferCount, cls_ptrn, cls_ptrn_type, cls_ptrn_len); >+ if (!cls_fltr) { >+ >+ /* Enlarge the filter buffer if necessary. */ >+ if (_filterListBufferCount >= _filterListSize) { >+ _filterListSize += FILTER_LIST_INCREMENT; >+ _filterListBuffer = (Filter *) realloc(_filterListBuffer, _filterListSize); >+ } >+ >+ /* Create the class filter for this method. */ >+ cls_fltr = _filterListBuffer + _filterListBufferCount; >+ cls_fltr -> genericPattern = cls_ptrn_type; >+ cls_fltr -> patternLength = cls_ptrn_len; >+ cls_fltr -> pattern = (char *) jvmpiAgent_Calloc(cls_ptrn_len + 1); >+ strcpy(cls_fltr -> pattern, cls_ptrn); >+ cls_fltr -> methodDetailCount = 0; >+ _filterListBufferCount++; >+ >+ } else if (cls_fltr -> methodDetailCount >= MAX_METHOD_FILTERS_PER_CLASS) { >+ >+ /* If there is no more room for the method filter, the filter will be dropped. */ >+ return; >+ } >+ >+ /* If there already exists an identical filter, then the new filter will be ignored. */ >+ mthd_ptrn_type = parseFilterPattern(&mthd_ptrn); >+ mthd_ptrn_len = strlen(mthd_ptrn); >+ mthd_fltr = get_mthd_fltr(cls_fltr -> methodDetails, cls_fltr -> methodDetailCount, >+ mthd_ptrn, mthd_ptrn_type, mthd_ptrn_len); >+ if (mthd_fltr) { >+ return; >+ } >+ >+ /* Insert the method filter into the class filter. */ >+ mthd_fltr = cls_fltr -> methodDetails + cls_fltr -> methodDetailCount; >+ mthd_fltr -> genericPattern = mthd_ptrn_type; >+ mthd_fltr -> patternLength = mthd_ptrn_len; >+ strcpy((mthd_fltr -> pattern = (char *) jvmpiAgent_Calloc(mthd_ptrn_len + 1)), mthd_ptrn); >+ mthd_fltr -> mode = mode; >+ cls_fltr -> methodDetailCount++; >+} >+ >+ >+/* PR */ >+void jvmpiAgent_changeDelimiter() >+{ >+ >+ int i; >+ char sunch = '.'; >+ char *tempFilterPattern; >+ memcpy(_filterListBuffer, _jvmpiAgent_Filters, _filterCount * sizeof(Filter)); >+ for (i=0; i < _filterCount; i++) >+ { >+ int j = 0; >+ tempFilterPattern = _filterListBuffer[i].pattern; >+ for (j=strlen(tempFilterPattern)-1; j >= 0; j--) >+ { >+ if(_setPathDelimiter == sunch) >+ { >+ if(tempFilterPattern[j] == '/') >+ { >+ (tempFilterPattern[j] = sunch); >+ } >+ } >+ } >+ strcpy(_filterListBuffer[i].pattern, tempFilterPattern); >+ } >+ jvmpiAgent_applyFilters(); >+ >+} >+/* PR */ >+ >+/* >+ This function is used to replace the current set of filters with the pending set of filters. >+*/ >+void jvmpiAgent_applyFilters() >+{ >+ int i; >+ if (!_filterListBufferCount) return; /* Empty list so this may be an extaneous apply, so ignore it */ >+ >+ for (i=0; i < _filterCount; i++) /* 173995 - replaced _filterListBufferCount with _filterCount for loop upper bound */ >+ { >+#ifndef _DEBUG >+ free(_jvmpiAgent_Filters[i].pattern); >+#endif >+ _jvmpiAgent_Filters[i].pattern=NULL; >+ } >+ free(_jvmpiAgent_Filters); >+ _jvmpiAgent_Filters=NULL; >+ _jvmpiAgent_Filters = (Filter *)jvmpiAgent_Calloc(sizeof(Filter)*_filterListSize); >+ memcpy(_jvmpiAgent_Filters, _filterListBuffer, _filterListBufferCount * sizeof(Filter)); >+ _filterCount = _filterListBufferCount; >+ _filterListBufferCount = 0; >+ memset(_filterListBuffer, '\0', sizeof(Filter)*_filterListSize); >+ >+ /* After the filter process, we need to set the tracing flags of the primitive classes */ >+ jvmpiAgent_SetTracingFlagsOnPrimitives(); >+} >+ >+ >+int jvmpiAgent_processFilters(char * fileName) { >+ FILE * filterFile = NULL; >+ char classPattern[250]; >+ char methodPattern[250]; >+ char mode[100]; >+ >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+ __atoe(fileName); >+#elif __OS400__ >+#pragma convert(0) >+#endif >+ filterFile = fopen(fileName, "r"); >+ if (!filterFile) return -1; >+ >+ while (fscanf(filterFile, "%s %s %s\n", classPattern, methodPattern, mode) != EOF) { >+ jvmpiAgent_addFilter(classPattern, methodPattern, strcmp("INCLUDE", mode) == 0 ? INCLUDE : EXCLUDE); >+ } >+ fclose(filterFile); >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#elif __OS400__ >+#pragma convert(819) >+#endif >+ >+ jvmpiAgent_applyFilters(); >+ return 0; >+} >+ >+ >+void jvmpiAgent_printFilters() >+{ >+ int i; >+ for (i=0; i < _filterCount; i++) >+ { >+ jvmpiAgent_printFilter(jvmpiAgent_getThreadLocalStorage(0), &_jvmpiAgent_Filters[i]); >+ } >+} >+ >+ >+void jvmpiAgent_initializeTriggers(char pathDelimiter) { >+ _jvmpiAgent_Triggers = (Trigger *)jvmpiAgent_Calloc(sizeof(Trigger)*TRIGGER_LIST_INCREMENT); >+ _triggerListBuffer = (Trigger *)jvmpiAgent_Calloc(sizeof(Trigger)*TRIGGER_LIST_INCREMENT); >+ _pathDelimiter = pathDelimiter; >+} >+ >+ >+int jvmpiAgent_processTriggers(char *filename) { >+ FILE * triggerFile = NULL; >+ char methodname[256]; >+ char classname[1024]; >+ int count; >+ >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+ __atoe(filename); >+#elif __OS400__ >+#pragma convert(0) >+#endif >+ triggerFile = fopen(filename, "r"); >+ if(!triggerFile) { >+ return -1; >+ } >+ >+ while (fscanf(triggerFile, "%s %s %d\n", methodname, classname, &count) != EOF) { >+ /* printf("Processing Trigger: %s %s %d\n", methodname, classname, count); */ >+ jvmpiAgent_addTrigger(methodname, classname, count); >+ } >+ >+ fclose(triggerFile); >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#elif __OS400__ >+#pragma convert(819) >+#endif >+ jvmpiAgent_applyTriggers(); >+ return 0; >+} >+ >+int jvmpiAgent_checkTrigger(char *classname, char *methodname) { >+ int i; >+ for (i=0; i < _triggerCount; i++) { >+ Trigger *tp = &_jvmpiAgent_Triggers[i]; >+ if ((tp->methodname[0] == '*' || !strcmp(tp->methodname, methodname)) >+ && (tp->classname[0] == '*' || !strcmp(tp->classname, classname))) { >+ >+ return tp->count; >+ >+ } >+ } >+ return INT32_MAX; >+} >+ >+int jvmpiAgent_addTrigger(char *methodname, >+ char *classname, >+ int count) >+{ >+ if (_triggerListBufferCount >= _triggerListSize) { >+ /* Reallocate a larger buffer for the filters */ >+ _triggerListSize += TRIGGER_LIST_INCREMENT; >+ _triggerListBuffer = (Trigger *)realloc(_triggerListBuffer, _triggerListSize); >+ } >+ >+#ifdef MVS /* 174190 */ >+ __etoa(methodname); >+ __etoa(classname); >+#elif __OS400__ >+ if (methodname != NULL) { >+ methodname = as400_etoa(methodname); >+ } >+ if (classname != NULL) { >+ classname = as400_etoa(classname); >+ } >+#endif >+ >+ /* Set the length of the pattern and allocate and set the pattern into the list of pending filters */ >+ _triggerListBuffer[_triggerListBufferCount].methodnameLength = >+ strlen(methodname); >+ STRDUP(_triggerListBuffer[_triggerListBufferCount].methodname, >+ methodname); /* 236501 */ >+ _triggerListBuffer[_triggerListBufferCount].classnameLength = >+ strlen(classname); >+ STRDUP(_triggerListBuffer[_triggerListBufferCount].classname, >+ classname); >+ _triggerListBuffer[_triggerListBufferCount].count = count; >+ _triggerListBufferCount++; >+ return 0; >+} >+ >+void jvmpiAgent_applyTriggers() { >+ int i; >+ if (!_triggerListBufferCount) { >+ return; /* Empty list so this may be an extaneous apply, so ignore it */ >+ } >+ >+ for (i=0; i < _triggerCount; i++) { >+ free(_jvmpiAgent_Triggers[i].methodname); >+ _jvmpiAgent_Triggers[i].methodname=NULL; >+ free(_jvmpiAgent_Triggers[i].classname); >+ _jvmpiAgent_Triggers[i].classname=NULL; >+ } >+ free(_jvmpiAgent_Triggers); >+ _jvmpiAgent_Triggers=NULL; >+ >+ _jvmpiAgent_Triggers = (Trigger*)jvmpiAgent_Calloc(sizeof(Trigger)*_triggerListSize); >+ memcpy(_jvmpiAgent_Triggers, _triggerListBuffer, _triggerListBufferCount * sizeof(Trigger)); >+ _triggerCount = _triggerListBufferCount; >+ _triggerListBufferCount = 0; >+ BZERO(_triggerListBuffer, sizeof(Trigger)*_triggerListSize); >+} >+/* stop literal conversions from ebcdic to ascii for as400 */ >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >Index: src-native-new/src/agents/native/java_profiler/agentDebug.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/agentDebug.h >diff -N src-native-new/src/agents/native/java_profiler/agentDebug.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/agentDebug.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: agentDebug.h,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __AGENT_DEBUG__ >+#define __AGENT_DEBUG__ 1 >+ >+#include "hash.h" >+ >+ >+void jvmpiAgent_dumpStack(ThreadPrivateStorage *tps, char * buffer); >+ >+void jvmpiAgent_dumpJVMStack(JNIEnv *thread, char * buffer); >+ >+#endif >+ >Index: src-native-new/src/agents/perfmon/rac/rac.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/rac/rac.h >diff -N src-native-new/src/agents/perfmon/rac/rac.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/rac/rac.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,203 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: rac.h,v 1.4 2006/05/05 18:10:56 hsuwanda Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __RAC_H__ >+#define __RAC_H__ >+ >+#include "DataTransferInterface.h" >+#include "system.h" >+ >+#include "RASocket.h" >+#include "RADataTransfer.h" >+#include "RAShm.h" >+#include "RABindings.h" >+#include "hashtable.h" >+ >+//WINDOWS ONLY >+#ifdef WIN32 >+ #include "winsock2.h" /* Bug 134924 */ >+ #include "windows.h" >+ #include "winperf.h" >+#endif >+//END WINDOWS ONLY >+ >+#define RAC_HYADES_TYPED_EVENT 1 >+#define RAC_HYADES_MESSAGE_EVENT 2 >+#define RAC_HYADES_VERDICT_EVENT 3 >+#define RAC_HYADES_INVOCATION_EVENT 4 >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+ >+//these two are not important - RACStartup and RACShutdown are all that are required >+int RACLoadRacLibs(); >+int RACGetRacFuncs(); >+ >+//////////////////////////// >+// Performance data related functions >+//////////////////////////// >+ >+typedef struct { >+ char* name; >+ int tracing; >+ int index; >+// int type; >+ >+ //WINDOWS ONLY >+ BOOL enabled; >+ #ifdef WIN32 >+ DWORD win_id; >+ >+ BOOL isPrinted; >+ int type; >+ int id; >+ LONGLONG newTime; >+ LONGLONG oldTime; >+ LONGLONG perfFreq; >+ LONGLONG newTime100Ns ; >+ LONGLONG oldTime100Ns ; >+ LONGLONG counterValue[2]; >+ LONGLONG oldCounterValue[2]; >+ PPERF_OBJECT_TYPE perfObject; >+ unsigned short nameLength; >+// char *name; >+ LONGLONG preservedOldTime100Ns; >+ #endif >+ //END WINDOWS ONLY >+} PerformanceElement_t; >+ >+PerformanceElement_t* all_counters; >+int all_counters_len; >+ >+int RACGetCounters(PerformanceElement_t** counters, int* counters_len); >+int RACDestroyCountersArray(PerformanceElement_t* counters, int counters_len); >+void RACPrintCounters(PerformanceElement_t* counters, int counters_len); >+void RACSendAvailableCounters(); >+void RACSendCounterData(); >+void RACSetFrequency(int new_freq); >+int RACGetFrequency(); >+ >+//PRIVATE >+int RACGetPerfNames(char** names); >+int increaseBufferSize(char** buf, int* buflen); >+void RACTraceCounters(PerformanceElement_t* counters, int counters_len); >+int RACTraceStats(BOOL trace_counters); >+ >+//WINDOWS ONLY >+#ifdef WIN32 >+int RACTracePerfData(PERF_DATA_BLOCK *perfData, XINT64 time, BOOL trace_counters); >+ >+void updateCounters(PerformanceElement_t* _perfElements, PERF_DATA_BLOCK *, PPERF_OBJECT_TYPE perfObj, PPERF_COUNTER_DEFINITION curCntr, PPERF_COUNTER_BLOCK ptrToCntr, BOOL instanceCounter, BOOL firstInstance, BOOL lastCounter); >+void calculateCounters(PerformanceElement_t* _perfElements, PPERF_OBJECT_TYPE perfObj, PPERF_COUNTER_BLOCK ptrToCntr, char** buf, int* buf_ptr, int* buf_len, BOOL instanceCounter); >+void calculate(PerformanceElement_t * element, char** buf, int* buf_ptr, int* buf_len); >+void updatePerformanceElement(PerformanceElement_t* _perfElements, >+ PPERF_DATA_BLOCK perfData, >+ PPERF_OBJECT_TYPE perfObj, >+ PPERF_COUNTER_DEFINITION curCntr, >+ PPERF_COUNTER_BLOCK ptrToCntr, >+ BOOL instanceCounter, BOOL firstInstance, BOOL lastCounter); >+#endif >+//END WINDOWS ONLY >+ >+ >+//////////////////////////// >+// RAC Bindings functions >+//////////////////////////// >+ >+typedef RA_AGENT_HANDLE (*ra_initializeBindings_t)(const char *name, >+ const char *type, >+ ra_commandHandler_t handler, >+ BOOL standalone); >+ >+typedef TID* (*ra_startListener_t)(RA_AGENT_HANDLE handle, >+ char block); >+ >+typedef void (*ra_stopListener_t)(RA_AGENT_HANDLE handle); >+ >+typedef void (*ra_finalizeBindings_t)(RA_AGENT_HANDLE handle); >+ >+typedef void (*ra_sendMessage_t)(RA_AGENT_HANDLE handle, >+ ra_message_t *message); >+ >+ >+//////////////////////////// >+// RAC DataTransfer functions >+//////////////////////////// >+ >+typedef unsigned char* (*ra_allocateMessageBlock_t)(ra_uint_t length); >+ >+typedef unsigned char* (*ra_reallocateMessageBlock_t)(unsigned char *message, ra_uint_t length); >+ >+typedef void (*ra_freeMessageBlock_t)(unsigned char *message); >+ >+/** WRITE_MESSAGE_BLOCK ************************************************* >+ * DNS - replaced socket parm with target handle struct >+ * Writes a message to the specified target using the specified format. >+ * @param handle - the handle of the target to write the data to. >+ * @param format - the format to use >+ * @param message - the address of the start of the message. >+ * @param length - the number of bytes to write to fd. >+ * @returns - the number of bytes written to the socket. >+ */ >+typedef ra_uint_t (*ra_writeMessageBlock_t)(ra_data_target_hdl_t *handle, >+ ra_dataFormat_t format, >+ unsigned char *message, >+ ra_uint_t length); >+ >+///////////////////////////// >+// RAC Shared memory >+///////////////////////////// >+ >+typedef ra_shm_err_t (*ra_attachToShm_t)(char *name, ra_shm_handle_t **handle); >+ >+typedef ra_shm_err_t (*ra_stopFlushingShm_t)(ra_shm_handle_t **handle); >+ >+ >+///////////////////////////// >+// RAC Common >+///////////////////////////// >+ >+typedef void (*ra_setLastError_t)(ra_uint_t major, ra_uint_t minor); >+ >+ >+//////////////////////////// >+// Dynamically Loaded RAC functions >+//////////////////////////// >+ >+ra_initializeBindings_t ra_initializeBindings_f; >+ra_finalizeBindings_t ra_finalizeBindings_f; >+ra_startListener_t ra_startListener_f; >+ra_stopListener_t ra_stopListener_f; >+ra_sendMessage_t ra_sendMessage_f; >+ >+ra_allocateMessageBlock_t ra_allocateMessageBlock_f; >+ra_reallocateMessageBlock_t ra_reallocateMessageBlock_f; >+ra_freeMessageBlock_t ra_freeMessageBlock_f; >+ra_writeMessageBlock_t ra_writeMessageBlock_f; >+ >+ra_attachToShm_t ra_attachToShm_f; >+ra_stopFlushingShm_t ra_stopFlushingShm_f; >+ >+ra_setLastError_t ra_setLastError_f; >+ >+/*********************************************************************** >+ * EOF >+ ***********************************************************************/ >+ >+#ifdef __cplusplus >+} >+#endif >+ >+ >+#endif >Index: src-native-new/src/agents/native/java_profiler/agentDebug.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/agentDebug.c >diff -N src-native-new/src/agents/native/java_profiler/agentDebug.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/agentDebug.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,85 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: agentDebug.c,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include "agentDebug.h" >+#include "JvmpiWriter.h" >+#include "print.h" >+ >+#ifdef _SHOOTDEBUG >+ >+void jvmpiAgent_dumpStack(ThreadPrivateStorage *tps, char * buffer) >+{ >+ unsigned long i; >+ sprintf(buffer, "*****************************INTERNAL_STACK\n"); >+ jvmpiAgent_print(buffer); >+ >+ for (i=0; i < jvmpiAgent_TOS(tps); i++) >+ { >+ HashEntry *methodHashEntry = jvmpiAgent_Peek(tps, i)->methodHashEntry; >+ if (methodHashEntry) >+ { >+ jvmpiAgent_printMethod(methodHashEntry->u.methodEntry, buffer); >+ } >+ } >+} >+ >+ >+ >+void jvmpiAgent_dumpJVMStack(JNIEnv *thread, char * buffer) >+{ >+ int i,j,tos; >+ jint depth = 200; >+ JVMPI_CallTrace *callTraceBuffer = jvmpiAgent_Calloc(sizeof(JVMPI_CallTrace)); >+ ThreadLocalStorage *tps = jvmpiAgent_getThreadLocalStorage(thread, FALSE); >+ >+ sprintf(buffer, "*****************************JVM_STACK %d FRAMES\n",callTraceBuffer->num_frames); >+ jvmpiAgent_print(buffer); >+ >+ callTraceBuffer->env_id = thread; >+ callTraceBuffer->frames = jvmpiAgent_Calloc(depth *sizeof(JVMPI_CallFrame)); >+ _jvmpiAgent_jvmpiInterface->GetCallTrace(callTraceBuffer, depth); >+ >+ tos = jvmpiAgent_TOS(tps); >+ for (i = 0; i<callTraceBuffer->num_frames; i++) >+ { >+ HashEntry *methodHashEntry = jvmpiAgent_FindSymbol(callTraceBuffer->frames[i].method_id, Method_t, FALSE); >+ if (!methodHashEntry) >+ { >+ StackEntry *stackEntry; >+ jobjectID class_id = _jvmpiAgent_jvmpiInterface->GetMethodClass(callTraceBuffer->frames[i].method_id); >+ HashEntry *classHashEntry = jvmpiAgent_FindClassSymbol(class_id); >+ assert(0); >+ if (!classHashEntry && class_id != 0) >+ { >+ REQUEST_EVENT(JVMPI_EVENT_CLASS_LOAD, (void *)class_id); >+ } >+ methodHashEntry = jvmpiAgent_FindMethodSymbol(callTraceBuffer->frames[i].method_id); >+ tos = jvmpiAgent_TOS(tps); >+ for (j = 0; j < tos; j++) >+ { >+ stackEntry = jvmpiAgent_Peek(tps, j); >+ assert(methodHashEntry == stackEntry->methodHashEntry); >+ } >+ >+ jvmpiAgent_printMethod(methodHashEntry->u.methodEntry, buffer); >+ } >+ else >+ { >+ /* This is just a temporary path for debugging purposes. */ >+ /*jobjectID class_id = _jvmpiAgent_jvmpiInterface->GetMethodClass(callTraceBuffer->frames[i].method_id); */ >+ /*assert(class_id && methodHashEntry->u.methodEntry->classEntry->id == (jint)class_id); */ >+ jvmpiAgent_printMethod(methodHashEntry->u.methodEntry, buffer); >+ } >+ } >+} >+ >+#endif /* _DEBUG */ >Index: src-native-new/src/agents/perfmon/WinBuild/rac.mak64 >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/rac.mak64 >diff -N src-native-new/src/agents/perfmon/WinBuild/rac.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/rac.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,370 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on rac.dsp >+!IF "$(CFG)" == "" >+CFG=rac - IA64 Release >+!MESSAGE No configuration specified. Defaulting to rac - IA64 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "rac - IA64 Release" && "$(CFG)" != "rac - IA64 Debug" && "$(CFG)" != "rac - X64 Release" && "$(CFG)" != "rac - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "rac.mak64" CFG="rac - IA64 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "rac - IA64 Release" >+!MESSAGE "rac - IA64 Debug" >+!MESSAGE "rac - X64 Release" >+!MESSAGE "rac - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "rac - IA64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\rac.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\rac.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\rac.dll" >+ -@erase "$(OUTDIR)\..\lib\rac.exp" >+ -@erase "$(OUTDIR)\..\lib\rac.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /I "../../RABindings" /I "../../../transport/RACommon" /I "../../../transport/RASocket" /I "../../../transport/RADataTransfer" /I "../../../transport/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\rac.pdb" /out:"$(OUTDIR)\rac.dll" /implib:"$(OUTDIR)\..\lib\rac.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\rac.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\rac.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "rac - IA64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\rac.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\rac.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\rac.dll" >+ -@erase "$(OUTDIR)\..\lib\rac.exp" >+ -@erase "$(OUTDIR)\..\lib\rac.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /I "../../RABindings" /I "../../../transport/RACommon" /I "../../../transport/RASocket" /I "../../../transport/RADataTransfer" /I "../../../transport/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\rac.pdb" /out:"$(OUTDIR)\rac.dll" /implib:"$(OUTDIR)\..\lib\rac.lib" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\rac.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\rac.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "rac - X64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\rac.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\rac.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\rac.dll" >+ -@erase "$(OUTDIR)\..\lib\rac.exp" >+ -@erase "$(OUTDIR)\..\lib\rac.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /I "../../RABindings" /I "../../../transport/RACommon" /I "../../../transport/RASocket" /I "../../../transport/RADataTransfer" /I "../../../transport/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\rac.pdb" /out:"$(OUTDIR)\rac.dll" /implib:"$(OUTDIR)\..\lib\rac.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\rac.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\rac.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "rac - X64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\rac.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\rac.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\rac.dll" >+ -@erase "$(OUTDIR)\..\lib\rac.exp" >+ -@erase "$(OUTDIR)\..\lib\rac.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /I "../../RABindings" /I "../../../transport/RACommon" /I "../../../transport/RASocket" /I "../../../transport/RADataTransfer" /I "../../../transport/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\rac.pdb" /out:"$(OUTDIR)\rac.dll" /implib:"$(OUTDIR)\..\lib\rac.lib" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\rac.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\rac.dll" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "rac - IA64 Release" || "$(CFG)" == "rac - IA64 Debug" || "$(CFG)" == "rac - X64 Release" || "$(CFG)" == "rac - X64 Debug" >+SOURCE=..\rac\rac.c >+ >+"$(INTDIR)\rac.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\rac\version.rc >+ >+!IF "$(CFG)" == "rac - IA64 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\rac" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "rac - IA64 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\rac" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "rac - X64 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\rac" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "rac - X64 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\rac" /d "NDEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/native/java_profiler/performance.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/performance.h >diff -N src-native-new/src/agents/native/java_profiler/performance.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/performance.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,159 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: performance.h,v 1.4 2006/05/16 22:09:53 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef _PERFORMANCE_H_ >+#define _PERFORMANCE_H_ >+ >+#include "RAComm.h" >+ >+#if defined __cplusplus >+ extern "C" { >+#endif >+ >+#ifdef __cplusplus >+ #ifdef MVS >+ #define _inline inline >+ #endif >+#endif >+ >+#ifdef _HPUX >+ #define _inline >+#elif __linux__ >+ #include <stdint.h> >+ #define _inline inline >+#elif _SOLARIS >+ #define _inline >+#elif _AIX >+ #define _inline >+#elif __OS400__ >+ #define _inline >+#endif >+ >+#ifdef _SOLARIS >+ #ifndef _UINT64_T >+ #define _UINT64_T >+ typedef unsigned long long uint64_t; >+ #endif >+#endif >+ >+#ifdef _WIN32 >+ typedef unsigned __int64 Uint64; >+#else >+ #ifdef MVS >+ /* 189110 - uint64_t is now defined on MVS but not as long long so we won't use it here */ >+ typedef unsigned long long Uint64; >+ #elif __OS400__ >+ typedef unsigned long long Uint64; >+ #elif _HPUX >+ typedef unsigned long long Uint64; >+ #else >+ typedef uint64_t Uint64; >+ #endif >+#endif >+ >+ >+/* typedef int *atomic_p; */ >+ >+/** The goal of this file is to define some inline performance code >+ * for doing metrics on each of the processors supported. >+ */ >+typedef Uint64 timestamp_t; >+ >+extern unsigned int _ticksPerMicrosecond; >+extern double _startTimeAsDouble; >+extern timestamp_t _startTimeAsTicks; >+extern timestamp_t _startTime; >+ >+extern void determineTicksPerMicrosecond(int *bogus); >+ >+ >+static _inline timestamp_t timeToTicks(Uint64 seconds, Uint64 microsecondsRemainder) { >+ timestamp_t ticks; >+ Uint64 microseconds = seconds; >+ microseconds *= 1000000; >+ microseconds += microsecondsRemainder; >+ >+ ticks = microseconds * _ticksPerMicrosecond; >+ return ticks; >+} >+ >+static _inline double ticksToTime2(timestamp_t timestampInTicks, BOOL asInterval) { >+ double microseconds = (double)( >+#ifdef WIN32 >+ (__int64) >+#endif /* WIN32 */ >+ timestampInTicks) / _ticksPerMicrosecond; >+ if(asInterval) { >+ return microseconds/1000000; >+ } >+ else { >+ return microseconds/1000000 + _startTimeAsDouble; >+ } >+} >+#define TIMESTAMP_GREATER(A,B) ((A)>(B)) >+#define TIMESTAMP_ADD(A,B) A=(A)+(B) >+#define TIMESTAMP_ZERO(A) (*(A)) = 0 >+static _inline timestamp_t TIMESTAMP_SUB(timestamp_t A, timestamp_t B) { >+ return A-B; >+} >+ >+ >+/** COLLECT_START_TIME_INFORMATION ******************************************* >+ * Initialization routine for future use of jvmpiAgent_getCurrentTime(). >+ * This routine records the time at which this function was called and uses >+ * this time to determine what the current time is. >+ */ >+extern void jvmpiAgent_collectStartTimeInformation(); >+ >+/* GET_START_TIME ************************************************************ >+ * Returns a copy of the start time that was recorded with >+ * jvmpiAgent_collectStartTimeInformation >+ */ >+extern void jvmpiAgent_getStartTime(timestamp_t *time); >+ >+/* GET_CURRENT_TIME ********************************************************** >+ * Determins the current clock time and fills the timestamp_t structure >+ * with the data >+ */ >+extern void jvmpiAgent_getCurrentTime(timestamp_t *time); >+ >+/** GET_CURRENT_THREAD_CPU_TIME *********************************************** >+ * Returns the amount of CPU time consumed by this thread as a 64 bit number. >+ */ >+extern Uint64 jvmpiAgent_getCurrentThreadCPUTime(); >+ >+/** GET_PROCESS_START_TIME *************************************************** >+ * Returns the start time of the current process as a timestamp_t in UTC time. >+ */ >+extern void jvmpiAgent_getProcessStartTime(timestamp_t *time); >+ >+/** GET_TIMEZONE ************************************************************* >+ * Returns the current timezone as an offset, in minutes, working westward from >+ * GMT. ie. GMT+5 would be 300 as there are 300 minutes in 5 hours. >+ */ >+extern unsigned long jvmpiAgent_getTimezone(); >+ >+/********************************************************* >+ * DEBUG assists: >+ */ >+#if defined(_DEBUG) && !defined (MVS) && !defined (__OS400__) >+extern void debug_check_and_report_time_overflow(timestamp_t time, char *errMsg); /* 134577 */ >+#define DBG_CHK_AND_REPORT_TIME_OVERFLOW(A,B) debug_check_and_report_time_overflow(A,B) >+#else >+#define DBG_CHK_AND_REPORT_TIME_OVERFLOW(A,B) >+#endif >+ >+#if defined __cplusplus >+} >+#endif >+ >+#endif >Index: src-native-new/src/agents/perfmon/rac/rac.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/rac/rac.c >diff -N src-native-new/src/agents/perfmon/rac/rac.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/rac/rac.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,610 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: rac.c,v 1.14 2006/05/24 16:39:20 gchristelis Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+#ifdef WIN32 >+ #include <winsock2.h> /* Bug 134924 */ >+#endif >+#include "rac.h" >+#include "system.h" >+#include "hashtable.h" >+ >+int available = 0; >+int monitoring = 0; >+ >+unsigned char* msg_block; >+int msg_block_len; >+ >+XLibrary rac_hcbnd; >+XLibrary rac_hccldt; >+XLibrary rac_hccls; >+XLibrary rac_hcclsm; >+XLibrary rac_hcjbnd; >+XLibrary rac_hcclco; >+ >+//ra_commandHandler_t command_handler; >+ra_data_target_hdl_t targetHdl; >+ >+RA_AGENT_HANDLE agent_handle; >+TID* agent_tid; >+ >+PerformanceElement_t* counters; >+int counters_len = -1; //-1 = uninitialised >+ >+static memoryleak = 0; >+static int first = 0; >+ >+char* agent_type; >+ >+int VERBOSE = FALSE; >+int LOG_TO_FILE = FALSE; >+ >+//////////////////////////// >+// PERFMON SPECIFIC STUFF >+//////////////////////////// >+HashTable* perf_filters; >+HashTable* perf_variables; >+HashTable* perf_tree; >+//////////////////////////// >+// END PERFMON SPECIFIC STUFF >+//////////////////////////// >+ >+char digits[] = { >+'0' , '1' , '2' , '3' , '4' , '5' , >+'6' , '7' , '8' , '9' , 'a' , 'b' , >+'c' , 'd' , 'e' , 'f' , 'g' , 'h' , >+'i' , 'j' , 'k' , 'l' , 'm' , 'n' , >+'o' , 'p' , 'q' , 'r' , 's' , 't' , >+'u' , 'v' , 'w' , 'x' , 'y' , 'z' >+}; >+ >+static FILE* f = NULL; >+ >+static char filename[] = "RACDll.log"; >+ >+void logToFile(const char*, ...); >+ >+void logToFile(const char* temp, ...) >+{ >+ if (!VERBOSE) >+ return; >+ if (LOG_TO_FILE) >+ { >+ va_list ap; >+ if (f == NULL) >+ f = fopen(filename, "w"); >+ va_start (ap, temp); >+ vfprintf (f, temp, ap); >+// printf(temp,ap); >+ va_end (ap); >+ fflush(f); >+ } >+} >+ >+void longToString(XINT64 i, char* str) { >+ int radix = 10; >+ char buf[65]; >+ >+ int charPos = 64; >+ int negative = (i < 0); >+ >+ if (!negative) { >+ i = -i; >+ } >+ >+ while (i <= -radix) { >+ buf[charPos--] = digits[(int)(-(i % radix))]; >+ i = i / radix; >+ } >+ buf[charPos] = digits[(int)(-i)]; >+ >+ if (negative) { >+ buf[--charPos] = '-'; >+ } >+ >+ memcpy(str,&(buf[charPos]),(65 - charPos)); >+} >+ >+int StrEq(char* a, char* b) { >+ int index = 0; >+ char ch_a, ch_b; >+ >+ if (a == NULL) { >+ return -1; >+ } else if (b == NULL) { >+ return -1; >+ } >+ >+ while (0==0) { >+ ch_a = a[index]; >+ ch_b = b[index]; >+ >+ if (ch_a != ch_b) return index+1; >+ >+ //could get rid of the OR here? >+ if (ch_a == '\0' || ch_b == '\0') { >+ return 0; >+ } >+ >+ index++; >+ } >+} >+ >+void handle(char* type, char* name, char* value) >+{ >+ char* tmp; >+ int len = strlen(value); >+ // >+ // This is how the filtering will work >+ // >+ logToFile("Received a RA_SET_NAME_VALUE_PAIR event, type %s, name %s, value %s\n", type, name, value); >+ >+ >+ if (StrEq(type,"filter") == 0) { >+ //this is a filter request >+ >+ if (StrEq(value,"true") == 0) { >+ tablePut(perf_filters,name,(XINT64)1); >+ } else { >+ tablePut(perf_filters,name,(XINT64)NULL); >+ } >+ >+ logToFile("FILTER REQUEST %s, %s (%d filters in place)\n",name,value,perf_filters->count); >+ >+ } else if (StrEq(type,"updatetree") == 0) { >+ >+ logToFile("Requested children of tree node %s\n", name); >+ >+ tablePut(perf_variables,DC_KEY_TREE_REQUESTED,TRUE); >+ if (name == NULL) >+ tablePut(perf_tree,"",1); >+ else >+ tablePut(perf_tree,name,1); >+ >+ } else if (StrEq(type,"var_int") == 0) { >+ >+ tablePut(perf_variables,name,atoi(value)); >+ >+ } else if (StrEq(type,"var_boolean") == 0) { >+ >+ if (StrEq(value,"true") == 0) { >+ tablePut(perf_variables,name,DC_VAL_TRUE); >+ } else { >+ tablePut(perf_variables,name,DC_VAL_FALSE); >+ } >+ >+ } >+ else if (StrEq(type,"var_string") == 0) >+ { >+ tmp = (char*)tableGet(perf_variables,name); >+ if (tmp != NULL) free(tmp); >+ >+ //convert string NULL to actual NULL >+ if (StrEq(value,"NULL") == 0 || StrEq(value,"null") == 0) { >+ logToFile("FOUND NULL STRING %s\n",value); >+ tmp = NULL; >+ } else { >+ logToFile("FOUND NON-NULL STRING %s\n",value); >+ tmp = (char*)malloc(sizeof(char) * (len + 2)); >+ memcpy(tmp,value,len); >+ tmp[len] = '\0'; >+ } >+ >+ tablePut(perf_variables,name,(XINT64)tmp); >+ >+ } else { >+ >+ logToFile("ERROR - UNRECOGNISED SETENV TYPE %s\n",type); >+ >+ } >+} >+ >+void RACCommandHandler(ra_command_t *command) { >+ int ret = 0; >+ >+ logToFile("RAC Command %08X\n",command->tag); >+ >+ switch (command->tag) { >+ case RA_START_MONITORING_AGENT_LOCAL: >+ case RA_START_MONITORING_AGENT_REMOTE: >+ { >+ monitoring = 1; >+ >+ targetHdl.dtarget = RA_SHAREDMEMORY; >+ >+ if (first == 0) >+ { >+ ret = (*ra_attachToShm_f)(command->info.start_monitor_local.file.data, &targetHdl.dtargetHdl.shmHdl); >+ first = 1; >+ } >+ >+ tablePut(perf_variables,DC_KEY_MONITORING,(XINT64)DC_VAL_TRUE); >+ >+ logToFile("RAC Agent Started Monitoring (%d)\n",ret); >+ >+ break; >+ } >+ case RA_STOP_MONITORING_AGENT: >+ { >+ monitoring = 0; >+ >+ tablePut(perf_variables,DC_KEY_MONITORING,(XINT64)DC_VAL_FALSE); >+ >+ logToFile("RAC Agent Stopped Monitoring\n"); >+ break; >+ } >+ case RA_ATTACH_TO_AGENT: >+ { >+ logToFile("RAC attach agent\n"); >+ >+ // RA_ATTATCH_TO_AGENT never seems to get called. Therefore, I have changed start and stop monitoring to >+ // reflect this befaviour. >+/* >+ targetHdl.dtarget = RA_SHAREDMEMORY; >+ >+ if (sharingmemory == 0) >+ { >+ ret = (*ra_attachToShm_f)(command->info.start_monitor_local.file.data, &targetHdl.dtargetHdl.shmHdl); >+ sharingmemory = 1; >+ } >+ >+ logToFile("RAC attach agent\n"); >+*/ >+ break; >+ >+ } >+ case RA_DETACH_FROM_AGENT: >+ { >+// tablePut(perf_variables,DC_KEY_FINISHED,(XINT64)DC_VAL_FALSE); >+ >+ if(targetHdl.dtarget == RA_SHAREDMEMORY) >+ ret = (*ra_stopFlushingShm_f)(&targetHdl.dtargetHdl.shmHdl); >+ first = 0; >+// Bug 131140 >+ tableClear(perf_tree); >+ tableClear(perf_filters); >+ >+ >+ logToFile("RAC detach agent (%d)\n",ret); >+ break; >+ } >+ case RA_AGENT_CONTROLER_AVAILABLE: >+ { >+ available = 1; >+ logToFile("RAC Agent Controller available\n"); >+ break; >+ } >+ case RA_AGENT_CONTROLER_UNAVAILABLE: >+ { >+ // Bug 99153 >+ if (available == 1) >+ tablePut(perf_variables,DC_AGENT_CONTROLLER_STOPPED,(XINT64)DC_VAL_TRUE); >+ // End Bug 99153 >+ available = 0; >+ logToFile("RAC Agent Controller unavailable\n"); >+ break; >+ } >+ case RA_SET_NAME_VALUE_PAIR: >+ { >+ char* type = command->info.set_nv_pair.type.data; >+ char* name = command->info.set_nv_pair.name.data; >+ char* value = command->info.set_nv_pair.value.data; >+ >+ handle(type,name,value); >+ break; >+ } >+ case RA_CUSTOM_COMMAND: >+ { >+ char valid = 1; >+ int i; >+ char ch; >+ >+ char* type; >+ char* name; >+ char* value; >+ >+ type = command->info.custom_command.message.data; >+ if (StrEq(type,"RESUME") == 0 || StrEq(type,"APPLYFILTERS") == 0 || StrEq(type,"TRACE_OBJECTS") == 0 || (StrEq(type,"ENABLE") == 0)) >+ return; >+ >+ for (i = 0; TRUE; i++) >+ { >+ ch = type[i]; >+ if (ch == 30) >+ { >+ type[i] = '\0'; >+ name = &type[i+1]; >+ break; >+ } >+ else if (ch == '\0') >+ { >+ valid = 0; >+ break; >+ } >+ } >+ >+ for (i = 0; TRUE; i++) >+ { >+ if (valid == 0) >+ break; >+ ch = name[i]; >+ if (ch == 30) >+ { >+ name[i] = '\0'; >+ value = &name[i+1]; >+ break; >+ } >+ } >+ >+ if (valid == 0) >+ { >+ logToFile("Received a invalid RA_CUSTOM_COMMAND, data=%s\n",command->info.custom_command.message.data); >+ } >+ else >+ { >+ logToFile("Received a RA_CUSTOM_COMMAND event, type = %s, name=%s, value=%s\n",type,name,value); >+ handle(type,name,value); >+ } >+ break; >+ } >+ default: >+ logToFile("Unhandled RAC Command %08X\n",command->tag); >+ } >+} >+ >+int RACLoadRacLibs() { >+ int ret = 0; >+ if ((ret = XLibraryCreate(&rac_hcbnd,"hcbnd")) != 0) { >+ logToFile("Error loading RAC Bindings library\n"); >+ return ret; >+ } >+ if ((ret = XLibraryCreate(&rac_hccldt,"hccldt")) != 0) { >+ logToFile("Error loading RAC Data Transfer library\n"); >+ return ret; >+ } >+ if ((ret = XLibraryCreate(&rac_hccls,"hccls")) != 0) { >+ logToFile("Error loading RAC Socket library\n"); >+ return ret; >+ } >+ if ((ret = XLibraryCreate(&rac_hcjbnd,"hcjbnd")) != 0) { >+ logToFile("Error loading RAC HCJ bindings library\n"); >+ return ret; >+ } >+ if ((ret = XLibraryCreate(&rac_hcclsm,"hcclsm")) != 0) { >+ logToFile("Error loading RAC shared memory library\n"); >+ return ret; >+ } >+ if ((ret = XLibraryCreate(&rac_hcclco,"hcclco")) != 0) { >+ logToFile("Error loading RAC Common library\n"); >+ return ret; >+ } >+ return 0; >+} >+ >+int RACGetRacFuncs() { >+ int ret = 0; >+ >+ if ((ret = XLibrarySymbol(&rac_hcbnd,"ra_initializeBindings",(void**)&ra_initializeBindings_f)) != 0) { >+ logToFile("Error getting ra_initializeBindings symbol\n"); >+ return ret; >+ } >+ if ((ret = XLibrarySymbol(&rac_hcbnd,"ra_startListener",(void**)&ra_startListener_f)) != 0) { >+ logToFile("Error getting ra_startListener symbol\n"); >+ return ret; >+ } >+ if ((ret = XLibrarySymbol(&rac_hcbnd,"ra_stopListener",(void**)&ra_stopListener_f)) != 0) { >+ logToFile("Error getting ra_stopListener symbol\n"); >+ return ret; >+ } >+ if ((ret = XLibrarySymbol(&rac_hcbnd,"ra_finalizeBindings",(void**)&ra_finalizeBindings_f)) != 0) { >+ logToFile("Error getting ra_finalizeBindings symbol\n"); >+ return ret; >+ } >+ if ((ret = XLibrarySymbol(&rac_hcbnd,"ra_sendMessage",(void**)&ra_sendMessage_f)) != 0) { >+ logToFile("Error getting ra_sendMessage symbol\n"); >+ return ret; >+ } >+ >+ if ((ret = XLibrarySymbol(&rac_hccldt,"ra_allocateMessageBlock",(void**)&ra_allocateMessageBlock_f)) != 0) { >+ logToFile("Error getting ra_allocateMessageBlock symbol\n"); >+ return ret; >+ } >+ if ((ret = XLibrarySymbol(&rac_hccldt,"ra_freeMessageBlock",(void**)&ra_freeMessageBlock_f)) != 0) { >+ logToFile("Error getting ra_freeMessageBlock symbol\n"); >+ return ret; >+ } >+ if ((ret = XLibrarySymbol(&rac_hccldt,"ra_writeMessageBlock",(void**)&ra_writeMessageBlock_f)) != 0) { >+ logToFile("Error getting ra_writeMessageBlock symbol\n"); >+ return ret; >+ } >+ >+ if ((ret = XLibrarySymbol(&rac_hcclsm,"ra_attachToShm",(void**)&ra_attachToShm_f)) != 0) { >+ logToFile("Error getting ra_attachToShm symbol\n"); >+ return ret; >+ } >+ if ((ret = XLibrarySymbol(&rac_hcclsm,"ra_stopFlushingShm",(void**)&ra_stopFlushingShm_f)) != 0) { >+ logToFile("Error getting ra_stopFlushingShm symbol\n"); >+ return ret; >+ } >+ >+ if ((ret = XLibrarySymbol(&rac_hcclco,"ra_setLastError",(void**)&ra_setLastError_f)) != 0) { >+ logToFile("Error getting ra_setLastError symbol\n"); >+ return ret; >+ } >+ return 0; >+} >+ >+int RACInitBindings() >+{ >+ XINT64 clock; >+ >+ char agent_name[256]; >+ char agent_time[256]; >+ >+ XClockMillis(&clock); >+ >+ memset(agent_name,'\0',256); >+ memset(agent_time,'\0',256); >+ >+ longToString(clock,agent_time); >+// XSNPrintf(agent_name,255,"%s - %s",agent_type,agent_time); >+ XSNPrintf(agent_name,255,"%s",agent_type); >+ >+ logToFile("Connecting to RAC - %s\n",agent_name); >+ >+ agent_handle = (*ra_initializeBindings_f)(agent_name,"Statistical",RACCommandHandler,FALSE); >+ if (agent_handle == NULL) { >+ >+ logToFile("Error initializing RAC bindings\n"); >+ return -1; >+ } >+ >+ return 0; >+} >+ >+int RACFiniBindings() { >+ (*ra_finalizeBindings_f)(agent_handle); >+ return 0; >+} >+ >+ >+int RACStartListener() { >+ agent_tid = (*ra_startListener_f)(agent_handle,0); >+ return 0; >+} >+ >+int RACStopListener() { >+ (*ra_stopListener_f)(agent_handle); >+ return 0; >+} >+ >+int RACAllocateMessageBlock(int siz) { >+ msg_block = (*ra_allocateMessageBlock_f)(siz); >+ msg_block_len = siz; >+ if (msg_block == NULL) { >+ msg_block_len = 0; >+ return -1; >+ } >+ return 0; >+} >+ >+int RACReallocateMessageBlock(int siz) { >+ int ret = 0; >+ (*ra_freeMessageBlock_f)(msg_block); >+ if ((ret = RACAllocateMessageBlock(siz)) != 0) { >+ msg_block_len = 0; >+ return -1; >+ } >+ msg_block_len = siz; >+ return 0; >+} >+ >+int RACFreeMessageBlock() { >+ (*ra_freeMessageBlock_f)(msg_block); >+ return 0; >+} >+ >+int DC_TransferSetAgentName(char* name) >+{ >+ logToFile("Setting the agent name is the transfer DLL to %s\n",name); >+ agent_type = name; >+ return 0; >+} >+ >+int DC_TransferStartup(HashTable* variables, >+ HashTable* filters, >+ HashTable* tree >+ ) { >+ int ret = 0; >+ >+ perf_filters = filters; >+ perf_variables = variables; >+ perf_tree = tree; >+ >+ logToFile("Loading RAC libraries\n"); >+ if ((ret = RACLoadRacLibs()) != 0) { >+ return ret; >+ } >+ logToFile("Getting RAC functions\n"); >+ if ((ret = RACGetRacFuncs()) != 0) { >+ return ret; >+ } >+ logToFile("Initializing RAC bindings\n"); >+ if ((ret = RACInitBindings()) != 0) { >+ return ret; >+ } >+ logToFile("Starting RAC listener\n"); >+ if ((ret = RACStartListener()) != 0) { >+ return ret; >+ } >+ logToFile("Allocating message block\n"); >+ if ((ret = RACAllocateMessageBlock(1024)) != 0) { >+ return ret; >+ } >+ >+ logToFile("RAC Startup succesful\n"); >+ return 0; >+} >+ >+int RACIsMonitoring() >+{ >+ return monitoring == 1; >+} >+ >+int DC_SendMessage(char* msg, int off, int len) >+{ >+ //check the length and reallocate the message block if necessary >+ if (len > msg_block_len-1) >+ { >+ RACReallocateMessageBlock(len+1); >+ len = msg_block_len-1; >+ } >+ >+ if (len == 0) >+ return 0; >+ >+ //copy the message data over to the message block >+ memset(msg_block,'\0',msg_block_len); >+ memcpy(msg_block,&(msg[off]),len); >+ msg_block[len] = '\0'; >+ >+ //check if the agent is listening etc >+ if (available != 1) >+ { >+ return -1; >+ } >+ >+ if (monitoring != 1) >+ { >+ return -1; >+ } >+ >+ logToFile("Sending message back...\n"); >+ >+ //then just use ra_sendMessage >+ (*ra_writeMessageBlock_f)(&targetHdl,RA_UTF8_STRING_DATA,msg_block,len); >+ >+ return 0; >+} >+ >+int DC_TransferShutdown() { >+ int ret = 0; >+ logToFile("Stopping RAC Listener\n"); >+ if ((ret = RACStopListener()) != 0) { >+ return ret; >+ } >+ logToFile("Finalising RAC bindings\n"); >+ if ((ret = RACFiniBindings()) != 0) { >+ return ret; >+ } >+ return 0; >+} >+ >Index: src-native-new/src/agents/perfmon/resutils/hashtable.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/hashtable.h >diff -N src-native-new/src/agents/perfmon/resutils/hashtable.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/hashtable.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,60 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hashtable.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __HASHTABLE_H__ >+#define __HASHTABLE_H__ >+ >+#include "system.h" >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+// >+// Hashtable collision list (user doesnt need to care about these - they're private) >+// >+typedef struct { >+ long int hash; >+ char* key; >+ XINT64 value; >+ void* next; >+} Entry; >+ >+// >+// Hashtable struct >+// >+typedef struct { >+ Entry** table; >+ int table_len; >+ int count; >+ int threshold; >+ XMutex mutex; >+ >+} HashTable; >+ >+BOOL containsKey(HashTable* table, char* key); >+int tableKeysAsList(HashTable* table, char** list, int list_size); >+HashTable* tableCreate(); >+void tableDelete(HashTable* hasht); >+void tableClear(HashTable* hasht); >+void tableFree(HashTable* hasht); //frees all the entry values in a table >+int tableSize(HashTable* hasht); >+XINT64 tableGet(HashTable* hasht, char* key); >+void tableRehash(HashTable* hasht); >+void tableRemove(HashTable* hasht, char* key); >+XINT64 tablePut(HashTable* hasht, char* key, XINT64 value); >+long int getHash(char* key); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif >Index: src-native-new/src/agents/native/java_profiler/performance.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/performance.c >diff -N src-native-new/src/agents/native/java_profiler/performance.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/performance.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,571 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: performance.c,v 1.12 2006/11/06 23:11:30 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifdef _WIN32 >+#include <winsock2.h> /* Bug 134924 */ >+#include <windows.h> >+#include <time.h> >+#include <sys/timeb.h> >+#include <sys/types.h> >+#ifdef _M_IA64 >+#include <ia64reg.h> >+#endif >+#else >+ #ifdef _AIX >+ #include <sys/atomic_op.h> >+ #include <sys/systemcfg.h> >+ #elif __linux__ >+ #if defined __i386__ >+ #include <asm/system.h> >+ #elif defined __s390__ || defined __powerpc64__ >+ #include <asm/atomic.h> >+ #endif >+ #elif __OS400__ >+ #include <mih/cmpswp.h> >+ #include <mih/mattod.h> >+ #else >+ #endif >+ >+ #include <sys/time.h> >+ #ifdef __OS400__ >+ #define TIMEB time_t >+ #define FTIME(param) time(param) >+ #else >+ #include <sys/timeb.h> >+ #endif >+ #include <unistd.h> >+#endif >+ >+#include <stdio.h> >+ >+#include "performance.h" >+#include "RABindings.h" >+#include "JvmpiWriter.h" >+ >+#ifdef _WIN32 /* _WIN32 */ >+#define TIMEB struct _timeb >+#define FTIME(param) _ftime(param) >+#else /* else */ >+#define TIMEB struct timeb >+#define FTIME(param) ftime(param) >+#endif /* endif */ >+ >+ >+timestamp_t _startTime; >+ >+unsigned int _ticksPerMicrosecond; >+double _startTimeAsDouble; >+timestamp_t _startTimeAsTicks; >+ >+#if defined (_WIN32) /* bug 160511 */ >+BOOL _highResPerfAvailable=FALSE; /* high-resolution performance counter if facility available*/ >+unsigned int _tickBooster; /* boosts tick frequency to at least 100 per microsec (3-digit accuracy) */ >+#endif >+ >+#ifdef MVS >+#pragma option_override(determineTicksPerMicrosecond, "OPT(LEVEL, 0)") >+#endif >+ >+void determineTicksPerMicrosecond(int *boggie) >+{ >+#if defined (_WIN32) /* bug 160511 start */ >+ LARGE_INTEGER liHighResTicksPerSec; /* actual ticks per sec if high resolution performance counter available */ >+ if (QueryPerformanceFrequency(&liHighResTicksPerSec)) { >+ double exactTicksPerMicrosecond; /* exact ticks per microsecond (possibly with fractional part)*/ >+ >+ _highResPerfAvailable=TRUE; >+ exactTicksPerMicrosecond=liHighResTicksPerSec.QuadPart/1000000.0; >+ >+ /* Need to simulate an integral MHz tick rate with at least 3-digit accuracy for consistency with other >+ * platforms. Calculate _tickBooster as multiplier that pushes both _ticksPerMicrosecond and the actual >+ * tick count obtained later into the right range. >+ */ >+ if (exactTicksPerMicrosecond < 1.0) { >+ _tickBooster=(unsigned int)(1+100.0/exactTicksPerMicrosecond); >+ } else if (exactTicksPerMicrosecond < 10.0) { >+ _tickBooster=100; >+ } else if (exactTicksPerMicrosecond < 100.0) { >+ _tickBooster=10; >+ } else { >+ _tickBooster=1; >+ } >+ /* _ticksPerMicrosecond will be recorded as a boosted rate via multiplication by _tickBooster. >+ * Actual ticks measured at jvmpiAgent_getCurrentTime will be equally boosted so it all works out. >+ */ >+ _ticksPerMicrosecond=(unsigned int)(_tickBooster*exactTicksPerMicrosecond); >+#if defined(_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("Using high res perf counter: highResTicksPerSec=%I64d, exactTicksPerMicrosecond=%f, _tickBooster=%d, _ticksPerMicrosecond=%d \n", >+ liHighResTicksPerSec.QuadPart, exactTicksPerMicrosecond, _tickBooster, _ticksPerMicrosecond); >+#endif >+ } else { /* bug 160511 end */ >+ HKEY handle; >+ DWORD error; >+ DWORD valueType; >+ DWORD valueLength=4; >+ char *valueName="~Mhz"; >+ char *key="HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"; >+ unsigned long cpuMhz; >+ >+ error=RegOpenKeyEx(HKEY_LOCAL_MACHINE, /* Registery tree */ >+ key, /* Key to look up */ >+ 0, /* Reserved, must be 0 */ >+ KEY_READ, /* READ mode */ >+ &handle); /* Handle to the key */ >+ if(error!=ERROR_SUCCESS) { >+ printf("Error opening CPU speed key 0x%x\n", error); >+ fflush(stdout); >+ } >+ >+ error=RegQueryValueEx(handle, /* Handle to the key */ >+ valueName, /* Value to query */ >+ NULL, /* Reserved, must be NULL */ >+ &valueType, /* Type of value */ >+ (char*)&cpuMhz, /* The result of the query */ >+ &valueLength); /* Length of the data */ >+ >+ >+ if(error!=ERROR_SUCCESS) { >+ printf("Error getting CPU speed 0x%x\n", error); >+ fflush(stdout); >+ } >+ RegCloseKey(handle); >+ _ticksPerMicrosecond=cpuMhz; >+ } >+ >+#elif defined (__OS400__) >+ /* There is always 4096 ticks per microsecond on AS400 */ >+ _ticksPerMicrosecond=4096; >+#else >+ >+ volatile int j; >+ volatile unsigned int ticks_per_microsecond = 0; >+ volatile int A[4003]; >+ >+ timestamp_t now; >+ timestamp_t a,b,c,start; >+ unsigned int jvmpiAgent_getCurrentTime_overhead; >+ const int MM=10000; >+ >+ jvmpiAgent_getCurrentTime(&a); >+ jvmpiAgent_getCurrentTime(&a); >+ start = a; >+ jvmpiAgent_getCurrentTime(&a); >+ c = 0; >+ for(j=0; j<MM; j++) { >+ jvmpiAgent_getCurrentTime(&c); >+ } >+ jvmpiAgent_getCurrentTime(&b); >+ jvmpiAgent_getCurrentTime_overhead = (unsigned int)(b-a)/MM; >+ >+ { >+ unsigned int interval_microseconds; >+ volatile unsigned int total = 0; >+ timestamp_t start_ticks, end_ticks; >+ const int M = 3; >+ const int N = 2003; >+ A[5] = 5; A[15] = 10; >+ for(j=0; j<M; j++) { >+ struct timeval start_clock, end_clock, interval_clock; >+ gettimeofday(&start_clock, NULL); >+ jvmpiAgent_getCurrentTime(&now); >+ start_ticks = now-start; >+ >+ { >+ int i,k=1, l=1; >+ for(i=0; i<N; i++) { >+ for(l=1; l<N; l++) { >+ k += (i*i)/k/l; >+ } >+ } >+ for(i=1; i<N; i++) { >+ k += (i*i+i*2)/i ; >+ } >+ } >+ >+ jvmpiAgent_getCurrentTime(&now); >+ end_ticks = now-start; >+ gettimeofday(&end_clock, NULL); >+ >+# define timersub(a, b, result) \ >+ do { \ >+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ >+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ >+ if ((result)->tv_usec < 0) { \ >+ --(result)->tv_sec; \ >+ (result)->tv_usec += 1000000; \ >+ } \ >+ } while (0) >+ >+ timersub(&end_clock, &start_clock, &interval_clock); >+ { >+ timestamp_t foo = interval_clock.tv_sec; >+ foo *= 1000000; >+ foo += interval_clock.tv_usec; >+ interval_microseconds = (unsigned int)foo; >+ } >+ >+ { >+ unsigned int tick_interval = (unsigned int)(end_ticks-start_ticks); >+ double temp = (1.0f * tick_interval)/interval_microseconds; >+ unsigned int this_one = (unsigned int) ( temp < 1 ? 1 : temp ); >+ >+ total += this_one; >+ if(this_one > ticks_per_microsecond) { >+ ticks_per_microsecond = this_one; >+ } >+ } >+ } >+ >+ ticks_per_microsecond = total/M; >+ } >+ >+ *boggie = A[5]+A[15]; >+ _ticksPerMicrosecond = ticks_per_microsecond; >+#endif >+} >+ >+ >+/** COLLECT_START_TIME_INFORMATION **************************************** >+ * Initialization routine for future use of jvmpiAgent_getCurrentTime(). >+ * This routine records the time at which this function was called and uses >+ * this time to determine what the current time is. >+ */ >+void jvmpiAgent_collectStartTimeInformation() { >+#ifdef _WIN32 >+ TIMEB time; >+ >+ FTIME(&time); >+ _startTime=timeToTicks(time.time, time.millitm*1000); >+ >+#else >+ { >+ struct timeval tv; >+ gettimeofday(&tv, NULL); >+ _startTime = timeToTicks(tv.tv_sec, tv.tv_usec); >+ } >+#endif >+ jvmpiAgent_getCurrentTime(&_startTimeAsTicks); >+ if(_startTime < _startTimeAsTicks) { >+ _startTimeAsDouble = -ticksToTime2(_startTimeAsTicks-_startTime, TRUE); >+ } >+ else { >+ _startTimeAsDouble = ticksToTime2(_startTime-_startTimeAsTicks, TRUE); >+ } >+} >+ >+ >+/* GET_START_TIME ******************************************************** >+ * Returns a copy of the start time that was recorded with >+ * jvmpiAgent_collectStartTimeInformation >+ */ >+void jvmpiAgent_getStartTime(timestamp_t *time) { >+ *time = _startTime; >+} >+ >+/* GET_CURRENT_TIME ****************************************************** >+ * Determins the current clock time and fills the timestamp_t structure >+ * with the data >+ */ >+void jvmpiAgent_getCurrentTime(timestamp_t *timestamp) { >+/* >+ * Note: WIN32 designates Windows generally and is specified with or without _WIN64. >+ * Therefore, when both are true, the _WIN64 case is desired (as in the following sequence). >+ */ >+ >+/* Windows */ >+#if defined(_WIN64) || defined(_WIN32) >+ >+ if (_highResPerfAvailable==TRUE) { /* bug 160511 start */ >+ LARGE_INTEGER liHighResPerfCount; >+ if (QueryPerformanceCounter(&liHighResPerfCount)) { >+ *timestamp=_tickBooster*liHighResPerfCount.QuadPart; >+ } else { >+ printf("Failed attempt to get highResperfCount\n"); >+ } >+ } else { /* bug 160511 end */ >+ >+ #if defined(_WIN64) /*ts. bug 120479*/ >+ #ifdef _M_IA64 >+ *timestamp = __getReg(CV_IA64_ApITC); >+ #else >+ *timestamp = __rdtsc(); >+ #endif >+ } >+ #else /* defined(_WIN32) */ >+ #define RDTSC(tsc_high,tsc_low) \ >+{ \ >+ __asm rdtsc \ >+ __asm mov tsc_high,edx \ >+ __asm mov tsc_low,eax \ >+} >+ >+ #define RDTSC_LL(time64) \ >+{ \ >+ unsigned int tsc_high,tsc_low; \ >+ RDTSC(tsc_high, tsc_low); \ >+ time64 = tsc_high; \ >+ time64 = time64 << 32; \ >+ time64 = time64 | tsc_low; \ >+} >+ >+ RDTSC_LL(*timestamp); >+ } >+ #endif >+ >+/* Linux */ >+#elif defined(__linux__) && defined(__s390__) /* bug 160511: deleted __i386__ clause*/ >+ /* for Linux/390, generate gcc assembler to use the STCK >+ instruction, which provides the current cycle counter */ >+ asm ("STCK %0" : "=m" (*timestamp) ); >+ >+/* OS/390 */ >+#elif defined(MVS) >+/* for os/390, use a pre-defined macro to accomplish the >+ same thing we did on Linux/390 */ >+ __stck(timestamp); >+ >+ >+#elif defined(SOLARIS) >+/* for Solaris, we don't yet use the most efficient method >+ to acquire a high-res clock, but this one is pretty good */ >+ hrtime_t time = gethrtime(); >+ *timestamp=time; >+ >+#elif defined(_AIX) >+/* AIX has built-in routines to handle this, but is somewhat >+ chip-dependent (PowerPC versus POWER) */ >+ timebasestruct_t t; >+ int i = read_real_time(&t, sizeof(timebasestruct_t)); >+ >+ if(t.flag == RTC_POWER_PC) { >+ /* then t contains the high-order >+ and low-order 32 bits of the cycle counter. */ >+ Uint64 ticks64 = t.tb_high; >+ ticks64 = ticks64 << 32; >+ ticks64 |= t.tb_low; >+ *timestamp=ticks64; >+ } >+ else { >+ /* then t contains seconds and nanoseconds (a little more >+ expensive in this case) */ >+ int32_t secs = t.tb_high; >+ int32_t n_secs = t.tb_low; >+ >+ /* >+ * If there was a carry from low-order to high-order during >+ * the measurement, we may have to undo it. >+ */ >+ if (n_secs < 0) { >+ secs--; >+ n_secs += 1000000000; >+ } >+ >+ /* here we add the seconds and nonoseconds */ >+ *timestamp = secs + n_secs*1000000000; >+ } >+ >+#elif defined (__OS400__) >+ mattod((unsigned char*)timestamp); >+#elif defined (_HPUX) >+ #include <machine/inline.h> >+ register unsigned long long now; >+ _MFCTL(16, now); >+ *timestamp = now; >+#else /* platform on which we don't support high-resolution timers */ >+ struct timeval tv; >+ struct timezone tz; >+ timestamp_t time; >+ gettimeofday(&tv, &tz); >+ time=tv.tv_sec*1000000; >+ time+=tv.tv_usec; >+ *timestamp = time; >+#endif /* CHOOSE PLATFORM */ >+} >+ >+ >+/** GET_CURRENT_THREAD_CPU_TIME ************************************************ >+ * Retruns the amount of CPU time consumed by this thread as a 64 bit number. >+ * This is returned in nanoseconds >+ */ >+Uint64 jvmpiAgent_getCurrentThreadCPUTime() { >+ >+ if (_jvmpiAgent_jvmpiInterface) { >+#ifdef __OS400__ >+ return (_jvmpiAgent_jvmpiInterface->GetCurrentThreadCpuTime()).unsigned_ll; >+#else >+ return _jvmpiAgent_jvmpiInterface->GetCurrentThreadCpuTime(); >+#endif >+ } else { >+ return 0; >+ } >+ >+/** old code **/ >+#if 0 >+ /* Get the current thread and then get its thread time >+ this could be improved by caching the handle in the >+ thread structure */ >+ FILETIME start, end, kernal, user; >+ Uint64 kernalTime, userTime; >+ HANDLE handle=GetCurrentThread(); >+ GetThreadTimes(handle, >+ &start, /* dont want start time */ >+ &end, /* dont want exit time */ >+ &kernal, /* kernal mode time */ >+ &user); /* user mode time */ >+ >+ kernalTime=(kernal.dwHighDateTime<<32); >+ kernalTime|=kernal.dwLowDateTime; >+ userTime=(user.dwHighDateTime<<32); >+ userTime|=user.dwLowDateTime; >+ return (kernalTime+userTime); >+/* #else */ >+ return 0; >+#endif >+ >+} >+ >+/** GET_PROCESS_START_TIME *************************************************** >+ * Returns the start time of the current process as a timestamp_t in UTC time. >+ */ >+void jvmpiAgent_getProcessStartTime(timestamp_t *timestamp) { >+#ifdef _WIN32 >+ >+ FILETIME start, end, kernal, user; >+ Uint64 startTime, deltaTime; >+ HANDLE handle; >+ timestamp_t ticks; >+ >+ handle=OpenProcess(PROCESS_QUERY_INFORMATION, >+ FALSE, >+ ra_getProcessId()); >+ GetProcessTimes(handle, >+ &start, /* start time */ >+ &end, /* dont want exit time */ >+ &kernal, /* dont want kernal mode time */ >+ &user); /* dont want user mode time */ >+ >+ >+ /* The filetime structure starts as of Janauary 1, 1601. Subtract the passed time >+ between this and January 1, 1970 >+ */ >+ startTime=((Uint64)(start.dwHighDateTime))<<32; >+ startTime|=start.dwLowDateTime; >+ >+ deltaTime=((Uint64)(0x19db1de))<<32; >+ deltaTime|=0xd53e8000; >+ >+ startTime-=deltaTime; >+ >+ /* The startTime is now a count of 100ns intervals since January 1, 1970. We need to change this to >+ * seconds and microseconds. >+ */ >+ ticks = timeToTicks(startTime/10000000,(startTime%10000000)/10); >+ >+ /* The ticks variable has the real value that represents the process start time. >+ * Because all of the timestamps taken in the trace are actually corrected by the >+ * constant _startTime-_startTimeAsTicks we need to subtract it here. >+ */ >+ *timestamp = ticks - (_startTime-_startTimeAsTicks); >+#else >+ /* On Unix we don't know when the process was started. We >+ * will specify the time the trace was started. >+ * Because all of the timestamps taken in the trace are actually corrected by the >+ * constant _startTime-_startTimeAsTicks we need to subtract it here. >+ */ >+ *timestamp = _startTime - (_startTime-_startTimeAsTicks); >+#endif >+} >+ >+/** GET_TIMEZONE ************************************************************* >+ * Returns the current timezone as an offset, in minutes, working westward from >+ * GMT. ie. GMT+5 would be 300 as there are 300 minutes in 5 hours. >+ */ >+unsigned long jvmpiAgent_getTimezone() { >+ /* The first version here may work on alll platforms. */ >+#ifdef __OS400__ >+ struct timeval time1; >+ struct timezone time2; >+ gettimeofday(&time1, &time2); >+ return time2.tz_minuteswest; >+#else >+ TIMEB currenttime; >+ FTIME(¤ttime); >+ return currenttime.timezone; >+#endif >+} >+ >+ >+/** RKD: The functions below are 64bit INTEL assembler functions to test compiler >+ * support and are not used anywhere in the code today. >+ */ >+ >+_inline Uint64 sub64(Uint64 op1, Uint64 op2) { >+#if defined (_INTEL) && !defined(_WIN64) /*ts. bug 120479*/ >+ unsigned long result_high=0, result_low=0, >+ op1_high, op1_low, >+ op2_high, op2_low; >+ op1_high=(unsigned long)(op1>>32 & 0x00000000ffffffff); >+ op1_low=(unsigned long)op1; >+ op2_high=(unsigned long)(op2>>32 & 0x00000000ffffffff); >+ op2_low=(unsigned long)op2; >+ __asm { >+ pushad /* Store all the general purpose registers */ >+ mov edx, op1_high /* High order subtract first */ >+ sub edx, op2_high >+ mov result_high, edx >+ mov edx, op1_low /* Low order subtract next */ >+ clc /* Clear the carry flag */ >+ sub edx, op2_low >+ mov result_low, edx >+ jnc Noflow /* Did we borrow? If so decrement the high order bits */ >+ dec result_high >+Noflow: popad >+ } >+ return ((Uint64)result_high<<32) | result_low; >+#else >+ return 0; >+#endif >+} >+ >+ >+_inline void div64(Uint64 op1, unsigned long op2, unsigned long *quotient, unsigned long remainder) { >+#ifdef INTEL /* TO GET THIS TO COMPILE CHANGE TO "_INTEL" */ >+ unsigned long q, r, op1_high, op1_low; >+ op1_high=(unsigned long)(op1>>32 & 0x00000000ffffffff); >+ op1_low=(unsigned long)op1; >+ __asm { >+ pushad /* Store all the general purpose registers */ >+ mov edx, op1_high >+ mov ead, op1_low >+ div op2 >+ mov r, edx >+ mov q, eax >+ popad >+ } >+ >+#else >+#endif >+} >+ >+/********************************************************* >+ * DEBUG assists: >+ */ >+#if defined(_DEBUG) && !defined (MVS) && !defined (__OS400__) >+/* This function tests for a POTENTIAL/IMMINENT time accumulation overflow and prints if one is detected */ >+void debug_check_and_report_time_overflow (timestamp_t testTime, char *errMsg) { /* 134577 */ >+ /* if time (in seconds) is suspiciously high (over 1000 secs for testing), then print message */ >+ if (testTime/(_ticksPerMicrosecond*1000000) > 1000) { >+ printf(errMsg); >+ fflush(stdout); >+ } >+} >+#endif >Index: src-native-new/src/agents/perfmon/WinBuild/WinBuild.dsw >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/WinBuild.dsw >diff -N src-native-new/src/agents/perfmon/WinBuild/WinBuild.dsw >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/WinBuild.dsw 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,68 @@ >+Microsoft Developer Studio Workspace File, Format Version 6.00 >+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! >+ >+############################################################################### >+ >+Project: "PerfmonAgent"=.\PerfmonAgent.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+ Begin Project Dependency >+ Project_Dep_Name resutils >+ End Project Dependency >+}}} >+ >+############################################################################### >+ >+Project: "rac"=.\rac.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Project: "resutils"=.\resutils.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Project: "sysperf"=.\sysperf.dsp - Package Owner=<4> >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<4> >+{{{ >+}}} >+ >+############################################################################### >+ >+Global: >+ >+Package=<5> >+{{{ >+}}} >+ >+Package=<3> >+{{{ >+}}} >+ >+############################################################################### >+ >Index: src-native-new/src/agents/perfmon/resutils/hashtable.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/hashtable.c >diff -N src-native-new/src/agents/perfmon/resutils/hashtable.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/hashtable.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,370 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hashtable.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+ >+#include "stdio.h" >+#include "stdlib.h" >+#include "memory.h" >+#include "string.h" >+#include "hashtable.h" >+#include "system.h" >+ >+ >+#define LOAD_FACTOR 0.75f >+ >+//INTERNAL - UNSYNCHRONIZED >+int match(Entry* entry, char* key) { >+ int c = 0; >+ while (entry->key[c] != '\0' && key[c] != '\0') { >+ if (entry->key[c] != key[c]) return 0; >+ c++; >+ } >+ if (entry->key[c] == key[c]) { >+ return 1; >+ } >+ return 0; >+} >+ >+//SYNCHRONIZED >+BOOL containsKey(HashTable* hasht, char* key) >+{ >+ Entry* entry; >+ Entry** tab; >+ >+ long int hash; >+ long int index; >+ >+ XMutexClaim(&hasht->mutex); >+ >+ tab = hasht->table; >+ >+ hash = getHash((char*)key); >+ index = (hash & 0x7FFFFFFF) % hasht->table_len; >+ >+ for (entry = tab[index]; entry != NULL; entry = (Entry*)entry->next) >+ { >+ if (hash == entry->hash) >+ { >+ if (match(entry,key)) >+ { >+ XMutexRelease(&hasht->mutex); >+ return TRUE; >+ } >+ } >+ } >+ >+ XMutexRelease(&hasht->mutex); >+ return FALSE; >+} >+ >+//SYNCHRONIZED >+int tableKeysAsList(HashTable* table, char** list, int list_size) { >+ int i; >+ int n; >+ Entry* next; >+ Entry* e; >+ >+ n = 0; >+ >+ XMutexClaim(&table->mutex); >+ >+ for (i = 0; i < table->table_len; i++) { >+ if (table->table[i] != NULL) { >+ >+ //run down the list of entries and add them to the list_size >+ e = table->table[i]; >+ >+ while (e != NULL) { >+ next = e->next; >+ >+ //add entry e to the list >+ list[n++] = e->key; >+ >+ if (n == list_size) { >+ XMutexRelease(&table->mutex); >+ return list_size*2; >+ } >+ >+ e = next; >+ } >+ >+ } >+ } >+ >+ XMutexRelease(&table->mutex); >+ return n; >+} >+ >+// >+// Allocate a new entry >+// >+//INTERNAL - UNSYNCHRONIZED >+Entry* createEntry(long int hash, char* key, XINT64 value, Entry* next) { >+ Entry* e; >+ int len = strlen(key)+1; >+ >+ e = (Entry*)malloc(sizeof(Entry)); >+ >+ if (e == NULL) return NULL; >+ >+ e->hash = hash; >+ e->key = malloc(sizeof(char) * len); >+ memcpy(e->key,key,len); >+ e->value = value; >+ e->next = next; >+ >+ return e; >+} >+ >+// >+// Deallocate an entry >+// >+//INTERNAL - UNSYNCHRONIZED >+void deleteEntry(Entry* e) { >+ Entry* next; >+ >+ while (e != NULL) { >+ next = e->next; >+ >+ free(e->key); >+ free(e); >+ >+ e = next; >+ } >+} >+ >+//create - UNSYNCHRONIZED >+HashTable* tableCreate() { >+ int i = 0; >+ >+ HashTable* hasht; >+ long int initialCapacity = 11; >+ >+ hasht = (HashTable*) malloc(sizeof(HashTable)); >+ >+ hasht->table = (Entry**)malloc(initialCapacity * sizeof(Entry*)); >+ hasht->table_len = initialCapacity; >+ >+ memset(hasht->table,'\0',hasht->table_len * sizeof(Entry*)); >+ >+ hasht->count = 0; >+ >+ hasht->threshold = (long int)(initialCapacity * LOAD_FACTOR); >+ >+ XMutexCreate(&hasht->mutex); >+ >+ return hasht; >+} >+ >+//delete - UNSYNCHRONIZED >+void tableDelete(HashTable* hasht) { >+ int i = 0; >+ >+ XMutexDelete(&hasht->mutex); >+ >+ for (i = 0; i < hasht->table_len; i++) { >+ if (hasht->table[i] != NULL) { >+ deleteEntry(hasht->table[i]); >+ hasht->table[i] = NULL; >+ } >+ } >+ >+ free(hasht->table); >+ free(hasht); >+ >+} >+ >+//SYNCHRONIZED >+void tableClear(HashTable* hasht) { >+ int i = 0; >+ >+ XMutexClaim(&hasht->mutex); >+ >+ hasht->count = 0; >+ >+ for (i = 0; i < hasht->table_len; i++) { >+ if (hasht->table[i] != NULL) { >+ deleteEntry(hasht->table[i]); >+ hasht->table[i] = NULL; >+ } >+ } >+ >+ XMutexRelease(&hasht->mutex); >+} >+ >+//no modification - UNSYNCHRONIZED >+int tableSize(HashTable* hasht) { >+ return hasht->count; >+} >+ >+//INTERNAL - UNSYNCHRONIZED >+long int getHash(char* key) { >+ long int n; >+ long int hash = 0; >+ >+ for (n = 0; key[n] != '\0'; n++) { >+ hash = (hash*n)+key[n]; >+ } >+ >+ return hash; >+} >+ >+//SYNCHRONIZED >+XINT64 tableGet(HashTable* hasht, char* key) { >+ Entry* entry; >+ Entry** tab; >+ >+// long int hash = (long int)key; >+ long int hash; >+ long int index; >+ >+ XMutexClaim(&hasht->mutex); >+ >+ tab = hasht->table; >+ >+ hash = getHash((char*)key); >+ index = (hash & 0x7FFFFFFF) % hasht->table_len; >+ >+ for (entry = tab[index]; entry != NULL; entry = (Entry*)entry->next) { >+ if (hash == entry->hash) { >+ if (match(entry,key)) { >+ >+ XMutexRelease(&hasht->mutex); >+ return entry->value; >+ } >+ } >+ } >+ >+ XMutexRelease(&hasht->mutex); >+ return (XINT64)NULL; >+} >+ >+//SYNCHRONIZED >+void tableRehash(HashTable* hasht) { >+ int i; >+ Entry* old; >+ Entry* ent; >+ long int index; >+ >+ long int oldCapacity; >+ Entry** oldMap; >+ >+ long int newCapacity; >+ Entry** newMap; >+ >+ oldCapacity = hasht->table_len; >+ oldMap = hasht->table; >+ >+ newCapacity = (oldCapacity * 2) + 1; >+ newMap = (Entry**)malloc(newCapacity * sizeof(Entry*)); >+ >+ hasht->threshold = (long int)(newCapacity * LOAD_FACTOR); >+ hasht->table = newMap; >+ hasht->table_len = newCapacity; >+ >+ memset(hasht->table,'\0',hasht->table_len * sizeof(Entry*)); >+ >+ for (i = oldCapacity; i-- > 0;) { >+ for (old = oldMap[i]; old != NULL; ) { >+ ent = old; >+ old = (Entry*)old->next; >+ >+ index = (ent->hash & 0x7FFFFFFF) % newCapacity; >+ ent->next = newMap[index]; >+ newMap[index] = ent; >+ } >+ oldMap[i] = NULL; >+ } >+ free(oldMap); >+} >+ >+//SYNCHRONIZED >+XINT64 tablePut(HashTable* hasht, char* key, XINT64 value) { >+ Entry** tab; >+ Entry* ent; >+// long int hash = (long int)key; >+ long int hash = getHash((char*)key); >+ long int index; >+ >+ XMutexClaim(&hasht->mutex); >+ >+ tab = hasht->table; >+ >+ index = (hash & 0x7FFFFFFF) % hasht->table_len; >+ >+ for (ent = tab[index]; ent != NULL; ent = (Entry*)ent->next) { >+ if (hash == ent->hash) { >+ if (match(ent,key)) { >+ XINT64 old = ent->value; >+ ent->value = value; >+ >+ XMutexRelease(&hasht->mutex); >+ return old; >+ } >+ } >+ } >+ >+ if (hasht->count >= hasht->threshold) >+ { >+ tableRehash(hasht); >+ tab = hasht->table; >+ index = (hash & 0x7FFFFFFF) % hasht->table_len; >+ } >+ >+ ent = createEntry(hash,key,value,tab[index]); >+ tab[index] = ent; >+ >+ hasht->count++; >+ >+ XMutexRelease(&hasht->mutex); >+ return (XINT64)NULL; >+} >+ >+//SYNCHRONIZED >+void tableRemove(HashTable* hasht, char* key) >+{ >+ Entry* entry; >+ Entry* prevEntry; >+ Entry** tab; >+ >+ long int hash; >+ long int index; >+ >+ XMutexClaim(&hasht->mutex); >+ >+ tab = hasht->table; >+ >+ hash = getHash((char*)key); >+ index = (hash & 0x7FFFFFFF) % hasht->table_len; >+ >+ prevEntry = NULL; >+ for (entry = tab[index]; entry != NULL; entry = (Entry*)entry->next) >+ { >+ if (hash == entry->hash) >+ { >+ if (match(entry,key)) >+ { >+ if (prevEntry == NULL) >+ tab[index] = entry->next; >+ else >+ prevEntry->next = entry->next; >+ >+ deleteEntry(entry); >+ hasht->count--; >+ XMutexRelease(&hasht->mutex); >+ return; >+ } >+ } >+ prevEntry = entry; >+ } >+ XMutexRelease(&hasht->mutex); >+} >Index: src-native-new/src/agents/native/java_profiler/segmentedValue.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/segmentedValue.h >diff -N src-native-new/src/agents/native/java_profiler/segmentedValue.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/segmentedValue.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,52 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: segmentedValue.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __SEGMENTEDVALUE_H__ >+#define __SEGMENTEDVALUE_H__ 1 >+ >+ >+#if defined __cplusplus >+ extern "C" { >+#endif >+/****************************** >+ * SegmentedValue types and methods >+ ******************************/ >+ >+/* RKD: The segmented values were initially designed to be a multiworded value. This turned out to >+ be a severe bottleneck due to memory fragmentation so it was disabled. Defining >+ SEGMENTED_VALUE_MULTIWORD will re-enable this function. >+*/ >+#ifdef SEGMENTED_VALUE_MULTIWORD >+typedef struct { >+ unsigned long numberOfWords; >+ unsigned long *values; >+} SegmentedValue_t; >+#else >+typedef struct { >+ unsigned long value; >+} SegmentedValue_t; >+#endif >+ >+void jvmpiAgent_incrementSegmentedValue(SegmentedValue_t *segValue, >+ unsigned long count); >+ >+SegmentedValue_t * jvmpiAgent_copySegmentedValue(SegmentedValue_t *target, >+ SegmentedValue_t *source); >+ >+void jvmpiAgent_initializeSegmentedValue(SegmentedValue_t *segValue, >+ int freeFlag); >+ >+#if defined __cplusplus >+ } >+#endif >+ >+#endif >Index: src-native-new/src/agents/native/java_profiler/segmentedValue.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/segmentedValue.c >diff -N src-native-new/src/agents/native/java_profiler/segmentedValue.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/segmentedValue.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,66 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: segmentedValue.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <stdlib.h> >+#include <string.h> >+#include "segmentedValue.h" >+#include "utility.h" >+ >+void jvmpiAgent_initializeSegmentedValue(SegmentedValue_t *segValue, int freeFlag) >+{ >+#ifdef SEGMENTED_VALUE_MULTIWORD >+ segValue->numberOfWords = 1; >+ if (freeFlag) >+ { >+ free(segValue->values); >+ } >+ segValue->values = (unsigned long *)jvmpiAgent_Calloc(segValue->numberOfWords * sizeof(unsigned long)); >+ segValue->values[0] = 0; >+#else >+ segValue->value=0; >+#endif >+} >+ >+SegmentedValue_t * jvmpiAgent_copySegmentedValue(SegmentedValue_t *target, SegmentedValue_t *source) >+{ >+#ifdef SEGMENTED_VALUE_MULTIWORD >+ int size = source->numberOfWords * sizeof(unsigned long); >+ *target = *source; >+ target->values = (unsigned long *)jvmpiAgent_Calloc(size); >+ memcpy(target->values, source->values, size); >+#else >+ *target = *source; >+#endif >+ return target; >+} >+ >+void jvmpiAgent_incrementSegmentedValue(SegmentedValue_t *segValue, unsigned long count) >+{ >+#ifdef SEGMENTED_VALUE_MULTIWORD >+ if (segValue->values[count] == 0xFFFFFFFF) { >+ /* Going to wrap the current value */ >+ if (count+1 == segValue->numberOfWords) >+ { >+ /* Need to increase the number of words in the collation values list */ >+ unsigned long *p = segValue->values; >+ segValue->numberOfWords++; >+ segValue->values = (unsigned long *)jvmpiAgent_Calloc(segValue->numberOfWords * sizeof(unsigned long)); >+ memcpy(segValue->values, p, (segValue->numberOfWords-1) * sizeof(unsigned long)); >+ free(p); >+ } >+ jvmpiAgent_incrementSegmentedValue(segValue, count+1); >+ } >+ segValue->values[count]++; >+#else >+ segValue->value++; >+#endif >+} >Index: src-native-new/src/HCLauncher/version.rc >=================================================================== >RCS file: src-native-new/src/HCLauncher/version.rc >diff -N src-native-new/src/HCLauncher/version.rc >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/version.rc 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,110 @@ >+#include "../../include/tptp/version.h" >+//Microsoft Developer Studio generated resource script. >+// >+#include "resource.h" >+ >+#define APSTUDIO_READONLY_SYMBOLS >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 2 resource. >+// >+#include "afxres.h" >+ >+///////////////////////////////////////////////////////////////////////////// >+#undef APSTUDIO_READONLY_SYMBOLS >+ >+///////////////////////////////////////////////////////////////////////////// >+// English (U.S.) resources >+ >+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) >+#ifdef _WIN32 >+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US >+#pragma code_page(1252) >+#endif //_WIN32 >+ >+#ifndef _MAC >+///////////////////////////////////////////////////////////////////////////// >+// >+// Version >+// >+ >+VS_VERSION_INFO VERSIONINFO >+ FILEVERSION _VERSION_WIN >+ PRODUCTVERSION _VERSION_WIN >+ FILEFLAGSMASK 0x3fL >+#ifdef _DEBUG >+ FILEFLAGS 0x1L >+#else >+ FILEFLAGS 0x0L >+#endif >+ FILEOS 0x40004L >+ FILETYPE 0x2L >+ FILESUBTYPE 0x0L >+BEGIN >+ BLOCK "StringFileInfo" >+ BEGIN >+ BLOCK "040904b0" >+ BEGIN >+ VALUE "Comments", "\0" >+ VALUE "CompanyName", _COMPANY_NAME >+ VALUE "FileDescription", "Agent Controller Launcher Library\0" >+ VALUE "FileVersion", _VERSION >+ VALUE "InternalName", "hclaunch\0" >+ VALUE "LegalCopyright", _COPYRIGHT >+ VALUE "LegalTrademarks", "\0" >+ VALUE "OriginalFilename", "HCLaunch.dll\0" >+ VALUE "PrivateBuild", "\0" >+ VALUE "ProductName", "\0" >+ VALUE "ProductVersion", _VERSION >+ VALUE "SpecialBuild", "\0" >+ END >+ END >+ BLOCK "VarFileInfo" >+ BEGIN >+ VALUE "Translation", 0x409, 1200 >+ END >+END >+ >+#endif // !_MAC >+ >+ >+#ifdef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// TEXTINCLUDE >+// >+ >+1 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "resource.h\0" >+END >+ >+2 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "#include ""afxres.h""\r\n" >+ "\0" >+END >+ >+3 TEXTINCLUDE DISCARDABLE >+BEGIN >+ "\r\n" >+ "\0" >+END >+ >+#endif // APSTUDIO_INVOKED >+ >+#endif // English (U.S.) resources >+///////////////////////////////////////////////////////////////////////////// >+ >+ >+ >+#ifndef APSTUDIO_INVOKED >+///////////////////////////////////////////////////////////////////////////// >+// >+// Generated from the TEXTINCLUDE 3 resource. >+// >+ >+ >+///////////////////////////////////////////////////////////////////////////// >+#endif // not APSTUDIO_INVOKED >+ >Index: src-native-new/src/agents/native/heapsnapshots/SnapshotFiller.h >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/SnapshotFiller.h >diff -N src-native-new/src/agents/native/heapsnapshots/SnapshotFiller.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/SnapshotFiller.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,34 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: SnapshotFiller.h,v 1.4 2005/04/06 19:15:49 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef SNAPSHOT_FILLER_H >+#define SNAPSHOT_FILLER_H >+ >+#include <jvmpi.h> >+ >+class SnapshotFiller { >+ public: >+ virtual void FillClassInfo(jobjectID cls, >+ const char* className, >+ int numStaticReferenceFields, >+ int numInterfaces, >+#ifdef __OS400__ >+ int instanceSize, >+ jobjectID* classRefs) = 0; >+#else >+ int instanceSize) = 0; >+#endif >+ >+ virtual void FillJvmpiSnapshot(char* begin, char* end) = 0; >+}; >+ >+#endif /* SNAPSHOT_FILLER_H */ >Index: src-native-new/src/agents/native/java_profiler/options.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/options.h >diff -N src-native-new/src/agents/native/java_profiler/options.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/options.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,181 @@ >+ /********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: options.h,v 1.7 2006/05/05 03:21:22 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+ >+#ifndef __OPTIONS_H__ >+#define __OPTIONS_H__ 1 >+ >+#if defined __cplusplus >+ extern "C" { >+#endif >+ >+/* DNS - added following include */ >+#include "RADataTransfer.h" >+ >+enum IdStyle {IdStyleStatic, IdStyleRelocatable, IdStyleStaticAndRelocatable}; >+ >+enum ObjRefMode {RespectFilter, Filter4Owner, IgnoreFilter}; >+ >+enum Gc {GcNone, GcDeletes, GcMoves, GcDeletesAndMoves}; >+ >+enum StackInfo {StackInfoNone, StackInfoNormal, StackInfoContiguous, StackInfoBoundary, StackInfoBoundaryAndContiguous}; >+ >+enum CompressLevel {CompressNone, CompressAggregate}; >+ >+/* >+HeapInfo is depreciated. Hoever, existing clients will keep working: >+ HeapInfoNone == TraceModeNoObjectCorrelation, and >+ HeapInfoAll == TraceModeFull >+enum HeapInfo {HeapInfoNone, HeapInfoAll }; >+*/ >+ >+/* 57681 don't add new tags at the beginning: leave it TraceModeFull. >+ * Otherwise you'll change the agent's behavior >+ * when _jvmpiagent_Options.mode is never set, which is common. >+ */ >+enum TraceMode {TraceModeFull, TraceModeNoObjectCorrelation, TraceModeStackSampling, TraceHeap, TraceOptimizedHeap, TraceModeNone }; >+ >+enum TraceStartMode {TraceStartModeFilter, TraceStartModeTriggerSingleThreaded, TraceStartModeTriggerMultiThreaded}; >+ >+enum BurstMode {BurstModeNone, BurstModeSeconds, BurstModeInvocations, BurstModeSecondsAndInvocations}; >+ >+enum MonitorMode {MonitorNone, MonitorAll}; >+ >+/* 60879 a structure used for storing options that the piAgent otherwise doesn't care about. >+ This is used mainly so that we can echo back these options to the UI. */ >+ >+typedef struct gen_option { >+ char *key; >+ char *value; >+ struct gen_option *next; >+} generic_option; >+ >+/** These are the global options specified on the command line and/or profile of the agent at >+ invocation time. >+ */ >+typedef struct { >+ unsigned int unreferencedSymbols:1; /* Print unreferenced symbols? (FALSE) */ >+ unsigned int timestamp:1; /* Provide timestamps on all events (TRUE) */ >+ unsigned int debugHash:1; /* Debug the hash table (FALSE) */ >+ unsigned int standalone:1; /* Standalone mode (FALSE) */ >+ unsigned int application:1; /* Application mode (FALSE) */ >+ unsigned int enabled:1; /* Enabled mode ie. attachable (TRUE) */ >+ unsigned int traceExceptions:1; /* Trace Exceptions (FALSE) */ >+ unsigned int enableExceptionTracing:1; /* Place hooks for exception tracing (TRUE) */ >+ unsigned int enableLineCoverage:1; /* Place hooks for Line Coverage (TRUE) */ >+ unsigned int collationValues:1; /* Print collation_value attribute on each element */ >+ unsigned int filters:1; /* Print FILTER Elements (TRUE) */ >+ unsigned int options:1; /* Print OPTIONS Elements (TRUE) */ >+ unsigned int traceIdrefs:1; /* Print trace_idref attribute on each element */ >+ unsigned int gcDefault:1; /* GC default option */ >+ unsigned int methodCounts:1; /* METHOD_COUNTS option */ >+ unsigned int classLoadDetails:1; /* CLASS_LOAD_DETAILS options */ >+ unsigned int methodDetails:1; /* Provied a detailed descriptive about the methods (FALSE) */ >+ unsigned int objAllocIsArray:1; /* OBJ_ALLOC_IS_ARRAY attribute option (TRUE) */ >+ unsigned int contextFlow:1; /* CONTEXT_FLOW attribute option */ >+ unsigned int ticket:1; /* TICKET (TRUE) */ >+ unsigned int modeSet:1; /* Was "mode" set on command line? */ >+ unsigned int exceptionTracingSet:1; /* Was "exceptionTracing" set on the command line? */ >+ unsigned int lineCoverageSet:1; /* Was "lineCoverage" set on the command line? */ >+ unsigned int gcSet:1; /* Was "trackGCEvent" set on the command line? */ >+ unsigned int heapInfoCountSet:1; /* Was "optHeapCount" set on the command line */ >+ unsigned int heapInfoFilePrefixSet:1; /* Was "optHeapFilePrefix" set on the command line */ >+ unsigned int jinsightFormat:1; /* I/O is in Jinsight format (FALSE)*/ >+ unsigned int cpuTime:1; /* Are we emmiting thread cpuTime (FALSE) */ >+ unsigned int llDataEnabled:1; /* Are we possibly emmiting line level data (FALSE) */ >+ enum IdStyle idStyle; >+ enum ObjRefMode objRefMode; /* RespectFilter, Filter4Owner, IgnoreFilter*/ >+ enum Gc gc; >+ enum StackInfo stackInfo; /* Stack maintenance mode (StackInfoContiguous)*/ >+ enum CompressLevel compressLevel; /* Compression level (CompressNone): controls pre-aggregate * 140009 */ >+ /* Depreciated: enum HeapInfo heapInfo; */ /* Object maintenence mode (HeapInfoAll) */ >+ enum TraceMode mode; /* Mode to trace in (TraceModeFull) */ >+ enum TraceStartMode startMode; /* When to start emiting trace info (TraceStartModeFilter) */ >+ enum BurstMode burstMode; /* Whether we are tring in burst mode (BurstModeNone) */ >+ enum MonitorMode monitorMode; /* Whether monitor events are being tracked */ >+ unsigned short burstInvocations; /* The number of invocations to trace per monitoring session */ >+ unsigned short burstSeconds; /* The number of seconds to trace per monitoring session */ >+ unsigned short boundaryDepth; /* The depth to trace into filtered code */ >+ int heapInfoCount; /* Number of heaps in each cycle, in TraceHeap and TraceOptimizedHeap modes (Default: 2) */ >+ ra_data_target_hdl_t targetHdl; >+ char *invocationOptions; /* The invocation options from the command line */ >+ char *filterFileName; /* Name of the filters file (filters.txt)*/ >+ char *triggerFileName; /* Name of the triggers file (triggers.txt)*/ >+ char *processName; /* Name of the process */ >+ char *processType; /* The type of process */ >+ char *outputFileName; /* Output file for trace */ >+ char *heapInfoFilePrefix; /* Filename prefix of the output trace in TraceHeap and TraceHeapOptimized modes (Default: heapinfo) */ >+ char *profileFile; /* Name of the profile file */ >+ char *workDir; /* Working directory (default is .) */ >+ char *extensionLibrary; /* The Agent Extension library name to load (empty string means none) */ >+ generic_option *unknowns; /* space to store the options the piAgent doesn't care about, but can echo back to the UI */ >+ unsigned int methodCountsOnly:1; /* METHOD_COUNTS_ONLY indicates if we want to track _ONLY_ method counts (without methodEntry/exit events) */ >+} Options; >+ >+/* The structure to hold the invocation options for this process */ >+extern Options _jvmpiAgent_Options; >+ >+/** PROCESS_INVOCATION_OPTIONS ******************************************* >+ * Takes the command line parameters and populates the _jvmpiAgent_Options >+ * with the correct values based upon the options specified. >+ * @param optionString - the command line args >+ * @returns >+ */ >+int jvmpiAgent_ProcessInvocationOptions(char *optionString); >+ >+/** PROCESS_PROFILE ****************************************************** >+ * Process the specified profile and set the profile options within the >+ * agent. >+ * @param profileName - the name of the profile file. >+ * @returns >+ */ >+int jvmpiAgent_processProfile(char *profileName); >+ >+/** SET_PROFILE_OPTION **************************************************** >+ * Sets the profile option specified by key to the value specified by >+ * value. >+ * @param key - the option that will be set >+ * @param value - the value that will be associated with the key. >+ * @returns >+ */ >+int jvmpiAgent_SetProfileOption(char * key, char * value); >+ >+/** CHECK_OPTIONS_CONSISTENCY ******************************************** >+ * Checks whether there is any conflict or inconsistency among various >+ * options. >+ * @returns -1 if error, 0 if no error >+ */ >+int jvmpiAgent_CheckOptionsConsistency(); >+ >+/** PRINT_OPTIONS ******************************************************** >+ * Prints the options >+ */ >+void jvmpiAgent_printOptions(); >+unsigned int jvmpiAgent_isPrintObjId(); >+unsigned int jvmpiAgent_isPrintStaticId(); >+unsigned int jvmpiAgent_isPrintMethodId(); >+void printUsage(); >+ >+/* initializeJvmpiAgentOptionsDefaults() - must be called at start up time */ >+void initializeJvmpiAgentOptionsDefaults(); >+ >+unsigned int jvmpiAgent_isTracingHeap(); >+ >+/* Piyush Agarwal */ >+/* If the piAgent is running in a controlled mode */ >+unsigned int jvmpiAgent_isControlled(); >+ >+#if defined __cplusplus >+ } >+#endif >+ >+#endif >Index: src-native-new/src/agents/perfmon/WinBuild/rac.dsp >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/rac.dsp >diff -N src-native-new/src/agents/perfmon/WinBuild/rac.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/rac.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,119 @@ >+# Microsoft Developer Studio Project File - Name="rac" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=rac - Win32 Release >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "rac.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "rac.mak" CFG="rac - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "rac - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "rac - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "rac - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "rac___Win32_Release" >+# PROP BASE Intermediate_Dir "rac___Win32_Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../resutils" /I "../../RABindings" /I "../../../transport/RACommon" /I "../../../transport/RASocket" /I "../../../transport/RADataTransfer" /I "../../../transport/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /dll /machine:I386 /libpath:"../../../../lib" /implib:"../../../../lib/rac.lib" /out:"..\..\..\..\bin\rac.dll" >+# SUBTRACT LINK32 /pdb:none >+ >+!ELSEIF "$(CFG)" == "rac - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "rac___Win32_Debug" >+# PROP BASE Intermediate_Dir "rac___Win32_Debug" >+# PROP BASE Ignore_Export_Lib 0 >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "..\..\..\..\lib" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /FD /c >+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../resutils" /I "../../RABindings" /I "../../../transport/RACommon" /I "../../../transport/RASocket" /I "../../../transport/RADataTransfer" /I "../../../transport/RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAC_EXPORTS" /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /dll /machine:I386 >+# SUBTRACT BASE LINK32 /pdb:none >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /dll /machine:I386 /libpath:"../../../../lib" /implib:"../../../../lib/rac.lib" /out:"..\..\..\..\bin\rac.dll" >+# SUBTRACT LINK32 /pdb:none >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "rac - Win32 Release" >+# Name "rac - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\rac\rac.c >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\rac\rac.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\rac\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak >=================================================================== >RCS file: src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak >diff -N src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/WinBuild/HCLauncher.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,274 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on HCLauncher.dsp >+!IF "$(CFG)" == "" >+CFG=HCLaunch - Win32 Debug >+!MESSAGE No configuration specified. Defaulting to HCLaunch - Win32 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "HCLaunch - Win32 Release" && "$(CFG)" != "HCLaunch - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "HCLauncher.mak" CFG="HCLaunch - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "HCLaunch - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "HCLaunch - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "HCLaunch - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hclaunch.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hclaunch.obj" >+ -@erase "$(INTDIR)\hclaunch.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\launcher_common.obj" >+ -@erase "$(INTDIR)\launcher_md.obj" >+ -@erase "$(INTDIR)\launcher_os400.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hclaunch.dll" >+ -@erase "$(OUTDIR)\hclaunch.exp" >+ -@erase "$(OUTDIR)\hclaunch.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "..\RACommon" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /Fp"$(INTDIR)\HCLauncher.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\HCLauncher.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib /nologo /dll /incremental:no /pdb:"$(OUTDIR)\hclaunch.pdb" /machine:I386 /out:"$(OUTDIR)\hclaunch.dll" /implib:"$(OUTDIR)\hclaunch.lib" >+LINK32_OBJS= \ >+ "$(INTDIR)\hclaunch.obj" \ >+ "$(INTDIR)\launcher_common.obj" \ >+ "$(INTDIR)\launcher_md.obj" \ >+ "$(INTDIR)\launcher_os400.obj" \ >+ "$(INTDIR)\hclaunch.res" \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" >+ >+"$(OUTDIR)\hclaunch.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "HCLaunch - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\hclaunch.dll" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\hclaunch.obj" >+ -@erase "$(INTDIR)\hclaunch.res" >+ -@erase "$(INTDIR)\java.obj" >+ -@erase "$(INTDIR)\launcher_common.obj" >+ -@erase "$(INTDIR)\launcher_md.obj" >+ -@erase "$(INTDIR)\launcher_os400.obj" >+ -@erase "$(INTDIR)\RAComm.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hclaunch.dll" >+ -@erase "$(OUTDIR)\hclaunch.exp" >+ -@erase "$(OUTDIR)\hclaunch.ilk" >+ -@erase "$(OUTDIR)\hclaunch.lib" >+ -@erase "$(OUTDIR)\hclaunch.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\RACommon" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HCLaunch_EXPORTS" /Fp"$(INTDIR)\HCLauncher.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hclaunch.res" /d "_DEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\HCLauncher.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib rpcrt4.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hclaunch.pdb" /debug /machine:I386 /out:"$(OUTDIR)\hclaunch.dll" /implib:"$(OUTDIR)\hclaunch.lib" /pdbtype:sept >+LINK32_OBJS= \ >+ "$(INTDIR)\hclaunch.obj" \ >+ "$(INTDIR)\launcher_common.obj" \ >+ "$(INTDIR)\launcher_md.obj" \ >+ "$(INTDIR)\launcher_os400.obj" \ >+ "$(INTDIR)\hclaunch.res" \ >+ "$(INTDIR)\java.obj" \ >+ "$(INTDIR)\RAComm.obj" >+ >+"$(OUTDIR)\hclaunch.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("HCLauncher.dep") >+!INCLUDE "HCLauncher.dep" >+!ELSE >+!MESSAGE Warning: cannot find "HCLauncher.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "HCLaunch - Win32 Release" || "$(CFG)" == "HCLaunch - Win32 Debug" >+SOURCE=..\HCLauncher\hclaunch.c >+ >+"$(INTDIR)\hclaunch.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\RACommon\java.c >+ >+"$(INTDIR)\java.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\HCLauncher\launcher_common.c >+ >+"$(INTDIR)\launcher_common.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\HCLauncher\launcher_md.c >+ >+"$(INTDIR)\launcher_md.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\HCLauncher\launcher_os400.c >+ >+"$(INTDIR)\launcher_os400.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\RACommon\RAComm.c >+ >+"$(INTDIR)\RAComm.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\HCLauncher\version.rc >+ >+!IF "$(CFG)" == "HCLaunch - Win32 Release" >+ >+ >+"$(INTDIR)\hclaunch.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hclaunch.res" /i "\eclipse\head-workspace\org.eclipse.tptp.platform.agentcontroller\src-native\collection\framework\HCLauncher" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "HCLaunch - Win32 Debug" >+ >+ >+"$(INTDIR)\hclaunch.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hclaunch.res" /i "\eclipse\head-workspace\org.eclipse.tptp.platform.agentcontroller\src-native\collection\framework\HCLauncher" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/java/WinBuild/log_agent.dsp >=================================================================== >RCS file: src-native-new/src/agents/java/WinBuild/log_agent.dsp >diff -N src-native-new/src/agents/java/WinBuild/log_agent.dsp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/WinBuild/log_agent.dsp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,123 @@ >+# Microsoft Developer Studio Project File - Name="log_agent" - Package Owner=<4> >+# Microsoft Developer Studio Generated Build File, Format Version 6.00 >+# ** DO NOT EDIT ** >+ >+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 >+ >+CFG=log_agent - Win32 Debug >+!MESSAGE This is not a valid makefile. To build this project using NMAKE, >+!MESSAGE use the Export Makefile command and run >+!MESSAGE >+!MESSAGE NMAKE /f "log_agent.mak". >+!MESSAGE >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "log_agent.mak" CFG="log_agent - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "log_agent - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "log_agent - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+ >+# Begin Project >+# PROP AllowPerConfigDependencies 0 >+# PROP Scc_ProjName "" >+# PROP Scc_LocalPath "" >+CPP=cl.exe >+MTL=midl.exe >+RSC=rc.exe >+ >+!IF "$(CFG)" == "log_agent - Win32 Release" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 0 >+# PROP BASE Output_Dir "Release" >+# PROP BASE Intermediate_Dir "Release" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 0 >+# PROP Output_Dir "bin" >+# PROP Intermediate_Dir "Release" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /YX /FD /c >+# ADD CPP /nologo /MT /W3 /GX /O2 /Ob0 /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /YX /FD /c >+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "NDEBUG" >+# ADD RSC /l 0x409 /fo"Release/hcjbnd.res" /d "NDEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /version:0.1 /dll /map /machine:I386 /out:"..\..\..\..\bin\hcjbnd.dll" /libpath:"..\..\..\..\lib" >+ >+!ELSEIF "$(CFG)" == "log_agent - Win32 Debug" >+ >+# PROP BASE Use_MFC 0 >+# PROP BASE Use_Debug_Libraries 1 >+# PROP BASE Output_Dir "Debug" >+# PROP BASE Intermediate_Dir "Debug" >+# PROP BASE Target_Dir "" >+# PROP Use_MFC 0 >+# PROP Use_Debug_Libraries 1 >+# PROP Output_Dir "bin" >+# PROP Intermediate_Dir "Debug" >+# PROP Ignore_Export_Lib 0 >+# PROP Target_Dir "" >+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /YX /FD /GZ /c >+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\RABindings" /I "..\..\..\transport\RACommon" /I "..\..\..\transport\RASocket" /I "..\..\..\transport\RADataTransfer" /I "..\..\..\transport\RASharedMemory" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LOG_AGENT_EXPORTS" /YX /FD /GZ /c >+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 >+# ADD BASE RSC /l 0x409 /d "_DEBUG" >+# ADD RSC /l 0x409 /fo"Debug/hcjbnd.res" /d "_DEBUG" >+BSC32=bscmake.exe >+# ADD BASE BSC32 /nologo >+# ADD BSC32 /nologo >+LINK32=link.exe >+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept >+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hcclco.lib hccldt.lib hccls.lib hcbnd.lib hcclsm.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\..\bin\hcjbnd.dll" /pdbtype:sept /libpath:"..\..\..\..\lib" >+ >+!ENDIF >+ >+# Begin Target >+ >+# Name "log_agent - Win32 Release" >+# Name "log_agent - Win32 Debug" >+# Begin Group "Source Files" >+ >+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" >+# Begin Source File >+ >+SOURCE=..\hcjbnd.c >+# End Source File >+# Begin Source File >+ >+SOURCE=..\hcjbnd.def >+# End Source File >+# End Group >+# Begin Group "Header Files" >+ >+# PROP Default_Filter "h;hpp;hxx;hm;inl" >+# Begin Source File >+ >+SOURCE=..\hcjbnd.h >+# End Source File >+# Begin Source File >+ >+SOURCE=..\resource.h >+# End Source File >+# End Group >+# Begin Group "Resource Files" >+ >+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" >+# Begin Source File >+ >+SOURCE=..\version.rc >+# End Source File >+# End Group >+# End Target >+# End Project >Index: src-native-new/src/agents/native/java_profiler/options.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/options.c >diff -N src-native-new/src/agents/native/java_profiler/options.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/options.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1373 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: options.c,v 1.11 2006/05/05 03:21:22 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <string.h> >+#include <stdio.h> >+#include <ctype.h> >+#include <stdlib.h> >+#include <errno.h> >+#include <sys/types.h> >+#include <sys/stat.h> >+ >+#ifdef _WIN32 >+#include <io.h> >+#include <direct.h> >+#define MKDIR(dirname) mkdir(dirname) >+#else >+#define MKDIR(dirname) mkdir((dirname), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) >+#endif >+ >+#include "options.h" >+#include "filters.h" >+#include "JvmpiWriter.h" >+#include "eventmask.h" >+#include "print.h" >+#include "utility.h" >+ >+/** >+ * MACROS >+ * To make the code more readable ;-) >+ */ >+#ifdef _WIN32 >+ #define STRICOLL _stricoll /* Case insensitive on Windows */ >+#else >+ #define STRICOLL strcoll /* Case sensitive on other platforms */ >+#endif >+ >+/* following two undefs were added to avoid conflict from new java.h defs ... 135623 */ >+#undef ATTACH_THREAD >+#undef DETACH_THREAD >+ >+#if defined __cplusplus && defined _HPUX >+ #define ENV(e) e >+ #define ATTACH_THREAD(env) (_jvmpiAgent_jvm)->AttachCurrentThread((void**)&env, NULL) >+ #define DETACH_THREAD() (_jvmpiAgent_jvm)->DetachCurrentThread() >+ #define ENVPARM(env) >+#else >+ #define ENV(e) (*e) >+ #define ATTACH_THREAD(env) (*_jvmpiAgent_jvm)->AttachCurrentThread(_jvmpiAgent_jvm, (void**)&env, NULL) >+ #define DETACH_THREAD() (*_jvmpiAgent_jvm)->DetachCurrentThread(_jvmpiAgent_jvm) >+ #define ENVPARM(env) env, >+#endif >+ >+#define BOOLTOSTRING(b) (b ? "true" : "false") >+ >+ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+static const char* piAgentVersion= "@(#)piAgent version 6.0.0.0"; >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+/** Globals >+ */ >+Options _jvmpiAgent_Options = >+{ >+ 0 /* Do not output Unreferenced Symbols */ >+ ,1 /* Provide timestamps by default */ >+ ,0 /* Debug Hash table option */ >+ ,0 /* Standalone mode */ >+ ,0 /* Application mode */ >+ ,1 /* Enabled mode */ >+ ,0 /* TraceExceptions */ >+ ,0 /* EnableExceptions - MW Changed the default to "no" */ >+ ,0 /* enableLineCoverage - */ >+ ,0 /* CollationValues */ >+ ,1 /* Filters */ >+ ,1 /* Options */ >+ ,0 /* TraceIdrefs */ >+ ,1 /* GcDefaults */ >+ ,0 /* MethodCounts */ >+ ,0 /* ClassLoadDetails */ >+ ,0 /* MethodDetail */ >+ ,1 /* OBJ_ALLOC_IS_ARRAY (default) */ >+ ,0 /* CONTEXT_FLOW */ >+ ,1 /* TICKET (default) */ >+ ,0 /* MODE SET */ >+ ,0 /* EXCEPTION TRACING SET */ >+ ,0 /* LINE COVERAGE SET */ >+ ,0 /* GC SET */ >+ ,0 /* HEAP INFO COUNT SET */ >+ ,0 /* HEAP INFO FILE PREFIX SET */ >+ ,0 /* Jinsight I/O */ >+ ,0 /* cpuTime */ >+ ,0 /* LLDATA_ENABLED */ >+ ,IdStyleStatic >+ ,Filter4Owner /* Heap dump preference (default) */ >+ ,GcDeletes >+ ,StackInfoContiguous /* Stack mode preference (default) */ >+ ,CompressNone /* Compression level (default) */ /* 140009 */ >+ /* ,HeapInfoAll -- Depreciated */ >+ ,TraceModeFull >+ ,TraceStartModeFilter >+ ,BurstModeNone >+ ,MonitorNone >+ ,0 /* Burst timer */ >+ ,0 /* Burst invocations */ >+ ,1 /* boundary depth */ >+ ,2 /* heapInfoCount */ >+ #ifdef _HPUX >+ ,{(enum _dataTarget)0,0} /* Target Handle initialization - 171664 initialize to RA_SOCKET (0) type */ >+ #else >+ ,{0,0} /* Target Handle initialization - 171664 initialize to RA_SOCKET (0) type */ >+ #endif >+ , NULL /* The invocation options from the command line */ >+ , NULL /* Filter File (to be initialized) */ >+ , NULL /* Triggers file (to be initialized) */ >+ , NULL /* Default process name (to be initialized) */ >+ , NULL /* Default process type (to be initialized) */ >+ , NULL /* Default trace file name (to be initialized) */ >+ , NULL /* heapInfoFilePrefix (to be initialized) */ >+ , NULL /*Default profile file name (to be initialized) */ >+ , NULL /* Defualt working dir (to be initialized) */ >+ , NULL /* agent extension library name to load (empty means none) (to be initialized) */ >+ , NULL /* currently no unknown options */ >+ , 0 /* method_counts_only is off by default */ >+}; >+ >+#define DEFAULT_FILTER_FILENAME "filters.txt" >+#define DEFAULT_TRIGGER_FILENAME "triggers.txt" >+#define DEFAULT_PROCESS_NAME "Java Profiling Agent" >+#define DEFAULT_PROCESS_TYPE "Profiler" >+#define DEFAULT_OUTPUT_FILENAME "trace.trcxml" >+#define DEFAULT_HEAPINFO_FILEPREFIX "optHeap" >+#define DEFAULT_PROFILE_FILE "jvmpi.pro" >+#define DEFAULT_WORK_DIR "." >+#define DEFAULT_EXTENSION_LIBRARY "" >+ >+void initializeJvmpiAgentOptionsDefaults() { >+ /* initialize filterFileName */ >+ _jvmpiAgent_Options.filterFileName = (char *) malloc(strlen(DEFAULT_FILTER_FILENAME)+1); >+ strcpy(_jvmpiAgent_Options.filterFileName,DEFAULT_FILTER_FILENAME); >+ >+ /* initialize trigger filename */ >+ _jvmpiAgent_Options.triggerFileName = (char *)malloc(strlen(DEFAULT_TRIGGER_FILENAME)+1); >+ strcpy(_jvmpiAgent_Options.triggerFileName, DEFAULT_TRIGGER_FILENAME); >+ >+ /* initialize process name */ >+ _jvmpiAgent_Options.processName = (char *)malloc(strlen(DEFAULT_PROCESS_NAME)+1); >+ strcpy(_jvmpiAgent_Options.processName,DEFAULT_PROCESS_NAME); >+ >+ /* initialize process type */ >+ _jvmpiAgent_Options.processType = (char *)malloc(strlen(DEFAULT_PROCESS_TYPE)+1); >+ strcpy(_jvmpiAgent_Options.processType,DEFAULT_PROCESS_TYPE); >+ >+ /* initialize output file */ >+ _jvmpiAgent_Options.outputFileName = (char *)malloc(strlen(DEFAULT_OUTPUT_FILENAME)+1); >+ strcpy(_jvmpiAgent_Options.outputFileName,DEFAULT_OUTPUT_FILENAME); >+ >+ /* initialize the heap info file prefix */ >+ _jvmpiAgent_Options.heapInfoFilePrefix = (char *)malloc(strlen(DEFAULT_HEAPINFO_FILEPREFIX)+1); >+ strcpy(_jvmpiAgent_Options.heapInfoFilePrefix,DEFAULT_HEAPINFO_FILEPREFIX); >+ >+ /* intiialize the profile file */ >+ _jvmpiAgent_Options.profileFile = (char *)malloc(strlen(DEFAULT_PROFILE_FILE)+1); >+ strcpy(_jvmpiAgent_Options.profileFile,DEFAULT_PROFILE_FILE); >+ >+ /* initiailize the working dir */ >+ _jvmpiAgent_Options.workDir = (char *)malloc(strlen(DEFAULT_WORK_DIR)+1); >+ strcpy(_jvmpiAgent_Options.workDir,DEFAULT_WORK_DIR); >+ >+ /* initialize the extension library */ >+ _jvmpiAgent_Options.extensionLibrary = (char *)malloc(strlen(DEFAULT_EXTENSION_LIBRARY)+1); >+ strcpy(_jvmpiAgent_Options.extensionLibrary,DEFAULT_EXTENSION_LIBRARY); >+ >+} >+ >+static int getToken(char **src, char *buf, int buflen, char sep) >+{ >+ int i; >+ char *p = *src; >+ for (i = 0; i < buflen; i++) >+ { >+ if (p[i] == 0 || p[i] == sep) >+ { >+ buf[i] = 0; >+ if (p[i] == sep) >+ { >+ i++; >+ } >+ *src += i; >+ return i; >+ } >+ buf[i] = p[i]; >+ } >+ /* overflow */ >+ return 0; >+} >+ >+ >+/** PRINT_USAGE ********************************************************************** >+ * Print the command line useage of the program. >+ */ >+void printUsage() >+{ >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+#endif >+ fprintf(stdout, >+ "\n%s\n" >+ "usage: -XrunpiAgent[:[help]|[<option>=<value>, ...]]\n" >+ "\n" >+ "Option Name and Values\tDescription (Default value)\n" >+ "----------------------\t---------------------------\n" >+ "file=<file>\t\tName of output file. Only used when server=standalone.(trace.trcxml)\n" >+ "filters=<file>\t\tName of filter definitions. Only used when server=standalone.(filters.txt)\n" >+#if 0 >+ "profile=<file>\t\tname of profile file. Only used when server=standalone.(jvmpi.pro)\n" >+#ifdef _DEBUG >+ "debug=hash\t\toutputs the specified debugging information. (disabled in production build)\n" >+#endif >+#endif >+ "mode=full|noObjectCorrelation|sampling|heap|optHeap\tCollect object execution information?.(full)\n" >+ "server=standalone|enabled|controlled|application\tSpecifies how the Agent is to be run.(enabled)\n" >+#if 0 >+ "enableExceptionTracing=yes|no\tEnable JVM Exception tracing.(no)\n" >+ "enableLineCoverage=no|yes\tEnable Line coverage.(no)\n" >+#endif >+ "trackGcEvent=default|none|moves|frees|movesAndFrees\t Specifies the GC events that need to be tracked\n" >+ "optHeapCount\tSpecifies the number of heap dumps in each cycle, default 2, maximum 50\n" >+ "optHeapFilePrefix\tSpecifies the prefix of heap dump files (optHeap)\n" >+ "extensionLibrary\tSpecifies an agent extension library path and name to load in stand-alone mode\n" >+ "Example: java -XrunpiAgent:file=log.trcxml <classname>\n" >+ "\n", piAgentVersion); >+ fflush(stdout); >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#endif >+} >+ >+/** STRIP_LEADING_BLANKS ************************************************************** >+ * Remove all spaces from the beginning of a buffer >+ */ >+static char * stripLeadingBlanks(char * buffer) >+{ >+ int i; >+ int len = strlen(buffer); >+ for (i = 0; i <= len; i++) >+ { >+ if (!isspace(buffer[i])) >+ { >+ return buffer+i; >+ } >+ } >+ return buffer; >+} >+ >+ >+ >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+#endif >+ >+static int setBooleanOption(char * value, char * key, int defaultValue) >+{ >+ if (STRICOLL(value, "true") == 0) >+ { >+ return 1; >+ } >+ else if(STRICOLL(value, "false") == 0) >+ { >+ return 0; >+ } >+ else >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\"\n", key, value); >+ fflush(stderr); >+ return defaultValue; >+ } >+} >+ >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#endif >+ >+/* Piyush Agarwal >+ Get the absolute directory path for the optheap working dir*/ >+static void jvmpiAgent_getWorkDir(char* buf) >+{ >+/* Bug 64476 */ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+#ifdef MVS >+__atoe(_jvmpiAgent_Options.workDir) ; >+#endif >+ realpath(_jvmpiAgent_Options.workDir,buf); >+ buf += strlen(buf); >+#ifdef MVS >+__etoa(_jvmpiAgent_Options.workDir) ; >+#endif >+#ifdef _WIN32 >+ *buf = '\\'; /* file delim in Windows */ >+#else >+ *buf = '/'; /* file delim in Unix */ >+#endif >+ buf += 1; *buf = '\0'; >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+} >+ >+/** PRINT_OPTIONS ********************************************************************* >+ * >+ */ >+void jvmpiAgent_printOptions() >+{ >+ char fulldirpath[PATH_MAX]; >+ ThreadPrivateStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+ jvmpiAgent_PrintOption(tps, "CLASS_LOAD_DETAILS", BOOLTOSTRING(_jvmpiAgent_Options.classLoadDetails)); >+ jvmpiAgent_PrintOption(tps, "METHOD_DETAILS", BOOLTOSTRING(_jvmpiAgent_Options.methodDetails)); >+ jvmpiAgent_PrintOption(tps, "COLLATION_VALUES", BOOLTOSTRING(_jvmpiAgent_Options.collationValues)); >+ jvmpiAgent_PrintOption(tps, "CONTEXT_FLOW", BOOLTOSTRING(_jvmpiAgent_Options.contextFlow)); >+#if 0 >+ jvmpiAgent_PrintOption(tps, "EXCEPTION_TRACING", BOOLTOSTRING(_jvmpiAgent_Options.traceExceptions)); >+#endif >+ jvmpiAgent_PrintOption(tps, "FILTERS", BOOLTOSTRING(_jvmpiAgent_Options.filters)); >+ /* "GC" is depreciated */ >+ jvmpiAgent_PrintOption(tps, "TRACK_GC_EVENT_TYPES", _jvmpiAgent_Options.gc == GcNone ? "none" : _jvmpiAgent_Options.gc == GcDeletes ? "frees" : _jvmpiAgent_Options.gc == GcMoves ? "moves" : "freesAndMoves"); >+ jvmpiAgent_PrintOption(tps, "ID_STYLE", _jvmpiAgent_Options.idStyle == IdStyleStatic ? "static" : _jvmpiAgent_Options.idStyle == IdStyleRelocatable ? "relocatable" : "staticAndRelocatable"); >+ jvmpiAgent_PrintOption(tps, "OBJ_REF_MODE", _jvmpiAgent_Options.objRefMode == RespectFilter ? "respectFilter" : _jvmpiAgent_Options.objRefMode == Filter4Owner ? "filterOwner" : "ignoreFilter"); >+ jvmpiAgent_PrintOption(tps, "METHOD_COUNTS", BOOLTOSTRING(_jvmpiAgent_Options.methodCounts)); >+ jvmpiAgent_PrintOption(tps, "OBJ_ALLOC_IS_ARRAY", BOOLTOSTRING(_jvmpiAgent_Options.objAllocIsArray)); >+ jvmpiAgent_PrintOption(tps, "OPTIONS", BOOLTOSTRING(_jvmpiAgent_Options.options)); >+ jvmpiAgent_PrintOption(tps, "STACK_INFORMATION", _jvmpiAgent_Options.stackInfo == StackInfoNone ? "none" : _jvmpiAgent_Options.stackInfo == StackInfoNormal ? "normal" : _jvmpiAgent_Options.stackInfo == StackInfoBoundary ? "boundary" : _jvmpiAgent_Options.stackInfo == StackInfoContiguous ? "contiguous" : "boundaryAndContiguous"); >+ jvmpiAgent_PrintOption(tps, "COMPRESS", _jvmpiAgent_Options.compressLevel == CompressNone ? "none" : "aggregate"); /* 140009 */ >+ /* Depreciated: jvmpiAgent_PrintOption(tps, "ALLOCATION_INFORMATION", _jvmpiAgent_Options.heapInfo == HeapInfoAll ? "all" : "none" ); */ >+ jvmpiAgent_PrintOption(tps, "TRACE_MODE", >+ _jvmpiAgent_Options.mode == TraceModeFull ? "full" : >+ _jvmpiAgent_Options.mode == TraceModeNoObjectCorrelation ? "noObjectCorrelation" : >+ _jvmpiAgent_Options.mode == TraceModeStackSampling ? "sampling" : >+ _jvmpiAgent_Options.mode == TraceHeap ? "heap" : >+ _jvmpiAgent_Options.mode == TraceOptimizedHeap ? "optHeap" : >+ _jvmpiAgent_Options.mode == TraceModeNone ? "none" : >+ "unknown_mode_value"); >+ jvmpiAgent_PrintOption(tps, "TICKET", BOOLTOSTRING(_jvmpiAgent_Options.ticket)); >+ jvmpiAgent_PrintOption(tps, "TIMESTAMPS", BOOLTOSTRING(_jvmpiAgent_Options.timestamp)); >+ jvmpiAgent_PrintOption(tps, "TRACE_IDREFS", BOOLTOSTRING(_jvmpiAgent_Options.traceIdrefs)); >+ jvmpiAgent_PrintOption(tps, "UNREFERENCED_SYMBOLS", BOOLTOSTRING(_jvmpiAgent_Options.unreferencedSymbols)); >+ jvmpiAgent_PrintOption(tps, "CPU_TIME", BOOLTOSTRING(_jvmpiAgent_Options.cpuTime)); >+ jvmpiAgent_PrintOption(tps, "LLDATA_ENABLED", BOOLTOSTRING(_jvmpiAgent_Options.llDataEnabled)); >+ jvmpiAgent_PrintOption(tps, "HEAP_INFO_FILE_PREFIX", _jvmpiAgent_Options.heapInfoFilePrefix); >+ jvmpiAgent_PrintOption(tps, "MONITOR_MODE",_jvmpiAgent_Options.monitorMode == MonitorAll ? "all" : "none"); >+ jvmpiAgent_PrintOption(tps, "METHOD_COUNTS_ONLY", BOOLTOSTRING(_jvmpiAgent_Options.methodCountsOnly)); >+ >+ /* Piyush Agarwal */ >+ /* Send options specifying that this is an optimized heap and also the work dir */ >+ /* Giri: <Defect 64462> Added the check for standalone mode instead of controlled mode */ >+ if ( !_jvmpiAgent_Options.standalone && _jvmpiAgent_Options.mode == TraceOptimizedHeap ) >+ { >+ jvmpiAgent_getWorkDir(fulldirpath) ; >+/* Bug 64476 */ >+#ifdef MVS >+ __etoa(fulldirpath) ; >+#endif >+ jvmpiAgent_PrintOption(tps, "WORK_DIR", fulldirpath); >+ jvmpiAgent_PrintOption(tps, "HEAP_FILE_TYPE", "optHeap" ); >+ jvmpiAgent_PrintOption(tps, "MULTIPLE_HEAP_DUMPS", "true" ); >+ jvmpiAgent_PrintOption(tps, "HEAP_FILE_SOURCE", "RAC" ); >+ >+ } >+ jvmpiAgent_PrintOption(tps, "EXTENSION_LIBRARY", _jvmpiAgent_Options.extensionLibrary); >+ >+ /* 60879 print all the 'unknown' options. These are the options that the piAgent doesn't care about. Despite >+ this, we need to echo these options back to the UI. */ >+ { >+ generic_option *cur_unknown = _jvmpiAgent_Options.unknowns; >+ while (cur_unknown != NULL) { >+ jvmpiAgent_PrintOption(tps,cur_unknown->key,cur_unknown->value); >+ cur_unknown = cur_unknown->next; >+ } >+ } >+} >+ >+/** >+ * addUnknownOption - 60879 add a key,value pair that the piAgent doesn't care about >+ * as an 'unknown' to the _jvmpiAgent_Options structure so that we can later echo >+ * it back to the UI. >+ ***/ >+ static void addUnknownOption(char *key, char *value) { >+ /* _jvmpiAgent_Options.unknowns is essentially a linked list. We only expect to encounter a dozen >+ or so unknown options, and moreover, we only do this processing once at start up. Hence the >+ performance impact of not using a more sophisticated data structure is negligible. */ >+ >+ >+ /* find a spot in the linked list where we can add the new unknown */ >+ generic_option *new_unknown = NULL; >+ if (_jvmpiAgent_Options.unknowns == NULL) { >+ _jvmpiAgent_Options.unknowns = (generic_option *) malloc(sizeof(generic_option)); >+ memset(_jvmpiAgent_Options.unknowns,0,sizeof(generic_option)); >+ new_unknown = _jvmpiAgent_Options.unknowns; >+ } else { >+ generic_option *cur_unknown = _jvmpiAgent_Options.unknowns; >+ while (cur_unknown->next != NULL) { >+ cur_unknown = cur_unknown->next; >+ } >+ new_unknown = (generic_option *) malloc(sizeof(generic_option)); >+ memset(new_unknown,0,sizeof(generic_option)); >+ cur_unknown->next = new_unknown; >+ } >+ >+ /* set the new unknown option */ >+ new_unknown->key = (char *) malloc(strlen(key)*sizeof(char)+1); >+ strcpy(new_unknown->key,key); >+ new_unknown->value = (char *) malloc(strlen(value)*sizeof(char)+1); >+ strcpy(new_unknown->value,value); >+ >+ } >+ >+ >+ >+ >+/** SET_PROFILE_OPTION ******************************************************************* >+ * >+ */ >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+#endif >+ >+int jvmpiAgent_SetProfileOption(char * key, char * value) >+{ >+ >+ if (key == NULL || value == NULL) { >+ return 0; >+ } >+ >+ if (STRICOLL(key, "CLASS_LOAD_DETAILS") == 0) >+ { >+ _jvmpiAgent_Options.classLoadDetails = setBooleanOption(value, key, _jvmpiAgent_Options.classLoadDetails); >+ } >+ >+ else if (STRICOLL(key,"METHOD_COUNTS_ONLY") == 0) >+ { >+ _jvmpiAgent_Options.methodCountsOnly = setBooleanOption(value, key, _jvmpiAgent_Options.methodCountsOnly); >+ /* turn on methodCounts option if methodCountsOnly option is turned on */ >+ _jvmpiAgent_Options.methodCounts = setBooleanOption(value, key, _jvmpiAgent_Options.methodCountsOnly); >+ } >+ >+ else if (STRICOLL(key, "METHOD_DETAILS") == 0) >+ { >+ _jvmpiAgent_Options.methodDetails = setBooleanOption(value, key, _jvmpiAgent_Options.methodDetails); >+ } >+ >+ else if (STRICOLL(key, "COLLATION_VALUES") == 0) >+ { >+ _jvmpiAgent_Options.collationValues = setBooleanOption(value, key, _jvmpiAgent_Options.collationValues); >+ } >+ else if (STRICOLL(key, "CONTEXT_FLOW") == 0) >+ { >+ _jvmpiAgent_Options.contextFlow = setBooleanOption(value, key, _jvmpiAgent_Options.contextFlow); >+ } >+ else if (STRICOLL(key, "EXCEPTION_TRACING") == 0) >+ { >+ if(!_jvmpiAgent_Options.exceptionTracingSet) >+ { >+ _jvmpiAgent_Options.traceExceptions = setBooleanOption(value, key, _jvmpiAgent_Options.traceExceptions); >+ /* Call the Java method to record the Exception Tracing state change */ >+ if (_jvmpiAgent_setExceptionTracing) >+ { >+ JNIEnv *env; >+ ATTACH_THREAD(env); >+ ENV(env)->CallStaticVoidMethod(ENVPARM(env) _jvmpiAgent_JVMPIException, _jvmpiAgent_setExceptionTracing, (jboolean)_jvmpiAgent_Options.traceExceptions ); >+ DETACH_THREAD(); >+ } >+ } >+ } >+ else if (STRICOLL(key, "FILTERS") == 0) >+ { >+ _jvmpiAgent_Options.filters = setBooleanOption(value, key, _jvmpiAgent_Options.filters); >+ } >+ else if ((STRICOLL(key, "GC") == 0 || STRICOLL(key, "TRACK_GC_EVENT_TYPES") == 0) >+ && !_jvmpiAgent_Options.gcSet) >+ { >+ if (STRICOLL(value, "default") == 0) >+ { >+ _jvmpiAgent_Options.gcDefault = 1; >+ } >+ else >+ { >+ _jvmpiAgent_Options.gcDefault = 0; >+ if (STRICOLL(value, "none") == 0) >+ { >+ _jvmpiAgent_Options.gc = GcNone; >+ } >+ else if (STRICOLL(value, "deletes") == 0 || STRICOLL(value, "frees") == 0) >+ { >+ /* "deletes" should be depreciated */ >+ _jvmpiAgent_Options.gc = GcDeletes; >+ } >+ else if (STRICOLL(value, "moves") == 0) >+ { >+ _jvmpiAgent_Options.gc = GcMoves; >+ } >+ else if (STRICOLL(value, "deletesAndMoves") == 0 || STRICOLL(value, "movesAndFrees") == 0) >+ { >+ /* "deletesAndMoves" should be depreciated */ >+ _jvmpiAgent_Options.gc = GcDeletesAndMoves; >+ } >+ else >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\"\n", key, value); >+ fflush(stderr); >+ return -1; >+ } >+ } >+ } >+ else if (STRICOLL(key, "ID_STYLE") == 0) >+ { >+ if (STRICOLL(value, "static") == 0) >+ { >+ _jvmpiAgent_Options.idStyle = IdStyleStatic; >+ } >+ else if (STRICOLL(value, "relocatable") == 0) >+ { >+ _jvmpiAgent_Options.idStyle = IdStyleRelocatable; >+ } >+ else if (STRICOLL(value, "staticAndRelocatable") == 0) >+ { >+ _jvmpiAgent_Options.idStyle = IdStyleStaticAndRelocatable; >+ } >+ else >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\"\n", key, value); >+ fflush(stderr); >+ return -1; >+ } >+ } >+ else if (STRICOLL(key, "OBJ_REF_MODE") == 0) >+ { >+ if (STRICOLL(value, "respectFilter") == 0) >+ { >+ _jvmpiAgent_Options.objRefMode = RespectFilter; >+ } >+ else if (STRICOLL(value, "filterOwner") == 0) >+ { >+ _jvmpiAgent_Options.objRefMode = Filter4Owner; >+ } >+ else if (STRICOLL(value, "ignoreFilter") == 0) >+ { >+ _jvmpiAgent_Options.objRefMode = IgnoreFilter; >+ } >+ else >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\"\n", key, value); >+ fflush(stderr); >+ return -1; >+ } >+ } >+ else if (STRICOLL(key, "TRACE_MODE") == 0) >+ { >+ if(!_jvmpiAgent_Options.modeSet) >+ { >+ if (STRICOLL(value, "full") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceModeFull; >+ } >+ else if (STRICOLL(value, "noObjectCorrelation") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceModeNoObjectCorrelation; >+ } >+ else if (STRICOLL(value, "sampling") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceModeStackSampling; >+ } >+ else if (STRICOLL(value, "heap") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceHeap; >+ if ( _jvmpiAgent_Options.gcDefault ) >+ _jvmpiAgent_Options.gc = GcMoves; >+ } >+ else if (STRICOLL(value, "optHeap") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceOptimizedHeap; >+ if ( _jvmpiAgent_Options.gcDefault ) >+ _jvmpiAgent_Options.gc = GcMoves; >+ >+ } >+ else if (STRICOLL(value, "none") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceModeNone; >+ } >+ else >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\"\n", key, value); >+ fflush(stderr); >+ return -1; >+ } >+ } >+ } >+ else if(STRICOLL(key, "BURST_MODE")==0) >+ { >+ if(STRICOLL(value, "invocations")==0) >+ { >+ _jvmpiAgent_Options.burstMode=BurstModeInvocations; >+ } >+ else if(STRICOLL(value, "seconds")==0) >+ { >+ _jvmpiAgent_Options.burstMode=BurstModeSeconds; >+ } >+ else if(STRICOLL(value, "secondsAndInvocations")==0) >+ { >+ _jvmpiAgent_Options.burstMode=BurstModeSecondsAndInvocations; >+ } >+ } >+ else if(STRICOLL(key, "MONITOR_MODE")==0) >+ { >+ if(STRICOLL(value, "all")==0) { >+ _jvmpiAgent_Options.monitorMode = MonitorAll; >+ } >+ >+ else >+ { >+ _jvmpiAgent_Options.monitorMode = MonitorNone; >+ } >+ } >+ >+ else if(STRICOLL(key, "BURST_INVOCATIONS")==0) >+ { >+ _jvmpiAgent_Options.burstInvocations=atoi(value); >+ } >+ else if(STRICOLL(key, "BURST_SECONDS")==0) >+ { >+ _jvmpiAgent_Options.burstSeconds=atoi(value); >+ } >+ else if(STRICOLL(key, "TRACE_START_MODE")==0) >+ { >+ if(STRICOLL(value, "filter")==0) >+ { >+ _jvmpiAgent_Options.startMode=TraceStartModeFilter; >+ } >+ else if(STRICOLL(value, "triggerSingleThreaded")==0) >+ { >+ _jvmpiAgent_Options.startMode=TraceStartModeTriggerSingleThreaded; >+ } >+ else if(STRICOLL(value, "triggerMultiThreaded")==0) >+ { >+ _jvmpiAgent_Options.startMode=TraceStartModeTriggerMultiThreaded; >+ } >+ } >+ else if (STRICOLL(key, "METHOD_COUNTS") == 0) >+ { >+ _jvmpiAgent_Options.methodCounts = setBooleanOption(value, key, _jvmpiAgent_Options.methodCounts); >+ } >+ else if (STRICOLL(key, "OBJ_ALLOC_IS_ARRAY") == 0) >+ { >+ _jvmpiAgent_Options.objAllocIsArray = setBooleanOption(value, key, _jvmpiAgent_Options.objAllocIsArray); >+ } >+ else if (STRICOLL(key, "OPTIONS") == 0) >+ { >+ _jvmpiAgent_Options.options = setBooleanOption(value, key, _jvmpiAgent_Options.options); >+ } >+ else if (STRICOLL(key, "STACK_INFORMATION") == 0) >+ { >+ if (STRICOLL(value, "none") == 0) >+ { >+ _jvmpiAgent_Options.stackInfo = StackInfoNone; >+ } >+ else if (STRICOLL(value, "normal") == 0) >+ { >+ _jvmpiAgent_Options.stackInfo = StackInfoNormal; >+ } >+ else if (STRICOLL(value, "boundary") == 0) >+ { >+ _jvmpiAgent_Options.stackInfo = StackInfoBoundary; >+ } >+ else if (STRICOLL(value, "contiguous") == 0) >+ { >+ _jvmpiAgent_Options.stackInfo = StackInfoContiguous; >+ } >+ else if (STRICOLL(value, "boundaryAndContiguous") == 0) >+ { >+ _jvmpiAgent_Options.stackInfo = StackInfoBoundaryAndContiguous; >+ } >+ else >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\"\n", key, value); >+ fflush(stderr); >+ return -1; >+ } >+ } >+ /* pre-aggregation: set compressLevel based on the option value */ >+ else if(STRICOLL(key, "COMPRESS")==0) /* 140009 */ >+ { >+ if (STRICOLL(value, "none") == 0) >+ { >+ _jvmpiAgent_Options.compressLevel=CompressNone; >+ } >+ else if (STRICOLL(value, "aggregate") == 0) >+ { >+ _jvmpiAgent_Options.compressLevel=CompressAggregate; >+ } >+ else >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\", it must be none or aggregate\n", key, value); >+ fflush(stderr); >+ return -1; >+ } >+ } >+ else if(STRICOLL(key, "ALLOCATION_INFORMATION") == 0) >+ { >+ if (STRICOLL(value, "none") == 0) >+ { >+ /* Depreciated: _jvmpiAgent_Options.heapInfo = HeapInfoNone; */ >+ _jvmpiAgent_Options.mode = TraceModeNoObjectCorrelation; >+ } >+ else if (STRICOLL(value, "optHeap") == 0) { >+ _jvmpiAgent_Options.mode = TraceOptimizedHeap; >+ } >+ else >+ { >+ /* Depreciated _jvmpiAgent_Options.heapInfo = HeapInfoAll; */ >+ _jvmpiAgent_Options.mode = TraceModeFull; >+ } >+ } >+ else if(STRICOLL(key, "BOUNDARY_DEPTH")==0) >+ { >+ _jvmpiAgent_Options.boundaryDepth=atoi(value); >+ } >+ else if (STRICOLL(key, "TICKET") == 0) >+ { >+ _jvmpiAgent_Options.ticket = setBooleanOption(value, key, _jvmpiAgent_Options.ticket); >+ } >+ else if (STRICOLL(key, "TIMESTAMPS") == 0) >+ { >+ _jvmpiAgent_Options.timestamp = setBooleanOption(value, key, _jvmpiAgent_Options.timestamp); >+ } >+ else if (STRICOLL(key, "TRACE_IDREFS") == 0) >+ { >+ _jvmpiAgent_Options.traceIdrefs = setBooleanOption(value, key, _jvmpiAgent_Options.traceIdrefs); >+ } >+ else if (STRICOLL(key, "UNREFERENCED_SYMBOLS") == 0) >+ { >+ _jvmpiAgent_Options.unreferencedSymbols = setBooleanOption(value, key, _jvmpiAgent_Options.unreferencedSymbols); >+ } >+ else if (STRICOLL(key, "THREAD_CPU_TIME") == 0 || STRICOLL(key, "CPU_TIME") == 0 ) >+ { >+ _jvmpiAgent_Options.cpuTime = setBooleanOption(value, key, _jvmpiAgent_Options.cpuTime); >+ } >+ else if (STRICOLL(key, "LLDATA_ENABLED") == 0) >+ { >+ _jvmpiAgent_Options.llDataEnabled = setBooleanOption(value, key, _jvmpiAgent_Options.llDataEnabled); >+ } >+ else if (STRICOLL(key, "HEAP_INFO_COUNT") == 0 && !_jvmpiAgent_Options.heapInfoCountSet) >+ { >+ _jvmpiAgent_Options.heapInfoCount = atoi(value); >+ if (_jvmpiAgent_Options.heapInfoCount<2 || _jvmpiAgent_Options.heapInfoCount>50) >+ { >+ fprintf(stderr, "Invalid %s option value \"%s\", it must be between 2 and 50\n", key, value); >+ fflush(stderr); >+ return -1; >+ } >+ } >+ else if (STRICOLL(key, "HEAP_INFO_FILE_PREFIX") == 0 && !_jvmpiAgent_Options.heapInfoFilePrefixSet) >+ { >+ strcpyrealloc(&_jvmpiAgent_Options.heapInfoFilePrefix, value); >+ } >+ else if (STRICOLL(key, "EXTENSION_LIBRARY") == 0) { >+ strcpyrealloc(&_jvmpiAgent_Options.extensionLibrary, value); >+ } >+ else { >+ /* 60879 add the unknown profiling option to the 'unknowns' list so that we >+ can echo it back to the UI */ >+ addUnknownOption(key,value); >+ } >+ >+ >+ >+ /**** bugzilla_54553 - it is valid to send non-profiling options to the RAC. >+ else >+ { >+ fprintf(stderr, "Unknown Profile Option \"%s\"\n", key); >+ return -1; >+ } >+ */ >+ return 0; >+} >+ >+ >+int jvmpiAgent_processProfile(char * fileName) >+{ >+ int rc = 0, linelen; >+ FILE * profileFile = NULL; >+ fpos_t filepos; >+ char *buffer; >+ char *strippedBuffer; >+ >+#ifdef MVS /* 174190 */ >+ __atoe(fileName); >+#endif >+ profileFile = fopen(fileName, "r"); >+ if (!profileFile) return -1; >+ /* loop until we reach the end of file */ >+ while (feof(profileFile) == 0) { >+ int len, i, ch; >+ char *end; >+ char *key; >+ char *value; >+ >+ /* save current file position */ >+ if (fgetpos(profileFile,&filepos) != 0) { >+ return -1; >+ } >+ >+ /* determine the length of the current line */ >+ linelen = 0; >+ do { >+ ch = fgetc(profileFile); >+ linelen++; >+ } while(ch != EOF && ch != '\n'); >+ /* allocate enough buffer space for the current line */ >+ buffer = (char *)malloc(linelen + 1); >+ /* rewind to the beginning of the line */ >+ if (fsetpos(profileFile,&filepos) != 0) { >+ free(buffer); >+ return -1; >+ } >+ >+ /* read the line */ >+ if (!fgets(buffer,linelen+1,profileFile)) { >+ /* loop termination condition */ >+ free(buffer); >+ break; >+ } >+ /* Truncate the buffer at the start of a comment */ >+ >+ end = strchr(buffer, '*'); >+ >+ >+ if (end) { >+ *end = '\0'; >+ } >+ >+ strippedBuffer = stripLeadingBlanks(buffer); >+ len = strlen(strippedBuffer); >+ if (!len) { >+ /* free the original buffer */ >+ free(buffer); >+ continue; >+ } >+ >+ >+ /* Parse key */ >+ >+ for (i = 0; i < len; i++) { >+ >+ if (isspace(strippedBuffer[i]) || strippedBuffer[i] == '=') { >+ key = (char *)malloc(i+1); >+ strncpy(key, strippedBuffer, i); >+ key[i] = '\0'; >+ strippedBuffer = strippedBuffer+i; >+ break; >+ } >+ } >+ strippedBuffer = stripLeadingBlanks(strippedBuffer); >+ >+ if (strippedBuffer[0] != '=') { >+ fprintf(stderr, "Syntax error in profile file\n"); >+ fflush(stderr); >+ rc = -1; >+ /* free the original buffer */ >+ free(buffer); >+ break; >+ } else { >+ strippedBuffer = strippedBuffer+1; >+ strippedBuffer = stripLeadingBlanks(strippedBuffer); >+ /* Parse value */ >+ for (i = 0; i <= len; i++) { >+ if (isspace(strippedBuffer[i]) || strippedBuffer[i] == '\0') { >+ value = (char *)malloc(i+1); >+ strncpy(value, strippedBuffer, i); >+ value[i] = '\0'; >+ break; >+ } >+ } >+ /*MW changed so that one bad option won't stop option processing */ >+/* if ( */ >+ jvmpiAgent_SetProfileOption(key,value); >+/* == -1) >+ { >+ rc = -1; >+ break; >+ } >+*/ } >+ >+ free(buffer); >+ free(key); >+ free(value); >+ } >+ >+ if (_jvmpiAgent_Options.gcDefault) { >+ if (_jvmpiAgent_Options.mode == TraceHeap || _jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ _jvmpiAgent_Options.gc = GcMoves; >+ } else { >+ _jvmpiAgent_Options.gc = _jvmpiAgent_Options.idStyle == IdStyleStatic ? GcDeletes : GcDeletesAndMoves; >+ } >+ } >+ fclose(profileFile); >+ return rc; >+} >+ >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#endif >+ >+/** PROCESS_INVOCATION_OPTIONS ******************************************* >+ * Takes the command line parameters and populates the _jvmpiAgent_Options >+ * with the correct values based upon the options specified. >+ * @param optionString - the command line args >+ * @returns >+ */ >+ >+int jvmpiAgent_ProcessInvocationOptions(char *str) >+{ >+ char *buf = 0; >+ int buflen; >+ int outputSpecified = 0; >+ if (str == NULL) str = ""; >+ >+ /* if "help" is specified print out the useage */ >+ if ((STRICOLL(str, "help")) == 0) >+ { >+ return -1; >+ } >+ >+ while (*str) >+ { >+ buflen= strlen(str)+1; >+ buf = (char *)malloc(buflen); >+ if (!buf) { >+ goto mem_error; >+ } >+ >+ /* All options contain an "=" */ >+ if (!getToken(&str, buf, buflen, '=')) >+ { >+ goto bad_option; >+ } >+ /* Specied output file */ >+ if (STRICOLL(buf, "file") == 0) >+ { >+ if (outputSpecified || !getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ strcpyrealloc(&_jvmpiAgent_Options.outputFileName, buf); >+ outputSpecified = 1; >+ } >+ else if (STRICOLL(buf, "enableExceptionTracing") == 0) >+ { >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ if (STRICOLL(buf, "yes") == 0) >+ { >+ _jvmpiAgent_Options.enableExceptionTracing = 1; >+ _jvmpiAgent_Options.exceptionTracingSet =1; >+ } >+ else if (STRICOLL(buf, "no") == 0) >+ { >+ _jvmpiAgent_Options.enableExceptionTracing = 0; >+ _jvmpiAgent_Options.exceptionTracingSet =1; >+ } >+ else >+ { >+ goto bad_option; >+ } >+ } >+ else if (STRICOLL(buf, "enableLineCoverage") == 0) >+ { >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ if (STRICOLL(buf, "yes") == 0) >+ { >+ _jvmpiAgent_Options.enableLineCoverage = 1; >+ _jvmpiAgent_Options.lineCoverageSet = 1; >+ } >+ else if (STRICOLL(buf, "no") == 0) >+ { >+ _jvmpiAgent_Options.enableLineCoverage = 0; >+ _jvmpiAgent_Options.lineCoverageSet = 1; >+ } >+ else >+ { >+ goto bad_option; >+ } >+ } >+ else if (STRICOLL(buf, "filters") == 0) >+ { >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ strcpyrealloc(&_jvmpiAgent_Options.filterFileName,buf); >+ } >+ else if (STRICOLL(buf, "debug") == 0) >+ { >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ if (STRICOLL(buf,"hash") == 0) >+ { >+ _jvmpiAgent_Options.debugHash = 1; >+ } >+ else >+ { >+ goto bad_option; >+ } >+ } >+ /* Mode of operation */ >+ else if (STRICOLL(buf, "server") == 0) >+ { >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ /* If standalone */ >+ if (STRICOLL(buf,"standalone") == 0) >+ { >+ _jvmpiAgent_Options.standalone = 1; >+ _jvmpiAgent_Options.enabled = 0; >+ } >+ /* If enabled */ >+ else if (STRICOLL(buf, "enabled") == 0) >+ { >+ _jvmpiAgent_Options.standalone = 0; >+ _jvmpiAgent_Options.enabled = 1; >+ } >+ /* If controlled */ >+ else if (STRICOLL(buf, "controlled") == 0) >+ { >+ _jvmpiAgent_Options.standalone = 0; >+ _jvmpiAgent_Options.enabled = 0; >+ } >+ /* If application */ >+ else if (STRICOLL(buf, "application") == 0) >+ { >+ _jvmpiAgent_Options.standalone = 0; >+ _jvmpiAgent_Options.enabled = 1; >+ _jvmpiAgent_Options.application=1; >+ } >+ /* If application, partially controlled by the RAC itself */ >+ else if (STRICOLL(buf, "applicationControlled") == 0) /* 215066 */ >+ { >+ _jvmpiAgent_Options.standalone = 0; >+ _jvmpiAgent_Options.enabled = 0; >+ _jvmpiAgent_Options.application=1; >+ } >+ else >+ { >+ goto bad_option; >+ } >+ } >+ else if (STRICOLL(buf, "mode") == 0) >+ { >+ if (_jvmpiAgent_Options.modeSet || !getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ /* If standalone */ >+ if (STRICOLL(buf,"full") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceModeFull; >+ _jvmpiAgent_Options.modeSet = 1; >+ } >+ /* If enabled */ >+ else if (STRICOLL(buf, "noObjectCorrelation") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceModeNoObjectCorrelation; >+ _jvmpiAgent_Options.modeSet = 1; >+ } >+ /* If controlled */ >+ else if (STRICOLL(buf, "sampling") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceModeStackSampling; >+ _jvmpiAgent_Options.modeSet = 1; >+ } >+ /* If heap */ >+ else if (STRICOLL(buf, "heap") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceHeap; >+ _jvmpiAgent_Options.modeSet = 1; >+ } >+ /* If optimizedHeap */ >+ else if (STRICOLL(buf, "optHeap") == 0) >+ { >+ _jvmpiAgent_Options.mode = TraceOptimizedHeap; >+ _jvmpiAgent_Options.modeSet = 1; >+ } >+ else if (STRICOLL(buf, "none") == 0) >+ { >+ /* See Bugzilla 57136 for all use of TraceModeNone */ >+ _jvmpiAgent_Options.mode = TraceModeNone; >+ _jvmpiAgent_Options.modeSet = 1; >+ } >+ else >+ { >+ goto bad_option; >+ } >+ } >+ else if (STRICOLL(buf, "trackGcEvent") == 0) >+ { >+ if (_jvmpiAgent_Options.gcSet || !getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ >+ if (STRICOLL(buf,"default") == 0) >+ { >+ _jvmpiAgent_Options.gcDefault = 1; >+ _jvmpiAgent_Options.gcSet = 1; >+ } >+ else if (STRICOLL(buf, "none") == 0) >+ { >+ _jvmpiAgent_Options.gcDefault = 0; >+ _jvmpiAgent_Options.gc = GcNone; >+ _jvmpiAgent_Options.gcSet = 1; >+ } >+ else if (STRICOLL(buf, "moves") == 0) >+ { >+ _jvmpiAgent_Options.gcDefault = 0; >+ _jvmpiAgent_Options.gc = GcMoves; >+ _jvmpiAgent_Options.gcSet = 1; >+ } >+ else if (STRICOLL(buf, "frees") == 0) >+ { >+ _jvmpiAgent_Options.gcDefault = 0; >+ _jvmpiAgent_Options.gc = GcDeletes; >+ _jvmpiAgent_Options.gcSet = 1; >+ } >+ else if (STRICOLL(buf, "movesAndFrees") == 0) >+ { >+ _jvmpiAgent_Options.gcDefault = 0; >+ _jvmpiAgent_Options.gc = GcDeletesAndMoves; >+ _jvmpiAgent_Options.gcSet = 1; >+ } >+ else >+ { >+ goto bad_option; >+ } >+ /* end of GC */ >+ } >+ else if (STRICOLL(buf, "workDir") == 0) >+ { >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ strcpyrealloc(&_jvmpiAgent_Options.workDir, buf); >+ >+ /* create the directory */ >+ if (MKDIR(_jvmpiAgent_Options.workDir) != 0 && errno != EEXIST) { >+ /* couldn't create the dir and it doesn't exists either */ >+ perror(_jvmpiAgent_Options.workDir); >+ goto bad_option; >+ } >+ >+ /* end of workDir */ >+ } >+ else if (STRICOLL(buf, "profile") == 0) >+ { >+ _jvmpiAgent_Options.profileFile; >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ strcpyrealloc(&_jvmpiAgent_Options.profileFile,buf); >+ } >+ else if (STRICOLL(buf, "optHeapFilePrefix") == 0) >+ { >+ if (_jvmpiAgent_Options.heapInfoFilePrefixSet || !getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ strcpyrealloc(&_jvmpiAgent_Options.heapInfoFilePrefix, buf); >+ _jvmpiAgent_Options.heapInfoFilePrefixSet = 1; >+ } >+ else if (STRICOLL(buf, "optHeapCount") == 0) >+ { >+ if (_jvmpiAgent_Options.heapInfoCountSet || !getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+#ifdef MVS >+#pragma convlit(suspend) >+ __atoe(buf) ; >+ _jvmpiAgent_Options.heapInfoCount = atoi(buf); >+ __etoa(buf) ; >+#pragma convlit(resume) >+#else >+ _jvmpiAgent_Options.heapInfoCount = atoi(buf); >+#endif >+ if (_jvmpiAgent_Options.heapInfoCount < 2 || _jvmpiAgent_Options.heapInfoCount > 50) >+ { >+#ifdef MVS >+#pragma convlit(suspend) >+ __atoe(buf); /* for fprintf's use */ >+#endif >+ fprintf(stderr, "optHeapCount=%s, it must be between 2 and 50", buf); >+#ifdef MVS >+ __etoa(buf); /* undo previous conversion */ >+#pragma convlit(resume) >+#endif >+ fflush(stderr); >+ goto bad_option; >+ } >+ _jvmpiAgent_Options.heapInfoCountSet = 1; >+ } >+ else if (STRICOLL(buf, "extensionLibrary") == 0) >+ { >+ if (!getToken(&str, buf, buflen, ',')) >+ { >+ goto bad_option; >+ } >+ strcpyrealloc(&_jvmpiAgent_Options.extensionLibrary, buf); >+ } >+ else >+ { >+ /* 57110 Silently ignore options starting with "ext-" >+ * because they're destined for an agent extension. >+ * I would use STRNICOLL(buf, "ext-", 4) if there were one. >+ * Copy the bytes manually rather than trust in having >+ * memcpy on all platforms. (Sure it isn't called _memcpy...?) >+ */ >+ char prefix[5]; >+ prefix[0] = buf[0]; >+ prefix[1] = buf[1]; >+ prefix[2] = buf[2]; >+ prefix[3] = buf[3]; >+ prefix[4] = '\0'; >+ if (STRICOLL(prefix, "ext-") == 0) { >+ /* consume up to the comma, error out if nothing after "=" */ >+ if (!getToken(&str, buf, buflen, ',')) { >+ goto bad_option; >+ } >+ else { >+ /* This is a well-formed ext- option. Do not error out. */ >+ } >+ } >+ else { >+ /* unknown option */ >+#ifdef MVS >+#pragma convlit(suspend) >+ __atoe(buf); >+#endif >+ fprintf(stderr, "Unknown option \"%s\"\n", buf); >+#ifdef MVS >+ __etoa(buf); >+#pragma convlit(resume) >+#endif >+ fflush(stderr); >+ goto bad_option; >+ } >+ } >+ >+ } >+ >+ if (_jvmpiAgent_Options.gcDefault >+ && (_jvmpiAgent_Options.mode == TraceHeap || _jvmpiAgent_Options.mode == TraceOptimizedHeap)) >+ { >+ _jvmpiAgent_Options.gc = GcMoves; >+ } >+ if (buf) { >+ free (buf); >+ } >+ return 0; >+ >+bad_option: >+ if (buf) { >+ free(buf); >+ } >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ fprintf(stderr, "Bad PIAgent option\n"); >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ fflush(stderr); >+ /* printUsage(); (JvmpiWriter will print the usage()) */ >+ return -1; >+mem_error: >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ fprintf(stderr, "Memory allocation error\n"); >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ fflush(stderr); >+ return -1; >+} >+ >+/** CHECK_OPTIONS_CONSISTENCY ******************************************** >+ * Checks whether there is any conflict or inconsistency among various >+ * options. >+ * @returns -1 if error, 0 if no error >+ */ >+int jvmpiAgent_CheckOptionsConsistency() >+{ >+ /* The TraceOptimizedHeap trace-mode can be set only in stand-alone mode */ >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ if (!_jvmpiAgent_Options.standalone && >+ !jvmpiAgent_isControlled() ) { >+ fprintf(stderr, "The TraceOptimizedHeap trace-mode can be set either in stand-alone or controlled mode.\n"); >+ fflush(stderr); >+ return -1; >+ } >+ if (_jvmpiAgent_Options.gc != GcMoves && _jvmpiAgent_Options.gc != GcNone) { >+ fprintf(stderr, "In TraceOptimizedHeap trace-mode, TrackGcEvent must be either Moves or None\n"); >+ fflush(stderr); >+ return -1; >+ } >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ } >+ >+ return 0; >+} >+ >+unsigned int jvmpiAgent_isPrintObjId() >+{ >+ return (_jvmpiAgent_Options.idStyle == IdStyleRelocatable || _jvmpiAgent_Options.idStyle == IdStyleStaticAndRelocatable); >+} >+ >+unsigned int jvmpiAgent_isPrintStaticId() >+{ >+ return (_jvmpiAgent_Options.idStyle == IdStyleStatic || _jvmpiAgent_Options.idStyle == IdStyleStaticAndRelocatable); >+} >+ >+unsigned int jvmpiAgent_isPrintMethodId() >+{ >+ return (_jvmpiAgent_Options.idStyle == IdStyleRelocatable || _jvmpiAgent_Options.idStyle == IdStyleStaticAndRelocatable); >+} >+ >+unsigned int jvmpiAgent_isTracingHeap() >+{ >+ return (_jvmpiAgent_Options.mode==TraceModeFull || _jvmpiAgent_Options.mode==TraceHeap || _jvmpiAgent_Options.mode==TraceOptimizedHeap ); >+} >+ >+unsigned int jvmpiAgent_isControlled() >+{ >+ return ( _jvmpiAgent_Options.standalone == 0 && _jvmpiAgent_Options.enabled ==0 ) ; >+} >Index: src-native-new/src/agents/RABindings/WinBuild/RABindings.mak >=================================================================== >RCS file: src-native-new/src/agents/RABindings/WinBuild/RABindings.mak >diff -N src-native-new/src/agents/RABindings/WinBuild/RABindings.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/WinBuild/RABindings.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,316 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on RABinding.dsp >+!IF "$(CFG)" == "" >+CFG=RABinding - Win32 Debug >+!MESSAGE No configuration specified. Defaulting to RABinding - Win32 Debug. >+!ENDIF >+ >+!IF "$(CFG)" != "RABinding - Win32 Release" && "$(CFG)" != "RABinding - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "RABinding.mak" CFG="RABinding - Win32 Debug" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "RABinding - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE "RABinding - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "RABinding - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ELSE >+ >+ALL : "RASocket - Win32 Release" "RACommon - Win32 Release" "$(OUTDIR)\hcbnd.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - Win32 ReleaseCLEAN" "RASocket - Win32 ReleaseCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hcbnd.res" >+ -@erase "$(INTDIR)\lock3.obj" >+ -@erase "$(INTDIR)\RABindings.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(OUTDIR)\hcbnd.dll" >+ -@erase "$(OUTDIR)\hcbnd.exp" >+ -@erase "$(OUTDIR)\hcbnd.lib" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MT /W3 /GX /O2 /Ob0 /I "..\RACommon" /I "..\RASocket" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /Fp"$(INTDIR)\RABinding.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\RABinding.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib hcclco.lib /nologo /version:0.1 /dll /pdb:none /machine:I386 /def:"..\RABindings\RABindings.def" /out:"$(OUTDIR)\hcbnd.dll" /implib:"$(OUTDIR)\hcbnd.lib" /libpath:".\bin" >+DEF_FILE= \ >+ "..\RABindings\RABindings.def" >+LINK32_OBJS= \ >+ "$(INTDIR)\lock3.obj" \ >+ "$(INTDIR)\RABindings.obj" \ >+ "$(INTDIR)\hcbnd.res" \ >+ "$(OUTDIR)\hcclco.lib" \ >+ "$(OUTDIR)\hccls.lib" >+ >+"$(OUTDIR)\hcbnd.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "RABinding - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+!IF "$(RECURSE)" == "0" >+ >+ALL : "$(OUTDIR)\hcbnd.dll" >+ >+!ELSE >+ >+ALL : "RASocket - Win32 Debug" "RACommon - Win32 Debug" "$(OUTDIR)\hcbnd.dll" >+ >+!ENDIF >+ >+!IF "$(RECURSE)" == "1" >+CLEAN :"RACommon - Win32 DebugCLEAN" "RASocket - Win32 DebugCLEAN" >+!ELSE >+CLEAN : >+!ENDIF >+ -@erase "$(INTDIR)\hcbnd.res" >+ -@erase "$(INTDIR)\lock3.obj" >+ -@erase "$(INTDIR)\RABindings.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\vc60.pdb" >+ -@erase "$(OUTDIR)\hcbnd.dll" >+ -@erase "$(OUTDIR)\hcbnd.exp" >+ -@erase "$(OUTDIR)\hcbnd.ilk" >+ -@erase "$(OUTDIR)\hcbnd.lib" >+ -@erase "$(OUTDIR)\hcbnd.pdb" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\RACommon" /I "..\RASocket" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RABINDING_EXPORTS" /Fp"$(INTDIR)\RABinding.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+MTL=midl.exe >+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\hcbnd.res" /d "_DEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\RABinding.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib hcclco.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\hcbnd.pdb" /debug /machine:I386 /def:"..\RABindings\RABindings.def" /out:"$(OUTDIR)\hcbnd.dll" /implib:"$(OUTDIR)\hcbnd.lib" /pdbtype:sept /libpath:".\bin" >+DEF_FILE= \ >+ "..\RABindings\RABindings.def" >+LINK32_OBJS= \ >+ "$(INTDIR)\lock3.obj" \ >+ "$(INTDIR)\RABindings.obj" \ >+ "$(INTDIR)\hcbnd.res" \ >+ "$(OUTDIR)\hcclco.lib" \ >+ "$(OUTDIR)\hccls.lib" >+ >+"$(OUTDIR)\hcbnd.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("RABinding.dep") >+!INCLUDE "RABinding.dep" >+!ELSE >+!MESSAGE Warning: cannot find "RABinding.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "RABinding - Win32 Release" || "$(CFG)" == "RABinding - Win32 Debug" >+SOURCE=..\RABindings\lock3.c >+ >+"$(INTDIR)\lock3.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\RABindings\RABindings.c >+ >+"$(INTDIR)\RABindings.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\RABindings\version.rc >+ >+!IF "$(CFG)" == "RABinding - Win32 Release" >+ >+ >+"$(INTDIR)\hcbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcbnd.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RABindings" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "RABinding - Win32 Debug" >+ >+ >+"$(INTDIR)\hcbnd.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\hcbnd.res" /i "\Documents and Settings\Administrator\Desktop\org.eclipse.hyades.datacollection\org.eclipse.hyades.datacollection\collection\framework\RABindings" /d "_DEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+!IF "$(CFG)" == "RABinding - Win32 Release" >+ >+"RACommon - Win32 Release" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak" CFG="RACommon - Win32 Release" >+ cd "." >+ >+"RACommon - Win32 ReleaseCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak" CFG="RACommon - Win32 Release" RECURSE=1 CLEAN >+ cd "." >+ >+!ELSEIF "$(CFG)" == "RABinding - Win32 Debug" >+ >+"RACommon - Win32 Debug" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak" CFG="RACommon - Win32 Debug" >+ cd "." >+ >+"RACommon - Win32 DebugCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RACommon.mak" CFG="RACommon - Win32 Debug" RECURSE=1 CLEAN >+ cd "." >+ >+!ENDIF >+ >+!IF "$(CFG)" == "RABinding - Win32 Release" >+ >+"RASocket - Win32 Release" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak" CFG="RASocket - Win32 Release" >+ cd "." >+ >+"RASocket - Win32 ReleaseCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak" CFG="RASocket - Win32 Release" RECURSE=1 CLEAN >+ cd "." >+ >+!ELSEIF "$(CFG)" == "RABinding - Win32 Debug" >+ >+"RASocket - Win32 Debug" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak" CFG="RASocket - Win32 Debug" >+ cd "." >+ >+"RASocket - Win32 DebugCLEAN" : >+ cd "." >+ $(MAKE) /$(MAKEFLAGS) /F ".\RASocket.mak" CFG="RASocket - Win32 Debug" RECURSE=1 CLEAN >+ cd "." >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/perfmon/resutils/random.c >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/random.c >diff -N src-native-new/src/agents/perfmon/resutils/random.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/random.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,153 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: random.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+/*********************************************************************** >+ * >+ * File: random.c >+ * Overview: random number generation >+ * >+ ***********************************************************************/ >+ >+#include "system.h" >+ >+#define WARMUP 100 >+ >+void XRandomSeed(XINT s) >+{ >+ srand(s); >+ >+#ifdef WARMUP >+ { >+ int i; >+ >+ for (i = 0; i < WARMUP; i++) >+ { >+ (void) rand(); >+ } >+ } >+#endif >+} >+ >+XDOUBLE XRandomUniform(void) >+{ >+ return (double)(rand()) / (double)(RAND_MAX); >+} >+ >+XDOUBLE XRandomNormal(void) >+{ >+ static double a[32] = { >+ 0.0,3.917609E-2,7.841241E-2,0.11777,0.1573107,0.1970991,0.2372021,0.2776904, >+ 0.3186394,0.36013,0.4022501,0.4450965,0.4887764,0.5334097,0.5791322, >+ 0.626099,0.6744898,0.7245144,0.7764218,0.8305109,0.8871466,0.9467818, >+ 1.00999,1.077516,1.150349,1.229859,1.318011,1.417797,1.534121,1.67594, >+ 1.862732,2.153875 >+}; >+ static double d[31] = { >+ 0.0,0.0,0.0,0.0,0.0,0.2636843,0.2425085,0.2255674,0.2116342,0.1999243, >+ 0.1899108,0.1812252,0.1736014,0.1668419,0.1607967,0.1553497,0.1504094, >+ 0.1459026,0.14177,0.1379632,0.1344418,0.1311722,0.128126,0.1252791, >+ 0.1226109,0.1201036,0.1177417,0.1155119,0.1134023,0.1114027,0.1095039 >+}; >+ static double t[31] = { >+ 7.673828E-4,2.30687E-3,3.860618E-3,5.438454E-3,7.0507E-3,8.708396E-3, >+ 1.042357E-2,1.220953E-2,1.408125E-2,1.605579E-2,1.81529E-2,2.039573E-2, >+ 2.281177E-2,2.543407E-2,2.830296E-2,3.146822E-2,3.499233E-2,3.895483E-2, >+ 4.345878E-2,4.864035E-2,5.468334E-2,6.184222E-2,7.047983E-2,8.113195E-2, >+ 9.462444E-2,0.1123001,0.136498,0.1716886,0.2276241,0.330498,0.5847031 >+}; >+ static double h[31] = { >+ 3.920617E-2,3.932705E-2,3.951E-2,3.975703E-2,4.007093E-2,4.045533E-2, >+ 4.091481E-2,4.145507E-2,4.208311E-2,4.280748E-2,4.363863E-2,4.458932E-2, >+ 4.567523E-2,4.691571E-2,4.833487E-2,4.996298E-2,5.183859E-2,5.401138E-2, >+ 5.654656E-2,5.95313E-2,6.308489E-2,6.737503E-2,7.264544E-2,7.926471E-2, >+ 8.781922E-2,9.930398E-2,0.11556,0.1404344,0.1836142,0.2790016,0.7010474 >+}; >+ long i; >+ double snorm,u,s,ustar,aa,w,y,tt; >+ >+ u = XRandomUniform(); >+ s = 0.0; >+ if(u > 0.5) s = 1.0; >+ u += (u-s); >+ u = 32.0*u; >+ i = (long) (u); >+ if(i == 32) i = 31; >+ if(i == 0) goto S100; >+/* >+ START CENTER >+*/ >+ ustar = u-(double)i; >+ aa = *(a+i-1); >+S40: >+ if(ustar <= *(t+i-1)) goto S60; >+ w = (ustar-*(t+i-1))**(h+i-1); >+S50: >+/* >+ EXIT (BOTH CASES) >+*/ >+ y = aa+w; >+ snorm = y; >+ if(s == 1.0) snorm = -y; >+ goto S170; >+S60: >+/* >+ CENTER CONTINUED >+*/ >+ u = XRandomUniform(); >+ w = u*(*(a+i)-aa); >+ tt = (0.5*w+aa)*w; >+ goto S80; >+S70: >+ tt = u; >+ ustar = XRandomUniform(); >+S80: >+ if(ustar > tt) goto S50; >+ u = XRandomUniform(); >+ if(ustar >= u) goto S70; >+ ustar = XRandomUniform(); >+ goto S40; >+S100: >+/* >+ START TAIL >+*/ >+ i = 6; >+ aa = *(a+31); >+ goto S120; >+S110: >+ aa += *(d+i-1); >+ i += 1; >+S120: >+ u += u; >+ if(u < 1.0) goto S110; >+ u -= 1.0; >+S140: >+ w = u**(d+i-1); >+ tt = (0.5*w+aa)*w; >+ goto S160; >+S150: >+ tt = u; >+S160: >+ ustar = XRandomUniform(); >+ if(ustar > tt) goto S50; >+ u = XRandomUniform(); >+ if(ustar >= u) goto S150; >+ u = XRandomUniform(); >+ goto S140; >+ >+S170: >+ >+ return snorm; >+} >+ >+/*********************************************************************** >+ * EOF >+ ***********************************************************************/ >Index: src-native-new/src/agents/RABindings/lock3.h >=================================================================== >RCS file: src-native-new/src/agents/RABindings/lock3.h >diff -N src-native-new/src/agents/RABindings/lock3.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/lock3.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: lock3.h,v 1.4 2006/04/24 13:29:36 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef _LOCK3_H_ >+#define _LOCK3_H_ >+ >+ >+#ifdef _WIN32 >+#include <winsock2.h> /* Bug 134924 */ >+#include <windows.h> >+ >+// The single-writer/multiple-reader guard >+// compound synchronization object >+typedef struct _SWMR { >+ // This critical section guards access to the other objects >+ // managed by this data structure and also indicates >+ // whether any writer threads are writing. >+ CRITICAL_SECTION cs; >+ >+ // This manual-reset event is signaled when >+ // no reader threads are reading. >+ HANDLE hEventNoReaders; >+ >+ LONG numReaders; >+} Lock_t; >+ >+ >+ >+#else >+ #include <pthread.h> >+ #include "RAComm.h" >+ >+#if defined __linux__ || defined _HPUX >+ typedef struct { >+ pthread_mutex_t mutex; >+ pthread_cond_t rcond; >+ pthread_cond_t wcond; >+ long readCount; >+ short waiting_writers; >+ short active_writers; >+ } Lock_t; >+ extern void rwlock_WaitingReaderCleanup(void *arg); >+ extern void rwlock_WaitingWriterCleanup(void *arg); >+#else >+ typedef pthread_rwlock_t Lock_t; >+#endif >+ >+#endif >+ >+ >+#if defined __cplusplus && defined _HPUX >+extern "C" { >+#endif >+ >+/** Initializes a SWMRG structure. This structure must be >+ initialized before any writer or reader threads attempt >+ to wait on it. >+ The structure must be allocated by the application and >+ the structure's address is passed as the first parameter. >+ The lpszName parameter is the name of the object. Pass >+ NULL if you do not want to share the object. >+ */ >+extern BOOL ra_initializeLock (Lock_t *lock); >+ >+ >+/** Deletes the system resources associated with a SWMRG >+ structure. The structure must be deleted only when >+ no writer or reader threads in the calling process >+ will wait on it. >+ */ >+extern void ra_deleteLock (Lock_t *lock); >+ >+/** A writer thread calls this function to know when >+ it can successfully write to the shared data. >+ */ >+extern int ra_getWriteLock (Lock_t *lock); >+ >+ >+/** A writer thread calls this function to let other threads >+ know that it no longer needs to write to the shared data. >+ */ >+extern void ra_releaseWriteLock (Lock_t *lock); >+ >+ >+/** A reader thread calls this function to know when >+ it can successfully read the shared data. >+ */ >+extern int ra_getReadLock(Lock_t *lock); >+ >+ >+/** A reader thread calls this function to let other threads >+ know when it no longer needs to read the shared data. >+ */ >+extern void ra_releaseReadLock (Lock_t *lock); >+ >+#if defined __cplusplus && defined _HPUX >+} >+#endif >+ >+#endif >Index: src-native-new/src/agents/RABindings/RABindings.make >=================================================================== >RCS file: src-native-new/src/agents/RABindings/RABindings.make >diff -N src-native-new/src/agents/RABindings/RABindings.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/RABindings.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+ >+################################################################################ >+# >+# makefile: RABindings project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libhcbnd >+TARGETDIR := ../../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux ../../transport/RACommon ../../transport/RASocket ../../transport/RASharedMemory ../../transport/RADataTransfer >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl hcclco hccls hcclsm hccldt pthread >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/agents/perfmon/resutils/DataTransferInterface.h >=================================================================== >RCS file: src-native-new/src/agents/perfmon/resutils/DataTransferInterface.h >diff -N src-native-new/src/agents/perfmon/resutils/DataTransferInterface.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/resutils/DataTransferInterface.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,49 @@ >+/********************************************************************** >+ * Copyright (c) 2005 Scapa Technologies Limited and others >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: DataTransferInterface.h,v 1.3 2005/06/09 18:05:36 gchristelis Exp $ >+ * >+ * Contributors: >+ * Scapa Technologies Limited - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __DATATRANSFER_H__ >+#define __DATATRANSFER_H__ >+ >+#include "system.h" >+#include "hashtable.h" >+ >+static char* DC_KEY_MONITORING = "DC_MONITORING"; >+//Bug 99153 >+static char* DC_AGENT_CONTROLLER_STOPPED = "DC_AGENT_CONTROLLER_STOPPED"; >+//End >+static char* DC_KEY_FINISHED = "DC_FINISHED"; >+static char* DC_KEY_TREE_REQUESTED = "DC_TREE_REQUESTED"; >+static XINT64 DC_VAL_TRUE = TRUE; >+static XINT64 DC_VAL_FALSE = FALSE; >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+#if defined(LINUX) || defined(SOLARIS) >+int DC_TransferStartup(HashTable* variables, HashTable* filters, HashTable* tree); >+int DC_TransferShutdown(); >+int DC_SendMessage(char* msg, int off, int len); >+int DC_TransferSetAgentName(char* name); >+#else >+int __declspec(dllexport) DC_TransferSetAgentName(char* name); >+int __declspec(dllexport) DC_TransferStartup(HashTable* variables, HashTable* filters, HashTable* tree); >+int __declspec(dllexport) DC_TransferShutdown(); >+int __declspec(dllexport) DC_SendMessage(char* msg, int off, int len); >+#endif >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif >+ >Index: src-native-new/src/agents/RABindings/lock3.c >=================================================================== >RCS file: src-native-new/src/agents/RABindings/lock3.c >diff -N src-native-new/src/agents/RABindings/lock3.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/RABindings/lock3.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,205 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: lock3.c,v 1.3 2005/03/24 17:42:29 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <stddef.h> >+#include "lock3.h" >+ >+BOOL ra_initializeLock(Lock_t *lock) { >+ BOOL fOk; >+#ifdef _WIN32 >+ >+ // Initialize all data members to NULL so that we can >+ // accurately check whether an error has occurred. >+ lock->hEventNoReaders = NULL; >+ >+ // This critical section guards access to the other objects >+ // managed by this data structure and also indicates >+ // whether there are any writer threads writing. >+ InitializeCriticalSection(&lock->cs); >+ >+ // Create the manual-reset event that is signalled when >+ // no reader threads are reading. >+ // Initially no reader threads are reading. >+ lock->hEventNoReaders = CreateEvent(NULL, >+ TRUE, >+ TRUE, >+ NULL); >+ >+ >+ // Initialize the variable that indicates the number of >+ // reader threads that are reading. >+ lock->numReaders=0; >+ >+ if ((NULL == lock->hEventNoReaders)) { >+ // If a synchronization object could not be created, >+ // destroy any created objects and return failure. >+ ra_deleteLock(lock); >+ fOk = FALSE; >+ } else { >+ fOk = TRUE; >+ } >+ >+ // Return TRUE upon success, FALSE upon failure. >+ return(fOk); >+ >+#else >+ >+#if defined __linux__ || defined _HPUX >+ pthread_mutex_init(&(lock->mutex), /* Create mutex */ >+ 0); /* Default behaviour (unlocked) */ >+ >+ pthread_cond_init(&(lock->rcond), /* Create read condition variable */ >+ 0); /* Default behaviour */ >+ >+ pthread_cond_init(&(lock->wcond), /* Create write condition variable */ >+ 0); /* Default behaviour */ >+ >+ lock->waiting_writers=0; >+ lock->readCount = 0; >+ return TRUE; >+#else >+ pthread_rwlock_init(lock, NULL); >+ return TRUE; >+#endif >+ >+#endif >+} >+ >+ >+ >+void ra_deleteLock(Lock_t *lock) { >+#ifdef _WIN32 >+ if (NULL != lock->hEventNoReaders) >+ CloseHandle(lock->hEventNoReaders); >+#elif defined __linux__ || defined _HPUX >+ /* do nothing */ >+#else >+ pthread_rwlock_destroy(lock); >+#endif >+} >+ >+ >+ >+int ra_getWriteLock(Lock_t *lock) { >+#ifdef _WIN32 >+ WaitForSingleObject(lock->hEventNoReaders, INFINITE); >+ EnterCriticalSection(&lock->cs); >+ return 0; >+#elif defined __linux__ || defined _HPUX >+ /*pthread_cleanup_push(rwlock_WaitingWriterCleanup, lock); */ >+ pthread_mutex_lock(&(lock->mutex)); >+ lock->waiting_writers++; >+ while(lock->readCount || lock->active_writers ) { >+ pthread_cond_wait(&(lock->wcond), &(lock->mutex)); >+ } >+ lock->active_writers++; >+ lock->waiting_writers--; >+ /* pthread_cleanup_pop(1); */ >+ pthread_mutex_unlock(&(lock->mutex)); >+#else >+ pthread_rwlock_wrlock(lock); >+ return 0; >+#endif >+} >+ >+ >+ >+void ra_releaseWriteLock(Lock_t* lock) { >+#ifdef _WIN32 >+ LeaveCriticalSection(&lock->cs); >+#elif defined __linux__ || defined _HPUX >+ pthread_mutex_lock(&(lock->mutex)); >+ if(!--lock->active_writers) { >+ pthread_cond_broadcast(&lock->rcond); >+ } >+ else { >+ pthread_cond_signal(&lock->wcond); >+ } >+ pthread_mutex_unlock(&(lock->mutex)); >+#else >+ pthread_rwlock_unlock(lock); >+#endif >+} >+ >+ >+ >+int ra_getReadLock(Lock_t *lock) { >+#ifdef _WIN32 >+ EnterCriticalSection(&lock->cs); >+ if (lock->numReaders++==1) { >+ // If this is the first reader thread, >+ // set our event to reflect this. >+ ResetEvent(lock->hEventNoReaders); >+ } >+ LeaveCriticalSection(&lock->cs); >+ return 0; >+#elif defined __linux__ || defined _HPUX >+ /*pthread_cleanup_push(rwlock_WaitingReaderCleanup, lock); */ >+ pthread_mutex_lock(&(lock->mutex)); >+ if(lock->waiting_writers || lock->active_writers) { >+ pthread_cond_wait(&(lock->rcond), &(lock->mutex)); >+ } >+ lock->readCount++; >+ /* pthread_cleanup_pop(1); */ >+ pthread_mutex_unlock(&(lock->mutex)); >+ return 0; >+#else >+ pthread_rwlock_rdlock(lock); >+ return 0; >+#endif >+} >+ >+ >+ >+ >+void ra_releaseReadLock (Lock_t *lock) { >+#ifdef _WIN32 >+ >+ EnterCriticalSection(&lock->cs); >+ if (!--lock->numReaders) { >+ SetEvent(lock->hEventNoReaders); >+ } >+ LeaveCriticalSection(&lock->cs); >+#elif defined __linux__ || defined _HPUX >+ pthread_mutex_lock(&(lock->mutex)); >+ if (!--lock->readCount) { >+ pthread_cond_signal(&(lock->wcond)); >+ } >+ pthread_mutex_unlock(&(lock->mutex)); >+#else >+ pthread_rwlock_unlock(lock); >+#endif >+} >+ >+ >+#if defined __linux__ || defined _HPUX >+ >+void rwlock_WaitingReaderCleanup(void *arg) >+{ >+ Lock_t *rwl; >+ rwl = (Lock_t*)arg; >+/* printf("Cleaning up reader\n"); */ >+ pthread_mutex_unlock(&(rwl->mutex)); >+/* printf("Reader cleaned\n"); */ >+} >+ >+void rwlock_WaitingWriterCleanup(void *arg) >+{ >+ Lock_t *rwl; >+ rwl = (Lock_t*)arg; >+/* printf("Cleaning up writer\n"); */ >+ if( (rwl->readCount>= 0 && !rwl->waiting_writers) ) >+ pthread_cond_broadcast(&(rwl->wcond)); /* This only happens if we have been cancelled */ >+/* printf("Writer Cleaned\n"); */ >+ pthread_mutex_unlock(&(rwl->mutex)); >+} >+#endif >Index: src-native-new/src/agents/thread/hcthread.h >=================================================================== >RCS file: src-native-new/src/agents/thread/hcthread.h >diff -N src-native-new/src/agents/thread/hcthread.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/hcthread.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,89 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hcthread.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <jni.h> >+#include <stdio.h> >+#include <stdarg.h> >+#include <string.h> >+ >+#include "RABindings.h" >+#include "RADataTransfer.h" >+#include "RAShm.h" >+#include "RASocket.h" >+ >+/* Strings */ >+#if defined(__OS400__) >+ #pragma convert(819) >+#elif defined(MVS) >+ #pragma convlit(suspend) >+#endif >+ >+#define THREAD_DUMP_AGENT_CLASS_NAME "org/eclipse/hyades/logging/jvm/threadanalysis/ThreadDumpAgentImpl" >+#define THREAD_DUMP_AGENT_PROCESSOR "processDumpData" >+#define THREAD_DUMP_AGENT_PROCESSOR_ARGS "(Ljava/lang/String;)Ljava/lang/String;" >+#define AGENT_NAME "Thread Analysis Agent" >+#define AGENT_TYPE "Logging" >+ >+#if defined(__OS400__) >+ #pragma convert(0) >+#elif defined(MVS) >+ #pragma convlit(resume) >+#endif >+ >+/* Macro to simplify the JNI code. */ >+#if defined __cplusplus && defined _HPUX >+ #define ENV(e) e >+ #define ENVPARM(e) >+#else >+ #define ENV(e) (*e) >+ #define ENVPARM(e) e, >+#endif >+ >+/* Macro for findind the current working directory */ >+#if defined(_WIN32) >+ #include <direct.h> >+ #include <signal.h> >+ #include <process.h> >+ #define getcwd _getcwd >+ #define getpid _getpid >+#else >+ #include <unistd.h> >+ #include <signal.h> >+#endif >+ >+/* Macro for debug messages */ >+#if defined(MVS) || defined(__OS400__) >+ #define vsnprintf(a,b,c,d) vsprintf(a,c,d) >+#elif defined(_WIN32) >+ #define vsnprintf _vsnprintf >+#endif >+ >+void init(char* name, char* type); >+void dump(); >+void deregister(); >+void hc_dumpThreads(); >+void autodump(); >+void getRunningDir(char* buffer); >+void messageHandler(ra_command_t *command); >+void processDumpData(char* path); >+void debugTrace(char* msg, ...); >+void autodump(int interval); >+void *autoDumpThread(void *args); >+ >+#if defined(_WIN32) >+DWORD WINAPI autoDumpProxy(LPVOID args); >+void sleep(int sec); >+#elif defined(__linux__) >+void getProcessStat(int pid, char* value); >+BOOL isProcessName(int pid, char* pname); >+int getParentProcessId(int pid); >+#endif >Index: src-native-new/src/agents/java/hcjbnd.make >=================================================================== >RCS file: src-native-new/src/agents/java/hcjbnd.make >diff -N src-native-new/src/agents/java/hcjbnd.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/java/hcjbnd.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,129 @@ >+ >+################################################################################ >+# >+# makefile: hcjbnd project >+# >+# $Id >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+# - The TARGETREALNAME variable specifies the name of the library file >+# that will be generated, this includes a base (TARGETLIB) plus a >+# version number plus a minor number plus a release number >+# - The TARGETSONAME variable specifies a file name that has just the >+# library name plus the major version number >+# - The TARGETLIB variable specifies the base library name >+# - The TARGETSONAME and TARGETLIB are generated as symbolic links >+# when the library is built >+# >+#----------------------------------- >+TARGET := libhcjbnd >+TARGETDIR := ../../../lib >+ >+if [ x$VERSIONNUM = x ]; then export VERSIONNUM=0; fi >+if [ x$MINORNUM = x ]; then export MINORNUM=0; fi >+if [ x$RELEASENUM = x ]; then export RELEASENUM=0; fi >+ >+TARGETLIB := $(TARGET).so >+TARGETSONAME := $(TARGETLIB).$(VERSIONNUM) >+TARGETREALNAME := $(TARGETSONAME).$(MINORNUM).$(RELEASENUM) >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+INCLUDEDIRS := . ../../../include $(JAVA_HOME)/include $(JAVA_HOME)/include/linux ../RABindings ../../transport/RACommon ../../transport/RASocket ../../transport/RASharedMemory ../../transport/RADataTransfer >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+LIBS := dl hcbnd pthread >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+LIBDIRS := ../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+DEFINES := -DSQLUNIX -DSQLLinux -DENW -DREENTRANT -D_REENTRANT -DCONFIG_X86_CMPXCHG >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 $(DEFINES) >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -shared -Wl,-soname,$(TARGETSONAME) -o $(TARGETDIR)/$(TARGETREALNAME) $(addprefix -L,$(LIBDIRS)) >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETLIB) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETSONAME) >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGETREALNAME) >+ >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ $(CREATELINK) $(TARGETREALNAME) $(TARGETDIR)/$(TARGETSONAME) >+ $(CREATELINK) $(TARGETSONAME) $(TARGETDIR)/$(TARGETLIB) >+ >Index: src-native-new/src/agents/native/java_profiler/JvmpiWriter.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/JvmpiWriter.h >diff -N src-native-new/src/agents/native/java_profiler/JvmpiWriter.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/JvmpiWriter.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,159 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: JvmpiWriter.h,v 1.3 2006/04/24 13:29:35 samwai Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __JVMPIWRITER__ >+ #define __JVMPIWRITER__ >+ >+ >+/* This macro defines the XML4Profiling Specification level of the agent */ >+#define AGENT_VERSION "1.000" >+ >+#ifdef _WIN32 >+ #include <winsock2.h> /* Bug 134924 */ >+ #include <windows.h> >+#else >+ #include <pthread.h> >+#endif >+ >+#include <stdio.h> >+#include <string.h> >+#include <jvmpi.h> >+#include "filters.h" >+ >+#include "hash.h" >+#include "stack.h" >+#include "lock3.h" >+#include "performance.h" /* 183945 - changed uppercase p to lowercase */ >+ >+#ifndef TRUE >+ #ifdef _HPUX >+ #define TRUE TRUE >+ #else >+ #define TRUE 1 >+ #endif >+#endif >+ >+#ifndef FALSE >+ #ifdef _HPUX >+ #define FALSE FALSE >+ #else >+ #define FALSE 0 >+ #endif >+#endif >+ >+ >+enum ThrowOrCatch {Throw, Catch}; >+ >+/* RKD: Request event macro as this has a slightly different signature on OS/400 but this >+ will be changing in the near future. >+*/ >+#ifdef __OS400__ >+ #define REQUEST_EVENT(A, B) _jvmpiAgent_jvmpiInterface->RequestEvent(A, (void*)(B)); >+ #define REQUEST_EVENT2(A, B) _jvmpiAgent_jvmpiInterface->RequestEvent2(A, B); /* 232010 */ >+#else >+ #define REQUEST_EVENT(A, B) _jvmpiAgent_jvmpiInterface->RequestEvent(A, B); >+ #define REQUEST_EVENT2(A, B) _jvmpiAgent_jvmpiInterface->RequestEvent(A, B); /* 232010 */ >+#endif >+ >+/* 236501 - STRDUP now defined in RAComm.h >+#ifdef __OS400__ >+ #define strdup(a) a >+#endif >+*/ >+ >+typedef struct >+{ >+ unsigned long traceMask; >+} EventList; >+ >+typedef struct { >+ unsigned long index; >+ timestamp_t lastGenerationTime; >+}GenerationInfo_t; >+ >+/* Bug 64476 Moved the #if defined above the typedef */ >+#if defined __cplusplus >+ extern "C" { >+#endif >+ >+/* Piyush Agarwal */ >+typedef void (*optHeapDumpFileInfoCallBackType)(char *filename); >+typedef struct { >+ optHeapDumpFileInfoCallBackType ohdcb ; >+} OptHeapCallBack ; >+ >+ >+enum JavaVendor {VendorIBM, VendorSun, VendorHP, VendorOther}; >+enum JavaVersion {Version13,Version140,Version141,Version142,VersionOther}; >+ >+extern enum JavaVendor _javaVendor; >+extern enum JavaVersion _javaVersion; >+ >+/* GLOBALS >+ */ >+extern JVMPI_Interface * _jvmpiAgent_jvmpiInterface; /* JVMPI Interface pointer created in JVM_OnLoad */ >+extern jmethodID _jvmpiAgent_setExceptionTracing; >+extern jclass _jvmpiAgent_JVMPIException; >+extern JavaVM * _jvmpiAgent_jvm; /* JVM Pointer passed in on JVM_OnLoad */ >+extern Lock_t _jvmpiAgent_synchLock; >+extern char *_jvmpiAgent_trace_id; >+extern const char *_jvmpiAgent_nodeUUID; >+extern const char *_jvmpiAgent_processUUID; >+extern GenerationInfo_t _heapDumpInfo; >+extern RA_AGENT_HANDLE _jvmpiAgent_bindingStorage; /* The Agent handle for the RAC */ >+ >+extern SegmentedValue_t _jvmpiAgent_collation; >+ >+/* Call Back Functions */ >+extern OptHeapCallBack _jvmpiAgent_optHeapCallBack ; >+ >+/* Function pointer definition for the JVM interface function that converts JNI >+ object handles to JVMPI object identifiers. This API is available as follows: >+ Sun JDK 1.2.2 Classic as an undocumented entry point in the JVM >+ Sun JDK 1.3 Classic as an undocumented entry point in the JVM >+ Note: The Sun JDK 1.3 Hotspot JVM documents this API as part of the JVMPI >+ interface, however they do not include the definition of this API in the JVMPI >+ header file that they ship. In addition, they have removed the entry point for >+ this function from the Hotspot JVM. So at this time, this function is not >+ available when running under the Sun Hotspot JVM. >+ IBM JDK 1.2.2 as both an entry point in the JVM and as part of the JVMPI interface >+ functions. >+ IBM JDK 1.3 as both an entry point in the JVM and as part of the JVMPI interface >+ functions. >+*/ >+typedef jobjectID (*Jobject2jobjectID)(jobject obj); >+ >+ >+ >+extern void jvmpiAgent_outputMethodDeclaration(HashEntry *methodHashEntry, ThreadPrivateStorage *tps); >+extern void jvmpiAgent_outputClassDeclaration(HashEntry *classHashEntry, ThreadPrivateStorage *tps); >+ >+extern void sendErrorMessage(RA_ERROR_LEVEL severity, >+ const char *errorId, >+ const char *errorString); >+ >+/** GET_THREAD_LOCAL_STORAGE ************************************************* >+ * This function returns the address of the thread local storage for the >+ * specified JNIEnv (aka thread). A special thread local storage structure is >+ * allocated for static references and is returned when the JNIEnv parameter is >+ * 0 or if the JVM is in Garbage Collection or Shutdown mode. Garbage Collection >+ * and Shutdown mode must be handled in this way because some versions of the >+ * JVM use special threads to do this processing which cause the >+ * GetThreadLocalStorage interface function to trap. >+ */ >+extern ThreadPrivateStorage *jvmpiAgent_getThreadLocalStorage(JNIEnv *env_id); >+ >+ >+#if defined __cplusplus >+ } >+#endif >+#endif >Index: src-native-new/src/agents/thread/hcthread.c >=================================================================== >RCS file: src-native-new/src/agents/thread/hcthread.c >diff -N src-native-new/src/agents/thread/hcthread.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/hcthread.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,515 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hcthread.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include "hcthread.h" >+ >+JavaVM *jvm = NULL; >+RA_AGENT_HANDLE handle = NULL; >+ra_data_target_hdl_t *targetHandle = NULL; >+BOOL attached = FALSE; >+BOOL isAuto = FALSE; >+BOOL isNative = TRUE; >+ra_critsec_t lock; >+ >+/* >+ * Initialization called from the java layer >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_init0(JNIEnv *env, jobject obj, jstring name, jstring type) { >+ char *_name; >+ char *_type; >+ >+ /* Retrieve the current JVM and store it */ >+ ENV(env)->GetJavaVM(ENVPARM(env) &jvm); >+ >+ /* Translate the java strings to native strings */ >+ _name = (char*)(ENV(env)->GetStringUTFChars(ENVPARM(env) name, NULL)); >+ _type = (char*)(ENV(env)->GetStringUTFChars(ENVPARM(env) type, NULL)); >+ >+ isNative = FALSE; >+ init(_name, _type); >+} >+ >+/* >+ * Deregister called from the java layer >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_deregister0(JNIEnv *env, jobject obj) { >+ deregister(); >+} >+ >+/* >+ * Dump thread called from the java layer >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_dumpThreads0(JNIEnv *env, jobject obj) { >+ /* Return the location of the running java program which has just produced a thread dump */ >+ dump(); >+} >+ >+/* >+ * Get process ID called from the java layer >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_getPid0(JNIEnv *env, jobject obj) { >+ return getpid(); >+} >+ >+/* >+ * JVMPI interface >+ */ >+JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM *_jvm, char *options, void *reserved) { >+ jvm = _jvm; >+ >+ init(AGENT_NAME, AGENT_TYPE); >+ >+ return JNI_OK; >+} >+ >+/* >+ * Register the agent with the agent controller >+ */ >+void init(char* name, char* type) { >+/* >+ JDK1_1InitArgs vm_args; >+ JNIEnv *env; >+*/ >+ >+ /* Create a lock for the critical section */ >+ ra_mutexCreate(&lock); >+ >+ /* Initialize and register the agent with the agent controller */ >+ handle = ra_initializeBindings(name, type, messageHandler, FALSE); >+ >+ targetHandle = (ra_data_target_hdl_t*)malloc(sizeof(ra_data_target_hdl_t)); >+ >+ /* Start the message handler */ >+ ra_startListener(handle, FALSE); >+ debugTrace("Registered agent: \"%s\" of type: \"%s\"", name, type); >+ >+ /* If this is called by the native code (and not by -Xrun), it won't have a JVM associated */ >+ if(isNative && (jvm == NULL)) { >+ debugTrace("Not supported"); >+/* >+ JNI_GetDefaultJavaVMInitArgs(&vm_args); >+ if(JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args) != 0) { >+ debugTrace("Error creating Java VM"); >+ return; >+ } >+ else { >+ debugTrace("Java VM created successfully"); >+ } >+*/ >+ } >+ >+} >+ >+/* >+ * Deregister the agent with the agent controller >+ */ >+void deregister() { >+ /* Deregister with the agent controller */ >+ ra_finalizeBindings(handle); >+ debugTrace("Deregistered agent"); >+ >+ /* Destroy the lock for the critical section */ >+ ra_mutexDestroy(&lock); >+ >+ if(isNative) { >+ /* Destroy the JVM */ >+#if defined __cplusplus && defined _HPUX >+ ENV(jvm)->DestroyJavaVM(); >+#else >+ ENV(jvm)->DestroyJavaVM(jvm); >+#endif >+ debugTrace("Destroyed from the JVM"); >+ } >+ >+ free(targetHandle); >+ targetHandle = NULL; >+} >+ >+/* >+ * Message handler for agent contorller messages >+ */ >+void messageHandler(ra_command_t *command) { >+ debugTrace("Command received, tag = 0x%x", command->tag); >+ switch(command->tag) { >+ case RA_CUSTOM_COMMAND: >+ { >+ debugTrace("Message received: RA_CUSTOM_COMMAND, data = %s", command->info.custom_command.message.data); >+ >+ if(strcmp(command->info.custom_command.message.data, "ANALYSEHEAP")==0) { >+ dump(); >+ debugTrace("Manual thread dump"); >+ } >+ else if(strcmp(command->info.custom_command.message.data, "RESUME")==0) { >+ dump(); >+/* >+ isAuto = TRUE; >+ autodump(3); >+*/ >+ debugTrace("Manual thread dump"); >+ } >+ break; >+ } >+ case RA_START_MONITORING_AGENT_REMOTE: >+ case RA_START_MONITORING_AGENT_LOCAL: >+ { >+ debugTrace("Message received: RA_START_MONITORING"); >+ if(!attached) { >+ if(command->tag == RA_START_MONITORING_AGENT_LOCAL) { >+ targetHandle->dtarget = RA_SHAREDMEMORY; >+ ra_attachToShm(command->info.start_monitor_local.file.data, &targetHandle->dtargetHdl.shmHdl); >+ debugTrace("Attached to shared memory"); >+ } >+ else if(command->tag == RA_START_MONITORING_AGENT_REMOTE) { >+ targetHandle->dtarget = RA_SOCKET; >+ ra_connectToTCPServer(command->info.start_monitor_remote.ip, (unsigned short)command->info.start_monitor_remote.port, &targetHandle->dtargetHdl.socketFD); >+ debugTrace("Connected to TCP server"); >+ } >+ attached = TRUE; >+ } >+ break; >+ } >+ case RA_STOP_MONITORING_AGENT: >+ { >+ debugTrace("Message received: RA_STOP_MONITORING"); >+ isAuto = FALSE; >+ break; >+ } >+ case RA_DETACH_FROM_AGENT: >+ { >+ debugTrace("Message received: RA_DETACH_FROM_AGENT"); >+ if(targetHandle->dtarget == RA_SHAREDMEMORY) { >+ ra_stopFlushingShm(&targetHandle->dtargetHdl.shmHdl); >+ } >+ else if(targetHandle->dtarget == RA_SOCKET) { >+ ra_closeSocket(targetHandle->dtargetHdl.socketFD); >+ } >+ isAuto = FALSE; >+ attached = FALSE; >+ break; >+ } >+ default: >+ break; >+ } >+} >+ >+/* >+ * Automatically performing a thread dump >+ */ >+void autodump(int interval) { >+ TID tid; >+#ifdef _WIN32 >+ CreateThread(NULL, 0, autoDumpProxy, (LPVOID)(&interval), 0, &tid); >+#else >+ pthread_create(&tid, NULL, autoDumpThread, &interval); >+#endif >+ debugTrace("Auto dump thread created: ID = %d, interval = %d sec", tid, interval); >+} >+ >+/* >+ * Windows proxy for the thread >+ */ >+#ifdef _WIN32 >+DWORD WINAPI autoDumpProxy(LPVOID args) { >+ DWORD returnVal = 0; >+ autoDumpThread(args); >+ return returnVal; >+} >+#endif >+ >+/* >+ * Thread for automatically dumping the threads at a certain time interval >+ * Note: On Windows 2000 this thread will exit after the Ctrl-Break is sent. It will keep on running >+ * on Windows XP. >+ */ >+void *autoDumpThread(void *args) { >+ int interval = *((int*)args); >+ while(isAuto) { >+ dump(); >+ sleep(interval); >+ } >+ return NULL; >+} >+ >+/* >+ * Dump thread called from the native layer >+ */ >+void dump() { >+ char* currentPath = (char*)malloc(_MAX_PATH * sizeof(char));; >+ >+ /* Enter critical section */ >+ ra_mutexEnter(&lock); >+ >+ getRunningDir(currentPath); >+ debugTrace("Current working directory: %s", currentPath); >+ >+ hc_dumpThreads(); >+ debugTrace("Finished native dump()"); >+ >+ /* Pushing the filename into the Java layer to do the processing */ >+ processDumpData(currentPath); >+ debugTrace("Finished native processDumpData()"); >+ >+ /* Leave critical section */ >+ ra_mutexExit(&lock); >+ >+ free(currentPath); >+ >+ return; >+} >+ >+/* >+ * Retrieve the current working directory >+ */ >+void getRunningDir(char* buffer) { >+ getcwd(buffer, _MAX_PATH); >+} >+ >+/* >+ * Call the "kill -3" or "Ctrl-Break" to initiate the thread dump >+ */ >+void hc_dumpThreads() { >+ BOOL rc = FALSE; >+#if defined(_WIN32) >+ DWORD dw; >+ >+ rc = GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, 0); >+/* >+ if(raise(SIGBREAK) == 0) { >+ debugTrace("Signal raised successfully: %d", SIGBREAK); >+ } >+ else { >+ debugTrace("Problem raising signal: %d", SIGBREAK); >+ } >+*/ >+ if(rc == 0) { >+ dw = GetLastError(); >+ debugTrace("Error sending console control event: %d to process: %d", dw, getpid()); >+ } >+ >+ debugTrace("Control-Break sent to process: %d", GetCurrentProcessId()); >+/* Since Linux threads are sub-processes so we need to send the signal to the main thread */ >+#elif defined(__linux__) >+ int last = getpid(); >+ int pid = getppid(); /* start searching from the current pid's parent */ >+ >+ while(isProcessName(pid, "java")) { /* Navigate until main thread is found */ >+ debugTrace("Parent is still java, going to its parent"); >+ last = pid; >+ pid = getParentProcessId(last); >+ debugTrace("Checking parent pid: %d", pid); >+ } >+ >+ kill(last, SIGQUIT); >+ debugTrace("Signal %d raised to process: %d", SIGQUIT, last); >+ >+#else >+ if(raise(SIGQUIT) == 0) { >+ debugTrace("Signal %d raised successfully to process: %d", SIGQUIT, getpid()); >+ } >+ else { >+ debugTrace("Problem raising signal %d to process %d", SIGQUIT, getpid()); >+ } >+#endif >+} >+ >+/* >+ * Call the java code to process the javacore file >+ */ >+void processDumpData(char* path) { >+ JNIEnv *env; >+ jclass cls; >+ jmethodID method; >+ jstring xmlString; >+ char *localXmlString; >+ unsigned char *copy; >+ int length; >+ >+ debugTrace("Inside native processDumpData()"); >+ >+ /* Attach to the current JVM */ >+ ENV(jvm)->AttachCurrentThread(ENVPARM(jvm) (void**)&env, NULL); >+ debugTrace("Attached current thread to the JVM"); >+ >+ /* Initialize the java class object */ >+ cls = ENV(env)->FindClass(ENVPARM(env) THREAD_DUMP_AGENT_CLASS_NAME); >+ >+ if(cls != NULL) { >+ debugTrace("Found class \"%s\"", THREAD_DUMP_AGENT_CLASS_NAME); >+ method = ENV(env)->GetStaticMethodID(ENVPARM(env) cls, THREAD_DUMP_AGENT_PROCESSOR, THREAD_DUMP_AGENT_PROCESSOR_ARGS); >+ >+ if(method != NULL) { >+ debugTrace("Found method \"%s\"", THREAD_DUMP_AGENT_PROCESSOR); >+ xmlString = (jstring)(ENV(env)->CallStaticObjectMethod(ENVPARM(env) cls, method, ENV(env)->NewStringUTF(ENVPARM(env) path))); >+ >+ if(xmlString != NULL) { >+ debugTrace("Returned successfully from java layer processDumpData()"); >+ localXmlString = (char*)(ENV(env)->GetStringUTFChars(ENVPARM(env) xmlString, NULL)); >+ >+ if(localXmlString != NULL) { >+ debugTrace("Translated java string to local string: %s", localXmlString); >+ >+ length = strlen(localXmlString); >+ copy = ra_allocateMessageBlock(length); >+ memcpy(copy, localXmlString, length); >+ >+ if(targetHandle != NULL) { >+ ra_writeMessageBlock(targetHandle, RA_BINARY_DATA, copy, length); >+ debugTrace("Wrote XML fragments to target handle"); >+ } >+ else { >+ debugTrace("Cannot write to target handle"); >+ } >+ >+ ra_freeMessageBlock(copy); >+ ENV(env)->ReleaseStringUTFChars(ENVPARM(env) xmlString, localXmlString); >+ debugTrace("Released local XML string"); >+ } >+ else { >+ debugTrace("Cannot translate java string to local string"); >+ } >+ } >+ else { >+ debugTrace("Problem getting XML string from java layer"); >+ } >+ } >+ else { >+ debugTrace("Cannot find the method \"%s\" in the java layer", THREAD_DUMP_AGENT_PROCESSOR); >+ } >+ } >+ else { >+ debugTrace("Cannot find the class \"%s\" in the java layer", THREAD_DUMP_AGENT_CLASS_NAME); >+ } >+ /* Detach from the JVM */ >+#if defined __cplusplus && defined _HPUX >+ ENV(jvm)->DetachCurrentThread(); >+#else >+ ENV(jvm)->DetachCurrentThread(jvm); >+#endif >+ debugTrace("Detached from the JVM"); >+} >+ >+/* >+ * Debugging output >+ */ >+void debugTrace(char* msg, ...) { >+#if _DEBUG >+ va_list argp; >+ int len; >+ int bufferSize = 8192; >+ char *buffer = NULL; >+ >+ va_start(argp, msg); >+ >+ buffer = (char*)malloc(bufferSize * sizeof(char)); >+ while((len = vsnprintf(buffer, bufferSize, msg, argp)) < 0) { >+ bufferSize += 1024; >+ buffer = (char*)malloc(bufferSize * sizeof(char)); >+ } >+ >+ va_end(argp); >+ >+ /* Check if local logging is enabled */ >+ printf("DEBUG(NATIVE): %s\n", buffer); >+ free(buffer); >+#endif >+} >+ >+/* >+ * Sleep in seconds >+ */ >+#if defined(_WIN32) >+void sleep(int sec) { >+ Sleep(sec * 1000); >+} >+#endif >+ >+#if defined(__linux__) >+/* >+ * Get the process status from /proc >+ */ >+void getProcessStat(int pid, char* value) { >+ FILE *fp; >+ char *proc; >+ int rc; >+ >+ proc = (char*)malloc(sizeof(char) * _MAX_PATH); >+ >+ sprintf(proc, "/proc/%d/stat", pid); /* open the stat file of pid */ >+ debugTrace("Opening file %s for reading", proc); >+ >+ fp = fopen(proc, "r"); >+ rc = fread(value, sizeof(char), _MAX_PATH, fp); >+ fclose(fp); >+ debugTrace("%d bytes read from file %s", rc, proc); >+ >+ free(proc); >+ >+ return; >+} >+ >+/* >+ * Check if the process with this pid has the name specified >+ */ >+BOOL isProcessName(int pid, char* pname) { >+ char *stat; >+ char *name; >+ BOOL exist; >+ >+ debugTrace("Inside isProcessName(%d, %s)", pid, pname); >+ stat = (char*)malloc(sizeof(char) * _MAX_PATH); >+ getProcessStat(pid, stat); >+ >+ strtok(stat, " "); /* skip the 1st tok, process id */ >+ name = strtok(NULL, " "); /* got the 2nd tok, parent name */ >+ >+ if(strstr(name, pname) != NULL) { >+ debugTrace("String \"%s\" found in string \"%s\"", pname, name); >+ exist = TRUE; >+ } >+ else { >+ debugTrace("String \"%s\" not found in string \"%s\"", pname, name); >+ exist = FALSE; >+ } >+ >+ free(stat); >+/* free(name); /* is it an error? */ >+ >+ return exist; >+} >+ >+/* >+ * Get the parent pid of a process >+ */ >+int getParentProcessId(int pid) { >+ char *stat; >+ char *ppid_str; >+ int ppid; >+ >+ debugTrace("Inside getParentProcessId(%d)", pid); >+ stat = (char*)malloc(sizeof(char) * _MAX_PATH); >+ getProcessStat(pid, stat); >+ >+ strtok(stat, " "); /* skip the 1st tok, process id */ >+ strtok(NULL, " "); /* skip the 2nd tok, process name */ >+ strtok(NULL, " "); /* skip the 3rd tok, process status */ >+ ppid_str = strtok(NULL, " "); /* got the 4th tok, parent process id */ >+ >+ sscanf(ppid_str, "%d", &ppid); >+ debugTrace("Parent process ID found is %d", ppid); >+ >+ free(stat); >+/* free(ppid_str); /* is it an error? */ >+ >+ return ppid; >+} >+ >+#endif >Index: src-native-new/src/transport/RADataTransfer/RADataTransfer.h >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/RADataTransfer.h >diff -N src-native-new/src/transport/RADataTransfer/RADataTransfer.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/RADataTransfer.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,116 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: RADataTransfer.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef _RADATATRANSFER_H >+#define _RADATATRANSFER_H >+ >+#include "stdio.h" >+#include "RASocket.h" >+#include "RAShm.h" /* 175248 - replaced RASharedMemory.h with this */ >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/* This library provides a more rich set of data transfer >+ functions then that provided by the RASocket library. >+*/ >+ >+/* The various message types that are supported by this library >+ are. >+ >+ BINARY_DATA - data that is intended to be consumed byte by byte. >+ UTF8_STRING_DATA - string data where each character is represented >+ by one byte. >+ UNICODE_STRING_DATA - string data where each character is represented >+ by two bytes >+*/ >+ >+enum _dataFormat {RA_BINARY_DATA, >+ RA_UTF8_STRING_DATA, >+ RA_UNICODE_STRING_DATA}; >+ >+typedef enum _dataFormat dataFormat_t; >+ >+typedef dataFormat_t ra_dataFormat_t; >+ >+/* DNS Definitions to make data transfer more general ie supports different targets >+ for the data transfer */ >+ >+enum _dataTarget { RA_SOCKET, >+ RA_FILE, >+ RA_SHAREDMEMORY }; >+ >+typedef enum _dataTarget dataTarget_t; >+ >+typedef struct { >+ dataTarget_t dtarget; >+ union { >+ SOCKET socketFD; >+ FILE fileD; >+ ra_shm_handle_t *shmHdl; /* 175248 - changed to a pointer */ >+ } dtargetHdl; >+} ra_data_target_hdl_t; >+/* DNS end */ >+ >+ >+/** ALLOCATE_MESSAGE_BLOCK ************************************************ >+ * Allocates a block of memory that can be used for a message and returns >+ * the address where the caller can start adding data. >+ * IMPORTANT: must use ra_freeMessageBlock to free the memory when done >+ * @param length - the number of bytes required for the message >+ * @returns - the address where the message can be written to. NULL if >+ * there is no available memory. >+ */ >+extern unsigned char *ra_allocateMessageBlock(ra_uint_t length); >+ >+ >+ >+/** REALLOCATE_MESSAGE_BLOCK ************************************************ >+ * Recieves an existing message block and allocates a block of memory with the >+ * newley specified size. The data in the existing message block is copied >+ * to the new message block. >+ * IMPORTANT: must use ra_freeMessageBlock to free the memory when done >+ * @param message - the existing message block. >+ * @param length - the number of bytes required for the new message >+ * @returns - the address where the message can be written to. NULL if >+ * there is no available memory. >+ */ >+extern unsigned char *ra_reallocateMessageBlock(unsigned char *message, ra_uint_t length); >+ >+ >+/** FREE_MESSAGE_BLOCK ************************************************ >+ * Free's a block of message memory >+ * @param message - the address returned by ra_allocateMessageBlock >+ */ >+extern void ra_freeMessageBlock(unsigned char *message); >+ >+ >+/** WRITE_MESSAGE_BLOCK ************************************************* >+ * DNS - replaced socket parm with target handle struct >+ * Writes a message to the specified target using the specified format. >+ * @param handle - the handle of the target to write the data to. >+ * @param format - the format to use >+ * @param message - the address of the start of the message. >+ * @param length - the number of bytes to write to fd. >+ * @returns - the number of bytes written to the socket. >+ */ >+extern ra_uint_t ra_writeMessageBlock(ra_data_target_hdl_t *handle, >+ ra_dataFormat_t format, >+ unsigned char *message, >+ ra_uint_t length); >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif >Index: src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak >diff -N src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,213 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on PerfmonAgent.dsp >+!IF "$(CFG)" == "" >+CFG=PerfmonAgent - Win32 Release >+!MESSAGE No configuration specified. Defaulting to PerfmonAgent - Win32 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "PerfmonAgent - Win32 Release" && "$(CFG)" != "PerfmonAgent - Win32 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "PerfmonAgent.mak" CFG="PerfmonAgent - Win32 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "PerfmonAgent - Win32 Release" (based on "Win32 (x86) Console Application") >+!MESSAGE "PerfmonAgent - Win32 Debug" (based on "Win32 (x86) Console Application") >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "PerfmonAgent - Win32 Release" >+ >+OUTDIR=.\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\PerfmonAgent.exe" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\PerfmonAgent.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\PerfmonAgent.exe" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\PerfmonAgent.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\PerfmonAgent.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\PerfmonAgent.pdb" /machine:I386 /out:"$(OUTDIR)\PerfmonAgent.exe" /libpath:"bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\PerfmonAgent.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\PerfmonAgent.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - Win32 Debug" >+ >+OUTDIR=.\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=.\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\PerfmonAgent.exe" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\PerfmonAgent.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\PerfmonAgent.exe" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\PerfmonAgent.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+BSC32=bscmake.exe >+BSC32_FLAGS=/nologo /o"$(OUTDIR)\PerfmonAgent.bsc" >+BSC32_SBRS= \ >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib resutils.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\PerfmonAgent.pdb" /machine:I386 /out:"$(OUTDIR)\PerfmonAgent.exe" /libpath:"bin" >+LINK32_OBJS= \ >+ "$(INTDIR)\PerfmonAgent.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\PerfmonAgent.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(NO_EXTERNAL_DEPS)" != "1" >+!IF EXISTS("PerfmonAgent.dep") >+!INCLUDE "PerfmonAgent.dep" >+!ELSE >+!MESSAGE Warning: cannot find "PerfmonAgent.dep" >+!ENDIF >+!ENDIF >+ >+ >+!IF "$(CFG)" == "PerfmonAgent - Win32 Release" || "$(CFG)" == "PerfmonAgent - Win32 Debug" >+SOURCE=..\PerfmonAgent\PerfmonAgent.cpp >+ >+"$(INTDIR)\PerfmonAgent.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\PerfmonAgent\version.rc >+ >+!IF "$(CFG)" == "PerfmonAgent - Win32 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "\perfmon\PerfmonAgent" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - Win32 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "\perfmon\PerfmonAgent" /d "NDEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/native/java_profiler/JvmpiWriter.c >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/JvmpiWriter.c >diff -N src-native-new/src/agents/native/java_profiler/JvmpiWriter.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/JvmpiWriter.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4903 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: JvmpiWriter.c,v 1.31 2007/01/22 19:14:31 nmehrega Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include <ctype.h> >+#include <stddef.h> >+#include <time.h> >+#include <sys/types.h> >+#include <jvmpi.h> >+#include <stdlib.h> >+#include <stdio.h> >+#include <assert.h> >+#include <signal.h> >+#include <jni.h> >+#ifndef __OS400__ >+#include <sys/timeb.h> >+#endif >+#include <sys/types.h> >+#include <time.h> >+#include "eventmask.h" >+#include "hash.h" >+#include "JvmpiWriter.h" >+#include "piAgentExtension.h" >+#include "options.h" >+#include "filters.h" >+#include "RABindings.h" >+#include "JVMPIException.h" >+#ifndef __OS400__ >+#endif >+#include "RASocket.h" >+#include "print.h" >+#include "performance.h" >+#include "strings.h" >+#include "utility.h" >+ >+#include "StatelessHeapSnapshotManager_C.h" >+ >+#if defined __cplusplus && defined _HPUX >+ #define ENV(e) e >+ #define JOBJECT jclass >+#else >+ #define ENV(e) (*e) >+ #define JOBJECT jobject >+#endif >+ >+#ifdef _SHOOTDEBUG >+ #include "agentDebug.h" >+#endif >+ >+/* >+ * A note about agent extensions: >+ * >+ * Allan Pratt of the Rational software division of IBM added a feature >+ * to this agent on March 31, 2004: a simple extensibility system >+ * that lets people write agent extensions. Instructions for building an agent >+ * extension can be found in piAgentExtension.h. >+ * >+ * The system is quite limited: it doesn't solve any of the hard problems >+ * related to sending JVMPI events to multiple agents. It is barely adequate >+ * for an agent extension that wants JVM_INIT_DONE and CLASS_LOAD_HOOK, >+ * which is all we need it for right now. >+ * >+ * Every code segment related to this extension system has the >+ * words "agent extension" in a comment nearby. >+ */ >+ >+/** >+ * MACROS >+ * >+ */ >+/* following two undefs were added to avoid conflict from new java.h defs ... 135623 */ >+#undef ATTACH_THREAD >+#undef DETACH_THREAD >+ >+#ifdef _WIN32 >+ #define MODULE_REFERENCE HMODULE >+ #define DLL_REFERENCE HINSTANCE >+ #define DLL_NAME "jvm" >+ #define RESOLVE_MODULE(name) GetModuleHandle(name) >+ #define LOAD_LIBRARY(name) LoadLibrary(name) >+ #define RESOLVE_ENTRY_POINT(mod, entry) GetProcAddress(mod, entry) >+ #define ATTACH_THREAD(env) (*_jvmpiAgent_jvm)->AttachCurrentThread(_jvmpiAgent_jvm, (void**)&env, NULL) >+ #define DETACH_THREAD() (*_jvmpiAgent_jvm)->DetachCurrentThread(_jvmpiAgent_jvm) >+ #ifndef CDECL >+ #define CDECL __cdecl >+ #endif >+#elif MVS >+ #include <dll.h> >+ #define MODULE_REFERENCE dllhandle * >+ #define DLL_REFERENCE dllhandle * >+ #define DLL_NAME "libjava.so" >+ #define RESOLVE_MODULE(name) dllload(name) >+ #define LOAD_LIBRARY(name) dllload(name) >+ #define RESOLVE_ENTRY_POINT(mod, entry) dllqueryfn(mod, entry) >+ #define ATTACH_THREAD(env) (*_jvmpiAgent_jvm)->AttachCurrentThread(_jvmpiAgent_jvm, (void**)&env, NULL) >+ #define DETACH_THREAD() (*_jvmpiAgent_jvm)->DetachCurrentThread(_jvmpiAgent_jvm) >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#elif _HPUX >+ #include <dlfcn.h> >+ #define MODULE_REFERENCE void * >+ #define DLL_REFERENCE void * >+ #define DLL_NAME "libjvm.sl" >+ #define RESOLVE_MODULE(name) dlopen(name, RTLD_LAZY) >+ #define LOAD_LIBRARY(name) dlopen(name, RTLD_LAZY) >+ #define RESOLVE_ENTRY_POINT(mod, entry) dlsym(mod, entry) >+ #define ATTACH_THREAD(env) (_jvmpiAgent_jvm)->AttachCurrentThread((void**)&env, NULL) >+ #define DETACH_THREAD() (_jvmpiAgent_jvm)->DetachCurrentThread() >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#elif __OS400__ >+ #define MODULE_REFERENCE void * >+ #define DLL_REFERENCE void * >+ #define DLL_NAME "libjvm" >+ #define RESOLVE_MODULE(name) loadServicePgm(name) >+ #define LOAD_LIBRARY(name) loadServicePgm(name) >+ #define RESOLVE_ENTRY_POINT(mod, entry) findServicePgmEntry(mod, entry) >+ #define ATTACH_THREAD(env) (*_jvmpiAgent_jvm)->AttachCurrentThread(_jvmpiAgent_jvm, (void**)&env, NULL) >+ #define DETACH_THREAD() (*_jvmpiAgent_jvm)->DetachCurrentThread(_jvmpiAgent_jvm) >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#else >+ #include <dlfcn.h> >+ #define MODULE_REFERENCE void * >+ #define DLL_REFERENCE void * >+ #define DLL_NAME "libjvm.so" >+ #define RESOLVE_MODULE(name) dlopen(name, RTLD_LAZY) >+ #define LOAD_LIBRARY(name) dlopen(name, RTLD_LAZY) >+ #define RESOLVE_ENTRY_POINT(mod, entry) dlsym(mod, entry) >+ #define ATTACH_THREAD(env) (*_jvmpiAgent_jvm)->AttachCurrentThread(_jvmpiAgent_jvm, (void**)&env, NULL) >+ #define DETACH_THREAD() (*_jvmpiAgent_jvm)->DetachCurrentThread(_jvmpiAgent_jvm) >+ #ifndef CDECL >+ #define CDECL >+ #endif >+#endif >+ >+#define IBM_VENDOR_STRING "IBM" >+#define IBM_VENDOR_STRING_LENGTH 3 >+#define SUN_VENDOR_STRING "Sun" >+#define SUN_VENDOR_STRING_LENGTH 3 >+/* we only use the first 3 characters in HP's vendor string "Hewlett-Packard Co." */ >+#define HP_VENDOR_STRING "Hew" >+#define HP_VENDOR_STRING_LENGTH 3 >+ >+#define org_eclipse_hyades_collection_profiler_Profiler_PROFILER_EXECUTION_ONLY 1L >+#define org_eclipse_hyades_collection_profiler_Profiler_PROFILER_HEAP_ONLY 2L >+#define org_eclipse_hyades_collection_profiler_Profiler_PROFILER_EXECUTION_AND_HEAP 3L >+#define org_eclipse_hyades_collection_profiler_Profiler_PROFILER_OPTIMIZED_HEAP_ONLY 4L >+#define org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_SUCCESS 0L >+#define org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_SUSPENDED_IO 1L >+#define org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_FAIL 2L >+ >+/** >+ * TYPEDEFS >+ */ >+ >+/* TraceON - turn on tracing >+ TracePause - Pause tracing (keeping in mind that hash tables are not scrubbed) >+ TraceOFF - Turn off tracing completely >+*/ >+enum TraceToggleType {TraceON,TracePause,TraceOFF}; >+typedef enum TraceToggleType TraceToggle; >+ >+/* This is the signature declaration for all the event handlers from JVMPI. With a common >+ signature we can load the functions into an array and random access the proper >+ handler based upon the event type. >+*/ >+typedef void (*ProcessEventFunction)(JVMPI_Event *event, ThreadPrivateStorage *tps, BOOL isRequested, timestamp_t timestamp, timestamp_t cpu_timestamp); >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+void *prevMthdTps=NULL; >+int meCount=0; /* methodEntryEvents count */ >+int mxCount=0; /* methodExitEvents count*/ >+ >+void dumpMethodEventCounts(void) {/* dump MethodEvent counts */ >+ if (meCount>0 || mxCount>0) { >+ printf("Method entries/exits on tps %8x = %5d/%5d\n", (void *)prevMthdTps, meCount, mxCount); fflush(stdout); >+ } >+ meCount=mxCount=0; >+} >+#endif >+ >+/* For pre-aggregation */ >+/* The threadsRoot list is a list of all "live" threads. >+ I believe you could reach all the same elements using the thread hash table. >+ This is an optimization opportunity. >+ */ >+struct ThreadListElement { >+ ThreadPrivateStorage * data; >+ struct ThreadListElement * next; >+ struct ThreadListElement * prev; >+}; >+ >+struct ThreadListElement * threadsRoot = 0; >+ >+/* >+ * Locks for pre-aggregation logic. >+ * >+ * threadListLock is used when you are reading or writing the list starting at threadsRoot. >+ * >+ * stackFrameStructureLock is used when you are changing (but not just reading) >+ * the "next" and "child" pointers of any StackFrame object. This might seem unnecessary >+ * since each thread has its own rooted StackFrame structure, but the killer is dumping: >+ * during a dump, one thread reads all StackFrame structures, and having other threads >+ * running and updating their "next" pointers could crash the dump. >+ * >+ * Technically, this lock could also be acquired when you update the field values >+ * in any StackFrame, since the dump could see inconsistent data if it visits a node >+ * at the same time you're updating it. But I don't want to do that - it's too expensive >+ * to acquire this on every method entry and exit event. >+ * >+ * There is a no-lock alternative to stackFrameStructureLock: in the dumping logic, >+ * use JNI to suspend all other Java threads. I think this will suspend them in Java, >+ * not in the middle of a JVMPI event handler, so once they're all suspended the >+ * thread doing the dumping will know it's safe. If you implement this, you can remove >+ * all references to stackFrameStructureLock. >+ * >+ * Here's another no-lock trick: use the garbage collector instead. [Credit to Victor Havin >+ * for this one.] If you want to do a dump, you use JNI to cause a GC. In the handler for >+ * the "GC Started" notification from JVMPI, that's where you actually do the dump. >+ * When you're in that handler, you know that all other Java threads are suspended in >+ * safe states - definitely not executing handlers for other JVMPI events. >+ */ >+ >+static ra_critsec_t * stackFrameStructureLock = 0; >+static ra_critsec_t * threadListLock = 0; >+ >+/* For pre-aggregation */ >+void getStackFrameStructureLock() { >+ if (stackFrameStructureLock == 0 ) { >+ stackFrameStructureLock = (ra_critsec_t *)jvmpiAgent_Calloc(sizeof(ra_critsec_t)); >+ ra_mutexCreate(stackFrameStructureLock); >+ } >+ >+ ra_mutexEnter(stackFrameStructureLock); >+} >+ >+/* For pre-aggregation */ >+void releaseStackFrameStructureLock() { >+ if( stackFrameStructureLock == 0 ) { >+ fprintf(stdout, "Error!! stackFrameStructureLock is NULL " ); >+ fflush(stdout); >+ } >+ ra_mutexExit(stackFrameStructureLock); >+} >+ >+ >+/* For pre-aggregation */ >+void getThreadListLock() { >+ if (threadListLock == 0 ) { >+ threadListLock = (ra_critsec_t *)jvmpiAgent_Calloc(sizeof(ra_critsec_t)); >+ ra_mutexCreate(threadListLock); >+ } >+ >+ ra_mutexEnter(threadListLock); >+} >+ >+/* For pre-aggregation */ >+void releaseThreadListLock() { >+ if( threadListLock == 0 ) { >+ fprintf(stdout, "Error!! threadListLock is NULL " ); >+ fflush(stdout); >+ } >+ ra_mutexExit(threadListLock); >+} >+ >+static BOOL _traceResourcesGone = FALSE; /* Trace Hash Tables were cleaned up * pre-agg: 134635 */ >+ >+extern int _requestClassObj; /* used to flag when a object_alloc is being performed on a class object */ >+ >+/** >+ * File Scope Variable Definitions >+ */ >+static Jobject2jobjectID _jobject2jobjectID = 0; /* Function pointer to JVM interface function that converts JNI object handles to >+ JVMPI object identifiers */ >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+static char _heapDefName[8] = "default"; >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ >+ >+static BOOL _jvmShutDown = FALSE; /* JVM is in shut down mode*/ >+static BOOL _jvmpiAgent_isJVMInitDone=FALSE; /* JVM has finished initialization */ >+static BOOL _jvmpiAgent_isListenerUnblocked=FALSE; /* Has ra_startListener returned? */ >+static BOOL _jvmpiAgent_isMonitored=FALSE; /* Are we currently monitored? */ >+static BOOL _jvmpiAgent_isSuspended=FALSE; /* Are we currently suspended? */ >+static BOOL _jvmpiAgent_burstTimeoutSet=FALSE; /* Is our timout value set? */ >+ >+/* In order to limit tracing to a single thread these variables are used */ >+static JNIEnv *_jvmpiAgent_limitingThread=NULL; >+static BOOL _jvmpiAgent_singleThreaded=FALSE; >+ >+static unsigned int _invocationCountRemaining=0; /* Used in burst tracing to count invocations */ >+static timestamp_t _burstTimeout; >+static BOOL _triggerSqueezed=FALSE; /* Used in trigger tracing to indicate we have started */ >+ >+static BOOL _stackSamplerActive=FALSE; /* Stack sampler shutoff switch */ >+ >+static BOOL _xmlHeadersPrinted=FALSE; >+ >+/* Piyush Agarwal */ >+static BOOL _analyseOptHeap = FALSE ; /* To determine if the analyse >+ message came from the RAC */ >+static int _optHeapError = 0 ; /*58049 Handle Error if OptHeap files >+ cannot be written */ >+static int _unknownClassSuffix = 1; >+static char _classNameBuffer[64]; /* "unknown" + "int" */ >+ >+/* Giri: <Defect 64462> */ >+static BOOL _optHeapSetupDone = FALSE ; /* For tracking status of optHeap setup */ >+/*Bug 82214*/ >+static int optHeapContextId = -1 ; >+ >+/*Bug 59544 SetConfig changes for opt heap dump location*/ >+/* Bug 64476 */ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+static char _tempDirOptionName[21] = "LOCAL_AGENT_TEMP_DIR" ; >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+/* Array of function pointers to the JVMPI event handling functions */ >+static ProcessEventFunction _processEventFunction[JVMPI_MAX_EVENT_TYPE_VAL + 1]; /* The defect number is 174948. */ >+ >+/* Array of function pointers for our agent extension; the signature is slightly different */ >+static AgentExtensionEventHandler agent_extension_handlers[JVMPI_MAX_EVENT_TYPE_VAL + 1]; >+ >+/* Pointer to handler function for the agent extension to handle RAC commands. */ >+/* Remains null unless an extension extension utilizes it. */ >+static void (*agent_extension_command_handler)(ra_command_t *command); >+ >+/** >+ * FUNCTION PROTOTYPES >+ */ >+static int enableJvmpiEvent(jint event_type, >+ ProcessEventFunction eventHandler); >+ >+static void processObjAllocEvent(JVMPI_Event *event, >+ ThreadPrivateStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp); >+ >+static void processGcStartEvent(JVMPI_Event *event, >+ ThreadPrivateStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp); >+ >+static void processGcFinishEvent(JVMPI_Event *event, >+ ThreadPrivateStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp); >+ >+static void processCountingMethodEntryEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp); >+ >+static void toggleActiveJvmpiEvents(TraceToggle toggle); >+ >+static void cleanUpAllTraceResources(); >+ >+static void loadStack(ThreadPrivateStorage *tps); >+ >+static void startTracing(BOOL standalone); >+ >+static void suspendTracing(TraceToggle toggle); >+ >+static void resumeTracing(); >+ >+static void stopTracing(); >+ >+static void jvmpiAgent_PrintStartingXMLFragments(); >+ >+static void setNowTimes(ThreadLocalStorage * tps, timestamp_t * nowTime_P, timestamp_t * nowCpuTime_P); >+ >+static void recordAgMethodEntry(ThreadLocalStorage * tps, StackEntry * stackEntry, StackEntry * caller); >+ >+/* Piyush Agarwal */ >+static void sendHeapDumpInformation(char *filename) ; >+static void sendHeapDumpEndMessage(RA_AGENT_HANDLE handle,ra_uint_t contextId,char* filename) ; >+static void processRACDataDumpRequest(BOOL finalheap,ra_uint_t contextId) ; >+/* Added Call Back Message */ >+OptHeapCallBack _jvmpiAgent_optHeapCallBack = { sendHeapDumpInformation }; >+ >+/* functions for agent extensions to call to enable events and command listening */ >+static void agentExtensionSetEventHandler(jint event_type, >+ AgentExtensionEventHandler handler); >+static void agentExtensionSetCommandHandler(void (*handler)(ra_command_t *command)); >+ >+ >+static void sendOptHeapErrorMessage(RA_AGENT_HANDLE handle,ra_uint_t contextId) ; /* Piyush 58049 */ >+ >+/* Giri: Defect 64462 For performing opt heap related setup */ >+static void jvmpiAgent_DoOptHeapSetup(); >+ >+/** >+ * GLOBALS >+ */ >+jclass _jvmpiAgent_JVMPIException = 0; /* JNI hook to JVMPIException class */ >+jmethodID _jvmpiAgent_setExceptionTracing = 0; /* JNI hook to JVMPIException.setExceptionTracing method */ >+JavaVM * _jvmpiAgent_jvm = 0; /* JVM reference (established in JVM_OnLoad) */ >+JVMPI_Interface * _jvmpiAgent_jvmpiInterface = 0; /* JVMPI Interface pointer (established in JVM_OnLoad */ >+Lock_t _jvmpiAgent_synchLock; >+char * _jvmpiAgent_trace_id; >+SegmentedValue_t _jvmpiAgent_collation; >+GenerationInfo_t _heapDumpInfo; /* GENERATION Index for Object reference*/ >+RA_AGENT_HANDLE _jvmpiAgent_bindingStorage; >+char _setPathDelimiter = 0; >+jobjectID _resolvedClassId = 0; /* Used to store the class id for the associated class of an object being dumped */ >+enum JavaVendor _javaVendor = VendorOther; >+enum JavaVersion _javaVersion = VersionOther; >+ >+ >+/** ANALYSE_HEAP ************************************************************** >+ * This is the function that must be called to request a heap dump. >+ * >+ */ >+jint analyseHeap(jint type) { >+ jint result; >+ JVMPI_HeapDumpArg arg; >+ >+ >+ /* RKD: When we are stack sampling or we have been told to ignore heap information >+ we don't want to be processing heap dump requests >+ */ >+ if(_jvmpiAgent_Options.mode==TraceModeStackSampling || !jvmpiAgent_isTracingHeap()) { >+ return -1; >+ } >+ >+ /* If we get a heap dump level 0 we are marking the heap and we >+ mark the generation to be zero. >+ RKD: Should we scrub the table here? >+ */ >+ if(type==JVMPI_DUMP_LEVEL_0) { >+ _heapDumpInfo.index = 0; >+ } >+ /* Bug Number 71068*/ >+ /*else { >+ _heapDumpInfo.index++; >+ >+ }*/ >+ >+ /* To make sure that analyseheap is being called from TraceOptHeap methods only */ >+ if ( _jvmpiAgent_Options.mode == TraceOptimizedHeap && _analyseOptHeap == FALSE ) { >+ /* Bug Number 71043 required for AS400 */ >+ if ( type == JVMPI_DUMP_LEVEL_0 ) >+ jvmpiAgent_getCurrentTime(&_heapDumpInfo.lastGenerationTime); >+ return (jint)0 ; >+ } >+ >+ /* Bug Number 71068*/ >+ if(type != JVMPI_DUMP_LEVEL_0) { >+ _heapDumpInfo.index++; >+ } >+ >+ arg.heap_dump_level=type; >+ >+ /* Because this can be invoked via JNI we need to check to >+ ensure we have the interface. Someone may invoke the >+ dump but JVMPI may not be enabled. >+ */ >+ >+ if(_jvmpiAgent_jvmpiInterface) { >+ result = REQUEST_EVENT(JVMPI_EVENT_HEAP_DUMP, &arg); >+ } >+ >+ /* Save the time we finished the dump at */ >+ jvmpiAgent_getCurrentTime(&_heapDumpInfo.lastGenerationTime); >+ >+ return result; >+} >+ >+ >+jint runGC() { >+ jint result; >+ JVMPI_HeapDumpArg arg; >+ ThreadPrivateStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ tps->scrubbingHeap=1; >+ >+ /* Scrub the heap */ >+ arg.heap_dump_level=JVMPI_DUMP_LEVEL_0; >+ if(_jvmpiAgent_jvmpiInterface) { >+ result = REQUEST_EVENT(JVMPI_EVENT_HEAP_DUMP, &arg); >+ } >+ >+ tps->scrubbingHeap=0; >+ return result; >+} >+ >+ >+/* bugzilla 71388 start - JNI methods need to be enclosed in a conditional 'extern "C"' declaration */ >+#if defined __cplusplus >+extern "C" { >+#endif >+ >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: initialize0 >+ * Signature: ()V >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_initialize0(JNIEnv *env, >+ JOBJECT obj) { >+ >+ /* We just need to check if we are running in application mode */ >+ if(_jvmpiAgent_jvm && _jvmpiAgent_Options.application) { >+ return (jint)0; >+ } >+ else { >+ return (jint)-1; >+ } >+} >+ >+ /* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: setMode0 >+ * Signature: (I)V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_setMode0 >+(JNIEnv *env, jobject obj, jint mode) { >+ >+ /* call to OPTIMIZED HEAP DUMP CODE for method setMode0() goes here */ >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: startProfiling0 >+ * Signature: (ZZ)I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_startProfiling0(JNIEnv *env, >+ JOBJECT obj, >+ jboolean currentThread, >+ jint boundaryDepth) { >+ >+ if(_jvmpiAgent_jvm) { >+ if(currentThread) { >+ _jvmpiAgent_singleThreaded=TRUE; >+ _jvmpiAgent_limitingThread=env; >+ } >+ else { >+ _jvmpiAgent_singleThreaded=FALSE; >+ } >+ >+ >+ /* If we have a boundary depth we are tracing in boundary and contiguous mode. Otherwise we >+ need to reset the stack info back to the orignal state in case this is a subsequent call >+ to start profiling. >+ */ >+ if(boundaryDepth>0) { >+ _jvmpiAgent_Options.stackInfo=StackInfoBoundaryAndContiguous; >+ _jvmpiAgent_Options.boundaryDepth=(unsigned short)boundaryDepth; >+ } >+ else { >+ _jvmpiAgent_Options.stackInfo=StackInfoNormal; >+ _jvmpiAgent_Options.boundaryDepth=0; >+ } >+ >+ /* If someone is attached we start tracing now, otherwise we ignore this call */ >+ if(_jvmpiAgent_isMonitored) { >+ if(_jvmpiAgent_isSuspended) { >+ resumeTracing(); >+ >+ } >+ else { >+ startTracing(TRUE); >+ } >+ >+ /* Squeeze the trigger */ >+ _triggerSqueezed=TRUE; >+ >+ return (jint)0; >+ >+ } >+ } >+ return (jint)-1; >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: stopProfiling0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_stopProfiling0(JNIEnv *env, >+ JOBJECT obj) { >+ >+ if(_jvmpiAgent_jvm) { >+ suspendTracing(TracePause); >+ _jvmpiAgent_limitingThread=NULL; >+ } >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: markHeap0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_markHeap0(JNIEnv *env, >+ JOBJECT obj) { >+ if(_jvmpiAgent_jvm) { >+ analyseHeap(JVMPI_DUMP_LEVEL_0); >+ } >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: analyzeHeap0 >+ * Signature: (Ljava/lang/String;)V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_analyzeHeap0(JNIEnv *env, >+ JOBJECT obj, >+ jstring name) { >+ if(_jvmpiAgent_jvm) { >+ analyseHeap(JVMPI_DUMP_LEVEL_1); >+ } >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: optimizedHeapDump0 >+ * Signature: ()Ljava/lang/String; >+ */ >+JNIEXPORT jstring JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_optimizedHeapDump0 >+(JNIEnv *env, jobject obj) { >+ >+ /* call to OPTIMIZED HEAP DUMP CODE for method optimizedHeapDump0() goes here */ >+ processRACDataDumpRequest(FALSE,0) ; >+ return (jstring)0; >+ >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: stopOptimizedHeapInfoSnapshot0 >+ * Signature: ()Ljava/lang/String; >+ */ >+JNIEXPORT jstring JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_stopOptimizedHeapInfoSnapshot0 >+(JNIEnv *env, jobject obj) { >+ >+ >+ /* call to OPTIMIZED HEAP DUMP CODE for method stopOptimizedHeapInfoSnapshot0() >+ goes here */ >+ processRACDataDumpRequest(TRUE,0) ; >+ return (jstring)0; >+ >+} >+ >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: disableGC0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_disableGC0 >+(JNIEnv *env, jobject obj) { >+ >+ if (_jvmpiAgent_jvmpiInterface) { >+ _jvmpiAgent_jvmpiInterface->DisableGC(); >+ } >+ >+ >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: enableGC0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_enableGC0 >+(JNIEnv *env, jobject obj) { >+ >+ if (_jvmpiAgent_jvmpiInterface) { >+ _jvmpiAgent_jvmpiInterface->EnableGC(); >+ } >+ >+} >+ >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: runGC0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_runGC0(JNIEnv *env, >+ JOBJECT obj) { >+ if(_jvmpiAgent_jvm) { >+ runGC(); >+ } >+} >+ >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: release0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_release0 >+(JNIEnv *env, jobject obj) { >+ >+ /* RJD: currently the following is the body of the cleanupAndExit method. Other >+ cleanup may be necessary -- need to discuss */ >+ >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+ /* If the application is logging to a file */ >+ if (_jvmpiAgent_outFile) { >+ jvmpiAgent_printStandaloneTraceTagClose(tps); >+ jvmpiAgent_cleanupStandaloneIO(); >+ } else if (_jvmpiAgent_Options.application) { /*94955*/ >+ jvmpiAgent_printStandaloneTraceTagClose(tps); >+ } >+ >+ /* If this application is being controlled/moitored remotely */ >+ if (!_jvmpiAgent_Options.standalone) { >+ >+ /* Wait until all the data is sent over the wire if there is a data connection */ >+ if(!_jvmpiAgent_suspendIO) { >+ if(_jvmpiAgent_Options.targetHdl.dtarget==RA_SOCKET && _jvmpiAgent_Options.targetHdl.dtargetHdl.socketFD>-1) { >+ ra_closeSocket(_jvmpiAgent_Options.targetHdl.dtargetHdl.socketFD); >+ } >+ else if (_jvmpiAgent_Options.targetHdl.dtarget == RA_SHAREDMEMORY) { >+ ra_stopFlushingShm(&_jvmpiAgent_Options.targetHdl.dtargetHdl.shmHdl); /* 175248 */ >+ } >+ >+ _jvmpiAgent_suspendIO=1; >+ } >+ ra_stopListener(_jvmpiAgent_bindingStorage); >+ } >+ >+ >+ >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: emitXMLFragment0 >+ * Signature: ([BII)I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_emitXMLFragment0 >+(JNIEnv *env, jclass clz, jbyteArray arr, jint offset, jint len) { >+ char *carr; /* note that jbyte * is a signed char* on most platforms */ >+ char *outputBuffer; >+#ifdef __OS400__ >+ char *tmp, *tmp2; /* temporary storage used only for AS/400 */ >+#endif >+ jboolean iscopy; >+ ThreadLocalStorage *tps; >+ iscopy = JNI_FALSE; >+ >+ if (_jvmpiAgent_suspendIO) { >+ return org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_SUSPENDED_IO; >+ } >+ >+ carr = (char *) ENV(env)->GetByteArrayElements(ENVPARM(env) arr,&iscopy); >+ >+ if (carr == NULL) { >+ /* NULL is returned by GetByteArrayElements only when an OutOfMemoryError occurs */ >+ return org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_FAIL; >+ } >+ >+ /* get the thread private storage */ >+ tps=jvmpiAgent_getThreadLocalStorage(env); >+ >+ if (tps == 0) { >+ tps = jvmpiAgent_getThreadLocalStorage(0); >+ } >+ >+ /* Ensure that the output buffer is large enough. Note, the jvmpiAgent_print >+ method adds a '\n', and on zOS a '\0' to the buffer. We take this into account >+ when sizing the buffer. */ >+ if (len > (ORIGINAL_MESSAGE_BUFFER_SIZE - 2)) { >+ outputBuffer = (char *)ra_allocateMessageBlock((unsigned short)len+2); >+#ifdef __OS400__ >+ /* we need to increase the size of the etoa scratch buffer */ >+ tmp = tps->buffer2; /* remember the normal buffer */ >+ tps->buffer2 = ra_allocateMessageBlock((unsigned short)len+2); >+#endif >+ if (!outputBuffer) { >+ return org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_FAIL; >+ } >+ } >+ else { >+ outputBuffer = tps->buffer; >+ } >+ >+#ifdef __OS400__ >+ /* on AS400 we assume the passed in string is in UTF-8. Convert it to EBCDIC before >+ putting it into the output buffer. */ >+ >+ /* this is ugly, but it's required: the as400_atoe routines require a null terminated string, >+ and that the 'from' buffer is not the same as the 'to' buffer */ >+ tmp2 = ra_malloc(sizeof(char)*(len+1)); >+ if (!tmp2) { >+ return org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_FAIL; >+ } >+ memcpy(tmp2,&carr[offset],len); >+ tmp2[len] = '\0'; >+ outputBuffer = as400_atoe_tobuffer(tmp2,outputBuffer); >+ ra_free(tmp2); >+#else >+ /* copy the XML fragment into the tps->buffer for printing */ >+ memcpy(outputBuffer,&carr[offset],len); >+#endif >+ >+ jvmpiAgent_print(tps,outputBuffer,(unsigned short) len); >+ >+ if (tps->buffer != outputBuffer) { >+ ra_freeMessageBlock((unsigned char *)outputBuffer); >+#ifdef __OS400__ >+ ra_freeMessageBlock((unsigned char *)tps->buffer2); >+ tps->buffer2 = tmp; /* restore the normal buffer */ >+#endif >+ } >+ >+ ENV(env)->ReleaseByteArrayElements(ENVPARM(env) arr, (signed char *) carr, JNI_ABORT); >+ >+ return org_eclipse_hyades_collection_profiler_Profiler_EMIT_XML_SUCCESS; >+ >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: getCurrentTime0() >+ * Signature: ()D >+ */ >+JNIEXPORT jdouble JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_getCurrentTime0 >+(JNIEnv *env, jclass clz) { >+ timestamp_t timestamp; >+ >+ jvmpiAgent_getCurrentTime(×tamp); >+ return ticksToTime2(timestamp, TRUE); >+} >+ >+/* >+ * Class: org_eclipse_hyades_collection_profiler_Profiler >+ * Method: getCurrentThreadCpuTime0() >+ * Signature: ()D >+ */ >+JNIEXPORT jdouble JNICALL Java_org_eclipse_hyades_collection_profiler_Profiler_getCurrentThreadCpuTime0 >+(JNIEnv *env, jclass clz) { >+ timestamp_t cpu_timestamp; >+ >+ cpu_timestamp = jvmpiAgent_getCurrentThreadCPUTime(); >+ return ((jdouble) >+#ifdef WIN32 >+ (__int64) >+#endif >+ cpu_timestamp)/1000000000; /* nanoseconds but very fat grain, about 10 milliseconds!!! */ >+} >+ >+ >+/* bugzilla 71388 end - JNI methods need to be enclosed in a conditional 'extern "C"' declaration */ >+#if defined __cplusplus >+} >+#endif >+ >+ >+ >+#ifndef __OS400__ >+/* Resolve to the jobject2jobjectID interface */ >+static jobjectID resolveJobject2jobjectID(jthrowable e, JNIEnv *env) >+{ >+ static resolved = 0; >+ if (_jobject2jobjectID) >+ { >+ return _jobject2jobjectID(e); >+ } >+ else if ( resolved ) >+ { >+ return 0; >+ } >+ else >+ { >+ resolved = 1; >+ /* jobject2jobjectID IBM JDK 1.2.2 IBM JDK1.3 Sun JDK 1.2.2 Classic Sun JDK 1.3 Classic Sun JDK 1.3 Hotspot >+ JVM.dll entry point not available yes yes yes no >+ JVMPI interface pointer not available yes no no yes - but no header >+ */ >+ /* First attempt to resolve the entry point directly from the JVM dll */ >+ _jobject2jobjectID = (Jobject2jobjectID)RESOLVE_ENTRY_POINT(RESOLVE_MODULE(DLL_NAME), "jobject2jobjectID"); >+ >+ if (!_jobject2jobjectID) >+ { >+ /* We couldn't find the entry point exported from the JVM dll so now we check the JVM version >+ to see if it is safe to retreive the entry point from the JVMPI interface structure. We assume >+ that any JVM above version 2.1 should support this interface... */ >+#if defined __cplusplus && defined _HPUX >+ jint version = ENV(env)->GetVersion(); >+#else >+ jint version = (*env)->GetVersion(env); >+#endif >+ unsigned short *p = (unsigned short *)&version; >+ unsigned short major = *p; >+ unsigned short minor = *(p+1); >+ if (major >= 2 && minor >= 1) >+ { >+#ifndef _HPUX >+ _jobject2jobjectID = _jvmpiAgent_jvmpiInterface->jobject2jobjectID; >+#endif >+ } >+ } >+ return _jobject2jobjectID ? _jobject2jobjectID(e) : 0; >+ } >+} >+#endif /* __OS400__ */ >+ >+ >+/** GET_THREAD_LOCAL_STORAGE ************************************************* >+ * This function returns the address of the thread local storage for the >+ * specified JNIEnv (aka thread). A special thread local storage structure is >+ * allocated for static references and is returned when the JNIEnv parameter is >+ * 0 or if the JVM is in Garbage Collection or Shutdown mode. Garbage Collection >+ * and Shutdown mode must be handled in this way because some versions of the >+ * JVM use special threads to do this processing which cause the >+ * GetThreadLocalStorage interface function to trap. >+ */ >+ThreadPrivateStorage *jvmpiAgent_getThreadLocalStorage(JNIEnv *env_id) { >+ HashEntry *hashEntry = jvmpiAgent_FindThreadSymbol(env_id); >+ if (hashEntry) { >+ if (!hashEntry->printed && env_id && THREAD_ENTRY(hashEntry)->threadStartEventSeen && _xmlHeadersPrinted) { >+ jvmpiAgent_printThreadStartElement(env_id, hashEntry); >+ } >+ return (ThreadPrivateStorage *)hashEntry->entry; >+ } >+ else { >+ hashEntry = jvmpiAgent_CreateStack(env_id); >+ return (ThreadPrivateStorage *)hashEntry->entry; >+ } >+} >+ >+ >+/** SEND_ERROR_MESSAGE ******************************************************************* >+ */ >+void sendErrorMessage(RA_ERROR_LEVEL severity, >+ const char *errorId, >+ const char *errorString) >+{ >+#ifdef MVS >+ __atoe(errorId); >+ __atoe(errorString); >+#endif >+ if(!_jvmpiAgent_Options.standalone) >+ { >+ ra_logErrorMessage(_jvmpiAgent_bindingStorage, severity, errorId, errorString); >+ } >+ else >+ { >+ /* 60642 standalone mode - write to stderr if warning or worse */ >+ if (severity >= RA_WARNING) >+ { >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ fprintf(stderr, "%s: %s\n", errorId, errorString); >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ fflush(stderr); >+ } >+ } >+/* we need to undo the conversion on 390 in case this method is called with the same >+ string more than once */ >+#ifdef MVS >+ __etoa(errorId); >+ __etoa(errorString); >+#endif >+} >+ >+/** CLEANUP_AND_EXIT ********************************************************** >+ * Flushes the I/O buffers, closes the data channel or file and shuts down the >+ * RAC connection. >+ */ >+static void CDECL cleanupAndExit(int sig) { >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("cleanupAndExit underway\n"); fflush(stdout); >+#endif >+ /* If the application is logging to a file */ >+ if (_jvmpiAgent_outFile) { >+ jvmpiAgent_printStandaloneTraceTagClose(tps); >+ jvmpiAgent_cleanupStandaloneIO(); >+ } else if (_jvmpiAgent_Options.application) { /*94955*/ >+ jvmpiAgent_printStandaloneTraceTagClose(tps); >+ } >+ >+ /* If this application is being controlled/moitored remotely */ >+ if (!_jvmpiAgent_Options.standalone) { >+ >+ /* Wait until all the data is sent over the wire if there is a data connection */ >+ if(!_jvmpiAgent_suspendIO) { >+ if(_jvmpiAgent_Options.targetHdl.dtarget==RA_SOCKET && _jvmpiAgent_Options.targetHdl.dtargetHdl.socketFD>-1) { >+ ra_closeSocket(_jvmpiAgent_Options.targetHdl.dtargetHdl.socketFD); >+ } >+ else if (_jvmpiAgent_Options.targetHdl.dtarget == RA_SHAREDMEMORY) { >+ ra_stopFlushingShm(&_jvmpiAgent_Options.targetHdl.dtargetHdl.shmHdl); /* 175248 */ >+ } >+ >+ _jvmpiAgent_suspendIO=1; >+ } >+ ra_stopListener(_jvmpiAgent_bindingStorage); >+ } >+} >+ >+ >+/** OUTPUT_CLASS_DECLARATION ************************************************** >+ * Conditionally outputs a classLoad element if it has not already been output. >+ */ >+void jvmpiAgent_outputClassDeclaration(HashEntry *classEntry, >+ ThreadPrivateStorage *tps) { >+ /* RKD: The testing for printing and the marking of printed elements is >+ not good. We need to mark the element as printed at the same >+ time as we check to see if it is printed. This is the only >+ way to ensure we don't have a race condition and an element >+ gets printed. >+ */ >+ if (!_jvmpiAgent_suspendIO && classEntry != NULL && !classEntry->printed) { >+ >+ /* Ensure that the class object and the java.lang.Class have been printed unless we are >+ specifically not tracing heap information or we have been specified to ignore heap information */ >+ if(CLASS_ENTRY(classEntry)->classObject!=NULL && jvmpiAgent_isTracingHeap()) { >+ if(!CLASS_ENTRY(classEntry)->classObject->printed) { >+ jvmpiAgent_printObjAllocElement(CLASS_ENTRY(classEntry)->classObject, tps->env, 0); >+ } >+ } >+ /* Have to check whether the class is printed already which is the case for java.lang.Class */ >+ >+ if (!classEntry->printed && CLASS_ENTRY(classEntry)->classId) { /* 218494 */ >+ jvmpiAgent_printClass(classEntry, tps); >+ } >+ /* If this is a primative class there is no class object */ >+ else if(CLASS_ENTRY(classEntry)->arrayClass) { >+ jvmpiAgent_printClass(classEntry, tps); >+ } >+ >+ } >+} >+ >+ >+ >+/** OUTPUT_METHOD_DECLARATION ********************************************************* >+ * Conditionally outputs a METHOD element (and any referenced CLASS_LOAD elements) >+ * if it has not already been output. >+ * Preconditions: In order to avoid redundant testing this method does not test to >+ * determine if IO is suspended and hense should not be called when >+ * it is. >+ * methodEntry - the method you wish to print the declaration for. >+ * buffer - the buffer to flush the IO to. >+ */ >+void jvmpiAgent_outputMethodDeclaration(HashEntry *methodHashEntry, >+ ThreadPrivateStorage *tps) { >+ >+ /* RKD: The testing for printing and the marking of printed elements is >+ not good. We need to mark the element as printed at the same >+ time as we check to see if it is printed. This is the only >+ way to ensure we don't have a race condition and an element >+ gets printed. >+ */ >+ if (!methodHashEntry->printed) { >+ methodHashEntry->printed=1; >+ jvmpiAgent_outputClassDeclaration(METHOD_ENTRY(methodHashEntry)->classHashEntry, tps); >+ jvmpiAgent_printMethod(METHOD_ENTRY(methodHashEntry), tps); >+ } >+} >+ >+ >+/* >+ This function resolves to the JAVA method JVMPIException.setExceptionTracing if not already done, and then synchronizes the >+ state of the traceExceptions option with the Java class. >+ The function returns the current state of the traceExceptions option. >+*/ >+static int isTracingExceptions(JNIEnv *env, jclass cls) >+{ >+ if (!_jvmpiAgent_setExceptionTracing) >+ { >+#if defined __cplusplus && defined _HPUX >+ _jvmpiAgent_setExceptionTracing = ENV(env)->GetStaticMethodID(cls, "setExceptionTracing", "(Z)V"); >+#else >+ _jvmpiAgent_setExceptionTracing = (*env)->GetStaticMethodID(env, cls, "setExceptionTracing", "(Z)V"); >+#endif >+ _jvmpiAgent_JVMPIException = cls; >+ } >+ if (!_jvmpiAgent_Options.traceExceptions && _jvmpiAgent_setExceptionTracing) >+ { >+#if defined __cplusplus && defined _HPUX >+ ENV(env)->CallStaticVoidMethod(_jvmpiAgent_JVMPIException, _jvmpiAgent_setExceptionTracing, (jboolean)0 ); >+#else >+ (*env)->CallStaticVoidMethod(env, _jvmpiAgent_JVMPIException, _jvmpiAgent_setExceptionTracing, (jboolean)0 ); >+#endif >+ } >+ return _jvmpiAgent_Options.traceExceptions; >+} >+ >+ >+#ifndef __OS400__ >+/** PROCESS_EXCEPTION_EVENT ************************************************** >+ */ >+static void processExceptionEvent(JNIEnv *env, ThreadPrivateStorage *tps, jclass cls, jthrowable e, enum ThrowOrCatch type) >+{ >+ >+ /* RKD: We shouldn't be testing IO here. */ >+ if (!_jvmpiAgent_suspendIO && isTracingExceptions(env, cls)) >+ { >+ HashEntry * methodHashEntry = 0; >+ methodHashEntry = jvmpiAgent_Peek(tps,2)->methodHashEntry; >+ if (methodHashEntry && CLASS_ENTRY(METHOD_ENTRY(methodHashEntry)->classHashEntry)->traceFlag) >+ { >+ jobjectID objId = resolveJobject2jobjectID(e, env); >+ jvmpiAgent_printExceptionElement(env, tps, type, methodHashEntry, objId, e); >+ } >+ } >+} >+#endif /* __OS400__ */ >+ >+/* bugzilla 71388 start - JNI methods need to be enclosed in a conditional 'extern "C"' declaration */ >+#if defined __cplusplus >+extern "C" { >+#endif >+ >+/* >+ * Class: JVMPIException >+ * Method: JVMPICatch >+ * Signature: (Ljava/lang/Throwable;)V >+ */ >+JNIEXPORT void JNICALL Java_com_ibm_etools_logging_tracing_agent_Callback_JVMPICatch0(JNIEnv *env, jclass cls, jthrowable e) >+{ >+#ifndef __OS400__ >+ processExceptionEvent(env, jvmpiAgent_getThreadLocalStorage(env), cls, e, Catch); >+#endif /* __OS400__ */ >+} >+ >+ >+/* >+ * Class: JVMPIException >+ * Method: JVMPIThrow >+ * Signature: (Ljava/lang/Throwable;)V >+ */ >+JNIEXPORT void JNICALL Java_com_ibm_etools_logging_tracing_agent_Callback_JVMPIThrow0(JNIEnv *env, jclass cls, jthrowable e) >+{ >+#ifndef __OS400__ >+ processExceptionEvent(env, jvmpiAgent_getThreadLocalStorage(env), cls, e, Throw); >+#endif >+} >+ >+/* bugzilla 71388 end - JNI methods need to be enclosed in a conditional 'extern "C"' declaration */ >+#if defined __cplusplus >+} >+#endif >+ >+/** PROCESS_METHOD_EXIT_EVENT ************************************************ >+ * >+ */ >+static void processMethodExitEvent(JVMPI_Event *event, >+ ThreadPrivateStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ HashEntry *methodHashEntry; >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ if (tps!=prevMthdTps) { >+ dumpMethodEventCounts(); prevMthdTps=tps; >+ } >+ mxCount++; >+#endif >+ if(_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ /* ToDo: remove. I know that, in TraceGcOptimizedHeap mode, it will never come >+ * here because METHOD_EXIT event is disbled, but just to make sure that it >+ * is not accidently causing lack of LeakCandidates. >+ */ >+ /* do nothing */ >+ return; >+ } >+ >+ /* RKD: If we don't know the stack for this thread >+ we will abort this event. >+ */ >+ if(!tps->threadStackKnown) { >+ return; >+ } >+ >+ >+ /* RKD: It could be possible that the stack will be empty. This happens >+ on various platforms with various JDK's due to bugs in the JVMPI >+ implementation. In order to avoid the almightly stack underflow >+ that would result in us bringing down the JVM, I will check and >+ see if the stack is empty. It this is the case I will back out >+ the profiler and allow the JVM to continue processing. >+ */ >+ if(!tps->tos) { >+ tps->threadStackKnown=0; >+ return; >+ } >+ >+ /* Compare the current method with that on the local stack */ >+ methodHashEntry = tps->stackEntry[tps->tos].methodHashEntry; >+ /* 174190 - added check for non-NULL methodHashEntry in case there isn't one stored on the stack */ >+ if(methodHashEntry && ((MethodHashKey *)methodHashEntry->id)->id != event->u.method.method_id) { >+ /* Stack is not synched, look up the method */ >+ methodHashEntry = jvmpiAgent_FindMethodSymbol(event->u.method.method_id); >+ } >+ >+ /* 174190 - added check for non-NULL methodHashEntry in case there isn't one stored on the stack */ >+ if (methodHashEntry) { >+ /* If not pre-aggregating, print the method-exit event for those where we printed the entry. */ >+ if (_jvmpiAgent_Options.compressLevel==CompressNone) { >+ if (jvmpiAgent_Peek(tps, 0)->printed) { >+ jvmpiAgent_printMethodExitElement(event, tps, methodHashEntry, timestamp,cpu_timestamp); >+ } >+ } >+ /* If this was a trigger that started tracing, stop tracing (only if trigger tracing) */ >+ if(_jvmpiAgent_Options.startMode>TraceStartModeFilter && !_jvmpiAgent_Options.application && jvmpiAgent_Peek(tps, 0)->trigger) { >+ suspendTracing(TracePause); >+ } >+ } >+ >+ /* if pre-aggregation, accumulate time into this StackEntry (unless bad lastEntryTime), and set lastEntryTime of caller. */ >+ if(_jvmpiAgent_Options.compressLevel==CompressAggregate) >+ { >+ StackEntry * top = jvmpiAgent_Peek(tps, 0); >+ StackEntry * caller = jvmpiAgent_Peek(tps, 1); >+ if( top != NULL && top->lastEntryTime!=0) { /* lastEntryTime is 0 for first stackEntry after loadstack * 139537 */ >+ TIMESTAMP_ADD(top->baseTime , timestamp - top->lastEntryTime); >+ TIMESTAMP_ADD(top->baseCPUTime, cpu_timestamp - top->lastEntryCPUTime); >+ DBG_CHK_AND_REPORT_TIME_OVERFLOW(top->baseTime, "Time overflowed?! (MethodExit: top->baseTime)\n"); /* 134577 */ >+ } >+ if( caller != NULL ) { >+ caller->lastEntryTime = timestamp; >+ caller->lastEntryCPUTime = cpu_timestamp; >+ } >+ /* The logic in jvmpiAgent_Pop will roll data from the StackEntry to the proper StackFrame. */ >+ } >+ jvmpiAgent_Pop(tps); >+} >+ >+/* bugzilla 71388 start - JNI methods need to be enclosed in a conditional 'extern "C"' declaration */ >+#if defined __cplusplus >+extern "C" { >+#endif >+ >+/* >+ * Class: com_ibm_etools_logging_tracing_agent_Callback >+ * Method: JVMPICoverage0 >+ * Signature: (S)V >+ */ >+JNIEXPORT void JNICALL Java_com_ibm_etools_logging_tracing_agent_Callback_JVMPICoverage0(JNIEnv *env, jclass cls, jshort e) >+{ >+ >+ /* RKD: We shouldn't be testing IO here */ >+ if (!_jvmpiAgent_suspendIO && _jvmpiAgent_jvm) /* Only do this if the dll has been initialized correctly */ >+ { >+ HashEntry * methodHashEntry = 0; >+ ThreadLocalStorage *tps; >+ tps = jvmpiAgent_getThreadLocalStorage(env); >+ >+ methodHashEntry = jvmpiAgent_Peek(tps,2)->methodHashEntry; >+ if (methodHashEntry && CLASS_ENTRY(METHOD_ENTRY(methodHashEntry)->classHashEntry)->traceFlag) >+ { >+ jvmpiAgent_printLineElement(env, tps, methodHashEntry, e); >+ } >+ } >+ >+} >+ >+/* bugzilla 71388 end - JNI methods need to be enclosed in a conditional 'extern "C"' declaration */ >+#if defined __cplusplus >+} >+#endif >+ >+static int decrementInvocationCount() { >+ /* Decrement the burst count if necessary. >+ RKD: This should be atomic. >+ */ >+ /* decrementInvocationCount() is called at the END of processMethodEntry, and so >+ when the invocationCountRemaining is 1, this means that we've traced the number >+ of methods asked for by the user */ >+ if(_invocationCountRemaining<=1) { >+ suspendTracing(TracePause); >+ return -1; >+ } >+ else { >+ _invocationCountRemaining--; >+ return 0; >+ } >+} >+ >+ >+static int incrementInvocationCount() { >+ _invocationCountRemaining--; >+} >+ >+/** PROCESS_MISSING_STACK_ENTRIES ******************************************** >+ * >+ */ >+static void processMissingStackEntries(JVMPI_Event *event, ThreadLocalStorage *tps) { >+ StackEntry * se = 0; >+ int i = 1; >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("processMissingStackEntries: tps = %8x\n", (void *)tps); fflush(stdout); >+#endif >+ if(_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ /* ToDo: remove. I know that, in TraceGcOptimizedHeap mode, it will never come >+ * here because it is called only from processMethodEntry() method, and >+ * METHOD_ENTRY events are disabled. But just to make sure that it >+ * is not accidently causing lack of LeakCandidates. >+ */ >+ /* do nothing */ >+ return; >+ } >+ >+ /* Walk up the stack looking for the first non filtered out method. This loop will leave >+ i being the stack offset of the first unfiltered method on the stack and se points to this >+ stackEntry. If se is null then we walked off the beginning of the stack without finding >+ an unfiltered method. >+ */ >+ for (se = jvmpiAgent_Peek(tps, i); se && !se->printed; se = jvmpiAgent_Peek(tps, ++i)); >+ >+ >+ /* Now we walk through the filtered out stack entries producing METHOD_ENTRYs for each entry.*/ >+ for (--i; se && i > 0; --i) { >+ se = jvmpiAgent_Peek(tps, i); >+ >+ /* If we are handling object collation we better ensure we know the object */ >+ if(_jvmpiAgent_Options.mode == TraceModeFull) { >+ /* RKD: If we know the object we should check our filter against it for inheritance reasons (only when filter tracing) */ >+ if (se->objectHashEntry && _jvmpiAgent_Options.startMode==TraceStartModeFilter && !se->objectHashEntry->printed) { >+ jvmpiAgent_printObjAllocElement(se->objectHashEntry, event->env_id, 0); >+ } >+ } >+ >+ /* Note: following if-else-if pattern repeats with variation in ProcessMethodEntry */ >+ /* Test pre-aggregation mode */ >+ if (_jvmpiAgent_Options.compressLevel==CompressNone) { >+ /* Full Trace: print the method entry for this stack frame */ >+ jvmpiAgent_printMethodEntryEvent(event, tps, se, tps->tos-i); >+ } >+ else { /* 134635C - fix contiguous mode (besides detach/attach/pause) */ >+ >+ /* pre-agg mode: print a methodDef if needed and create a stackFrame for this stackEntry. >+ * >+ * We can safely create a stackFrame after the fact here. It is later than usual (normally >+ * done on method entry) but still before it is needed (in the agPop invoked at method exit). >+ * Note that the baseTime/baseCpuTime accumulations have already been done correctly for this >+ * stackEntry by the normal MethodEntryEvent operations which accumulate time the same way >+ * regardless of whether the method is filtered or not. It is the processing of MethodExitEvents >+ * (specifically the jvmpiAgent_agPop) that differentiates between filtered and not. >+ */ >+ StackEntry * caller; >+ caller = jvmpiAgent_Peek(tps, i+1); /* se is guaranteed to have a caller on the stack */ >+ /* Pre-agg: print method def if needed & create/re-use StackFrame for method * 134577 */ >+ /* : set lastEntryTime (& lastEntryCpuTime as needed) * 134577 */ >+ recordAgMethodEntry(tps, se, caller); /* 134577 */ >+ } >+ /* Deal with burst mode if we are running in that mode (ignore BurstModeSeconds here) */ >+ if( _jvmpiAgent_Options.burstMode == BurstModeInvocations || >+ _jvmpiAgent_Options.burstMode == BurstModeSecondsAndInvocations ) { >+ decrementInvocationCount(); /* non-zero indicates count exhausted: tracing has suspended */ >+ } >+ >+ } >+} >+ >+/** >+ * loadMethodHashEntry() >+ * >+ * Load the method hash entry for a given method_id, ensuring that a CLASS_LOAD >+ * is requested if the piAgent doesn't currently know about the method >+ */ >+static HashEntry *loadMethodHashEntry(jmethodID method_id) { >+ HashEntry *methodHashEntry = NULL; >+ /* The JVM may give us a method_id of '0' */ >+ if(method_id != 0) { >+ methodHashEntry = jvmpiAgent_FindMethodSymbol(method_id); >+ >+ /* If this is an unknown method we need to ask for the CLASS_LOAD event */ >+ if(!methodHashEntry) { >+ jobjectID clazz; >+ jint result; >+ clazz=_jvmpiAgent_jvmpiInterface->GetMethodClass(method_id); >+ result=!JVMPI_SUCCESS; >+ >+ if(clazz) { >+ result=REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, clazz); /* 232010 */ >+ /* If we found the class we should have the method */ >+ if(result == JVMPI_SUCCESS) { >+ methodHashEntry = jvmpiAgent_FindMethodSymbol(method_id); >+ } >+ } >+ } >+ } >+ return methodHashEntry; >+} >+ >+ >+/** PROCESS_COUNTING_METHOD_ENTRY_EVENT >+ * >+ * This version of processMethodEntryEvent is called when the METHOD_COUNTS_ONLY option is turned >+ * on. We don't want the overhead of the regular processMethodEntry event in this case. >+ */ >+ >+static void processCountingMethodEntryEvent(JVMPI_Event *event, ThreadLocalStorage *tps, BOOL isRequested, timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ HashEntry *methodHashEntry; >+ >+ methodHashEntry = loadMethodHashEntry(event->u.method.method_id); >+ if (methodHashEntry != NULL) { >+ METHOD_ENTRY(methodHashEntry)->methodCount++; >+ } >+} >+ >+/* For pre-aggregation */ >+/* Recursively free stack frames. >+ * This function frees all children of the frame being passed in, >+ * then frees that frame itself. It returns the "next" (sibling) pointer >+ * from the frame being freed. >+ * >+ * OPTIMIZATION OPPORTUNITY HERE: use a chunky allocator for StackFrame >+ * objects, with one chunk chain per thread. Since the frames for a thread >+ * are always freed all at once, you could just free the chunks and not have >+ * to do this recursive descent. >+ */ >+void freeStackFrames(StackFrame* frame) >+{ >+ if (frame == NULL) return; >+ >+ /* first, free children */ >+ freeStackFrames(frame->calledList); >+ >+ /* then, free the next sibling */ >+ freeStackFrames(frame->next); >+ >+ /* finally, free this frame */ >+ free(frame); >+} >+ >+/* For pre-aggregation */ >+/* >+ * Add a thread to the list of live threads that the >+ * pre-aggregation logic is tracking. >+ * >+ * This may seem redundant - the list of live threads is also available >+ * in the ThreadHashTable data structure. But the timing and semantics >+ * adding and removing threads from that list and this one are different, >+ * and I didn't want to go poking around to make sure the right things would >+ * always happen in the right order, so I left this as a separate data >+ * structure just like the original prototype implementors had. >+ */ >+void addThreadToList( ThreadPrivateStorage * tpsLocal ) >+{ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("addThreadToList (try): tpsLocal = %8x\n", (void *)tpsLocal); fflush(stdout); >+#endif >+ /* Get the thread list lock because we're managing that list here */ >+ getThreadListLock(); >+ { >+ /* It seems we are recieving duplicate events for thread starts. First, make >+ * sure we don't already have the thread */ >+ struct ThreadListElement * it = threadsRoot; >+ while (it) { >+ if (it->data == tpsLocal ) { >+ /* Thread already seen; exit with "it" != NULL */ >+ break; >+ } >+ it = it->next; >+ } >+ >+ if (it == NULL ) { >+ /* usual case: we don't already have an entry for this thread */ >+ struct ThreadListElement * newThreadElement = (struct ThreadListElement *)jvmpiAgent_Calloc( sizeof( struct ThreadListElement ) ); >+ newThreadElement->data = tpsLocal; >+ newThreadElement->next = threadsRoot; >+ newThreadElement->prev = 0; >+ if( threadsRoot ) >+ threadsRoot->prev = newThreadElement; >+ threadsRoot = newThreadElement; >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("addThreadToList (succeed)\n"); fflush(stdout); >+#endif >+ } >+ } >+ releaseThreadListLock(); >+} >+ >+/* For pre-aggregation */ >+/* >+ * Remove a thread from the list of live threads being maintained >+ * by the pre-aggregation logic. See notes above for why this >+ * exists in parallel with the ThreadHashTable stuff. >+ * >+ * Frees all StackFrames associated with the thread being removed. >+ * Does not dump any data; this function assumes you did that already or you >+ * don't care. >+ */ >+void removeThreadFromList( ThreadPrivateStorage * target_tps ) >+{ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("removeThreadFromList (try): target_tps = %8x\n", (void *)target_tps); fflush(stdout); >+#endif >+ /* get the thread list lock because we're managing that list here */ >+ getThreadListLock(); >+ { >+ struct ThreadListElement * it = threadsRoot; >+ while (it) { >+ if( it->data == target_tps ) >+ break; >+ it = it->next; >+ } >+ >+ if (it) { /* If found */ >+ /* Free all the elements from calledList, recursively */ >+ freeStackFrames(it->data->calledList); >+ it->data->calledList = NULL; >+ >+ /* Now actually remove the thread from the list */ >+ if( it->next ) >+ it->next->prev = it->prev; >+ if( it->prev ) >+ it->prev->next = it->next; >+ if( threadsRoot == it ) >+ threadsRoot = it->next; >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("removeThreadFromList (succeed)\n"); fflush(stdout); >+#endif >+ } >+ >+ free(it); >+ } >+ target_tps->calledList = NULL; /* 134635: frames are all gone so thread's calledList must be nulled */ >+ releaseThreadListLock(); >+} >+ >+/* For pre-aggregation */ >+/* >+ * Recursively print the aggregated data for a single thread, >+ * starting from a given StackFrame. Called from PrintAgThreadData. >+ */ >+ >+void printAgData(ThreadPrivateStorage * tps, StackFrame * call) { >+ >+ if (call == NULL) >+ return; >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); >+ printf("printAgData: agMethodEntry, (children), agMethodExit\n"); fflush(stdout); >+ printf(" : tps, &stackframe, &methodHashEntry, MethodIdRef= %8x, %8x, %8x", >+ (void *)tps, (void *)call, (void*)(METHOD_ENTRY(call->methodHashEntry)) ); fflush(stdout); >+ printf(", %5d\n", (jint)((METHOD_ENTRY(call->methodHashEntry))->static_id)); fflush(stdout); >+#endif >+ >+ jvmpiAgent_printAgMethodEntryEvent(tps, call); /* 135437 */ >+ >+ /* Note: The following loop prints the call chains of the direct children of the current "call", >+ * depth first and then breadth. It terminates when the "next" ptr of one of the direct children >+ * of the current call is null. Thus it terminates after printing the call chains of the last >+ * direct child of the current call frame. (The loop & recursion is compact but can confuse.) >+ */ >+ >+ /* Dump this call's children */ >+ { >+ StackFrame * it = call->calledList; /* select the first direct child of the current "call" */ >+ while( it != NULL ) { /* stop if there are no more direct children of the current caller */ >+ printAgData(tps, it); /* print the call chains of this direct child of the current caller */ >+ it = it->next; /* select the next direct child of the current caller */ >+ } >+ } >+ >+ jvmpiAgent_printAgMethodExitElement(tps, call); /* 135457 */ >+} >+ >+ >+ >+/* For pre-aggregation */ >+/* >+ * Send the call chain counts for the indicated thread. >+ * This is called from two places: when a single thread dies, >+ * and when you do a full-process snapshot. >+ * >+ * This function calls getStackFrameStructureLock, but >+ * only if it's called from a place where you didn't already have it. >+ * This is conveyed by a boolean argument, true if the caller >+ * already has the lock. That's necessary because the >+ * ra_critsec_t implementation isn't reentrant on Linux. >+ * >+ * The reason we need to acquire StackFrameStructureLock even though >+ * we're only dumping a single thread is that another dump request >+ * (a snapshot or JVM shutdown) could come in on another thread >+ * while this dump is still going on. We don't want to have >+ * multiple dumps happening in parallel: they would cause >+ * duplicate data to be sent. >+ * >+ * This does mean that one thread's death will stall any other thread that >+ * makes a unique call (and thus also needs StackFrameStructureLock) >+ * for the duration of the dump, even though they couldn't >+ * possibly step on each other. This makes me wish for a different >+ * lock implementation, one that more completely expresses the possible collisions. >+ */ >+void printThreadAgData ( ThreadLocalStorage * tps, int alreadyHasLock ) { >+ StackFrame * it; >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); >+ printf("printThreadAgData: tps, tps->calledList, _traceResourcesGone = %8x, %8x, %2d\n", >+ (void *)tps, (void *)tps->calledList, (int)_traceResourcesGone); fflush(stdout); >+#endif >+ /* pre-agg: 134635 >+ * This test is necessary because it is possible for a print of agg data >+ * to be attempted after the underlying trace resources (esp. method hash table) >+ * have been cleaned-up via cleanupAllTraceResources. This is known to occur at >+ * least sometimes when a processThreadEndEvent occurs after DETACH_FROM_AGENT >+ * has been processed. It is a harmless test for the non-pre-agg case >+ */ >+ if (_traceResourcesGone) { >+ return; >+ } >+ >+ if (!alreadyHasLock) { >+ getStackFrameStructureLock(); >+ } >+ it = tps->calledList; >+ while( it != NULL ) { >+ printAgData(tps, it); >+ it = it->next; >+ } >+ if (!alreadyHasLock) { >+ releaseStackFrameStructureLock(); >+ } >+} >+ >+/* For pre-aggregation */ >+/* >+ * Send the call chain counts for all threads. This is a "snapshot" >+ * operation that acquires the StackFrameStructureLock >+ * and walks the StackFrames of all threads. >+ */ >+void printAllThreadAgData() { >+ >+ /* Get the thread list lock because we walk the whole thread list here */ >+ getThreadListLock(); >+ { >+ struct ThreadListElement * it = threadsRoot; >+ >+ /* >+ * Acquire this lock so we block out any other thread >+ * that is trying to add new callers to frames. >+ * See notes elsewhere about a no-lock alternative >+ * to stackFrameStructureLock. >+ */ >+ getStackFrameStructureLock(); >+ { >+ while (it) { >+ printThreadAgData( it->data, TRUE ); >+ it = it->next; >+ } >+ } >+ releaseStackFrameStructureLock(); >+ } >+ releaseThreadListLock(); >+} >+ >+/* >+ * Return current time and (if options so indicate) current cpu time. As a side-effect, >+ * tps->last_cpu_time is updated if cpu time is updated. This function is used in >+ * processMethodEntryEvent and processMissingStackEntries because they share a pattern >+ * of usage where latest time/cpu_time are used for both stackEntry aggregation (if applicable) >+ * and method entry overhead calculations. >+ */ >+void setNowTimes(ThreadLocalStorage * tps, timestamp_t * nowTime_P, timestamp_t * nowCpuTime_P) { /* 134577 */ >+ jvmpiAgent_getCurrentTime(nowTime_P); >+ if (_jvmpiAgent_Options.cpuTime) { >+ *nowCpuTime_P = jvmpiAgent_getCurrentThreadCPUTime(); >+ tps->last_cpu_timestamp = *nowCpuTime_P; >+ } >+} >+ >+/* For pre-aggregation */ >+/* >+ * Print method def if needed and create/re-use StackFrame for method along this chain since it >+ * is not filtered out. Get latest time/cpuTime. Store them in stackEntry->lastEntryTime and >+ * lastEntryCPUTime to allow for potential suspendTracing (which references these values) from >+ * subsequent decrementInvocationCount calls and for later overhead calculations in the caller. >+ * They are purposely calculated as late in this function as possible to eliminate overhjeas from method stats. >+ */ >+void recordAgMethodEntry(ThreadLocalStorage * tps, StackEntry * stackEntry, StackEntry * caller) { /*134577 */ >+ timestamp_t nowTime; >+ timestamp_t nowCpuTime = 0; >+ >+ stackEntry->printed = 1; /* Indicate that this entry is "printed"=non-filtered - 134635C */ >+ jvmpiAgent_outputMethodDeclaration(stackEntry->methodHashEntry, tps); >+ jvmpiAgent_CreateStackFrame(tps, stackEntry->methodHashEntry, caller); >+ >+ setNowTimes(tps, &nowTime, &nowCpuTime); >+ stackEntry->lastEntryTime = nowTime; /* critical in case suspend occurs from burst mode before Method entry ends *134577 */ >+ stackEntry->lastEntryCPUTime = nowCpuTime; >+} >+ >+ >+/** PROCESS_METHOD_ENTRY_EVENT *********************************************** >+ * >+ */ >+static void processMethodEntryEvent(JVMPI_Event *event, ThreadLocalStorage *tps, BOOL isRequested, timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ HashEntry *methodHashEntry, *objectHashEntry; >+ StackEntry * stackEntry, *caller; >+ int isPrinting; >+ jmethodID method_id; >+ jobjectID object_id; >+ BOOL triggeringEvent=FALSE; >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ if (tps!=prevMthdTps) { >+ dumpMethodEventCounts(); prevMthdTps=tps; >+ } >+ meCount++; >+#endif >+ >+ if(_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ /* ToDo: remove. I know that, in TraceGcOptimizedHeap mode, it will never come >+ * here because METHOD_ENTRY event is disbled, but just to make sure that it >+ * is not accidently causing lack of LeakCandidates. >+ */ >+ /* do nothing */ >+ return; >+ } >+ >+ objectHashEntry=methodHashEntry=NULL; >+ method_id = event->u.method.method_id; >+ object_id=(event->event_type==JVMPI_EVENT_METHOD_ENTRY2) ? event->u.method_entry2.obj_id : 0; >+ >+ /* RKD: If we don't know the stack for this thread >+ we better materialize this stack now. >+ */ >+ if(!tps->threadStackKnown) { >+ /* Disable GC */ >+ _jvmpiAgent_jvmpiInterface->DisableGC(); >+ loadStack(tps); >+ >+ /* Re-enable GC */ >+ _jvmpiAgent_jvmpiInterface->EnableGC(); >+ >+ /* We are already on the stack from the load. Pop us off */ >+ jvmpiAgent_Pop(tps); >+ >+ /* RKD: Do to problems we have with the JIT being enabled it may be possible that the >+ thread stack is still not known. If this case we abort this method >+ */ >+ if(!tps->threadStackKnown) { >+ return; >+ } >+ >+ } >+ >+ >+ methodHashEntry = loadMethodHashEntry(method_id); >+ >+ /* Determine if we are supposed to print this method. Depending upon the trace start mode will determine this test */ >+ if(_jvmpiAgent_Options.startMode==TraceStartModeFilter) { >+ isPrinting = (methodHashEntry && METHOD_ENTRY(methodHashEntry)->traceFlag && _jvmpiAgent_Options.stackInfo > StackInfoNone); >+ } >+ /* Trigger tracing */ >+ else { >+ /* If the trigger hasn't been squeezed yet check to see if we are the trigger and scope to thread if neccessary */ >+ if(!_triggerSqueezed) { >+ isPrinting = (methodHashEntry >+ && (METHOD_ENTRY(methodHashEntry)->trigger >+ == METHOD_ENTRY(methodHashEntry)->methodCount)); >+ >+ if(isPrinting) { >+ _triggerSqueezed=TRUE; >+ triggeringEvent=TRUE; >+ if(_jvmpiAgent_Options.startMode==TraceStartModeTriggerSingleThreaded) { >+ _jvmpiAgent_limitingThread=event->env_id; >+ _jvmpiAgent_singleThreaded=TRUE; >+ } >+ if(_jvmpiAgent_isSuspended) { >+ resumeTracing(); >+ } >+ } >+ isPrinting=isPrinting && _jvmpiAgent_Options.stackInfo > StackInfoNone; >+ } >+ else { >+ isPrinting = (methodHashEntry && _jvmpiAgent_Options.stackInfo > StackInfoNone); >+ } >+ } >+ >+ /* If we are handling object collation we better ensure we know the object */ >+ if(_jvmpiAgent_Options.mode == TraceModeFull && object_id) { >+ /* Look for the object */ >+ >+ /* 226233: we can safely use the "fast", non-ref counting >+ version here, since we'd only be here if this is an >+ ENTRY2 event, in which case the heap is locked */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolFast(object_id); >+ >+ /* If the object is not currently in the DB look it upo in the VM */ >+ if(!objectHashEntry || !objectHashEntry->id || >+ !((ObjectHashKey*)objectHashEntry->id)->id) { >+ int result; >+ /* RKD: Disable the garbage collector while we get the object */ >+ _jvmpiAgent_jvmpiInterface->DisableGC(); >+ result=REQUEST_EVENT2(JVMPI_EVENT_OBJECT_ALLOC, event->u.method_entry2.obj_id); /* 232010 */ >+ _jvmpiAgent_jvmpiInterface->EnableGC(); >+ >+ /* We should now find the object without incident */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolFast(object_id); >+ } >+ >+ /* RKD: If we know the object we should check our filter against it for inheritance reasons (only when filter tracing) */ >+ if ( objectHashEntry && _jvmpiAgent_Options.startMode==TraceStartModeFilter >+ && OBJECT_ENTRY(objectHashEntry)->traceFlag && !objectHashEntry->printed ) { >+ jvmpiAgent_printObjAllocElement(objectHashEntry, event->env_id, 0); >+ isPrinting=1; >+ } >+ } >+ >+ /* pre-aggregation mode: accumulate time into the caller (unless caller was added to stack by loadstack) */ >+ if (_jvmpiAgent_Options.compressLevel==CompressAggregate) { >+ caller = jvmpiAgent_Peek(tps, 0); >+ if (caller != NULL && caller->lastEntryTime!=0) { /* lastEntryTime is 0 for first caller after loadstack * 139537 */ >+ TIMESTAMP_ADD(caller->baseTime, timestamp - caller->lastEntryTime); >+ TIMESTAMP_ADD(caller->baseCPUTime, cpu_timestamp - caller->lastEntryCPUTime); >+ DBG_CHK_AND_REPORT_TIME_OVERFLOW(caller->baseTime, "Time overflowed?! (MethodEntry: caller->baseTime)\n"); /* 134577 */ >+ caller->lastEntryTime = -1; /* -1 means this frame active right now */ >+ caller->lastEntryCPUTime = -1; >+ } >+ } >+ >+ /* Push the method on the stack. (Note: this initializes all pre-agg stackEntry fields to 0) */ >+ stackEntry = jvmpiAgent_Push(tps, event->env_id, methodHashEntry, objectHashEntry, timestamp,cpu_timestamp); >+ >+ /* If we are in a pure trigger mode we need to indicate whether this frame is the trigger so we stop >+ profiling when the frame is popped. >+ */ >+ stackEntry->trigger=triggeringEvent; >+ >+ >+ if (methodHashEntry) { >+ if (isPrinting) { >+ if(_jvmpiAgent_Options.startMode==TraceStartModeFilter && (_jvmpiAgent_Options.stackInfo==StackInfoContiguous || _jvmpiAgent_Options.stackInfo==StackInfoBoundaryAndContiguous)) { >+ processMissingStackEntries(event, tps); >+ } >+ >+ /* When in filtering mode, reset the boundary depth every time we hit a traced method. */ >+ if(_jvmpiAgent_Options.startMode==TraceStartModeFilter) { >+ stackEntry->currentBoundaryDepth=_jvmpiAgent_Options.boundaryDepth+1; >+ } >+ >+ /* If we are in application mode we need to set the boundary depth only when we did not see >+ the entry event on the next frame up the stack. >+ */ >+ if(_jvmpiAgent_Options.application && _jvmpiAgent_Options.boundaryDepth) { >+ StackEntry *invokerFrame=jvmpiAgent_Peek(tps,1); >+ if(invokerFrame && !invokerFrame->entryEventSeen) { >+ stackEntry->currentBoundaryDepth=_jvmpiAgent_Options.boundaryDepth; >+ } >+ >+ /* Application mode is a different then all the other modes in the fact that we >+ don't keep tracing deeper if our boundaryDepth is >+ */ >+ if(!stackEntry->currentBoundaryDepth) { >+ return; >+ } >+ } >+ /* Note: following if-else-if pattern repeats below and with variation in ProcessMissingStackEntries */ >+ if (_jvmpiAgent_Options.compressLevel==CompressNone) { >+ /* Full trace: print the method entry for this event */ >+ jvmpiAgent_printMethodEntryEvent(event, tps, stackEntry, tps->tos); >+ } >+ else { >+ /* Pre-agg: print method def if needed & create/re-use StackFrame for method * 134577 */ >+ /* : set lastEntryTime (& lastEntryCpuTime as needed) * 134577 */ >+ recordAgMethodEntry(tps, stackEntry, caller); /* 134577 */ >+ } >+ /* Deal with burst mode if we are running in that mode (ignore BurstModeSeconds here) */ >+ if( _jvmpiAgent_Options.burstMode == BurstModeInvocations || >+ _jvmpiAgent_Options.burstMode == BurstModeSecondsAndInvocations ) { >+ if(decrementInvocationCount()) { /* non-zero indicates count exhausted: tracing has suspended */ >+ return; /* don't count suspension time in entry overhead */ >+ } >+ } >+ } >+ else if(_jvmpiAgent_Options.stackInfo>=StackInfoBoundary && stackEntry->currentBoundaryDepth) { >+ /* Note: following if-else-if pattern repeats above and with variation in ProcessMissingStackEntries */ >+ if (_jvmpiAgent_Options.compressLevel==CompressNone) { >+ /* Full trace: print the method entry for this event */ >+ jvmpiAgent_printMethodEntryEvent(event, tps, stackEntry, tps->tos); >+ } >+ else { >+ /* Pre-agg: print method def if needed & create/re-use StackFrame for method * 134577 */ >+ /* : set lastEntryTime (& lastEntryCpuTime as needed) * 134577 */ >+ recordAgMethodEntry(tps, stackEntry, caller); /*134577 */ >+ } >+ /* Deal with burst mode if we are running in that mode (ignore BurstModeSeconds here) */ >+ if( _jvmpiAgent_Options.burstMode == BurstModeInvocations || >+ _jvmpiAgent_Options.burstMode == BurstModeSecondsAndInvocations ) { >+ if(decrementInvocationCount()) { /* non-zero indicates count exhausted: tracing has suspended */ >+ return; /* don't count suspension time in entry overhead */ >+ } >+ } >+ } >+ } >+ >+ { >+ /* NMM: here is where we accumulate the tracing overhead due >+ to method enter processing */ >+ timestamp_t now; >+ timestamp_t cpu_now = 0; >+ Uint64 enter_overhead; >+ Uint64 cpu_enter_overhead = 0; >+ >+ /* Get new times that include our overhead in them */ >+ if (_jvmpiAgent_Options.compressLevel==CompressNone) { >+ setNowTimes(tps, &now, &cpu_now); >+ } else { >+ /* 134577 * >+ * Pre-agg: only set now & cpu_now here if they were not previously set by recordAgMethodEntry. >+ * The difference in calculating them here and in an earlier recordAgMethod is >+ * negligible. The intent is to conserve getCurrentTime & getCurrentThreadCPUtime >+ * calls because they are expensive and would skew the overhead calculation. >+ */ >+ if (stackEntry->lastEntryTime == 0) { /* not set by either previous recordAgMethodEntry */ >+ setNowTimes(tps, &now, &cpu_now); >+ stackEntry->lastEntryTime = now; >+ stackEntry->lastEntryCPUTime = cpu_now; >+ } else { /* set by one of the previous recordAgMethodEntry */ >+ now = stackEntry->lastEntryTime; >+ cpu_now = stackEntry->lastEntryCPUTime; >+ } >+ } >+ >+ enter_overhead = TIMESTAMP_SUB(now,timestamp); >+ if (_jvmpiAgent_Options.cpuTime) { >+ cpu_enter_overhead = TIMESTAMP_SUB(cpu_now,cpu_timestamp); >+ } >+ >+ stackEntry->cumulative_overhead = enter_overhead; >+ stackEntry->cumulative_cpu_overhead = cpu_enter_overhead; >+ } >+} >+ >+ >+/** SET_PATH_DELIMITER ******************************************************** >+ * Checks class name's provided by JVMPI to determine if this JVM uses the '.' >+ * package delimiter. If it does, we will tell the filters checker to use >+ * change all it's strings to the '.' delimiter. >+ * RKD: I hate the use of a global here. I bet we can get around this. >+ */ >+static void setPathDelimiter(char * str) { >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ >+ /* The path delimiter on IBM's JDK */ >+ char ibmch = '/'; >+ /* The path delimiter on SUN's JDK */ >+ char sunch = '.'; >+ /* The location of the delimiter */ >+ char *pdest; >+ >+ /* Look for the IBM delimiter in the given string */ >+ pdest = strchr(str, ibmch ); >+ >+ /* Set the global delimiter */ >+ if(pdest) { >+ _setPathDelimiter = ibmch; >+ } >+ else { >+ pdest = strchr(str, sunch ); >+ if(pdest) { >+ _setPathDelimiter = sunch; >+ jvmpiAgent_changeDelimiter(); >+ } >+ } >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+} >+ >+#ifdef __OS400__ >+/** PROCESS_OBJECT_DUMP_EVENT ************************************************* >+ * Handles the output of a OBJECT_DUMP element and attributes along with any >+ * @param event - the event data provided by the JVM. >+ * @param isRequested - whether this event is generated as a result of a specific >+ * RequestEvent call. If the event is requested it is assumed >+ * that the writelock is held for the hashtables. >+ */ >+static void processObjectDumpEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ if((_jvmpiAgent_Options.mode == TraceOptimizedHeap) && (event->u.object_dump.data_len > 0) && >+ (event->u.object_dump.data[0] == JVMPI_GC_CLASS_DUMP)) { >+ >+ StatelessHeapSnapshotManager_objectDumpCallbackMethod(event); >+ return; >+ } >+ >+} >+#endif >+ >+/** PROCESS_CLASS_LOAD_EVENT ************************************************* >+ * Handles the output of a CLASS_LOAD element and attributes along with any >+ * associated METHOD, STATIC_FIELD and INSTANCE_FIELD elements. >+ * @param event - the event data provided by the JVM. >+ * @param isRequested - whether this event is generated as a result of a specific >+ * RequestEvent call. If the event is requested it is assumed >+ * that the writelock is held for the hashtables. >+ */ >+static void processClassLoadEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ char * buffer; >+ HashEntry *classHashEntry; >+ >+ if(_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ if(_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ /* ToDo: We do not track callInfo currently >+ if (_jvmpiAgent_Options.classInfoCallback) { >+ */ >+ >+ /* Giri <Defect 78980/78981>: Sometimes, the IBM Classic VM sends >+ * class load events with class_name set to NULL. Other fields are set correctly. >+ * Handle these cases properly. >+ * >+ * Anandi Aug 2005 Fix Giri's fix, bugzilla 106779. >+ * Don't simply return when className is >+ * NULL. Not calling StatelessHeapSnapshotManager_classInfoCallback leaves stale >+ * values in the globals that the function sets and corrupts the parsing of >+ * the heap. Anoint the class with a name and call >+ * StatelessHeapSnapshotManager_classInfoCallback. >+ * Also handle the empty string case. >+ * >+ * Not thread-safe and that is OK. This code is conditional >+ * on mode==TraceOptimizedHeap and that always runs in a single thread. >+ * (JVMPI CLASS_LOAD events are not enabled from JVMPI; they only occur >+ * when we ask for them, and we only ask from a single thread.) >+ */ >+ >+ if (event->u.class_load.class_name == NULL || >+ (strlen(event->u.class_load.class_name) == 0)) { >+ sprintf(_classNameBuffer, "unknown%d", _unknownClassSuffix++); >+ StatelessHeapSnapshotManager_classInfoCallback(_classNameBuffer, >+ event->u.class_load.num_interfaces, >+ event->u.class_load.num_static_fields, >+ event->u.class_load.statics); >+ } else { >+ >+ StatelessHeapSnapshotManager_classInfoCallback(event->u.class_load.class_name, >+ event->u.class_load.num_interfaces, >+ event->u.class_load.num_static_fields, >+ event->u.class_load.statics); >+ } >+ /* } */ >+ return; >+ } >+ >+ buffer = tps->buffer; >+ >+ >+ >+ /* If we haven't determined the path delimiter of this JVM try to use this >+ class name to determine the delimiter. >+ */ >+ if(!_setPathDelimiter) { >+ setPathDelimiter((char*)event->u.class_load.class_name); >+ } >+ >+ >+ >+ /* Create the class symbol */ >+ classHashEntry = jvmpiAgent_CreateClassSymbol(event, tps, jvmpiAgent_getFilter((char *)event->u.class_load.class_name, "")); >+ >+ >+ >+ /* RKD: We print this class definition if we are traing this type or if we are asked >+ to output classes irregardless of whether the are ever used. Also, if this class >+ has already had its class object printed then we should also print the class definition >+ */ >+ if (_jvmpiAgent_Options.unreferencedSymbols && CLASS_ENTRY(classHashEntry)->traceFlag) { >+ jvmpiAgent_outputClassDeclaration(classHashEntry, tps); >+ jvmpiAgent_printMethods((HashEntry **)CLASS_ENTRY(classHashEntry)->methods, CLASS_ENTRY(classHashEntry)->numMethods, tps); >+ } >+ /* DNS: 218494 - added this check back in so class is not output indiscrimantly */ >+ else if(CLASS_ENTRY(classHashEntry)->classObject && CLASS_ENTRY(classHashEntry)->classObject->printed) { >+ jvmpiAgent_outputClassDeclaration(classHashEntry, tps); >+ >+ } >+ >+ if(!isRequested) { >+ /* NMM: here is where we accumulate the tracing overhead due >+ to classload processing */ >+ StackEntry* tos; >+ if((tos=jvmpiAgent_Peek(tps, 0)) >+ && tos->entryEventSeen) { >+ timestamp_t now; >+ timestamp_t cpu_now = 0; >+ Uint64 classload_overhead; >+ Uint64 cpu_classload_overhead = 0; >+ >+ if (_jvmpiAgent_Options.cpuTime) { >+ cpu_now = jvmpiAgent_getCurrentThreadCPUTime(); >+ tps->last_cpu_timestamp = cpu_timestamp; /* remember last known CPU time */ >+ cpu_classload_overhead = TIMESTAMP_SUB(cpu_now,cpu_timestamp); >+ } >+ jvmpiAgent_getCurrentTime(&now); >+ classload_overhead = TIMESTAMP_SUB(now,timestamp); >+ >+ tos->cumulative_overhead += classload_overhead; >+ tos->cumulative_cpu_overhead += cpu_classload_overhead; >+ >+ } >+ } >+ >+} >+ >+static void agRollUpStack(ThreadLocalStorage* tps, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) >+{ >+ /* simulate an exit for the top frame - that is, >+ * perform the same boookkeeping that a method exit would have. >+ * All other frames have accurate baseTime already, >+ * and agPop will update their cumulative times. >+ */ >+ int depth = 0; >+ StackEntry* stkentry = jvmpiAgent_Peek(tps, depth); >+ if (stkentry != NULL) { >+ TIMESTAMP_ADD(stkentry->baseTime, timestamp - stkentry->lastEntryTime); >+ DBG_CHK_AND_REPORT_TIME_OVERFLOW(stkentry->baseTime, "Time overflowed?! (agRollUpStack: stkentry->baseTime)\n"); /* 134577 */ >+ >+ /* Add last known CPU time on the thread to the frame's >+ * base CPU time, if it's greater. It might not be greater >+ * because it's just a guess - the last time we updated >+ * tps->last_cpu_timestamp for that thread. If the logic >+ * that updates that value isn't perfect, then we >+ * could be behind the times and we would add negative time. >+ * In that case just don't add anything. >+ * >+ * This system always under-reports the CPU time of the top >+ * frame on other threads, but we can't help that because we >+ * don't have a platform-independent "get the CPU time on >+ * another thread" query. >+ */ >+ if (cpu_timestamp > stkentry->lastEntryCPUTime) { >+ TIMESTAMP_ADD(stkentry->baseCPUTime, cpu_timestamp - stkentry->lastEntryCPUTime); >+ } >+ } >+ >+ /* now call agPop for each active frame, to roll up data */ >+ while ((stkentry = jvmpiAgent_Peek(tps, depth)) != NULL) { >+ jvmpiAgent_agPop(stkentry); >+ depth++; >+ } >+} >+ >+/** PROCESS_THREAD_END_EVENT *********************************************** >+ * Handles thread end events from JVMPI. >+ */ >+static void processThreadEndEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); >+ printf("processThreadEnd: tps, tps->calledList, _traceResourcesGone = %8x, %8x, %2d\n", >+ (void *)tps, (void *)tps->calledList, (int)_traceResourcesGone); fflush(stdout); >+#endif >+ /* In TraceTraceOptimizedHeap mode, we don't need any hashing */ >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap || _jvmpiAgent_Options.mode == TraceModeNone) { >+ /* do nothing */ >+ return; >+ } >+ >+ if (_jvmpiAgent_Options.compressLevel==CompressAggregate) { >+ /* We are pre-aggregating: >+ * Roll up this stack, then report its data. >+ * >+ * We send the data now so the thread-exit notification occurs >+ * in the proper sequence; if we saved up the data and sent >+ * it later, we'd be sending agMethodEntry events on a thread >+ * that had already been seen to exit. >+ * >+ * Locking note: printThreadAgData will call getStackFrameStructureLock >+ * because we're passing FALSE, saying we don't already have it. >+ * See comments at printThreadAgData for why this is a shame. >+ */ >+ agRollUpStack(tps, timestamp, cpu_timestamp); >+ printThreadAgData(tps, FALSE); >+ removeThreadFromList(tps); >+ } >+ >+ jvmpiAgent_printThreadEndElement(event->env_id, tps); >+ jvmpiAgent_DestroyStack(event->env_id); >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("processThreadEnd: done!\n"); fflush(stdout); >+#endif >+} >+ >+ >+/** PROCESS_THREAD_START_EVENT *********************************************** >+ * Handles thread start events from JVMPI. >+ */ >+static void processThreadStartEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ ThreadLocalStorage *tpsLocal = 0; >+ HashEntry *hashEntry; >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); >+ printf("processThreadStart: tps, tps->calledList, _traceResourcesGone = %8x, %8x, %2d\n", >+ (void *)tps, (void *)tps->calledList, (int)_traceResourcesGone); fflush(stdout); >+#endif >+ >+ /* In TraceTraceOptimizedHeap mode, we don't need any hashing */ >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap || _jvmpiAgent_Options.mode == TraceModeNone) { >+ /* do nothing */ >+ return; >+ } >+ >+ /* Find the thread to determine if it already exists. This should never happen. */ >+ hashEntry = jvmpiAgent_FindThreadSymbol(event->env_id); >+ >+ /* If this is a new thread create a stack for it */ >+ if (!hashEntry) { >+ hashEntry = jvmpiAgent_CreateStack(event->env_id); >+ } >+ >+ >+ >+ >+ tpsLocal = THREAD_ENTRY(hashEntry); >+ >+ /* 236501 begins */ >+ tpsLocal->threadName = ""; >+ tpsLocal->groupName = ""; >+ tpsLocal->parentName = "" ; >+ >+ if(event->u.thread_start.thread_name) { >+ STRDUP(tps->threadName, event->u.thread_start.thread_name); >+ } >+ if(event->u.thread_start.group_name) { >+ STRDUP(tps->groupName, event->u.thread_start.group_name); >+ } >+ if(event->u.thread_start.parent_name) { >+ STRDUP(tps->parentName, event->u.thread_start.parent_name); >+ } >+ /* 236501 ends */ >+ >+ tpsLocal->threadId = event->u.thread_start.thread_id; >+ tpsLocal->threadStartEventSeen = 1; >+ tpsLocal->threadStackKnown=0; >+ tpsLocal->disableEventsForThisThread=0; >+ >+ if(_jvmpiAgent_Options.compressLevel==CompressAggregate) { >+ /* we are pre-aggregating: add this thread to the list >+ * of threads that we will want to dump data for when requested, >+ * or when they die. >+ */ >+ addThreadToList(tpsLocal); >+ } >+ >+ if (hashEntry) { /* bugzilla 72292 */ >+ if (!hashEntry->printed && event->env_id && THREAD_ENTRY(hashEntry)->threadStartEventSeen && _xmlHeadersPrinted) { >+ jvmpiAgent_printThreadStartElement(event->env_id, hashEntry); >+ } >+ } >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("processThreadStart: done!\n"); fflush(stdout); >+#endif >+} >+ >+/* pre-aggregation */ >+ >+/* rollUpAndPrintAllThreadAgData >+ * >+ * This function rolls up all threads' stacks and prints their data. >+ * You use this when the JVM is shutting down, or as a final data dump >+ * when the user asks to detach from the target process. >+ * >+ * Note: I'm not sure what happens if you do this and then keep >+ * running the process and collecting more data. The live frame at the >+ * top of each stack will probably accumulate more baseTime, and when >+ * that frame exits the new baseTime will roll up into its callers AGAIN, >+ * so the time it had run before the first snapshot will get double-counted. >+ */ >+void rollUpAndPrintAllThreadAgData(timestamp_t timestamp) >+{ >+ /* Roll up stacks and emit data for living threads. >+ * (Data for threads that have died has already been transmitted.) >+ * >+ * Notice that the cpu_timestamp we use for rolling up is the >+ * last_cpu_timestamp recorded for each thread. >+ * That field in tps is updated for each event notification, >+ * so we're acting like each thread has consumed zero >+ * time since the last notification on that thread. >+ * This is the best we can do because we can't ask >+ * what the CPU time is on a thread other than the current thread. >+ * >+ * IMPORTANT LOCKING NOTE: the function dumpAllThreadStatistics >+ * calls getThreadListLock, and on some platforms the lock >+ * implementation we get from the RAC shared libraries is the >+ * kind that you can't reenter. So we have to get that lock, >+ * roll up the live stack frames, then release it before calling >+ * dumpAllThreadStatistics ... otherwise we'll deadlock on ourselves. >+ * (The lock impl on Windows is reentrant, but not on Linux.) >+ */ >+ struct ThreadListElement * it; >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("rollUpAndPrintAllThreadAgData\n"); fflush(stdout); >+#endif >+ getThreadListLock(); /* see IMPORTANT LOCKING NOTE above */ >+ it = threadsRoot; >+ while (it) { >+ ThreadPrivateStorage * target_tps = it->data; >+ if (target_tps != NULL) { >+ agRollUpStack(target_tps, timestamp, target_tps->last_cpu_timestamp); >+ } >+ it = it->next; >+ } >+ releaseThreadListLock(); >+ printAllThreadAgData(); >+} >+ >+/** PROCESSES_JVM_SHUTDOWN_EVENT ********************************************* >+ * >+ */ >+static void processesJVMShutdownEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ _jvmShutDown = (enum _BOOL)1; >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("processesJVMShutdownEvent\n"); fflush(stdout); >+#endif >+ /* If pre-aggregating, dump aggregated data for all living threads */ >+ if (_jvmpiAgent_Options.compressLevel==CompressAggregate) { >+ rollUpAndPrintAllThreadAgData(timestamp); >+ /* Note: we leak StackFrames here for all living threads. >+ * To fix this leak, call removeThreadFromList for all living threads. >+ * But, in general, the process is coming down anyway, >+ * so that would be a waste of time. >+ */ >+ } >+ jvmpiAgent_printJvmShutdownElement(event); >+#ifdef _DEBUG >+ if (_jvmpiAgent_Options.debugHash) { >+ jvmpiAgent_DumpHashTableStatistics(); >+ } >+#endif >+ >+ cleanupAndExit(0); >+ ra_releaseVMLock(); >+} >+ >+/** PROCESS_OBJ_MOVE_EVENT *************************************************** >+ * Handler for object move events recieved during GC from JVMPI. >+ * >+ * The class id for the class associated with the object being moved is subject to change. >+ * In such cases, the hash entry for the associated class will also be moved. >+ */ >+static void processObjMoveEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ HashEntry *objectHashEntry; /* Hash entry of the object being moved */ >+ HashEntry *classHashEntry; /* Hash entry of the class associated with the object being moved */ >+ >+ if (_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ >+ if(_jvmpiAgent_Options.mode == TraceOptimizedHeap ) { /*58049*/ >+ return; >+ } >+ /* Find the object */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbol(event->u.obj_move.obj_id); >+ >+ >+ if (objectHashEntry) { >+ void *id; >+ ObjectHashKey newId; >+ newId.id = event->u.obj_move.new_obj_id; >+ id = objectHashEntry->id; >+ >+ /* Move the object hash entry and determine its associated class */ >+ jvmpiAgent_MoveSymbol(objectHashEntry, Object_t, id, (void*)&newId); >+ >+ >+ >+ /* RJD- The following should be unnecessary. According to JVMPI spec, class id's >+ should also have their own object move events, and not be implicit as part of a regular >+ object move. >+ >+ >+ classHashEntry = OBJECT_ENTRY(objectHashEntry)->classHashEntry; >+ if (classHashEntry) >+ { >+ // Mode 1: Resolve the class id for the object being requested. The class id for >+ // the object will be stored in the global variable '_resolvedClassId' >+ tps->mode = 1; >+ REQUEST_EVENT2(JVMPI_EVENT_OBJECT_ALLOC, event->u.obj_move.new_obj_id); >+ tps->mode = 0; >+ >+ >+ // Move the class hash entry if necessary >+ if (_resolvedClassId != CLASS_ENTRY(classHashEntry)->classId) >+ jvmpiAgent_MoveSymbol(classHashEntry, Class_t, (jint)_resolvedClassId); >+ } >+ */ >+ >+ /* We will only print object move for objects which we have already declared >+ within the trace and if we have been asked to print object moves >+ */ >+ >+ if (objectHashEntry->printed && >+ (_jvmpiAgent_Options.gc==GcMoves || _jvmpiAgent_Options.gc==GcDeletesAndMoves) && >+ !_jvmpiAgent_suspendIO) { >+ jvmpiAgent_printObjMoveElement(event, objectHashEntry); >+ } >+ } >+ >+ >+ /* The object move may be that of a java.lang.Class instance, in which >+ case the class table must be updated as well */ >+ classHashEntry = jvmpiAgent_FindClassSymbol(event->u.obj_move.obj_id); >+ >+ if (classHashEntry) { >+ void *id; >+ ClassHashKey newId; >+ newId.id = event->u.obj_move.new_obj_id; >+ id = classHashEntry->id; >+ jvmpiAgent_MoveSymbol(classHashEntry, Class_t, id,(void*)&newId); >+ } >+ >+ >+ >+} >+ >+/** PROCESS_OBJ_FREE_EVENT *************************************************** >+ * Handler for object free events recieved during GC from JVMPI. >+ */ >+static void processObjFreeEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ HashEntry *objectHashEntry; >+ >+ if (_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ >+ if(_jvmpiAgent_Options.mode == TraceOptimizedHeap) { /*58049*/ >+ return; >+ } >+ /* Do we know of this object */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbol(event->u.obj_free.obj_id); >+ if (objectHashEntry) { >+ /* We will only print object move for objects which we have already declared >+ within the trace and if we have been asked to print object free's >+ */ >+ if (objectHashEntry->printed && >+ (_jvmpiAgent_Options.gc==GcDeletes || _jvmpiAgent_Options.gc==GcDeletesAndMoves) >+ && !_jvmpiAgent_suspendIO) { >+ >+ jvmpiAgent_printObjFreeElement(jvmpiAgent_getThreadLocalStorage(event->env_id), objectHashEntry); >+ } >+ >+ /* Remove the object from the object hashtable */ >+ jvmpiAgent_DeleteSymbol(objectHashEntry, Object_t); >+ } >+} >+ >+/** PROCESS_CLASS_UNLOAD_EVENT *********************************************** >+ * Handle class unload events. >+ */ >+static void processClassUnloadEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ HashEntry *classHashEntry; >+ if (_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ >+ if(_jvmpiAgent_Options.mode == TraceOptimizedHeap ) { >+ return; >+ } >+ >+ classHashEntry = jvmpiAgent_FindClassSymbol(event->u.class_unload.class_id); >+ >+ /* We will only print class unloads for classes which we have already declared >+ within the trace >+ */ >+ if (classHashEntry) { >+ classHashEntry->deleted = 1; /* Mark as deleted */ >+ >+ if (!_jvmpiAgent_suspendIO) { >+ jvmpiAgent_printClassUnloadElement(event, tps, classHashEntry); >+ } >+ } >+} >+ >+/** PROCESS_GC_START_EVENT *************************************************** >+ * Handle GC start events. >+ */ >+static void processGcStartEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ if (_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ >+ if(_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ /* do nothing */ >+ return; >+ } >+ if (!_jvmpiAgent_suspendIO) { >+ jvmpiAgent_printGcStartElement(event); >+ } >+} >+ >+/** PROCESS_GC_FINISH_EVENT ************************************************** >+ * Handle GC finish events. >+ */ >+static void processGcFinishEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap || _jvmpiAgent_Options.mode == TraceModeNone) { >+ /* do nothing */ >+ return; >+ } >+ if (!_jvmpiAgent_suspendIO) { >+ jvmpiAgent_printGcFinishElement(event); >+ } >+} >+ >+/** PROCESS_OBJ_ALLOC_EVENT ************************************************** >+ * >+ */ >+static void processObjAllocEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) >+{ >+ HashEntry *classHashEntry; >+ HashEntry *objectHashEntry; >+ BOOL allocatedOnTracedStackframe=FALSE; >+ >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap || _jvmpiAgent_Options.mode == TraceModeNone) { >+ /* do nothing */ >+ return; >+ } >+ >+ /* In case the mode of 'tps' is set to 1, then this handler will only need to resolve the class >+ * id of the object that has been dumped */ >+ if (tps->mode == 1) >+ { >+ _resolvedClassId = event->u.obj_alloc.class_id; >+ return; >+ } >+ >+ >+ objectHashEntry = jvmpiAgent_FindObjectSymbol(event->u.obj_alloc.obj_id); >+ if (objectHashEntry) { >+ /* the object already exists, don't do anything */ >+ return; >+ } >+ >+ /* RKD: Determine if this object is being allocated on a traced stack frame >+ */ >+ if(_jvmpiAgent_Options.stackInfo>StackInfoNone) { >+ StackEntry *tos; >+ if(tos=jvmpiAgent_Peek(tps, 0)) { >+ allocatedOnTracedStackframe=(BOOL)(tos->printed); >+ } >+ } >+ >+ >+ /* RJD We normally shouldn't receive an OBJ_ALLOC with class_id == 0 and >+ is_array = JVMPI_NORMAL_OBJECT; however, the Sun JVM seems to send >+ this for the object instance of java.lang.Class. >+ We handle this by assigning the class_id to the object_id (since the >+ object instance of java.lang.Class is clearly of type java.lang.Class). >+ >+ Only do this when _requestClassObj is set (which should only be set >+ from a heap dump). Further, only do this when IsRequest bit is set to true. >+ This is a work around that may have some subtle concurrency issues crop up (because >+ of bugs with different JVMs), so this should be kept in mind if examining a >+ future bug that seems to be a result of the following code. >+ bugzilla_57475 */ >+ >+ if (!event->u.obj_alloc.class_id && >+ event->u.obj_alloc.is_array == JVMPI_NORMAL_OBJECT && >+ _requestClassObj && isRequested) { >+ event->u.obj_alloc.class_id = event->u.obj_alloc.obj_id; >+ } >+ >+ >+ >+ /* ##RKD: We could have an object allocate and not know about it's class. This >+ is a performance hit to look up the class whenever we get an object >+ with unknown type..but I don't see any way around it right now. Also >+ don't try and lookup primitive array classes as this fries the JVM. As for >+ classes with a class id of "0", this is a documented limitation. It >+ appears that the class id of all object arrays is always NULL. If we have an >+ array object manually associate it with our spoofed array class objects. We >+ only need to do this if the array object was explicitly asked for. >+ */ >+ if(event->u.obj_alloc.class_id && (event->u.obj_alloc.is_array==JVMPI_NORMAL_OBJECT >+ #if !(defined _HPUX || defined _SOLARIS) >+ || event->u.obj_alloc.is_array==JVMPI_CLASS) ) { >+ #else >+ )) { >+ #endif >+ >+ >+ classHashEntry = jvmpiAgent_FindClassSymbol(event->u.obj_alloc.class_id); >+ if(!classHashEntry) { >+ jint result; >+ result=REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, event->u.obj_alloc.class_id); /* 232010 */ >+ /* Look up the class again*/ >+ if(result == JVMPI_SUCCESS) { >+ classHashEntry = jvmpiAgent_FindClassSymbol(event->u.obj_alloc.class_id); >+ } >+ } >+ >+ /* Always add this object if we explicitly asked for it. In filtered mode store it if >+ we are tracing this type. In triggered mode we will store it if it is on the stack. >+ */ >+ if(classHashEntry) { >+ if(_jvmpiAgent_Options.startMode==TraceStartModeFilter) { >+ if(CLASS_ENTRY(classHashEntry)->traceFlag || isRequested) { >+ objectHashEntry = jvmpiAgent_CreateObjectSymbol(event, (BOOL)(!isRequested), (BOOL)(!isRequested)); >+ OBJECT_ENTRY(objectHashEntry)->classHashEntry=classHashEntry; >+ >+ /* Print this object only if we are tracing this type and we want object information */ >+ if(OBJECT_ENTRY(objectHashEntry)->traceFlag && jvmpiAgent_isTracingHeap()) { >+ jvmpiAgent_printObjAllocElement(objectHashEntry, event->env_id, 0); >+ } >+ } >+ } >+ else { >+ if(isRequested) { >+ objectHashEntry = jvmpiAgent_CreateObjectSymbol(event, FALSE, FALSE); >+ OBJECT_ENTRY(objectHashEntry)->classHashEntry=classHashEntry; >+ } >+ else if(allocatedOnTracedStackframe) { >+ objectHashEntry = jvmpiAgent_CreateObjectSymbol(event, TRUE, (BOOL)(!isRequested)); >+ >+ OBJECT_ENTRY(objectHashEntry)->classHashEntry=classHashEntry; >+ jvmpiAgent_printObjAllocElement(objectHashEntry, event->env_id, 0); >+ } >+ } >+ } >+ } >+ /* This is a primative array. If we requested it's alloc event then create it's entries. Also we print >+ primative array allocations if the current stack frame has been printed >+ */ >+ else if(isRequested || allocatedOnTracedStackframe || _jvmpiAgent_Options.stackInfo==StackInfoNone) { >+ ObjectEntry *objectEntry; >+ >+/* RJD. The 1.3 JVM's on Solaris and HP crash when requesting a >+ JVMPI_EVENT_CLASS_LOAD event on class_id of array objects due to a bug in the JVM. >+ Thus, do not look up the >+ class in those cases. >+ bugzilla_56189 */ >+ >+ >+#if (defined _HPUX || defined _SOLARIS) >+ if(event->u.obj_alloc.class_id && >+ (_javaVersion != Version13 || event->u.obj_alloc.is_array!=JVMPI_CLASS)) { >+#else >+ if(event->u.obj_alloc.class_id) { >+#endif >+ >+ classHashEntry = jvmpiAgent_FindClassSymbol(event->u.obj_alloc.class_id); >+ if(!classHashEntry) { >+ jint result; >+ result=REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, event->u.obj_alloc.class_id); /* 232010 */ >+ /* Look up the class again*/ >+ if(result == JVMPI_SUCCESS) { >+ classHashEntry = jvmpiAgent_FindClassSymbol(event->u.obj_alloc.class_id); >+ } >+ >+ objectHashEntry = jvmpiAgent_CreateObjectSymbol(event, FALSE, FALSE); >+ OBJECT_ENTRY(objectHashEntry)->classHashEntry=classHashEntry; >+ } >+ } >+ else { >+ classHashEntry=jvmpiAgent_getPrimativeClassEntry(event->u.obj_alloc.is_array); >+ if(classHashEntry && CLASS_ENTRY(classHashEntry)->traceFlag && jvmpiAgent_isTracingHeap()) { >+ jvmpiAgent_outputClassDeclaration(classHashEntry, tps); >+ objectHashEntry = jvmpiAgent_CreateObjectSymbol(event, allocatedOnTracedStackframe, (BOOL)(!isRequested)); >+ objectEntry=OBJECT_ENTRY(objectHashEntry); >+ jvmpiAgent_printObjAllocElement(objectHashEntry, event->env_id, 0); >+ } >+ } >+ } >+ >+ if(!isRequested) { >+ /* NMM: here is where we accumulate the tracing overhead due to >+ object allocation processing */ >+ StackEntry* tos; >+ if(tps >+ && (tos=jvmpiAgent_Peek(tps, 0)) >+ && tos->entryEventSeen) { >+ timestamp_t now; >+ timestamp_t cpu_now = 0; >+ Uint64 objalloc_overhead; >+ Uint64 cpu_objalloc_overhead = 0; >+ >+ if (_jvmpiAgent_Options.cpuTime) { >+ cpu_now = jvmpiAgent_getCurrentThreadCPUTime(); >+ cpu_objalloc_overhead = TIMESTAMP_SUB(cpu_now,cpu_timestamp); >+ } >+ >+ jvmpiAgent_getCurrentTime(&now); >+ objalloc_overhead = TIMESTAMP_SUB(now,timestamp); >+ tos->cumulative_overhead += objalloc_overhead; >+ tos->cumulative_cpu_overhead += cpu_objalloc_overhead; >+ >+ } >+ } >+} >+ >+/** PROCESS_CLASS_LOAD_HOOK_EVENT ******************************************** >+ * >+ */ >+static void processClassLoadHookEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) >+{ >+} >+ >+/** PROCESS_DATA_DUMP_REQUEST >+ * This is the kill-3 handler >+ */ >+static void processDataDumpRequest(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ /* status(KILL3_DUMP_REQUEST); */ >+ _analyseOptHeap = TRUE ; >+ analyseHeap(JVMPI_DUMP_LEVEL_1); >+ >+ _analyseOptHeap = FALSE ; >+ _optHeapError = 0 ; >+ } >+ else if (_jvmpiAgent_Options.mode == TraceHeap) { >+ analyseHeap(JVMPI_DUMP_LEVEL_1); >+ } >+} >+ >+/* Piyush Agarwal */ >+/* Optimized Heap Dump from RAC */ >+/* We need to send the heapDumpFile Name to the RAC */ >+static void sendHeapDumpInformation(char *filename){ >+ >+ /* Giri: <Defect 64462> Added the standalone mode check, instead of isControlled check */ >+ /* THe pring HD Start Element should be sent at the end after the heap dump is taken for optHeap */ >+ >+ if ( _jvmpiAgent_Options.mode == TraceOptimizedHeap && !_jvmpiAgent_Options.standalone ) >+ { >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+#ifdef __OS400__ >+ /* Anandi 25 May 2004: The print routines expect ascii chars in >+ strings */ >+ char *tmpname = as400_etoa(filename); >+ jvmpiAgent_printHDStartElement(tps,tmpname) ; >+ ra_free(tmpname); >+#else >+ /* Bug 64476 Added change for converting the name to ascii from ebcdic */ >+ #ifdef MVS >+ __etoa(filename) ; >+ #endif >+ jvmpiAgent_printHDStartElement(tps,filename) ; >+ #ifdef MVS >+ __atoe(filename) ; >+ #endif >+#endif >+ /*Bug 82214*/ >+ if (!_optHeapError && (optHeapContextId != -1)) { >+ sendHeapDumpEndMessage(_jvmpiAgent_bindingStorage,optHeapContextId,filename); >+ } >+ /*Bug 82214*/ >+ >+ } >+} >+ >+static void processRACDataDumpRequest(BOOL finalheap,ra_uint_t contextId) >+{ >+ optHeapContextId = contextId ; >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap) { >+ /* Called From client */ >+ /* We also need to send an empty heap dump header to the workbench */ >+ _analyseOptHeap = TRUE ; >+ >+ analyseHeap(JVMPI_DUMP_LEVEL_1); >+ /* If this application is being controlled/moitored remotely */ >+ if (!_jvmpiAgent_Options.standalone) { >+ if (_optHeapError) >+ { >+ sendOptHeapErrorMessage(_jvmpiAgent_bindingStorage, /* Piyush 58049 */ >+ contextId) ; >+ } >+ _optHeapError = 0 ; >+ } >+ _analyseOptHeap = FALSE ; >+ } >+ optHeapContextId = -1 ; >+} >+ >+/* Send message to RAC which then sends it to the client */ >+static void sendHeapDumpEndMessage(RA_AGENT_HANDLE handle,ra_uint_t contextId,char* filename) >+{ >+ ra_message_t *message; >+ ra_command_t *command; >+ char *tmpMessageName ; >+ >+ message=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ command=ra_addCommandToMessage(message, NULL); >+ >+ /* Set the agent information */ >+ command->tag= RA_CUSTOM_COMMAND ; >+ command->info.custom_command.context= contextId ; >+ command->info.custom_command.processId = ra_getProcessId(); >+ >+/*Bug 64476*/ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ tmpMessageName = (char *)malloc(sizeof("RA_OPT_HEAP_DUMP_DONE")+strlen(filename)+(2*sizeof(char))) ; >+ strcpy(tmpMessageName,"RA_OPT_HEAP_DUMP_DONE:") ; >+ strcat(tmpMessageName,filename) ; >+ ra_copyRASTRING(&command->info.custom_command.agent, &handle->agentName); >+ ra_createRASTRING(&command->info.custom_command.message,tmpMessageName); >+ free(tmpMessageName) ; >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+ /* Inform server about heap done */ >+ ra_sendMessage(handle, message); >+ /* Clean up the allocated memory */ >+ ra_destroyMessage(message, TRUE); >+} >+ >+/* Send error message to RAC which then sends it to the client */ >+/* Piyush 58049 */ >+static void sendOptHeapErrorMessage(RA_AGENT_HANDLE handle, >+ ra_uint_t contextId) >+{ >+ ra_message_t *message; >+ ra_command_t *command; >+ >+ message=ra_createMessage(RA_CONTROL_MESSAGE, 0); >+ command=ra_addCommandToMessage(message, NULL); >+ >+ /* Set the agent information */ >+ command->tag= RA_CUSTOM_COMMAND ; >+ command->info.custom_command.context= contextId ; >+ command->info.custom_command.processId = ra_getProcessId(); >+ >+/* Giri: Defect 70308 */ >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ >+ ra_copyRASTRING(&command->info.custom_command.agent, &handle->agentName); >+ switch (_optHeapError) { >+ case RA_OPT_HEAP_DISK_FULL : >+ ra_createRASTRING(&command->info.custom_command.message, "RA_OPT_HEAP_DISK_FULL"); >+ break ; >+ case RA_OPT_HEAP_COULD_NOT_CREATE_FILE : >+ ra_createRASTRING(&command->info.custom_command.message, "RA_OPT_HEAP_COULD_NOT_CREATE_FILE"); >+ break ; >+ } >+ >+/* Giri: Defect 70308 */ >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ >+ /* Inform server about heap done */ >+ ra_sendMessage(handle, message); >+ /* Clean up the allocated memory */ >+ ra_destroyMessage(message, TRUE); >+} >+ >+/** PROCESS_HEAP_DUMP_EVENT *************************************************** >+ * This is called by notify_event when we are getting a heap dump data as the >+ * result of a heap dump request. >+ */ >+static void processHeapDumpEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ if (_jvmpiAgent_Options.mode == TraceModeNone) { >+ return; >+ } >+ >+ switch (event->u.heap_dump.dump_level) { >+ case JVMPI_DUMP_LEVEL_0: /* we must have asked for a dump population */ >+ if(_jvmpiAgent_Options.mode != TraceOptimizedHeap && _jvmpiAgent_isMonitored ) >+ { >+ jvmpiAgent_markHeap(event); >+ } >+ break; >+ case JVMPI_DUMP_LEVEL_1: /* we must have asked for a dump for references */ >+ if(_jvmpiAgent_Options.mode == TraceOptimizedHeap && !_optHeapError ) { /*58049*/ >+ _optHeapError = StatelessHeapSnapshotManager_handleHeapSnapshot_FromC(event->env_id, >+ event->u.heap_dump.dump_level, >+ event->u.heap_dump.begin, >+ event->u.heap_dump.end); >+ } else { >+ jvmpiAgent_analyseHeap(event, _heapDefName); >+ } >+ break; >+ default: >+ break; >+ } /* dump_level switch */ >+ >+} >+ >+ >+ >+ >+ >+/* long getOwnerThread(jobjectID object_id) >+ >+ Obtain the owner thread of the given monitor object >+ >+ args - >+ object_id - the object (monitor) whose thread owner is to be determined. >+ tps - thread local storage for storing monitor dump >+ >+ returns - >+ the thread that owns the given object >+*/ >+ >+unsigned long getOwnerThread(jobjectID object_id, ThreadLocalStorage *tps) { >+ >+ int result = JVMPI_FAIL; >+ >+ tps->monitorObj = object_id; >+ if (object_id != 0) { >+ >+ /* Requesting MONITOR_DUMP in IBM 1.4.x JVM's prior to 1.4.2 cause >+ the JVM to crash. Do not request a JVMPI_EVENT_MONITOR_DUMP in those cases */ >+ if (!(_javaVendor == VendorIBM && >+ (_javaVersion == Version140 || _javaVersion == Version141))) { >+ >+ result = REQUEST_EVENT(JVMPI_EVENT_MONITOR_DUMP,0); >+ } >+ >+ } >+ >+ if (result == JVMPI_SUCCESS) { >+ /* the owner thread is set in the tps->ownerThread variable upon return >+ from the monitor dump request */ >+ return tps->ownerThread; >+ } >+ >+ return 0; >+ >+} >+ >+ >+static void processMonitorDumpEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ tps->ownerThread = jvmpiAgent_analyseMonitorDump(event,tps->monitorObj); >+} >+ >+static void processMonitorContendedEnter(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ HashEntry *objectHashEntry = 0; /* hash entry corresponding to the monitor object */ >+ unsigned long thread_owner = 0; >+ >+ /* determine the thread that currently owns the monitor */ >+ thread_owner = getOwnerThread(event->u.monitor.object,tps); >+ >+ >+ /* lookup monitor object, ensuring that it exists in the trace */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocateAndPrint(event->env_id, >+ event->u.monitor.object); >+ >+ >+ if (objectHashEntry) { >+ jvmpiAgent_printMonitorContendedEnterElement(objectHashEntry, event, >+ thread_owner, timestamp); >+ } >+ >+} >+ >+static void processMonitorContendedEntered(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ HashEntry *objectHashEntry = 0; /* hash entry corresponding to the monitor object */ >+ >+ /* lookup monitor object, ensuring that it exists in the trace */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocateAndPrint(event->env_id, >+ event->u.monitor.object); >+ >+ >+ if (objectHashEntry) { >+ jvmpiAgent_printMonitorContendedEnteredElement(objectHashEntry, event, timestamp); >+ } >+ >+} >+ >+static void processMonitorContendedExit(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp) { >+ /* currently not required according to BlueRat specs; stub in place since it might >+ be useful */ >+} >+ >+static void processMonitorWait(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ HashEntry *objectHashEntry = 0; /* hash entry corresponding to the monitor object */ >+ int isThreadSleep = 0; /* boolean indicating if monitor wait occured in thread >+ sleep */ >+ >+ >+ >+ /* if the monitor object is NOT NULL, it is a regular object, >+ if it is NULL, then it indicates that the wait is in Thread.sleep() */ >+ >+ if ((void *) event->u.monitor_wait.object != NULL) { >+ /* lookup monitor object, ensuring that it exists in the trace */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocateAndPrint(event->env_id, >+ event->u.monitor.object); >+ } >+ else { >+ isThreadSleep = 1; >+ } >+ >+ /* print the element only if we managed to resolve the hash entry for the monitor >+ object, or if the the monitor waited event was due to Thread.sleep(). */ >+ if (objectHashEntry || isThreadSleep) { >+ jvmpiAgent_printMonitorWaitElement(objectHashEntry, event, timestamp, isThreadSleep); >+ } >+ >+ >+} >+ >+static void processMonitorWaited(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ >+ HashEntry *objectHashEntry = 0; /* hash entry corresponding to the monitor object */ >+ int isThreadSleep = 0; /* boolean indicating if monitor wait occured in thread >+ sleep */ >+ >+ /* if the monitor object is not NULL, it is a regular object, >+ if it is NULL, then it indicates that the wait is in Thread.sleep() */ >+ >+ if ((void *) event->u.monitor_wait.object != NULL) { >+ /* lookup monitor object, ensuring that it exists in the trace */ >+ objectHashEntry = jvmpiAgent_FindObjectSymbolWithAllocateAndPrint(event->env_id, >+ event->u.monitor.object); >+ } >+ else { >+ isThreadSleep = 1; >+ } >+ >+ /* print the element only if we managed to resolve the hash entry for the monitor >+ object, or if the the monitor waited event was due to Thread.sleep(). */ >+ if (objectHashEntry || isThreadSleep) { >+ jvmpiAgent_printMonitorWaitedElement(objectHashEntry, event, timestamp,isThreadSleep); >+ } >+ >+} >+ >+ >+/** NOTIFY_EVENT -- JVMPI EVENT HANDLER FUNCTION ***************************** >+ * This is the entry point for all events from the JVMPI interface. These >+ * events may be because of registered events or specific requested events. >+ * from here we jump to the specific handler for each event. >+ */ >+static void notify_event(JVMPI_Event *event) { >+ BOOL isRequested=FALSE; >+ timestamp_t timestamp; >+ timestamp_t cpu_timestamp = 0; >+ jint masked_event_type = event->event_type & (0xffffffff ^ JVMPI_REQUESTED_EVENT); >+ >+ /* Get the tps */ >+ ThreadPrivateStorage *tps=jvmpiAgent_getThreadLocalStorage(event->env_id); >+ >+ /* Get the timestamp */ >+ jvmpiAgent_getCurrentTime(×tamp); >+ if (_jvmpiAgent_Options.cpuTime) { >+ cpu_timestamp = jvmpiAgent_getCurrentThreadCPUTime(); >+ >+ /* record the last CPU timestamp on this thread; we'll need this later. >+ * (Actually, it's only needed if pre-aggregating (CompressAggregate), but >+ * testing that would slow this function down unnecessarily.) >+ */ >+ tps->last_cpu_timestamp = cpu_timestamp; >+ } >+ >+ /* Check for disablement. Note: today (3/29/04) no code disables events */ >+ if(tps->disableEventsForThisThread) { >+ return; >+ } >+ >+ /*------------------------------------------------------------ >+ * Route this event to an agent extension if one is listening. >+ * This is a simple dispatcher system with no advanced logic >+ * for (e.g.) sending requested events to the requesting agent only. >+ * >+ * Agent extensions get events regardless of thread or burst timeout. >+ * They get the event pointer plus their own thread local storage pointer. >+ */ >+ if (agent_extension_handlers[masked_event_type] != NULL) { >+ agent_extension_handlers[masked_event_type](event, &(tps->agent_extension_slot)); >+ } >+ /*------------------------------------------------------------*/ >+ >+ /* Just route the event to the appropriate event handler function */ >+ if(event->event_type & JVMPI_REQUESTED_EVENT) { >+ event->event_type=masked_event_type; >+ isRequested=TRUE; >+ } >+ else { >+ >+ /* If we are in burst timeout then stop tracing now */ >+ if(_jvmpiAgent_burstTimeoutSet) { >+ if(TIMESTAMP_GREATER(timestamp,_burstTimeout)) { >+ suspendTracing(TracePause); >+ } >+ } >+ >+ /* If we are in single threaded tracing ignore this event if it isn't on the proper thread. Can't do >+ this if we are insturmenting code though >+ */ >+ if(event->event_type!=JVMPI_EVENT_CLASS_LOAD_HOOK >+ && _jvmpiAgent_singleThreaded >+ && _jvmpiAgent_limitingThread!=event->env_id) { >+ return; >+ } >+ } >+ >+ /* Check for null: maybe only an agent extension has a handler */ >+ if (_processEventFunction[event->event_type] != NULL) { >+ _processEventFunction[event->event_type](event, tps, isRequested, timestamp,cpu_timestamp); >+ } >+} >+ >+ >+/** AGENT_EXTENSION_SET_EVENT_HANDLER ******************************************************* >+ * Remember an agent extension's handler for an event. >+ * >+ * This function is called from agent extensions. The agent extension >+ * calls this function to set a handler and enable the corresponding >+ * JVMPI event. >+ * >+ * In stand-alone mode, this function actually calls JVMPI to enable the event. >+ * >+ * But in non-standalone mode, if isJVMInitDone is still false, >+ * we don't enable the event. Instead, we just record the extension's >+ * desire to handle the event. Later we will loop through and enable >+ * the events that the extension asked for. >+ * >+ * Why? Because in non-standalone mode, the agent extension's init function >+ * is calling us from a different thread - not the main thread that JVM_OnLoad >+ * was called on. If you try to enable events from this other thread, >+ * the JVM crashes. >+ * >+ * Rather than needlessly attaching threads to the JVM (and risk having >+ * them stay attached too long, or detach too soon), I decided to queue >+ * up the "enable" operations and process them in the main (OnLoad) thread >+ * after the listener gets unblocked - that is, when Workbench sends RESUME. >+ * >+ * In standalone mode, this system is not necessary because the extension >+ * agent init function is called from the main thread, where OnLoad is running. >+ * >+ * This system isn't used in "enabled" or "application" mode. In those >+ * modes, ra_startListener doesn't block, so it doesn't work to queue the >+ * requests and handle them when ra_startListener returns. But it's >+ * also not a standalone mode, meaning commands will come in on the >+ * listener thread (and calling enableEvent on a separate thread is bad). >+ * >+ * The agent_extension_init function gets a flag telling the extension >+ * whether it's safe to call enable_event_handler. It's safe in standalone >+ * mode, and in controlled mode, but not in application mode or enabled mode. >+ * >+ * One way to make sure it's safe is to start a new thread, attach that >+ * thread to the JVM, make the SetEventHandler call, detach the thread, >+ * then let the thread die. >+ */ >+static void agentExtensionSetEventHandler(jint event_type, >+ AgentExtensionEventHandler handler) { >+ agent_extension_handlers[event_type] = handler; >+ if (_jvmpiAgent_Options.standalone || _jvmpiAgent_isListenerUnblocked) { >+ _jvmpiAgent_jvmpiInterface->EnableEvent(event_type, 0); >+ } >+} >+ >+/** AGENT_EXTENSION_SET_COMMAND_HANDLER ******************************************************* >+ * Records an agent extension's handler for RAC commands. >+ */ >+static void agentExtensionSetCommandHandler(void (*handler)(ra_command_t *command)) { >+ agent_extension_command_handler = handler; >+} >+ >+ >+/** LOAD_STACK **************************************************************** >+ * The intention of this method is to materialize a single thread stack >+ * within the JVM. This would be used when doing stack sampling and when >+ * starting a trace at some arbitrary point during execution. The problem is... >+ * the IBM JVM often returns the wrong stack. Furthermore, it does not support >+ * asynchronous stack traversal so this needs to be called on the thread >+ * that is being loaded. >+ * >+ * The bug on IBM JDK's appears to be that information missing after a stack >+ * load is always at the top of the stack. Broken stack frame links due to >+ * the JIT is the cause. >+ */ >+static void loadStack(ThreadPrivateStorage *tps) >+{ >+ int i; >+ JVMPI_CallTrace callTrace; >+ timestamp_t now; >+ timestamp_t cpu_now = 0; >+ StackFrame *it, *calledListOfCaller; /* pre-agg: 134635 */ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("LoadStack: tps = %8x\n", (void *)tps); fflush(stdout); >+#endif >+ >+ /* Ignore the Global thread */ >+ if(!tps->env) >+ { >+ return; >+ } >+ >+ >+ jvmpiAgent_getCurrentTime(&now); >+ if (_jvmpiAgent_Options.cpuTime) { >+ cpu_now = jvmpiAgent_getCurrentThreadCPUTime(); >+ tps->last_cpu_timestamp = cpu_now; /* remember last known CPU time */ >+ } >+ >+ callTrace.frames=(JVMPI_CallFrame*)malloc(400*sizeof(JVMPI_CallFrame)); >+ callTrace.env_id=tps->env; >+ _jvmpiAgent_jvmpiInterface->GetCallTrace(&callTrace, 400); >+ calledListOfCaller=tps->calledList; /* pre-agg: 134635 */ >+ for(i=callTrace.num_frames-1; i>=0; i--) >+ { >+ HashEntry *methodHashEntry; >+ StackEntry *stackEntry; >+ methodHashEntry=jvmpiAgent_FindMethodSymbol((callTrace.frames[i].method_id)); >+ >+ /* If we don't know about the method we should get the class */ >+ if(!methodHashEntry) >+ { >+ int result; >+ jobjectID clazz=_jvmpiAgent_jvmpiInterface->GetMethodClass(callTrace.frames[i].method_id); >+ result=REQUEST_EVENT2(JVMPI_EVENT_CLASS_LOAD, clazz); /* 232010 */ >+ /* If we found the class we should have the method */ >+ if(result == JVMPI_SUCCESS) { >+ methodHashEntry = jvmpiAgent_FindMethodSymbol((callTrace.frames[i].method_id)); >+ } >+ } >+ stackEntry=jvmpiAgent_Push(tps, tps->env, methodHashEntry ,NULL, now,cpu_now); >+ stackEntry->entryEventSeen=0; >+ >+ /* 134635 */ >+ /* Note that, before pre-agg was supported, filtering was not tested for and methodEntryEvents >+ * were not printed for these re-constructed method invocations. However, any >+ * MethodEntryEvents emitted from a previous run of this thread were still in effect and >+ * resumption of the thread picked-up where the last one left off. To get the same effect in >+ * the pre-agg case, it's necessary to determine if any of the thread's pre-existing >+ * calledList trees/sub-trees (from a previous run of the thread) has a record of the currrent >+ * call sequence being loaded (or of any starting portion thereof). If so, those stackEntries >+ * represented in the calledList tree will be connected to the corresponding stackFrames in >+ * that tree (and are marked as "realFrames" and "printed"). This occurs after a resume that >+ * follows a pause but *not* after an attach that follows a detach (because, in the >+ * detach/attach case, the calledList tree will have been cleared/freed by the detach). >+ */ >+ if (_jvmpiAgent_Options.compressLevel==CompressAggregate) { /* pre-agg: 134635 */ >+ /* search for current method in calledList of Caller: if found, it will be a non-null "it" */ >+ for (it=calledListOfCaller; it!=NULL && it->methodHashEntry!=methodHashEntry; it=it->next); >+ >+ if (it != NULL) { /* if it!=NULL then the current method was found as a child of the caller frame */ >+ stackEntry->stackFrame = it; /* connect the current stack entry to the found frame */ >+ stackEntry->realFrame = 1; /* treat almost as a CreateStackFrame operation * 139537 */ >+ stackEntry->printed = 1; /* treat almost as a CreateStackFrame operation * 139537 */ >+ calledListOfCaller = it->calledList; /* the next stack entry's method will need to one of this frame's >+ * children for the repeated starting call sequence to continue */ >+ } else { /* 139537 */ >+ calledListOfCaller = NULL; /* this terminates the repeated starting call sequence * 139537 */ >+ } >+ } >+ } >+ free(callTrace.frames); >+ >+ /* RKD: Mark this thread as a valid thread only if the thread stack is depth is greater then zero. This check >+ needs to be here as the JIT in some IBM JDKS doesn't always give the stack information when you invoke >+ GetCallTrace() >+ */ >+ if(callTrace.num_frames > 0) >+ { >+ tps->threadStackKnown=1; >+ /* pre-agg: add this thread to the list of threads that we will want to >+ * dump data for when requested, or when they die. >+ */ >+ if(_jvmpiAgent_Options.compressLevel==CompressAggregate) { /* pre-agg: 134635 */ >+ addThreadToList(tps); >+ } >+ } >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("LoadStack: tps = %8x Done!\n", (void *)tps); fflush(stdout); >+#endif >+ >+ >+ return; >+} >+ >+/** STACK_CLEANER ************************************************************ >+ * Walk a stack and cleanup all the memory in use. >+ */ >+int stackCleaner(HashEntry *hashEntry, >+ void *parm) { >+ ThreadPrivateStorage *tps; >+ tps=(ThreadPrivateStorage*)THREAD_ENTRY(hashEntry); >+ >+ /* Pop all the entries on the stack */ >+ while(tps->tos) { >+ jvmpiAgent_Pop(tps); >+ } >+ /* Mark this thread as an invalid thread */ >+ tps->threadStackKnown=0; >+ >+ return 0; >+} >+ >+ >+/** DELETE_HASH_ENTRY ********************************************************* >+ * >+ */ >+int deleteHashEntry(HashEntry *entry, >+ void *param) { >+ jvmpiAgent_DeleteSymbol(entry, (*(enum EntryType*)param)); >+ return 0; >+} >+ >+ >+ >+ >+/** CLEAN_UP_ALL_TRACE_ROSOURCES ********************************************** >+ * Cleanup all our resources that were allocated during a trace so that we have >+ * no history of events/objects to refer to. With this done we can start a new >+ * trace. >+ */ >+static void cleanUpAllTraceResources() { >+ enum EntryType type; >+ >+ _traceResourcesGone = TRUE; /* pre-agg: 134635 */ >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("cleanUpAllTraceResources\n"); fflush(stdout); >+#endif >+ /* Delete each of the objects */ >+ type=Object_t; >+ jvmpiAgent_ForAll(Object_t, deleteHashEntry, &type); >+ >+ /* 174841 - RKD: Always keep the state of threads >+ so that the stack can be re-materialized later if >+ necessary >+ type=Thread_t; >+ jvmpiAgent_ForAll(Thread_t, deleteHashEntry, &type); >+ 174841 end */ >+ >+ /* pre-aggregation */ >+ /* Remove all threads from the "threadsRoot" list of live threads. >+ * This will free the StackFrames pointed to by the threads, >+ * and set all tps->callerList to NULL. >+ * >+ * Note that threadEnds sometimes occur even after Detach/cleanup. >+ * Thus, removeThreadFromList could be underway on multiple "threads" >+ * but the ThreadList lock combined with the traceResourcesGone flag >+ * should be sufficient to provide correct operation even in that >+ * scenario. >+ */ >+ if (_jvmpiAgent_Options.compressLevel==CompressAggregate) { /* 134635 */ >+ while (threadsRoot != NULL) { >+ removeThreadFromList(threadsRoot->data); >+ } >+ } >+ >+ /* Delete each of the classes */ >+ type=Class_t; >+ jvmpiAgent_ForAll(Class_t, deleteHashEntry, &type); >+ >+ /* Delete each of the methods */ >+ type=Method_t; >+ jvmpiAgent_ForAll(Method_t, deleteHashEntry, &type); >+ >+ /* deleting the class hashtable will have also removed the primitive types; >+ if someone reattaches to the profiler, the primitive types will not be >+ regenerated automatically. Hence, we must regenerate them now. */ >+ >+ createPrimitiveTypes(); >+} >+ >+ >+/** START_TRACING ************************************************************* >+ * This is the entry point which must be called to start a trace. It takes >+ * care of emitting all the header information and turning the JVMPI events >+ * on so we will start recieving events. >+ */ >+static void startTracing(BOOL standalone) { >+ >+ _jvmpiAgent_suspendIO = 0; >+ _traceResourcesGone = FALSE; /* pre-agg: 134635 */ >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("startTracing\n"); fflush(stdout); >+#endif >+ >+ /** Giri: <Defect 64462> We need to do some optHeap related setup, before we can request opt Heap dumps >+ So we do the required set-up if the mode is TraceOptimizedHeap */ >+ >+ if (_jvmpiAgent_Options.mode == TraceOptimizedHeap ) { >+ jvmpiAgent_DoOptHeapSetup(); >+ } >+ >+ jvmpiAgent_PrintStartingXMLFragments(); >+ _xmlHeadersPrinted=TRUE; >+ >+ /* We need to ensure the entire sybmol table is "unreferenced" to ensure we get the references >+ for all method invocations for this trace. >+ */ >+ jvmpiAgent_clearAllPrintFlags(); >+ >+ /* Reset the trigger flag if we are not running in application mode. */ >+ if(!_jvmpiAgent_Options.application) { >+ _triggerSqueezed=FALSE; >+ } >+ else { >+ _jvmpiAgent_Options.startMode=TraceStartModeTriggerMultiThreaded; >+ } >+ >+ resumeTracing(); >+} >+ >+static void resumeTracing() { >+ >+ /* Turn on IO */ >+ _jvmpiAgent_suspendIO = 0; >+ >+ /* If we are burst tracing set the burst information */ >+ if(_jvmpiAgent_Options.burstMode>BurstModeNone) { >+ switch(_jvmpiAgent_Options.burstMode) { >+ case BurstModeInvocations: >+ _invocationCountRemaining=_jvmpiAgent_Options.burstInvocations; >+ break; >+ case BurstModeSeconds: >+ { >+ timestamp_t ticks; >+ jvmpiAgent_getCurrentTime(&_burstTimeout); >+ ticks = timeToTicks(_jvmpiAgent_Options.burstSeconds, 0); >+ TIMESTAMP_ADD(_burstTimeout,ticks); >+ _jvmpiAgent_burstTimeoutSet=TRUE; >+ break; >+ } >+ case BurstModeSecondsAndInvocations: >+ { >+ timestamp_t ticks; >+ _invocationCountRemaining=_jvmpiAgent_Options.burstInvocations; >+ ticks = timeToTicks(_jvmpiAgent_Options.burstSeconds, 0); >+ jvmpiAgent_getCurrentTime(&_burstTimeout); >+ TIMESTAMP_ADD(_burstTimeout,ticks); >+ _jvmpiAgent_burstTimeoutSet=TRUE; >+ } >+ } >+ } >+ >+ _jvmpiAgent_isSuspended=FALSE; >+ >+ /* Enable the events */ >+ toggleActiveJvmpiEvents(TraceON); >+} >+ >+ >+/** SUSPEND_TRACING *********************************************************** >+ * >+ * toggle - TraceOFF - completely turning off tracing >+ * TracePause - pausing tracing >+ */ >+static void suspendTracing(TraceToggle toggle) { >+ >+ /* pre-aggregation: >+ * Roll up stacks in live threads and report their data. This applies both >+ * to Pause (RA_STOP_MONITORING_AGENT) and to Detach (RA_DETACH_FROM_AGENT). >+ * NB: the agPops triggered in this stack rollup break the links between the >+ * stackEntries and corresponding stackFrames. This ensures that the >+ * agPops from the stackCleaner below do nothing and thus avoid a double >+ * rollup that would produce double counts. (See jvmpiAgent_agPop.) >+ */ >+ if (_jvmpiAgent_Options.compressLevel==CompressAggregate) { /* 134635 */ >+ /* pre-agg mode; roll up stacks and dump data */ >+ timestamp_t now; >+ jvmpiAgent_getCurrentTime(&now); >+ rollUpAndPrintAllThreadAgData(now); >+ } >+ >+ /* Turn off IO */ >+ _jvmpiAgent_suspendIO = 1; >+ >+ /* Disable the events */ >+ toggleActiveJvmpiEvents(toggle); >+ >+ _jvmpiAgent_burstTimeoutSet=FALSE; >+ >+ _jvmpiAgent_isSuspended=TRUE; >+ _triggerSqueezed=FALSE; >+ >+ /* We need to destroy the stacks */ >+ jvmpiAgent_ForAll(Thread_t, stackCleaner, NULL); >+} >+ >+/** STOP_TRACING ************************************************************** >+ * This is where a trace is stopped. >+ */ >+static void stopTracing() { >+ /* Get the global buffer for IO */ >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("stopTracing\n"); fflush(stdout); >+#endif >+ >+ /* Print the TRACE_END element */ >+ jvmpiAgent_printTraceEndElement(tps); >+ >+ suspendTracing(TraceOFF); >+ >+ /* Clean up all our resources for this trace */ >+ cleanUpAllTraceResources(); >+ >+ _jvmpiAgent_isSuspended=FALSE; >+ >+} >+ >+ >+/** determineJavaVersion() ********************************************************** >+ * Determine the java vendor and version so that we can disable certain functionality >+ * based on the runtime version to avoid jvm bugs. >+ * >+ * @param env the JNIEnv * to use for the JNI calls >+ */ >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+static void determineJavaVersion(JNIEnv *env) { >+ >+ /* The basic approach is to call System.getProperty("java.version") and >+ System.getProperty("java.vendor") through JNI. If any sort of failure >+ occurs while doing JNI, the behaviour of this method is to fail immediately >+ and return to the caller. */ >+ >+ jclass javaLangSystem; /* java.lang.System class */ >+ jmethodID getPropertyID; /* System.getProperty() method */ >+ jstring javaVersionProperty, javaVersionValue; >+ jstring javaVendorProperty, javaVendorValue; >+ int tmpStrLen; >+ char *javaVersionChars; >+ char *javaVendorChars; >+ >+ /* initialize javaVendor/Version to defaults */ >+ _javaVendor = VendorOther; >+ _javaVersion = VersionOther; >+ >+ /* first we need a reference to the class java.lang.System */ >+ >+ javaLangSystem = FIND_CLASS(env, "java/lang/System"); >+ >+ if (!javaLangSystem) { >+ return; >+ } >+ >+ /* next we need the jmethodID of the static getProperty() method in the >+ System class */ >+ >+ getPropertyID = GET_SMETHODID(env, javaLangSystem, "getProperty", >+ "(Ljava/lang/String;)Ljava/lang/String;"); >+ >+ if (!getPropertyID) { >+ return; >+ } >+ >+ /* we need to create a jstring version of the native string "java.version" */ >+ javaVersionProperty = CREATE_JSTRING(env, "java.version"); >+ if (!javaVersionProperty) { >+ return; >+ } >+ >+ /* we need to create a jstring version of the native string "java.vendor" */ >+ javaVendorProperty = CREATE_JSTRING(env, "java.vendor"); >+ if (!javaVendorProperty) { >+ return; >+ } >+ >+ /* Here we invoke System.getProperty("java.version") */ >+ javaVersionValue = (jstring) CALL_OBJ_SMETHOD1(env, javaLangSystem, >+ getPropertyID, javaVersionProperty); >+ >+ /* make sure there were no exceptions thrown during the preceding call */ >+ if (CHECK_EXCEPTION(env)) { >+ CLEAR_EXCEPTIONS(env); >+ return; >+ } >+ if (!javaVersionValue) { >+ return; >+ } >+ >+ /* Here we invoke System.getProperty("java.vendor") */ >+ javaVendorValue = (jstring) CALL_OBJ_SMETHOD1(env, javaLangSystem, >+ getPropertyID, javaVendorProperty); >+ if (CHECK_EXCEPTION(env)) { >+ CLEAR_EXCEPTIONS(env); >+ return; >+ } >+ if (!javaVendorValue) { >+ return; >+ } >+ >+ /* convert the jstring's into UTF-8 char arrays */ >+ javaVersionChars = (char *)CONVERT_TO_UTF(env, javaVersionValue); >+ if (!javaVersionChars) { >+ return; >+ } >+ >+ javaVendorChars = (char *)CONVERT_TO_UTF(env, javaVendorValue); >+ if (!javaVendorChars) { >+ RELEASE_UTF_CHARS(env,javaVersionValue,javaVersionChars); >+ return; >+ } >+ >+ >+ >+ tmpStrLen = strlen(javaVersionChars); >+ if (tmpStrLen >= 3 && strncmp(javaVersionChars,"1.3",3) == 0) { >+ _javaVersion = Version13; >+ } >+ else if (tmpStrLen >= 5 && strncmp(javaVersionChars,"1.4.0",5) == 0) { >+ _javaVersion = Version140; >+ } >+ else if (tmpStrLen >= 5 && strncmp(javaVersionChars,"1.4.1",5) == 0) { >+ _javaVersion = Version141; >+ } >+ else if (tmpStrLen >= 5 && strncmp(javaVersionChars,"1.4.2",5) == 0) { >+ _javaVersion = Version142; >+ } >+ else { >+ _javaVersion = VersionOther; >+ } >+ >+ >+ /* determine the vendor */ >+ tmpStrLen = strlen(javaVendorChars); >+ if (tmpStrLen >= IBM_VENDOR_STRING_LENGTH && >+ strncmp(javaVendorChars,IBM_VENDOR_STRING,IBM_VENDOR_STRING_LENGTH) == 0) { >+ _javaVendor = VendorIBM; >+ } >+ else if (tmpStrLen >= SUN_VENDOR_STRING_LENGTH && >+ strncmp(javaVendorChars,SUN_VENDOR_STRING,SUN_VENDOR_STRING_LENGTH) == 0) { >+ _javaVendor = VendorSun; >+ } >+ else if (tmpStrLen >= HP_VENDOR_STRING_LENGTH && >+ strncmp(javaVendorChars,HP_VENDOR_STRING,HP_VENDOR_STRING_LENGTH) == 0) { >+ _javaVendor = VendorHP; >+ } >+ else { >+ _javaVendor = VendorOther; >+ } >+ >+ /* free up all the strings */ >+ RELEASE_UTF_CHARS(env,javaVersionValue,javaVersionChars); >+ RELEASE_UTF_CHARS(env,javaVendorValue,javaVendorChars); >+ >+} >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ >+ >+ >+/** PROCESS_JVM_INIT_DONE_EVENT ********************************************** >+ * Event called by the JVM when the JVM has completed all of it's >+ * initialization. This is the earliest pont where we can start tracing. >+ */ >+static void processJvmInitDoneEvent(JVMPI_Event *event, >+ ThreadLocalStorage *tps, >+ BOOL isRequested, >+ timestamp_t timestamp, >+ timestamp_t cpu_timestamp) { >+ >+ >+ int currentSuspendIO = _jvmpiAgent_suspendIO; >+ int isStarted = 0; >+ >+ /* determine the java runtime vendor/version */ >+ determineJavaVersion(event->env_id); >+ >+ /* If we are actively profiling start the trace. This cannot happen in any of the application mode, the >+ additional test is neccessary as applicationControlled will be monitoing at this time. >+ >+ We start tracing even though _jvmpiAgent_suspendIO may be true in order to be able >+ to later monitor applications that were not monitored from the beginning (see >+ bugzilla 49541 and the next comment.) >+ >+ We cannot do this trick if we are in enabled mode, however, since this causes >+ problems with OS/400. Starting tracing actually tries forcing the RAC to write >+ data, which, if premature, can result in the problems described in bugzilla 59667. >+ There should be no need to do this trick anyhow when in enabled mode. >+ */ >+ if(!_jvmpiAgent_Options.application >+ && !(currentSuspendIO && _jvmpiAgent_Options.enabled) ) { >+ startTracing(TRUE); >+ isStarted = 1; >+ } >+ >+ /* This little trick is needed to be able to later on monitor >+ * Java applications that have been resumed but not monitored */ >+ >+ if (currentSuspendIO && isStarted) >+ { >+ stopTracing(); >+ _jvmpiAgent_suspendIO = 1; >+ } >+ >+ >+ >+ /* MARK the heap now so we have a baseline to start from. This is nice >+ as the UI can just ask for an ANALYSE without a preceading MARK if >+ desired >+ */ >+ analyseHeap(JVMPI_DUMP_LEVEL_0); >+ >+ /* Set the flag to say we can now trace if we wish */ >+ _jvmpiAgent_isJVMInitDone=TRUE; >+ >+ if ( _jvmpiAgent_Options.mode != TraceModeNone || !_jvmpiAgent_Options.standalone ) { >+ jvmpiAgent_printJvmInitDoneElement(event); >+ } >+ >+ >+} >+ >+/** SET_DYNAMIC_EVENT_HANDLERS ******************************************************* >+ * Some events will be requested via the RequestEvent() call and hense we need to >+ * set the function pointers for these so we don't get burned. >+ */ >+static void setDynamicEventHandlers() { >+ _processEventFunction[JVMPI_EVENT_CLASS_LOAD] = processClassLoadEvent; >+ _processEventFunction[JVMPI_EVENT_OBJECT_ALLOC] = processObjAllocEvent; >+#ifdef __OS400__ >+ _processEventFunction[JVMPI_EVENT_OBJECT_DUMP] = processObjectDumpEvent; >+#endif >+} >+ >+/** ENABLE_JVMPI_EVENT ******************************************************* >+ * Enables an event in JVMPI so that we start recieving these types of >+ * events. >+ */ >+static int enableJvmpiEvent(jint event_type, >+ ProcessEventFunction eventHandler) { >+ _processEventFunction[event_type] = eventHandler; >+ return _jvmpiAgent_jvmpiInterface->EnableEvent(event_type, 0); >+} >+ >+ >+/** DISABLE_JVMPI_EVENT ****************************************************** >+ * Disables an event in JVMPI so that we stop recieving these types of >+ * events. >+ */ >+static void disableJvmpiEvent(jint event_type) { >+ _jvmpiAgent_jvmpiInterface->DisableEvent(event_type, NULL); >+} >+ >+ >+/** ENABLE_GLOBAL_JVMPI_EVENTS *********************************************** >+ * Enables all the JVMPI events that we need in order to start tracing at any >+ * point in time. These are the obligitory events. >+ */ >+static void enableGlobalJvmpiEvents(enum TraceMode mode) { >+ >+ /* If Exception tracing or line coverage is enabled then activate the class load hook event so that >+ we can instrument each class with our trace hooks. >+ */ >+ if (_jvmpiAgent_Options.enableExceptionTracing || _jvmpiAgent_Options.enableLineCoverage) { >+ enableJvmpiEvent(JVMPI_EVENT_CLASS_LOAD_HOOK, processClassLoadHookEvent); >+ } >+ >+ /* Events we always need */ >+ enableJvmpiEvent(JVMPI_EVENT_JVM_INIT_DONE, processJvmInitDoneEvent); >+ enableJvmpiEvent(JVMPI_EVENT_JVM_SHUT_DOWN, processesJVMShutdownEvent); >+ /* Bug 62852 - We do not need to track these events for TraceOptimizedHeap Mode */ >+ if (_jvmpiAgent_Options.mode != TraceOptimizedHeap) { >+ enableJvmpiEvent(JVMPI_EVENT_THREAD_START, processThreadStartEvent); >+ enableJvmpiEvent(JVMPI_EVENT_THREAD_END, processThreadEndEvent); >+ } >+ _processEventFunction[JVMPI_EVENT_HEAP_DUMP] = processHeapDumpEvent; >+ enableJvmpiEvent(JVMPI_EVENT_MONITOR_DUMP, processMonitorDumpEvent); >+ enableJvmpiEvent(JVMPI_EVENT_DATA_DUMP_REQUEST, processDataDumpRequest); >+} >+ >+ >+/** SAMPLE_STACK ************************************************************** >+ * Samples the contents of a stack. In the current impl this cleans up the >+ * stack immediately after sampling its contents. If we ever get the stack >+ * traversal stuff fixed in the JVM we should change loadStack to assign >+ * a weight to each stack frame so we can finish the job of providing >+ * a stack sampling profiler. >+ */ >+int sampleStack(HashEntry * hashEntry, void *parm) { >+ JNIEnv *env=(JNIEnv*)parm; >+ ThreadPrivateStorage *tps=THREAD_ENTRY(hashEntry); >+ /* Ignore the global thread as it isn't part of the JVM threads. >+ Also don't sample ourselves as this will deadlock. Thi condition occurs >+ because the thread is attached to the JVM >+ */ >+ if(tps->env && tps->env!=env) { >+ >+ /* suspend the thread */ >+ _jvmpiAgent_jvmpiInterface->SuspendThread(tps->env); >+ >+ /* Load the stack and then clean it up */ >+ loadStack(tps); >+ stackCleaner(hashEntry, NULL); >+ >+ /* Resume the thread */ >+ _jvmpiAgent_jvmpiInterface->ResumeThread(tps->env); >+ } >+ return 0; >+} >+ >+/** STACK_SAMPLER ************************************************************* >+ * This is the impl for the background thread that will sample each of the >+ * threads in the JVM when we are running in mode=sampling. >+ */ >+void *stackSampler(void *args) { >+ JNIEnv *env; >+ if(!ATTACH_THREAD(env)) { >+ do { >+ /* Disable GC */ >+ _jvmpiAgent_jvmpiInterface->DisableGC(); >+ >+ /* Sample each of the threads in turn */ >+ jvmpiAgent_ForAll(Thread_t, sampleStack, (void *)env); >+ >+ /* Re-enable GC */ >+ _jvmpiAgent_jvmpiInterface->EnableGC(); >+ SLEEP(10); /* Hardcoded period of 10 milliseconds */ >+ } >+ while(_stackSamplerActive); >+ DETACH_THREAD(); >+ } >+ return 0; >+} >+ >+ >+/** >+ * Proxy to the stack sampler thread for porting ease >+ */ >+#ifdef _WIN32 >+DWORD WINAPI win32stackSamplerProxy(LPVOID args) { >+ DWORD returnVal=0; >+ stackSampler(args); >+ return returnVal; >+} >+#endif >+ >+/** TOGGLE_ACTIVE_JVMPI_EVENTS ************************************************ >+ * Toggles the optional JVMPI events on and off so that we can minimize our >+ * impact on an executing application when we are not profiling. The events >+ * turned on are determined by the trace mode we are running. >+ */ >+static void toggleActiveJvmpiEvents(TraceToggle toggle) { >+#if defined MVS || defined __OS400__ >+ static TID stackSamplerTid; >+#else >+ static TID stackSamplerTid=0; >+#endif >+ >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("toggleActiveJvmpiEvents\n"); fflush(stdout); >+#endif >+ >+ /* Navid Mehregani - bugzilla 162754: Note that 'processClassLoadHookEvent' is an empty method >+ It's the class load event handler in the agent extension that does the real work. */ >+ if (toggle == TraceON) >+ enableJvmpiEvent(JVMPI_EVENT_CLASS_LOAD_HOOK, processClassLoadHookEvent); >+ else >+ disableJvmpiEvent(JVMPI_EVENT_CLASS_LOAD_HOOK); >+ /* End of bugzilla 162754 */ >+ >+ /** the METHOD_COUNTS_ONLY option overrides all other options **/ >+ if (_jvmpiAgent_Options.methodCountsOnly) { >+ if (toggle == TraceON) { >+ enableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY, processCountingMethodEntryEvent); >+ } >+ else { >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY); >+ } >+ /* return immediately as methodCountsOnly overrides all other options */ >+ return; >+ } >+ >+ >+ >+ /* Register for the correct method events based upon trace mode */ >+ /* RKD: We should only turn on stack events if our StackInfo > StackInfoNone */ >+ if(_jvmpiAgent_Options.stackInfo > StackInfoNone) { >+ if(_jvmpiAgent_Options.mode == TraceModeFull) { >+ if(toggle == TraceON) { >+ enableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY2, processMethodEntryEvent); >+ enableJvmpiEvent(JVMPI_EVENT_METHOD_EXIT, processMethodExitEvent); >+ } >+ else { >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY2); >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_EXIT); >+ } >+ } >+ else if(_jvmpiAgent_Options.mode == TraceModeNoObjectCorrelation) { >+ if(toggle == TraceON) { >+ enableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY, processMethodEntryEvent); >+ enableJvmpiEvent(JVMPI_EVENT_METHOD_EXIT, processMethodExitEvent); >+ } >+ else { >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY); >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_EXIT); >+ } >+ } >+ /* RKD: This is placed as a placeholder for a stack sampling profiler. >+ This has not shipped due to problems with the IBM JDK with enumerating >+ stack's. >+ */ >+ else if(_jvmpiAgent_Options.mode == TraceModeStackSampling) { >+ if(toggle == TraceON) { >+ _stackSamplerActive=TRUE; >+#ifdef _WIN32 >+ CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ win32stackSamplerProxy, /* Thread entry point */ >+ NULL, /* params */ >+ 0, /* start executing immediately */ >+ &stackSamplerTid); /* the thread ID */ >+#else >+ pthread_create(&stackSamplerTid, >+ NULL, >+ stackSampler, /* explicit cast to avoid HP compilation failure */ >+ NULL); >+#endif >+ >+ } >+ else { >+ _stackSamplerActive=FALSE; >+ } >+ } >+ else /* TraceHeap, TraceOptimizedHeap, or TraceModeNone */ { >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY); >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_ENTRY2); >+ disableJvmpiEvent(JVMPI_EVENT_METHOD_EXIT); >+ } >+ } >+ >+ /* Do we want object heap information */ >+ if (jvmpiAgent_isTracingHeap()) { >+ switch(toggle) { >+ case TraceON: >+ /* RJD We *always* must instrument object free's/move's/and class unloads >+ in this case, because otherwise our hash table >+ may become inconsistent */ >+ >+ /* PA - We need to disable move,free,class Unload events when we are running in >+ TraceOptimized Mode - as in TraceOptimized mode we do not care >+ about the hashtables. If the mode is not TraceOptimizedHeap then >+ enable the moves and frees. >+ */ >+ if ( _jvmpiAgent_Options.mode == TraceOptimizedHeap ) { >+ disableJvmpiEvent(JVMPI_EVENT_OBJECT_FREE); >+ disableJvmpiEvent(JVMPI_EVENT_OBJECT_MOVE); >+ disableJvmpiEvent(JVMPI_EVENT_CLASS_UNLOAD); >+ } >+ else /* Mode is not Optmized Heap */{ >+ enableJvmpiEvent(JVMPI_EVENT_OBJECT_FREE, processObjFreeEvent); >+ enableJvmpiEvent(JVMPI_EVENT_OBJECT_MOVE, processObjMoveEvent); >+ /*62852 The following events are not required to be tracked >+ during optimized mode */ >+ enableJvmpiEvent(JVMPI_EVENT_OBJECT_ALLOC, processObjAllocEvent); >+ enableJvmpiEvent(JVMPI_EVENT_GC_START, processGcStartEvent); >+ enableJvmpiEvent(JVMPI_EVENT_GC_FINISH, processGcFinishEvent); >+ enableJvmpiEvent(JVMPI_EVENT_CLASS_UNLOAD, processClassUnloadEvent); >+ } >+ >+ break; >+ case TraceOFF: >+ /* PA - We need to disable free events when we are running in >+ TraceOptimized Mode - as in TraceOptimized mode we do not care >+ about the hashtables. If the mode is not TraceOptimizedHeap then >+ enable the moves and frees. If we are in TraceOptimizedHeap then >+ enable them depending on the gc options. >+ */ >+ if ( _jvmpiAgent_Options.mode == TraceOptimizedHeap ) { >+ /*62852 The following events are not required to be tracked >+ during optimized mode */ >+ disableJvmpiEvent(JVMPI_EVENT_OBJECT_ALLOC); >+ } >+ disableJvmpiEvent(JVMPI_EVENT_OBJECT_MOVE); >+ disableJvmpiEvent(JVMPI_EVENT_OBJECT_FREE); >+ disableJvmpiEvent(JVMPI_EVENT_CLASS_UNLOAD); >+ disableJvmpiEvent(JVMPI_EVENT_GC_START); >+ disableJvmpiEvent(JVMPI_EVENT_GC_FINISH); >+ >+ /* fall through to the TracePause case */ >+ case TracePause: >+ /* RJD We cannot disable object free's/move's/class unloads because >+ we do not clean out the hash table; we can however disable the following >+ events */ >+ disableJvmpiEvent(JVMPI_EVENT_OBJECT_ALLOC); >+ break; >+ default: >+ break; >+ } >+ } >+ >+ /* Do we want monitor information */ >+ /* Events not dealt with currently: >+ JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTER, >+ JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTERED, >+ JVMPI_EVENT_RAW_MONITOR_CONTENDED_EXIT >+ (raw monitors aren't created anywhere in the profiler, so they aren't >+ presently needed) >+ >+ JVMPI_EVENT_MONITOR_CONTENDED_EXIT (not currently required according to >+ Bluerat Specs) >+ */ >+ >+ if (_jvmpiAgent_Options.monitorMode > MonitorNone) { >+ if (toggle == TraceON) { >+ >+ enableJvmpiEvent(JVMPI_EVENT_MONITOR_CONTENDED_ENTER, processMonitorContendedEnter); >+ enableJvmpiEvent(JVMPI_EVENT_MONITOR_CONTENDED_ENTERED, processMonitorContendedEntered); >+ /* enableJvmpiEvent(JVMPI_EVENT_MONITOR_CONTENDED_EXIT, processMonitorContendedExit); */ >+ enableJvmpiEvent(JVMPI_EVENT_MONITOR_WAIT, processMonitorWait); >+ enableJvmpiEvent(JVMPI_EVENT_MONITOR_WAITED, processMonitorWaited); >+ } >+ else { >+ disableJvmpiEvent(JVMPI_EVENT_MONITOR_CONTENDED_ENTER); >+ disableJvmpiEvent(JVMPI_EVENT_MONITOR_CONTENDED_ENTERED); >+ /* disableJvmpiEvent(JVMPI_EVENT_MONITOR_CONTENDED_EXIT); */ >+ disableJvmpiEvent(JVMPI_EVENT_MONITOR_WAIT); >+ disableJvmpiEvent(JVMPI_EVENT_MONITOR_WAITED); >+ } >+ } >+ >+ >+ >+} >+ >+/** startListenerShouldBlock -- ENCAPSULATES LOGIC FOR BLOCKING STARTLISTENER ************* >+ * >+ * This function holds the logic telling whether the call to ra_startListener >+ * should block until a RAC connects to this agent. >+ * >+ * This logic is used in two places, which is why I pulled it into this >+ * function rather than open-coding it. If anybody changes this logic, >+ * it'll change in all the places where it's used. >+ * >+ * This answer this function gives does not make sense in standalone mode, >+ * because in that mode we never call ra_startListener. >+ */ >+static char startListenerShouldBlock() >+{ >+ return !_jvmpiAgent_Options.enabled; >+} >+ >+/** load_agent_extension_library -- AGENT EXTENSION LOADER ************* >+ * This function loads whatever library is named by the >+ * _jvmpiAgent.extensionLibrary option variable, unless it's the empty string. >+ */ >+ >+static void load_agent_extension_library() >+{ >+ char* extLib = _jvmpiAgent_Options.extensionLibrary; >+ if (extLib[0] != '\0') { >+ DLL_REFERENCE module; >+ module = LOAD_LIBRARY(extLib); >+#ifdef MVS >+ if (module == NULL) { >+ /* try converting ASCII to EBCDIC */ >+ extLib = strdup(extLib); >+ __atoe(extLib); >+ module = LOAD_LIBRARY(extLib); >+ free(extLib); >+ } >+#endif >+ >+ if (module != NULL) { >+ AgentExtensionInitFunction agent_extension_init; >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ agent_extension_init = (AgentExtensionInitFunction)RESOLVE_ENTRY_POINT(module, "agent_extension_init"); >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ if (agent_extension_init != NULL) { >+ AgentExtensionInitArgs agent_extension_init_args; >+ agent_extension_init_args.api_version = 1; >+ agent_extension_init_args.options = _jvmpiAgent_Options.invocationOptions; >+ agent_extension_init_args.jvm = _jvmpiAgent_jvm; >+ agent_extension_init_args.jvmpi_interface = _jvmpiAgent_jvmpiInterface; >+ agent_extension_init_args.set_command_handler = agentExtensionSetCommandHandler; >+ agent_extension_init_args.set_event_handler = agentExtensionSetEventHandler; >+ agent_extension_init_args.agent_handle = _jvmpiAgent_bindingStorage; >+ >+ /* >+ * Compute the "safety flag." >+ * This flag is true if it's safe for the agent extension >+ * to call "agentExtensionSetEventHandler" from inside >+ * "agent_extension_init" or false if it's not safe. >+ * >+ * It's safe if ra_startListener blocks until a RAC connects, >+ * and it's safe in standalone mode, but otherwise it's not safe. >+ * >+ * If the "blocking" flag passed to ra_startListener changes, >+ * this code should change too. >+ */ >+ agent_extension_init_args.event_enable_safety_flag = >+ (_jvmpiAgent_Options.standalone || startListenerShouldBlock()); >+ >+ >+ /* Call the agent extension init function. */ >+ /* See comments at agentExtensionSetEventHandler about this. */ >+ agent_extension_init(&agent_extension_init_args); >+ } >+ else { >+ sendErrorMessage(RA_SEVERE, "IWAT5001E", "Profiler failed to find agent_extension_init entry point in library; continuing.\n"); >+ } >+ } >+ else { >+ sendErrorMessage(RA_SEVERE, "IWAT5000E", "Profiler failed to load agent extension library; continuing.\n"); >+ } >+ } >+} >+ >+ >+ >+/** _JVMPIAGENT_NOTIFY_MESSAGE -- AGENT CONTROLLER MESSAGE PUMP ************* >+ * Callback function used to process messages from the Agent Controller. This >+ * is the entry point for all control messages comming from the agent controler. >+ * It is the responsibility of the agent to react to these messages. >+ * >+ * This handler reacts to RA_AGENT_CONTROLER_AVAILABLE >+ * by checking the configuration for an extension library name, >+ * and loading and initializing that library if it's found. >+ */ >+ >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+#endif >+ >+static void _jvmpiAgent_notify_message(ra_command_t *command) { >+ /*------------------------------------------------------------* >+ * Route this message to an agent extension if one is configured and listening >+ */ >+ if (agent_extension_command_handler != NULL) { >+ agent_extension_command_handler(command); >+ } >+ /*------------------------------------------------------------*/ >+ >+ /* Handle the command */ >+ switch(command->tag) { >+ >+ case RA_AGENT_CONTROLER_AVAILABLE: >+ { >+ ra_agentConfigList_t* clist = ra_getDefaultConfiguration(_jvmpiAgent_bindingStorage); >+ ra_agentConfigListEntry_t* listEntry; >+ for (listEntry = clist->head; listEntry != NULL; listEntry = listEntry->next) { >+ ra_agentConfigEntry_t* e = &listEntry->entry; >+ const char* name, *type, *value; >+ if (e->name.length == 0) name = ""; >+ else name = e->name.data; >+ if (e->type.length == 0) type = ""; >+ else type= e->type.data; >+ if (e->value.length == 0) value = ""; >+ else value = e->value.data; >+ if ((strcmp(name, "piAgentExtension") == 0) && >+ (strcmp(type, "libraryName") == 0)) >+ { >+ /* >+ * An empty value string means "don't load anything" >+ */ >+ if (value[0] != '\0') { >+ /* only load agent extensions if we could successfully copy >+ the value string */ >+ if (strcpyrealloc(&_jvmpiAgent_Options.extensionLibrary, value) == 0) { >+ load_agent_extension_library(); >+ /* bugzilla 66599 -- only load agent extension once */ >+ break; >+ } >+ } >+ } >+ } >+ break; >+ } >+ /* Called by the local monitor to start IO at this point */ >+ case RA_START_MONITORING_AGENT_REMOTE: >+ case RA_START_MONITORING_AGENT_LOCAL: >+ { >+ int result, type=0; >+ ThreadLocalStorage *tps = jvmpiAgent_getThreadLocalStorage(0); /* Grab the I/O buffer from the static private storage */ >+ >+ if(!_jvmpiAgent_isMonitored && !_jvmpiAgent_isSuspended) { >+ /* Set target handle type - 171664 added this line*/ >+ >+ result=-1; >+ if(command->tag==RA_START_MONITORING_AGENT_LOCAL) { >+ >+ _jvmpiAgent_Options.targetHdl.dtarget = RA_SHAREDMEMORY; >+ type=0; >+ >+ /* transfer data via shared memory */ >+ result = ra_attachToShm(command->info.start_monitor_local.file.data, >+ &_jvmpiAgent_Options.targetHdl.dtargetHdl.shmHdl); >+ } >+ else if(command->tag==RA_START_MONITORING_AGENT_REMOTE) { >+ /* Set target handle type */ >+ _jvmpiAgent_Options.targetHdl.dtarget = RA_SOCKET; >+ type=1; >+ >+ /* Connect to the remote monitor's listening port as indicated in the message */ >+ result=ra_connectToTCPServer(command->info.start_monitor_remote.ip, >+ (unsigned short)command->info.start_monitor_remote.port, >+ &_jvmpiAgent_Options.targetHdl.dtargetHdl.socketFD); >+ } >+ >+ if(result != 0) { >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ char *connectType[2]={"SharedMemory","Socket"}; /* add type/returncode to error msg if connect failed * 139537 */ >+ char errMsg[2000]; >+ sprintf(errMsg,"Profiler unable to establish connection with Agent Controller via %s. Returncode from attempt is %d.", >+ connectType[type], result); >+ sendErrorMessage(RA_SEVERE,"0",errMsg); >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ break; >+ } >+ _jvmpiAgent_isMonitored=TRUE; >+ } >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); printf("Start Monitoring ... begin\n"); fflush(stdout); >+#endif >+ >+ /* In application mode we never turn on IO here */ >+ if (_jvmpiAgent_suspendIO && !_jvmpiAgent_Options.application) { >+ >+ if(_jvmpiAgent_isJVMInitDone) { >+ JNIEnv *env; >+ /* Attach the current thread to the JVM */ >+ if(ATTACH_THREAD(env)) { >+ break; >+ } >+ >+ /* Start tracing the application now */ >+ if(_jvmpiAgent_isSuspended) { >+ resumeTracing(); >+ } >+ else { >+ startTracing(FALSE); >+ } >+ >+ DETACH_THREAD(); >+ } >+ else { >+ /* Re-enable IO */ >+ _jvmpiAgent_suspendIO = 0; >+ } >+ } >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("Start Monitoring ... done\n"); fflush(stdout); >+#endif >+ break; >+ } >+ /* Called by the remote monitor to turn off IO */ >+ case RA_STOP_MONITORING_AGENT: >+ { >+ /* Don't do anything if IO is suspended */ >+ if(!_jvmpiAgent_suspendIO) { >+ JNIEnv *env; >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+ if(_jvmpiAgent_isJVMInitDone) { >+ if(ATTACH_THREAD(env)) { >+ break; >+ } >+ >+ suspendTracing(TracePause); >+ >+ DETACH_THREAD(); >+ } >+ else { >+ /* In the case where we stop traing before we get the initDone event. We need to just set the >+ IO to off so we don't start tracing when we get the initDone event >+ */ >+ _jvmpiAgent_suspendIO = 1; >+ } >+ } >+ break; >+ } >+ case RA_DETACH_FROM_AGENT: >+ { >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ dumpMethodEventCounts(); >+ printf("Detach_Agent ... begin: suspendIO=%d, isJVMInitDone=%d\n", >+ _jvmpiAgent_suspendIO, _jvmpiAgent_isJVMInitDone); fflush(stdout); >+#endif >+ /* Don't do anything if IO is suspended */ >+ if(!_jvmpiAgent_suspendIO) { >+ JNIEnv *env; >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+ if(_jvmpiAgent_isJVMInitDone) { >+ if(ATTACH_THREAD(env)) { >+ break; >+ } >+ >+ stopTracing(); >+ >+ DETACH_THREAD(); >+ } >+ else { >+ /* In the case where we stop tracing before we get the initDone event. We need to just set the >+ IO to off so we don't start tracing when we get the initDone event >+ */ >+ _jvmpiAgent_suspendIO = 1; >+ } >+ } >+ else { >+ JNIEnv *env; >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ if(_jvmpiAgent_isJVMInitDone) { >+ if(ATTACH_THREAD(env)) { >+ break; >+ } >+ toggleActiveJvmpiEvents(TraceOFF); >+ DETACH_THREAD(); >+ } >+ /* Clean up all our resources for this trace */ >+ cleanUpAllTraceResources(); >+ } >+ >+ /* If we have been monitoring THEN */ >+ if (_jvmpiAgent_isMonitored) { >+ >+ if(_jvmpiAgent_Options.targetHdl.dtarget == RA_SHAREDMEMORY) { >+ /* Stop flushing shm buffer */ >+ ra_stopFlushingShm(&_jvmpiAgent_Options.targetHdl.dtargetHdl.shmHdl); /* 175248 */ >+ } >+ else if(_jvmpiAgent_Options.targetHdl.dtarget == RA_SOCKET) { >+ ra_closeSocket(_jvmpiAgent_Options.targetHdl.dtargetHdl.socketFD); >+ } >+ _jvmpiAgent_isMonitored=FALSE; >+ _jvmpiAgent_isSuspended=FALSE; >+ } >+#if defined (_DEBUG) && !defined (MVS) && !defined (__OS400__) >+ printf("Detach_Agent ... done\n"); fflush(stdout); >+#endif >+ break; >+ } >+ case RA_CUSTOM_COMMAND: >+ { >+ jint failed; >+ JNIEnv *env; >+ if(strcmp(command->info.custom_command.message.data, "RESUME")==0) { >+ /* Grab the I/O buffer from the static private storage */ >+ ThreadLocalStorage *tps = jvmpiAgent_getThreadLocalStorage(0); >+ /* RKD: resume should be ignored from an IO standpoint. >+ jvmpiAgent_printVMResume(tps); >+ */ >+ ra_releaseVMLock(); >+ } >+ else if(strcmp(command->info.custom_command.message.data, "MARKHEAP")==0) { >+ if(_jvmpiAgent_isJVMInitDone && !_jvmShutDown) { >+ failed=ATTACH_THREAD(env); >+ if(!failed) { >+ failed=analyseHeap(JVMPI_DUMP_LEVEL_0); >+ DETACH_THREAD(); >+ } >+ } >+ } >+ else if(strcmp(command->info.custom_command.message.data, "ANALYSEHEAP")==0) { >+ if(_jvmpiAgent_isJVMInitDone && !_jvmShutDown) { >+ failed=ATTACH_THREAD(env); >+ if(!failed) { >+ runGC(); >+ failed=analyseHeap(JVMPI_DUMP_LEVEL_1); >+ DETACH_THREAD(); >+ } >+ } >+ } >+ else if(strcmp(command->info.custom_command.message.data, "TERMINATE")==0) { >+ _jvmpiAgent_jvmpiInterface->ProfilerExit(0); >+ } >+ else if(strcmp(command->info.custom_command.message.data, "APPLYFILTERS")==0) { >+ jvmpiAgent_applyFilters(); >+ >+ /* Check the current filter criteria against existing information */ >+ jvmpiAgent_resetTraceFlags(); >+ } >+ else if(strcmp(command->info.custom_command.message.data, "RUNGC")==0) { >+ if(_jvmpiAgent_isJVMInitDone && !_jvmShutDown) { >+ failed=ATTACH_THREAD(env); >+ if(!failed) { >+ runGC(); >+ DETACH_THREAD(); >+ } >+ } >+ } >+ /* Piyush Agarwal */ >+ /* Change made to enable RAC connected file transfer */ >+ else if(strcmp(command->info.custom_command.message.data, "OPTHEAP")==0) { >+ if(_jvmpiAgent_isJVMInitDone && !_jvmShutDown) { >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ failed=ATTACH_THREAD(env); >+ if(!failed) { >+ runGC(); >+ processRACDataDumpRequest(FALSE,command->info.custom_command.context) ; >+ DETACH_THREAD(); >+ } >+ } >+ } >+ else if(strcmp(command->info.custom_command.message.data, "FINAL_OPTHEAP")==0) { >+ if(_jvmpiAgent_isJVMInitDone && !_jvmShutDown) { >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ failed=ATTACH_THREAD(env); >+ if(!failed) { >+ runGC(); >+ processRACDataDumpRequest(TRUE,command->info.custom_command.context) ; >+ DETACH_THREAD(); >+ } >+ } >+ } >+ /* Indicates a headless client. We will only need to take an action if we are in >+ application mode. */ >+ else if(strcmp(command->info.custom_command.message.data, "HEADLESS")==0) { >+ /* Start profiling the agent (simulating the effect of a JNI call). */ >+ if (_jvmpiAgent_Options.application) { >+ /* Bug 71507 : Do not start profiling if it is applicationControlled */ >+ if(_jvmpiAgent_Options.enabled) { >+ Java_org_eclipse_hyades_collection_profiler_Profiler_startProfiling0((JNIEnv *)NULL, (JOBJECT)NULL, (jboolean)FALSE, 0); >+ } >+ } >+ } >+ /* Bug 64712 */ >+ else if(strcmp(command->info.custom_command.message.data, "KILLED")==0) { >+ stopTracing(); >+ } >+ /* Bug 64712 */ >+ else if(strcmp(command->info.custom_command.message.data, "COLLECTDATA")==0) { >+ /* Pre-aggregation */ >+ /* Dump all the threads' statistics */ >+ if (_jvmpiAgent_Options.compressLevel==CompressAggregate) { /* 134635 */ >+ if (!_jvmpiAgent_suspendIO) { >+ printAllThreadAgData(); /* 140009 */ >+ } >+ } >+ } >+ >+ break; >+ } >+ case RA_SET_NAME_VALUE_PAIR: >+ { >+ if(strcmp(command->info.set_nv_pair.type.data, "SETOPTION")==0) { >+ jvmpiAgent_SetProfileOption(command->info.set_nv_pair.name.data, >+ command->info.set_nv_pair.value.data); >+ } >+ /* RKD: The SETFILTER name value pair is ffor complicance with the V4 UI and V5 filters not containing method detail */ >+ else if(strcmp(command->info.set_nv_pair.type.data, "SETFILTER")==0) { >+ jvmpiAgent_addFilter(command->info.set_nv_pair.name.data, NULL, !strcmp(command->info.set_nv_pair.value.data,"INCLUDE") ? INCLUDE : EXCLUDE); >+ } >+ else if(strcmp(command->info.set_nv_pair.type.data, "SETMETHODFILTER")==0) { >+ char *separator=strchr(command->info.set_nv_pair.name.data, ' '); >+ if(separator) { >+ *separator='\0'; >+ jvmpiAgent_addFilter(command->info.set_nv_pair.name.data, separator+1, !strcmp(command->info.set_nv_pair.value.data,"INCLUDE") ? INCLUDE : EXCLUDE); >+ } >+ } >+ break; >+ } >+ default: break; >+ } >+} >+ >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#endif >+ >+ >+/** JVM_ON_LOAD *************************************************************** >+ * The entry point for the profiler. This function is called by the JVM if >+ * the .dll is provided on the -Xrun parameter when the JVM is launched. This >+ * function is called at the very bootstrap level of the JVM before much >+ * has happened. >+ */ >+ >+ >+ >+#if defined __cplusplus >+extern "C" { >+#endif >+JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM *vm, >+ char *options, >+ void *reserved) { >+ int res; >+ char * buffer; >+ int bogus; >+ >+ initializeJvmpiAgentOptionsDefaults(); >+ >+ determineTicksPerMicrosecond(&bogus); >+ >+ /* Turn IO off until we need to start tracing */ >+ _jvmpiAgent_suspendIO = 1; >+ >+ >+ /* Establish panic exit handler */ >+ signal(SIGABRT, cleanupAndExit); >+ signal(SIGINT, cleanupAndExit); >+ signal(SIGTERM, cleanupAndExit); >+ >+ /* Initialize the global collation value */ >+ jvmpiAgent_initializeSegmentedValue(&_jvmpiAgent_collation, 0); >+ >+ /* Determine start time from here */ >+ jvmpiAgent_collectStartTimeInformation(); >+ >+ /* Create the filter tables. We will assume that this JVM uses the '/' package >+ separator. This can be overriddden during tracing by the setpathDelimiter >+ function. >+ */ >+#ifdef __OS400__ >+#pragma convert(819) >+#endif >+ >+ jvmpiAgent_initializeFilters('/'); >+ >+ /* Create the trigger tables. We will assume that this JVM uses the '/' package >+ separator. This can be overriddden during tracing by the setpathDelimiter >+ function. >+ */ >+ jvmpiAgent_initializeTriggers('/'); >+#ifdef __OS400__ >+#pragma convert(0) >+#endif >+ >+ >+ /* Tuck away the JVM pointer for future use */ >+ _jvmpiAgent_jvm = vm; >+ >+ /* Resolve to the JVMPI environment */ >+#if defined __cplusplus && defined _HPUX >+ res = ENV(_jvmpiAgent_jvm)->GetEnv((void **)&_jvmpiAgent_jvmpiInterface, JVMPI_VERSION_1); >+#else >+ res = (*_jvmpiAgent_jvm)->GetEnv(_jvmpiAgent_jvm, (void **)&_jvmpiAgent_jvmpiInterface, JVMPI_VERSION_1); >+#endif >+ if (res < 0 || !_jvmpiAgent_jvmpiInterface) { >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+#endif >+ fprintf(stderr, " Could not resolve to JVMPI interface\n"); >+ fflush(stderr); >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#endif >+ return JNI_ERR; >+ } >+ >+ /* Make a global copy of the options for the agent to print later */ >+ if (options) { >+ _jvmpiAgent_Options.invocationOptions = (char*)jvmpiAgent_Calloc(strlen(options)+1); >+ strcpy(_jvmpiAgent_Options.invocationOptions, options); >+ } else { >+ _jvmpiAgent_Options.invocationOptions = ""; /* 101734 */ >+ } >+ >+ /* Process the command line options, continue initialization only if this is successful */ >+ if (jvmpiAgent_ProcessInvocationOptions(options) == 0) { >+#ifdef MVS /* 174190 */ >+ char *tmpname, *tmpType; >+#endif >+ >+ if (_jvmpiAgent_Options.standalone) { >+ jvmpiAgent_processProfile(_jvmpiAgent_Options.profileFile); >+ /* Satish: perhaps we should move following code from the bottom of this function >+ * to here. >+ */ >+ /* jvmpiAgent_processFilters(_jvmpiAgent_Options.filterFileName); */ >+ /* jvmpiAgent_processTriggers(_jvmpiAgent_Options.triggerFileName); */ >+ } >+ >+ /* Now command-line options, as well as profile has been processed, check consistency */ >+ if (jvmpiAgent_CheckOptionsConsistency() != 0) { >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ fprintf(stderr, "Specified options are not consistent\n"); >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ fflush(stderr); >+ printUsage(); >+ return JNI_ERR; >+ } >+ >+ /* Set up the symbol table */ >+ jvmpiAgent_InitializeSymbolTable(); >+ >+ /* Initialize the synchronization lock */ >+ ra_initializeLock(&_jvmpiAgent_synchLock); >+ >+ /* Grab the I/O buffer from the static private storage */ >+ buffer = jvmpiAgent_getThreadLocalStorage(0)->buffer; >+ >+ /* Set the JVMPI pointer to the Agents notify_event handler function */ >+ _jvmpiAgent_jvmpiInterface->NotifyEvent = notify_event; >+ >+ /* Enable all of the appropriate events depending upon our mode */ >+ enableGlobalJvmpiEvents(_jvmpiAgent_Options.mode); >+ >+ /* Set the dynamic event pointers */ >+ setDynamicEventHandlers(); >+ >+ /* Initialize the communication layer bindings */ >+#ifdef MVS /* 174190 */ >+ tmpname = (char *)malloc(strlen(_jvmpiAgent_Options.processName) + 1); >+ strcpy(tmpname, _jvmpiAgent_Options.processName); >+ __atoe(tmpname); >+ tmpType = (char *)malloc(strlen(_jvmpiAgent_Options.processType) + 1); >+ strcpy(tmpType, _jvmpiAgent_Options.processType); >+ __atoe(tmpType); >+ _jvmpiAgent_bindingStorage = ra_initializeBindings(tmpname, >+ tmpType, >+ _jvmpiAgent_notify_message, >+ _jvmpiAgent_Options.standalone); >+ free(tmpname); >+ free(tmpType); >+#else >+#ifdef _HPUX >+ _jvmpiAgent_bindingStorage=ra_initializeBindings(_jvmpiAgent_Options.processName, >+ _jvmpiAgent_Options.processType, >+ _jvmpiAgent_notify_message, >+ (enum _BOOL)_jvmpiAgent_Options.standalone); >+#else >+ _jvmpiAgent_bindingStorage=ra_initializeBindings(_jvmpiAgent_Options.processName, >+ _jvmpiAgent_Options.processType, >+ _jvmpiAgent_notify_message, >+ _jvmpiAgent_Options.standalone); >+#endif >+#endif >+ >+ /* Do setup for Agent when being controlled by the "Agent Controller" */ >+ if (!_jvmpiAgent_Options.standalone) { >+ /*## probably need this global so that I can kill the thread on shutdown */ >+ TID *tid; >+ >+ /* If the trace is "enabled" we don't want to block on invocation. Otherwise >+ we are in "controlled" mode, wait until the controller sends a >+ RA_CUSTOM_COMMAND with "RESUME" message. >+ */ >+ tid=ra_startListener(_jvmpiAgent_bindingStorage, startListenerShouldBlock()); >+ _jvmpiAgent_isListenerUnblocked = TRUE; >+ >+ /*------------------------------------------------------------* >+ * startListener returned. That means we have processed the >+ * initial message from the RAC, RA_AGENT_CONTROLER_AVAILABLE. >+ * And *that* means we have loaded and initialized the agent >+ * extension, if one was configured. >+ * >+ * See comments at agentExtensionSetEventHandler for more >+ * about initializing agent extensions and having them >+ * enable JVMPI events. >+ */ >+ { >+ /* Process the initial agent extension event enable requests */ >+ int i; >+ for (i = 0; i < JVMPI_MAX_EVENT_TYPE_VAL; i++) { >+ if (agent_extension_handlers[i] != NULL) { >+ _jvmpiAgent_jvmpiInterface->EnableEvent(i, 0); >+ } >+ } >+ } >+ } >+ else { >+ /* Standalone mode */ >+ ThreadLocalStorage *tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+ /*------------------------------------------------------------* >+ * If the extensionLibrary option is set, load and >+ * initialize an agent extension. >+ * >+ * In non-stand-alone mode, this will be done based on >+ * the settings available when the RA_AGENT_CONTROLER_AVAILABLE >+ * message arrives. >+ * >+ * In stand-alone mode, we don't need to worry about enabling >+ * events after the agent extension initializes; see notes at >+ * agentExtensionSetEventHandler for an explanation. >+ */ >+ if (_jvmpiAgent_Options.extensionLibrary[0] != '\0') { >+ load_agent_extension_library(); >+ } >+ >+ ra_initializeVMLock(); >+#ifdef MVS /* 174190 */ >+#pragma convlit(suspend) >+ __atoe(_jvmpiAgent_Options.outputFileName); >+#endif >+ /* Open the output file if we are doing file I/O */ >+ jvmpiAgent_initializeStandaloneIO(); >+#ifdef MVS /* 174190 */ >+#pragma convlit(resume) >+#endif >+ _jvmpiAgent_suspendIO = 0; >+ >+ /* Satish: As a principle, any configuartion file must be processed before, applying >+ * any business logic. Perhaps, we should move these just processing command-line >+ * options. I am moving the call jvmpiAgent_processProfile(_jvmpiAgent_Options.profileFile) >+ * there, because profile specifications might create inconsistencies that must >+ * be checked before doing anything. >+ */ >+ /* jvmpiAgent_processProfile(_jvmpiAgent_Options.profileFile); */ >+ jvmpiAgent_processFilters(_jvmpiAgent_Options.filterFileName); >+ jvmpiAgent_processTriggers(_jvmpiAgent_Options.triggerFileName); >+ >+ } >+ >+ return JNI_OK; >+ } >+ else { >+ printUsage(); >+ return JNI_ERR; >+ } >+} >+ >+/** Giri: <Defect 64462> This method is performs all the optHeap related setup necessary within >+ the agent. Previously, we were doing this set-up only within JVM_OnLoad(), so if we tried >+ to attach a running process, and then tried to do optHeap related operations, the setup >+ would not have happened, and the JVM would crash **/ >+ >+static void jvmpiAgent_DoOptHeapSetup() >+{ >+ if (_optHeapSetupDone) { >+ return; >+ } >+ >+ _optHeapSetupDone = TRUE; /* We need to do this set-up only once */ >+ _jvmpiAgent_optHeapCallBack.ohdcb = sendHeapDumpInformation ; >+ >+ StatelessHeapSnapshotManager_setup_FromC(_jvmpiAgent_jvmpiInterface, TRUE); >+ >+ /* Get the LOCAL_AGENT_TEMP_DIR */ >+ /* Bug 59544 querying tempDir from RAC */ >+ if (!_jvmpiAgent_Options.standalone) { >+ char tempDir[1024] ; >+ int result ; >+ result = ra_getEnvironmentVariable(_tempDirOptionName,tempDir,1024) ; >+ /* If "LOCAL_AGENT_TEMP_DIR" is not defined then get try to look >+ for "TMP" */ >+ if ( !result ) >+ result = ra_getEnvironmentVariable("TMP",tempDir,1024) ; >+ /* If tempDir is defined then set it as the workDir . >+ else leave it as default */ >+ if ( result ) { >+ strcpyrealloc(&_jvmpiAgent_Options.workDir,tempDir) ; >+/* 64476 Convert it to ascii for consistency */ >+#ifdef MVS >+ __etoa(_jvmpiAgent_Options.workDir) ; >+#endif >+ } >+ } >+} >+ >+static void jvmpiAgent_PrintStartingXMLFragments() >+{ >+ >+ ThreadLocalStorage *tps; >+ >+ /* Get the global buffer for IO */ >+ tps=jvmpiAgent_getThreadLocalStorage(0); >+ >+ /* If we are in standalone print the required additional elements */ >+ if((_jvmpiAgent_Options.standalone||_jvmpiAgent_Options.application)) /*94955*/ >+ { >+ jvmpiAgent_printXMLStartElement(tps); >+ jvmpiAgent_printStandaloneTraceTagOpen(tps); >+ } >+ >+ /* Print the trace header */ >+ jvmpiAgent_printNodeElement(tps); >+ jvmpiAgent_printProcessCreateElement(tps); >+ jvmpiAgent_printAgentCreateElement(tps, _jvmpiAgent_Options.invocationOptions); >+ jvmpiAgent_printTraceStartElement(tps, _jvmpiAgent_Options.invocationOptions); >+ >+ /* Print the filters and options only if the proper option is set */ >+ if (_jvmpiAgent_Options.filters) >+ { >+ jvmpiAgent_printFilters(); >+ } >+ if (_jvmpiAgent_Options.options) >+ { >+ jvmpiAgent_printOptions(); >+ } >+} >+ >+ >+#if defined __cplusplus >+} >+#endif >Index: src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak64 >=================================================================== >RCS file: src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak64 >diff -N src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak64 >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/WinBuild/PerfmonAgent.mak64 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,354 @@ >+# Microsoft Developer Studio Generated NMAKE File, Based on PerfmonAgent.dsp >+!IF "$(CFG)" == "" >+CFG=PerfmonAgent - IA64 Release >+!MESSAGE No configuration specified. Defaulting to PerfmonAgent - IA64 Release. >+!ENDIF >+ >+!IF "$(CFG)" != "PerfmonAgent - IA64 Release" && "$(CFG)" != "PerfmonAgent - IA64 Debug" && "$(CFG)" != "PerfmonAgent - X64 Release" && "$(CFG)" != "PerfmonAgent - X64 Debug" >+!MESSAGE Invalid configuration "$(CFG)" specified. >+!MESSAGE You can specify a configuration when running NMAKE >+!MESSAGE by defining the macro CFG on the command line. For example: >+!MESSAGE >+!MESSAGE NMAKE /f "PerfmonAgent.mak64" CFG="PerfmonAgent - IA64 Release" >+!MESSAGE >+!MESSAGE Possible choices for configuration are: >+!MESSAGE >+!MESSAGE "PerfmonAgent - IA64 Release" >+!MESSAGE "PerfmonAgent - IA64 Debug" >+!MESSAGE "PerfmonAgent - X64 Release" >+!MESSAGE "PerfmonAgent - X64 Debug" >+!MESSAGE >+!ERROR An invalid configuration is specified. >+!ENDIF >+ >+!IF "$(OS)" == "Windows_NT" >+NULL= >+!ELSE >+NULL=nul >+!ENDIF >+ >+!IF "$(CFG)" == "PerfmonAgent - IA64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\PerfmonAgent.exe" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\PerfmonAgent.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\PerfmonAgent.exe" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\PerfmonAgent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\PerfmonAgent.pdb" /out:"$(OUTDIR)\PerfmonAgent.exe" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\PerfmonAgent.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\PerfmonAgent.exe" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - IA64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\PerfmonAgent.exe" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\PerfmonAgent.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\PerfmonAgent.exe" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\PerfmonAgent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\PerfmonAgent.pdb" /out:"$(OUTDIR)\PerfmonAgent.exe" /libpath:"$(OUTDIR)\..\lib" /machine:IA64 >+LINK32_OBJS= \ >+ "$(INTDIR)\PerfmonAgent.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\PerfmonAgent.exe" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - X64 Release" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Release >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\PerfmonAgent.exe" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\PerfmonAgent.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\PerfmonAgent.exe" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\PerfmonAgent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\PerfmonAgent.pdb" /out:"$(OUTDIR)\PerfmonAgent.exe" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\PerfmonAgent.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\PerfmonAgent.exe" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - X64 Debug" >+ >+OUTDIR=..\..\..\..\bin >+INTDIR=.\Debug >+# Begin Custom Macros >+OutDir=..\..\..\..\bin >+# End Custom Macros >+ >+ALL : "$(OUTDIR)\PerfmonAgent.exe" >+ >+ >+CLEAN : >+ -@erase "$(INTDIR)\PerfmonAgent.obj" >+ -@erase "$(INTDIR)\vc60.idb" >+ -@erase "$(INTDIR)\version.res" >+ -@erase "$(OUTDIR)\PerfmonAgent.exe" >+ >+"$(OUTDIR)" : >+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" >+ >+"$(INTDIR)" : >+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)" >+ >+CPP=cl.exe >+CPP_PROJ=/nologo /MD /W3 /EHsc /O2 /I "../resutils" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\PerfmonAgent.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c >+ >+.c{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.obj:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.c{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cpp{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+.cxx{$(INTDIR)}.sbr:: >+ $(CPP) @<< >+ $(CPP_PROJ) $< >+<< >+ >+RSC=rc.exe >+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\version.res" /d "NDEBUG" >+ >+LINK32=link.exe >+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib resutils.lib bufferoverflowU.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\PerfmonAgent.pdb" /out:"$(OUTDIR)\PerfmonAgent.exe" /libpath:"$(OUTDIR)\..\lib" /machine:AMD64 >+LINK32_OBJS= \ >+ "$(INTDIR)\PerfmonAgent.obj" \ >+ "$(INTDIR)\version.res" >+ >+"$(OUTDIR)\PerfmonAgent.exe" : "$(OUTDIR)" $(LINK32_OBJS) >+ $(LINK32) @<< >+ $(LINK32_FLAGS) $(LINK32_OBJS) >+<< >+ >+!ENDIF >+ >+ >+!IF "$(CFG)" == "PerfmonAgent - IA64 Release" || "$(CFG)" == "PerfmonAgent - IA64 Debug" || "$(CFG)" == "PerfmonAgent - X64 Release" || "$(CFG)" == "PerfmonAgent - X64 Debug" >+SOURCE=..\PerfmonAgent\PerfmonAgent.cpp >+ >+"$(INTDIR)\PerfmonAgent.obj" : $(SOURCE) "$(INTDIR)" >+ $(CPP) $(CPP_PROJ) $(SOURCE) >+ >+ >+SOURCE=..\PerfmonAgent\version.rc >+ >+!IF "$(CFG)" == "PerfmonAgent - IA64 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\PerfmonAgent" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - IA64 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\PerfmonAgent" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - X64 Release" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\PerfmonAgent" /d "NDEBUG" $(SOURCE) >+ >+ >+!ELSEIF "$(CFG)" == "PerfmonAgent - X64 Debug" >+ >+ >+"$(INTDIR)\version.res" : $(SOURCE) "$(INTDIR)" >+ $(RSC) /l 0x409 /fo"$(INTDIR)\version.res" /i "..\PerfmonAgent" /d "NDEBUG" $(SOURCE) >+ >+ >+!ENDIF >+ >+ >+!ENDIF >+ >Index: src-native-new/src/agents/native/java_profiler/eventmask.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/eventmask.h >diff -N src-native-new/src/agents/native/java_profiler/eventmask.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/eventmask.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: eventmask.h,v 1.2 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef __EVENTMASK_H__ >+ #define __EVENTMASK_H__ 1 >+ >+/* New Events */ >+#define JVMPI_EVENT_THROW JVMPI_MAX_EVENT_TYPE_VAL + 1 >+#define JVMPI_EVENT_CATCH JVMPI_MAX_EVENT_TYPE_VAL + 2 >+ >+#endif >Index: src-native-new/src/agents/perfmon/pluginconfig_linux.xml >=================================================================== >RCS file: src-native-new/src/agents/perfmon/pluginconfig_linux.xml >diff -N src-native-new/src/agents/perfmon/pluginconfig_linux.xml >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/pluginconfig_linux.xml 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,6 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<PluginConfiguration> >+ <Application configuration="default" executable="LinuxAgent" location="%RASERVER_HOME%/plugins/org.eclipse.hyades.perfmon.linux" path="%RASERVER_HOME%/plugins/org.eclipse.hyades.perfmon.linux/bin/LinuxAgent"> >+ <Variable name="LD_LIBRARY_PATH" position="prepend" value="%RASERVER_HOME%/plugins/org.eclipse.hyades.perfmon.linux/lib"/> >+ </Application> >+</PluginConfiguration> >Index: src-native-new/src/agents/thread/hcthread.exp >=================================================================== >RCS file: src-native-new/src/agents/thread/hcthread.exp >diff -N src-native-new/src/agents/thread/hcthread.exp >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/thread/hcthread.exp 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,6 @@ >+Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_init0 >+Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_dumpThreads0 >+Java_org_eclipse_hyades_logging_jvm_threadanalysis_ThreadDumpAgentImpl_deregister0 >+init >+dump >+deregister >Index: src-native-new/src/transport/RADataTransfer/RADataTransfer.c >=================================================================== >RCS file: src-native-new/src/transport/RADataTransfer/RADataTransfer.c >diff -N src-native-new/src/transport/RADataTransfer/RADataTransfer.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/transport/RADataTransfer/RADataTransfer.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,142 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: RADataTransfer.c,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#include "RADataTransfer.h" >+#include "RASharedMemory.h" /* 175248 - added */ >+ >+#define RA_MESSAGE_HEADER_SIZE 0x000a >+ >+ >+/** ALLOCATE_MESSAGE_BLOCK ************************************************ >+ * Allocates a block of memory that can be used for a message and returns >+ * the address where the caller can start adding data. >+ * IMPORTANT: must use ra_freeMessageBlock to free the memory when done >+ * @param length - the number of bytes required for the message >+ * @returns - the address where the message can be written to. NULL if >+ * there is no available memory. >+ */ >+unsigned char *ra_allocateMessageBlock(ra_uint_t length) { >+ ra_uint_t size=length+RA_MESSAGE_HEADER_SIZE; >+ void *p=(void*)malloc(size); >+ if(p==NULL) { >+ return NULL; >+ } >+ return ((unsigned char*)p+RA_MESSAGE_HEADER_SIZE); >+} >+ >+/** REALLOCATE_MESSAGE_BLOCK ************************************************ >+ * Recieves an existing message block and allocates a block of memory with the >+ * newley specified size. The data in the existing message block is copied >+ * to the new message block. >+ * IMPORTANT: must use ra_freeMessageBlock to free the memory when done >+ * @param message - the existing message block. >+ * @param length - the number of bytes required for the new message >+ * @returns - the address where the message can be written to. NULL if >+ * there is no available memory. >+ */ >+unsigned char *ra_reallocateMessageBlock(unsigned char *message, >+ ra_uint_t length) { >+ ra_uint_t size=length+RA_MESSAGE_HEADER_SIZE; >+ void *p=(void*)realloc((void*)(message-RA_MESSAGE_HEADER_SIZE), size); >+ if(p==NULL) { >+ if(size==0) { >+ return NULL; >+ } >+ return message; >+ } >+ return ((unsigned char*)p+RA_MESSAGE_HEADER_SIZE); >+} >+ >+ >+/** FREE_MESSAGE_BLOCK ************************************************ >+ * Free's a block of message memory >+ * @param message - the address returned by ra_allocateMessageBlock >+ */ >+void ra_freeMessageBlock(unsigned char *message) { >+ free((void*)(message-RA_MESSAGE_HEADER_SIZE)); >+} >+ >+ >+/** WRITE_MESSAGE_BLOCK ************************************************* >+ * Writes a message to the specified target using the specified format. >+ * DNS changed @param from fd - the target SOCKET object to the following >+ * @param dthdl - the handle of the target to write the data to. >+ * @param format - the format to use >+ * @param message - the address of the start of the message. >+ * @param length - the number of bytes to write to fd. >+ * @returns - the number of bytes written to the socket. >+ */ >+/* DNS extern unsigned short ra_writeMessageBlock(SOCKET fd, */ >+ra_uint_t ra_writeMessageBlock(ra_data_target_hdl_t *dthdl, >+ dataFormat_t format, >+ unsigned char *message, >+ ra_uint_t length) { >+ ra_uint_t bytesWritten=0; >+ >+ if (!dthdl || !message) { >+ return 0; >+ } >+ /* Place the majic header */ >+ message[-10]=(unsigned char)(RA_MAGIC>>24); >+ message[-9]=(unsigned char)(RA_MAGIC>>16); >+ message[-8]=(unsigned char)(RA_MAGIC>>8); >+ message[-7]=(unsigned char)(RA_MAGIC); >+ >+ /* Place the endian bits in the header */ >+ message[-6]=0xff; >+ >+ /* Place the length in the header */ >+ message[-5]=(unsigned char)(length>>24 & 0x000000ff); >+ message[-4]=(unsigned char)(length>>16 & 0x000000ff); >+ message[-3]=(unsigned char)(length>>8 & 0x000000ff); >+ message[-2]=(unsigned char)length; >+ >+ /* Place the format specifier in the message */ >+ message[-1]=format; >+ >+ /* Write to the proper device */ >+ if ( dthdl->dtarget == RA_SOCKET ) { >+ bytesWritten=ra_writeToSocket(dthdl->dtargetHdl.socketFD, >+ (char*)&message[-RA_MESSAGE_HEADER_SIZE], >+ (length+RA_MESSAGE_HEADER_SIZE)); >+ >+/* DNS changed return value by subtracting the header size >+ because that is what the user expects */ >+ if(bytesWritten>0) { >+ return bytesWritten-RA_MESSAGE_HEADER_SIZE; >+ } >+ else { >+ return 0; >+ } >+ } >+ else if ( dthdl->dtarget == RA_SHAREDMEMORY ) { >+ ra_uint_t length2 = length + RA_MESSAGE_HEADER_SIZE; >+ ra_uint_t rc; /* 194539 */ >+ /* Write to the shared memory buffer */ >+ rc = ra_writeToShm((OSSRambo *)dthdl->dtargetHdl.shmHdl, /* 175248 */ >+ &message[-RA_MESSAGE_HEADER_SIZE], >+ (length2)); >+/* 194539 begin */ >+ if (0 != rc ) { >+ ra_setLastError(SHM_WRITE_FAILED, rc); >+ return 0; >+ } >+ else { >+/* 194539 end */ >+ return (length2 - RA_MESSAGE_HEADER_SIZE); >+ } /* 194539 */ >+ } >+/* TO DO DNS - add code to write to a file */ >+ else { >+ return 0; >+ } >+} >Index: src-native-new/src/agents/native/java_profiler/strings.h >=================================================================== >RCS file: src-native-new/src/agents/native/java_profiler/strings.h >diff -N src-native-new/src/agents/native/java_profiler/strings.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/java_profiler/strings.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,369 @@ >+/********************************************************************** >+ * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: strings.h,v 1.6 2006/06/05 23:12:42 bduncan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef _STRINGS_H_ >+#define _STRINGS_H_ >+ >+/** This is a list of all the hardcoded strings that are used during IO >+ operations on the agent and the length of each string. This is used >+ to streamline IO operations >+ */ >+#define UNAVAILABLE "-Unavailable-" >+#define STRLEN_UNAVAILABLE 11 >+ >+/* XML Elements */ >+ >+#define METHOD_EXIT_ELEMENT "methodExit" >+#define STRLEN_METHOD_EXIT_ELEMENT 10 >+#define METHOD_RETURN_ELEMENT "methodReturn" >+#define STRLEN_METHOD_RETURN_ELEMENT 12 >+#define JVM_SHUT_DOWN_ELEMENT "runtimeShutdown" >+#define STRLEN_JVM_SHUT_DOWN_ELEMENT 15 >+#define TRACE_STOP_ELEMENT "traceEnd" >+#define STRLEN_TRACE_STOP_ELEMENT 8 >+#define CLASS_UNLOAD_ELEMENT "classUnload" >+#define STRLEN_CLASS_UNLOAD_ELEMENT 11 >+#define JVM_INIT_DONE_ELEMENT "runtimeInitDone" >+#define STRLEN_JVM_INIT_DONE_ELEMENT 15 >+#define OBJ_ALLOC_ELEMENT "objAlloc" >+#define STRLEN_OBJ_ALLOC_ELEMENT 8 >+#define GC_START_ELEMENT "gcStart" >+#define STRLEN_GC_START_ELEMENT 7 >+#define GC_FINISH_ELEMENT "gcFinish" >+#define STRLEN_GC_FINISH_ELEMENT 8 >+#define HD_START_ELEMENT "heapDumpDef" >+#define STRLEN_HD_START_ELEMENT 11 >+#define HD_FINISH_ELEMENT "hdFinish" >+#define STRLEN_HD_FINISH_ELEMENT 8 >+#define OBJ_FREE_ELEMENT "objFree" >+#define STRLEN_OBJ_FREE_ELEMENT 7 >+#define OBJ_MOVE_ELEMENT "objMove" >+#define STRLEN_OBJ_MOVE_ELEMENT 7 >+#define THREAD_END_ELEMENT "threadEnd" >+#define STRLEN_THREAD_END_ELEMENT 9 >+#define OPTION_ELEMENT "option" >+#define STRLEN_OPTION_ELEMENT 6 >+#define FILTER_ELEMENT "filter" >+#define STRLEN_FILTER_ELEMENT 6 >+#define THREAD_START_ELEMENT "threadStart" >+#define STRLEN_THREAD_START_ELEMENT 11 >+#define CLASS_ELEMENT "CLASS" >+#define STRLEN_CLASS_ELEMENT 5 >+#define CLASS_LOAD_ELEMENT "classDef" >+#define STRLEN_CLASS_LOAD_ELEMENT 8 >+#define METHOD_ELEMENT "methodDef" >+#define STRLEN_METHOD_ELEMENT 9 >+#define STATIC_FIELD_ELEMENT "staticField" >+#define STRLEN_STATIC_FIELD_ELEMENT 11 >+#define INSTANCE_FIELD_ELEMENT "instanceField" >+#define STRLEN_INSTANCE_FIELD_ELEMENT 13 >+#define METHOD_COUNT_ELEMENT "methodCount" >+#define STRLEN_METHOD_COUNT_ELEMENT 11 >+#define TRACE_START_ELEMENT "traceStart" >+#define STRLEN_TRACE_START_ELEMENT 10 >+#define PROCESS_SUSPEND_ELEMENT "processSuspend" >+#define STRLEN_PROCESS_SUSPEND_ELEMENT 14 >+#define PROCESS_RESUME_ELEMENT "processResume" >+#define STRLEN_PROCESS_RESUME_ELEMENT 13 >+#define TRACE_ELEMENT "traceRoot" >+#define STRLEN_TRACE_ELEMENT 9 >+#define CATCH_ELEMENT "catch" >+#define STRLEN_CATCH_ELEMENT 5 >+#define THROW_ELEMENT "throw" >+#define STRLEN_THROW_ELEMENT 5 >+#define METHOD_ENTRY_ATTRIBUTE "methodEntry" >+#define STRLEN_METHOD_ENTRY_ATTRIBUTE 11 >+#define METHOD_CALL_ATTRIBUTE "methodCall" >+#define STRLEN_METHOD_CALL_ATTRIBUTE 10 >+#define AGENT_CREATE_ELEMENT "agentCreate" >+#define STRLEN_AGENT_CREATE_ELEMENT 11 >+#define AGENT_DESTROY_ELEMENT "agentDestroy" >+#define STRLEN_AGENT_DESTROY_ELEMENT 12 >+#define NODE_ELEMENT "node" >+#define STRLEN_NODE_ELEMENT 4 >+#define PROCESS_CREATE_ELEMENT "processCreate" >+#define STRLEN_PROCESS_CREATE_ELEMENT 13 >+#define LINE_ELEMENT "line" >+#define STRLEN_LINE_ELEMENT 4 >+#define OBJECT_REFERENCE_ATTRIBUTE "objReference" >+#define STRLEN_OBJECT_REFERENCE_ATTRIBUTE 12 >+#define STATIC_REFERENCE_ATTRIBUTE "staticReference" >+#define STRLEN_STATIC_REFERENCE_ATTRIBUTE 15 >+#define GC_ROOT_ELEMENT "gcRoot" >+#define STRLEN_GC_ROOT_ELEMENT 6 >+ >+#define MONITOR_WAIT_ELEMENT "monWait" >+#define STRLEN_MONITOR_WAIT_ELEMENT 7 >+#define MONITOR_WAITED_ELEMENT "monWaited" >+#define STRLEN_MONITOR_WAITED_ELEMENT 9 >+#define MONITOR_STILL_OWNED_EVENT "monStillOwned" >+#define STRLEN_MONITOR_STILL_OWNED_EVENT 13 >+#define MONITOR_CONTENDED_ENTER_ELEMENT "monContendedEnter" >+#define STRLEN_MONITOR_CONTENDED_ENTER_ELEMENT 17 >+#define MONITOR_CONTENDED_ENTERED_ELEMENT "monContendedEntered" >+#define STRLEN_MONITOR_CONTENDED_ENTERED_ELEMENT 19 >+ >+/* The following 2 constants were added for bug 135437 (preAgg piAgent). */ >+#define AG_METHOD_ENTRY_ELEMENT "agMethodEntry" >+#define STRLEN_AG_METHOD_ENTRY_ELEMENT 13 >+#define AG_METHOD_EXIT_ELEMENT "agMethodExit" >+#define STRLEN_AG_METHOD_EXIT_ELEMENT 12 >+ >+ >+ >+/* XML Attributes */ >+ >+#define CLASS_ID_ATTRIBUTE "transientClassId" >+#define STRLEN_CLASS_ID_ATTRIBUTE 16 >+#define CLASS_IDREF_ATTRIBUTE "transientClassIdRef" >+#define STRLEN_CLASS_IDREF_ATTRIBUTE 19 >+#define METHOD_ID_ATTRIBUTE "transientMethodId" >+#define STRLEN_METHOD_ID_ATTRIBUTE 17 >+#define METHOD_IDREF_ATTRIBUTE "transientMethodIdRef" >+#define STRLEN_METHOD_IDREF_ATTRIBUTE 20 >+#define OBJ_ID_ATTRIBUTE "transientObjId" >+#define STRLEN_OBJ_ID_ATTRIBUTE 14 >+#define OBJ_IDREF_ATTRIBUTE "transientObjIdRef" >+#define STRLEN_OBJ_IDREF_ATTRIBUTE 17 >+#define THREAD_ID_ATTRIBUTE "transientThreadId" >+#define STRLEN_THREAD_ID_ATTRIBUTE 17 >+#define STATIC_THREAD_ID_ATTRIBUTE "threadId" >+#define STRLEN_STATIC_THREAD_ID_ATTRIBUTE 8 >+#define THREAD_IDREF_ATTRIBUTE "transientThreadIdRef" >+#define STRLEN_THREAD_IDREF_ATTRIBUTE 20 >+#define STATIC_THREAD_IDREF_ATTRIBUTE "threadIdRef" >+#define STRLEN_STATIC_THREAD_IDREF_ATTRIBUTE 11 >+#define STATIC_CLASS_ID_ATTRIBUTE "classId" >+#define STRLEN_STATIC_CLASS_ID_ATTRIBUTE 7 >+#define STATIC_CLASS_IDREF_ATTRIBUTE "classIdRef" >+#define STRLEN_STATIC_CLASS_IDREF_ATTRIBUTE 10 >+#define STATIC_OBJ_ID_ATTRIBUTE "objId" >+#define STRLEN_STATIC_OBJ_ID_ATTRIBUTE 5 >+#define STATIC_OBJ_IDREF_ATTRIBUTE "objIdRef" >+#define STRLEN_STATIC_OBJ_IDREF_ATTRIBUTE 8 >+#define STATIC_METHOD_ID_ATTRIBUTE "methodId" >+#define STRLEN_STATIC_METHOD_ID_ATTRIBUTE 8 >+#define STATIC_METHOD_IDREF_ATTRIBUTE "methodIdRef" >+#define STRLEN_STATIC_METHOD_IDREF_ATTRIBUTE 11 >+ >+/* Test */ >+#define TRACE_FLAG4OWN_ATTRIBUTE "traceFlag4Own" >+#define STRLEN_TRACE_FLAG4OWN_ATTRIBUTE 13 >+#define TRACE_FLAG4REF_ATTRIBUTE "traceFlag4Ref" >+#define STRLEN_TRACE_FLAG4REF_ATTRIBUTE 13 >+/* Test */ >+ >+#define STATIC_ID_ATTRIBUTE "static_id" >+#define STRLEN_STATIC_ID_ATTRIBUTE 9 >+#define OBJ_HANDLE_ATTRIBUTE "objHandle" >+#define STRLEN_OBJ_HANDLE_ATTRIBUTE 9 >+#define TICKET_ATTRIBUTE "ticket" >+#define STRLEN_TICKET_ATTRIBUTE 6 >+#define ENV_ID_ATTRIBUTE "env_id" >+#define STRLEN_ENV_ID_ATTRIBUTE 6 >+#define STACK_DEPTH_ATTRIBUTE "stackDepth" >+#define STRLEN_STACK_DEPTH_ATTRIBUTE 10 >+#define ID_ATTRIBUTE "id" >+#define STRLEN_ID_ATTRIBUTE 2 >+#define USED_OBJECTS_ATTRIBUTE "usedObjects" >+#define STRLEN_USED_OBJECTS_ATTRIBUTE 11 >+#define USED_OBJECT_SPACE_ATTRIBUTE "usedObjSpace" >+#define STRLEN_USED_OBJECT_SPACE_ATTRIBUTE 12 >+#define TOTAL_OBJECT_SPACE_ATTRIBUTE "totalObjSpace" >+#define STRLEN_TOTAL_OBJECT_SPACE_ATTRIBUTE 13 >+#define ARENA_ID_ATTRIBUTE "arena_id" >+#define STRLEN_ARENA_ID_ATTRIBUTE 8 >+#define IS_ARRAY_ATTRIBUTE "isArray" >+#define STRLEN_IS_ARRAY_ATTRIBUTE 7 >+#define SIZE_ATTRIBUTE "size" >+#define STRLEN_SIZE_ATTRIBUTE 4 >+#define NEW_ARENA_ID_ATTRIBUTE "new_arena_id" >+#define STRLEN_NEW_ARENA_ID_ATTRIBUTE 12 >+#define NEW_OBJ_ID_ATTRIBUTE "newObjId" >+#define STRLEN_NEW_OBJ_ID_ATTRIBUTE 8 >+#define THREAD_NAME_ATTRIBUTE "threadName" >+#define STRLEN_THREAD_NAME_ATTRIBUTE 10 >+#define GROUP_NAME_ATTRIBUTE "groupName" >+#define STRLEN_GROUP_NAME_ATTRIBUTE 9 >+#define PARENT_NAME_ATTRIBUTE "parentName" >+#define STRLEN_PARENT_NAME_ATTRIBUTE 10 >+#define THREAD_OBJ_ID_ATTRIBUTE "thread_obj_id" >+#define STRLEN_THREAD_OBJ_ID_ATTRIBUTE 13 >+#define THREAD_ENV_ID_ATTRIBUTE "thread_env_id" >+#define STRLEN_THREAD_ENV_ID_ATTRIBUTE 13 >+#define KEY_ATTRIBUTE "key" >+#define STRLEN_KEY_ATTRIBUTE 3 >+#define VALUE_ATTRIBUTE "value" >+#define STRLEN_VALUE_ATTRIBUTE 5 >+#define TIME_ATTRIBUTE "time" >+#define STRLEN_TIME_ATTRIBUTE 4 >+#define THREAD_CPU_TIME_ATTRIBUTE "cpuTime" >+#define STRLEN_THREAD_CPU_TIME_ATTRIBUTE 7 >+#define TYPE_ATTRIBUTE "type" >+#define STRLEN_TYPE_ATTRIBUTE 4 >+#define CLASS_MODE_ATTRIBUTE "mode" >+#define STRLEN_CLASS_MODE_ATTRIBUTE 4 >+#define METHOD_MODE_ATTRIBUTE "methodMode" >+#define STRLEN_METHOD_MODE_ATTRIBUTE 10 >+#define PATTERN_ATTRIBUTE "pattern" >+#define STRLEN_PATTERN_ATTRIBUTE 7 >+#define METHOD_PATTERN_ATTRIBUTE "methodPattern" >+#define STRLEN_METHOD_PATTERN_ATTRIBUTE 13 >+#define GENERICPATTERN_ATTRIBUTE "genericPattern" >+#define STRLEN_GENERICPATTERN_ATTRIBUTE 14 >+#define METHOD_GENERICPATTERN_ATTRIBUTE "methodGenericPattern" >+#define STRLEN_METHOD_GENERICPATTERN_ATTRIBUTE 20 >+#define NAME_ATTRIBUTE "name" >+#define STRLEN_NAME_ATTRIBUTE 4 >+#define SIGNATURE_ATTRIBUTE "signature" >+#define STRLEN_SIGNATURE_ATTRIBUTE 9 >+#define START_LINENO_ATTRIBUTE "startLineNumber" >+#define STRLEN_START_LINENO_ATTRIBUTE 15 >+#define END_LINENO_ATTRIBUTE "endLineNumber" >+#define STRLEN_END_LINENO_ATTRIBUTE 13 >+#define IS_NATIVE_ATTRIBUTE "isNative" >+#define STRLEN_IS_NATIVE_ATTRIBUTE 8 >+#define IS_ABSTRACT_ATTRIBUTE "isAbstract" >+#define STRLEN_IS_ABSTRACT_ATTRIBUTE 10 >+#define IS_STATIC_ATTRIBUTE "isStatic" >+#define STRLEN_IS_STATIC_ATTRIBUTE 8 >+#define IS_SYNCHRONIZED_ATTRIBUTE "isSynchronized" >+#define STRLEN_IS_SYNCHRONIZED_ATTRIBUTE 14 >+#define VISIBILITY_ATTRIBUTE "visibility" >+#define STRLEN_VISIBILITY_ATTRIBUTE 10 >+#define EXCEPTIONS_ATTRIBUTE "exceptions" >+#define STRLEN_EXCEPTIONS_ATTRIBUTE 10 >+#define SOURCE_NAME_ATTRIBUTE "sourceName" >+#define STRLEN_SOURCE_NAME_ATTRIBUTE 10 >+#define NUM_INTERFACES_ATTRIBUTE "numInterfaces" >+#define STRLEN_NUM_INTERFACES_ATTRIBUTE 13 >+#define CLASS_LOADER_NAME "classLoader" >+#define STRLEN_CLASS_LOADER_NAME 11 >+#define SUPER_CLASS_NAME_ATTRIBUTE "superclass" >+#define STRLENT_SUPER_CLASS_NAME_ATTRIBUTE 10 >+#define INTERFACE_NAMES_ATTRIBUTE "interfaceNames" >+#define STRLEN_INTERFACE_NAMES_ATTRIBUTE 14 >+#define NUM_METHODS_ATTRIBUTE "numMethods" >+#define STRLEN_NUM_METHODS_ATTRIBUTE 10 >+#define FIELD_ID_ATTRIBUTE "fieldId" >+#define STRLEN_FIELD_ID_ATTRIBUTE 7 >+#define FIELD_IDREF_ATTRIBUTE "fieldIdRef" >+#define STRLEN_FIELD_IDREF_ATTRIBUTE 10 >+#define NUM_STATIC_FIELDS_ATTRIBUTE "numStaticFields" >+#define STRLEN_NUM_STATIC_FIELDS_ATTRIBUTE 15 >+#define NUM_INSTANCE_FIELDS_ATTRIBUTE "numInstanceFields" >+#define STRLEN_NUM_INSTANCE_FIELDS_ATTRIBUTE 17 >+#define COUNT_ATTRIBUTE "count" >+#define STRLEN_COUNT_ATTRIBUTE 5 >+#define PID_ATTRIBUTE "pid" >+#define STRLEN_PID_ATTRIBUTE 3 >+#define HOSTNAME_ATTRIBUTE "hostname" >+#define STRLEN_HOSTNAME_ATTRIBUTE 8 >+#define IPADDRESS_ATTRIBUTE "ipaddress" >+#define STRLEN_IPADDRESS_ATTRIBUTE 9 >+#define DATE_ATTRIBUTE "date" >+#define STRLEN_DATE_ATTRIBUTE 4 >+#define TIMEZONE_ATTRIBUTE "timezone" >+#define STRLEN_TIMEZONE_ATTRIBUTE 8 >+#define INVOCATIONOPTIONS_ATTRIBUTE "invocationOptions" >+#define STRLEN_INVOCATIONOPTIONS_ATTRIBUTE 17 >+#define TRACE_ID_ATTRIBUTE "traceId" >+#define STRLEN_TRACE_ID_ATTRIBUTE 7 >+#define TRACE_IDREF_ATTRIBUTE "traceIdRef" >+#define STRLEN_TRACE_IDREF_ATTRIBUTE 10 >+#define AGENT_ID_ATTRIBUTE "agentId" >+#define STRLEN_AGENT_ID_ATTRIBUTE 7 >+#define AGENT_IDREF_ATTRIBUTE "agentIdRef" >+#define STRLEN_AGENT_IDREF_ATTRIBUTE 10 >+#define PROCESS_IDREF_ATTRIBUTE "processIdRef" >+#define STRLEN_PROCESS_IDREF_ATTRIBUTE 12 >+#define AGENT_NAME_ATTRIBUTE "agentName" >+#define STRLEN_AGENT_NAME_ATTRIBUTE 9 >+#define AGENT_PARAMETERS_ATTRIBUTE "agentParameters" >+#define STRLEN_AGENT_PARAMETERS_ATTRIBUTE 15 >+#define COLLATION_VALUE_ATTRIBUTE "collationValue" >+#define STRLEN_COLLATION_VALUE_ATTRIBUTE 14 >+#define NODE_ID_ATTRIBUTE "nodeId" >+#define STRLEN_NODE_ID_ATTRIBUTE 6 >+#define NODE_IDREF_ATTRIBUTE "nodeIdRef" >+#define STRLEN_NODE_IDREF_ATTRIBUTE 9 >+#define PROCESS_ID_ATTRIBUTE "processId" >+#define STRLEN_PROCESS_ID_ATTRIBUTE 9 >+#define ENVIRONMENT_ATTRIBUTE "environment" >+#define STRLEN_ENVIRONMENT_ATTRIBUTE 11 >+#define APPLICATION_PARMS_ATTRIBUTE "application_parameters" >+#define STRLEN_APPLICATION_PARMS_ATTRIBUTE 22 >+#define APPLICATION_NAME_ATTRIBUTE "application_executable" >+#define STRLEN_APPLICATION_NAME_ATTRIBUTE 22 >+#define PROCESS_OPTIONS_ATTRIBUTE "process_options" >+#define STRLEN_PROCESS_OPTIONS_ATTRIBUTE 15 >+#define SEQUENCE_COUNTER_ATTRIBUTE "sequenceCounter" >+#define STRLEN_SEQUENCE_COUNTER_ATTRIBUTE 15 >+#define CONTEXT_DATA_ATTRIBUTE "contextData" >+#define STRLEN_CONTEXT_DATA_ATTRIBUTE 11 >+#define AGENT_VERSION_ATTRIBUTE "version" >+#define STRLEN_AGENT_VERSION_ATTRIBUTE 7 >+#define LINE_NUMBER_ATTRIBUTE "line_number" >+#define STRLEN_LINE_NUMBER_ATTRIBUTE 11 >+#define OBJECT_OWNER_ATTRIBUTE "ownerObjIdRef" >+#define STRLEN_OBJECT_OWNER_ATTRIBUTE 13 >+#define OBJECT_TARGET_ATTRIBUTE "targetObjIdRef" >+#define STRLEN_OBJECT_TARGET_ATTRIBUTE 14 >+#define OBJECT_ARRAY_INDEX_ATTRIBUTE "objArrayIndex" >+#define STRLEN_OBJECT_ARRAY_INDEX_ATTRIBUTE 13 >+#define OBJECT_FIELD_INDEX_ATTRIBUTE "fieldIndex" >+#define STRLEN_OBJECT_FIELD_INDEX_ATTRIBUTE 10 >+#define HEAPDUMP_IDREF_ATTRIBUTE "heapDumpIdRef" >+#define STRLEN_HEAPDUMP_IDREF_ATTRIBUTE 13 >+#define HEAPDUMP_ID_ATTRIBUTE "heapDumpId" >+#define STRLEN_HEAPDUMP_ID_ATTRIBUTE 10 >+#define AGENT_TYPE_ATTRIBUTE "agentType" >+#define STRLEN_AGENT_TYPE_ATTRIBUTE 9 >+#define BASETIME_ATTRIBUTE "basetime" >+#define STRLEN_BASETIME_ATTRIBUTE 8 >+ >+/* The following 3 constants were added for bug 135437 (preAgg piAgent). >+ * A second version of bastetime (ie: baseTime) was added because that >+ * is the preferred casing of the loader going forward but the old >+ * casing is needed for backward compatability >+ */ >+#define BASETIME1_ATTRIBUTE "baseTime" >+#define STRLEN_BASETIME1_ATTRIBUTE 8 >+#define MAXTIME_ATTRIBUTE "maxTime" >+#define STRLEN_MAXTIME_ATTRIBUTE 7 >+#define MINTIME_ATTRIBUTE "minTime" >+#define STRLEN_MINTIME_ATTRIBUTE 7 >+ >+#define CLASS_OWNER_ATTRIBUTE "ownerClassIdRef" >+#define STRLEN_CLASS_OWNER_ATTRIBUTE 15 >+#define OVERHEAD_ATTRIBUTE "overhead" >+#define STRLEN_OVERHEAD_ATTRIBUTE 8 >+#define GC_ROOT_TYPE_ATTRIBUTE "type" >+#define STRLEN_GC_ROOT_TYPE_ATTRIBUTE 4 >+#define HEAPDUMP_FIRST_SEEN_ATTRIBUTE "firstSeenIndex" >+#define STRLEN_HEAPDUMP_FIRST_SEEN_ATTRIBUTE 14 >+ >+#define TIMEOUT_ATTRIBUTE "timeout" >+#define STRLEN_TIMEOUT_ATTRIBUTE 7 >+#define THREAD_OWNER_ATTRIBUTE "threadOwner" >+#define STRLEN_THREAD_OWNER_ATTRIBUTE 11 >+ >+/* XML Attribute Values */ >+#define CLASS_VALUE "CLASS" >+#define METHOD_VALUE "METHOD" >+#define INCLUDE_VALUE "INCLUDE" >+#define EXCLUDE_VALUE "EXCLUDE" >+#define PREFIX_VALUE "PREFIX" >+#define SUFFIX_VALUE "SUFFIX" >+#define NONE_VALUE "NONE" >+ >+#endif >Index: src-native-new/src/HCLauncher/hclaunch.h >=================================================================== >RCS file: src-native-new/src/HCLauncher/hclaunch.h >diff -N src-native-new/src/HCLauncher/hclaunch.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/hclaunch.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,114 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: hclaunch.h,v 1.2 2005/02/25 22:17:35 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+/* DO NOT EDIT THIS FILE - it is machine generated */ >+#include <jni.h> >+/* Header for class org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl */ >+ >+#ifndef _Included_org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl >+#define _Included_org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl >+#ifdef __cplusplus >+extern "C" { >+#endif >+/* Inaccessible static: originalProcessEnvironment */ >+/* >+ * Class: org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl >+ * Method: getNativeSystemEnvironment0 >+ * Signature: ()[Ljava/lang/Object; >+ */ >+JNIEXPORT jobjectArray JNICALL Java_org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl_getNativeSystemEnvironment0 >+ (JNIEnv *, jobject); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif >+/* Header for class org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl */ >+ >+#ifndef _Included_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+#define _Included_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+#ifdef __cplusplus >+extern "C" { >+#endif >+/* >+ * Class: org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+ * Method: startProcess0 >+ * Signature: ()I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_startProcess0 >+ (JNIEnv *, jobject); >+ >+/* >+ * Class: org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+ * Method: killProcess0 >+ * Signature: ()V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_killProcess0 >+ (JNIEnv *, jobject); >+ >+/* >+ * Class: org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+ * Method: writeToProcess0 >+ * Signature: (C)V >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_writeToProcess0 >+ (JNIEnv *, jobject, jchar); >+ >+/* >+ * Class: org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+ * Method: readFromProcessOutput0 >+ * Signature: ()I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessOutput0 >+ (JNIEnv *, jobject); >+ >+/* >+ * Class: org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+ * Method: readFromProcessError0 >+ * Signature: ()I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessError0 >+ (JNIEnv *, jobject); >+ >+/* >+ * Class: org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl >+ * Method: getProcessStatus0 >+ * Signature: (I)I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_getProcessStatus0 >+ (JNIEnv *, jobject, jint); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif >+/* Header for class org_eclipse_hyades_execution_core_IExecutionComponent */ >+ >+#ifndef _Included_org_eclipse_hyades_execution_core_IExecutionComponent >+#define _Included_org_eclipse_hyades_execution_core_IExecutionComponent >+#ifdef __cplusplus >+extern "C" { >+#endif >+#undef org_eclipse_hyades_execution_core_IExecutionComponent_INACTIVE >+#define org_eclipse_hyades_execution_core_IExecutionComponent_INACTIVE 0L >+#undef org_eclipse_hyades_execution_core_IExecutionComponent_NOT_CONFIGURED >+#define org_eclipse_hyades_execution_core_IExecutionComponent_NOT_CONFIGURED 1L >+#undef org_eclipse_hyades_execution_core_IExecutionComponent_READY >+#define org_eclipse_hyades_execution_core_IExecutionComponent_READY 2L >+#undef org_eclipse_hyades_execution_core_IExecutionComponent_SUSPENDED >+#define org_eclipse_hyades_execution_core_IExecutionComponent_SUSPENDED 3L >+#undef org_eclipse_hyades_execution_core_IExecutionComponent_DEAD >+#define org_eclipse_hyades_execution_core_IExecutionComponent_DEAD 4L >+#ifdef __cplusplus >+} >+#endif >+#endif >Index: src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.make >=================================================================== >RCS file: src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.make >diff -N src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.make >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/perfmon/PerfmonAgent/PerfmonAgent.make 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,107 @@ >+ >+################################################################################ >+# >+# makefile: PerfmonAgent project >+# >+# $Id: PerfmonAgent.make,v 1.9 2007/03/22 00:00:00 samwai Exp $ >+################################################################################ >+ >+ >+#----------------------------------- >+# >+# Customizable section >+# >+#----------------------------------- >+TARGET := LinuxAgent >+TARGETDIR := ../../../../bin >+ >+ >+#----------------------------------- >+# list of additional INCLUDE directories to search headers from >+# (separated by blanks) >+#----------------------------------- >+ >+INCLUDEDIRS := . ../resutils >+ >+ >+#----------------------------------- >+# list of additional libraries to be linked with >+# (separated by blanks) >+#----------------------------------- >+ >+LIBS := dl pthread resutils >+ >+#----------------------------------- >+# list of additional library directories to search from >+# (separated by blanks) >+#----------------------------------- >+ >+LIBDIRS := ../../../../lib >+ >+ >+#----------------------------------- >+# >+# Compiler options >+# >+# -g produce debug info >+# -Wall enable all types of warnings >+# -O3 highest level of code optimization >+# -fPIC generate position-independent code (PIC). >+# This is required for building shared library. >+# -c compile only >+# >+# Linking options >+# >+# -Wl pass options to linker >+# -shared produce shared library >+# -L add the given directory to the search path for libraries >+# >+#----------------------------------- >+ >+CFLAGS := $(C_FLAGS) $(DEBUGABLE) -Wall $(OPTIMIZABLE) -fPIC $(addprefix -I,$(INCLUDEDIRS)) -D_LINUX_X86 -D_TPTP_DIAGNOSTIC_ -DLINUX >+ >+CXXFLAGS := $(CFLAGS) >+ >+LINKOPTS := $(L_FLAGS) $(DEBUGABLE) -o $(TARGETDIR)/$(TARGET) $(addprefix -L,$(LIBDIRS)) -DLINUX >+ >+ >+#----------------------------------- >+# general commands and options >+#----------------------------------- >+ >+CC := gcc >+CXX := $(CC) >+ >+SOURCE := $(wildcard *.c) $(wildcard *.cpp) >+ >+OBJS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) >+ >+REMOVEFILE := rm -f >+CREATELINK := ln -sf >+ >+ >+#----------------------------------- >+# "make" rules >+#----------------------------------- >+ >+.PHONY : default everything objs clean veryclean rebuild $(TARGET) >+ >+ >+default : $(TARGET) >+ >+ >+objs : $(OBJS) >+ >+ >+clean : >+ $(REMOVEFILE) *.o >+ >+veryclean: clean >+ $(REMOVEFILE) $(TARGETDIR)/$(TARGET) >+ >+rebuild: veryclean everything >+ >+ >+$(TARGET) : $(OBJS) >+ $(CC) $(LINKOPTS) $(OBJS) $(addprefix -l,$(LIBS)) >+ >Index: src-native-new/src/HCLauncher/hclaunch.c >=================================================================== >RCS file: src-native-new/src/HCLauncher/hclaunch.c >diff -N src-native-new/src/HCLauncher/hclaunch.c >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/HCLauncher/hclaunch.c 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,922 @@ >+/********************************************************************** >+Copyright (c) 2005, 2007 IBM Corporation and others. >+All rights reserved. This program and the accompanying materials >+are made available under the terms of the Eclipse Public License v1.0 >+which accompanies this distribution, and is available at >+http://www.eclipse.org/legal/epl-v10.html >+$Id: hclaunch.c,v 1.10 2007/02/28 16:24:39 samwai Exp $ >+ >+Contributors: >+ IBM Corporation - initial implementation >+**********************************************************************/ >+ >+#include "hclaunch.h" >+#include "launcher_common.h" >+#include "RAComm.h" >+ >+#ifdef _DEBUG >+FILE * trcFile; >+#endif >+ >+/* Function declaration */ >+char* callJNIStringMethod(JNIEnv *jenv, jobject jobj, char *method); >+long callJNILongMethod(JNIEnv *jenv, jobject jobj, char *method); >+int callJNIIntMethod(JNIEnv *jenv, jobject jobj, char *method); >+short callJNIShortMethod(JNIEnv *jenv, jobject jobj, char *method); >+void callJNIVoidMethod(JNIEnv *jenv, jobject jobj, char *method); >+jobject callJNIObjectMethod(JNIEnv *jenv, jobject jobj, char *method, int pos); >+void cleanupChild(int sig); >+ >+/* we only need to keep track of the processes on platforms other than Windows. >+ The java code keeps track of processes on Windows platforms */ >+ >+/* bugzilla 69642 start */ >+#ifndef _WIN32 >+#if defined(__linux__) && defined(__i386__) >+ /* Bug 141033 */ >+#else >+typedef struct child_process_list { >+ PID childProcessID; /* child process id of process launched */ >+ jobject processObject; /* associated processObject */ >+ struct child_process_list *next; >+} child_process_list_t; >+ >+child_process_list_t *child_processes = NULL; >+ >+ra_critsec_t process_lock; >+ >+#endif /* __linux__ && __i386__ */ >+#endif /* _WIN32 */ >+/* bugzilla 69642 end */ >+ >+/* Global reference to the JVM. */ >+static JavaVM *jvm = NULL; /* Bug 73453 */ >+ >+/* Globals */ >+RemoteConsole_t console; /* User console for receiving input */ >+jobject exeObj; >+ >+/* >+ * Called when JVM loads this DLL. This will register a signal handler for SIGCHLD on non-Windows platforms >+ */ >+ >+/* bugzilla 69642 -- do not #if 0 the code out */ >+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { >+#ifndef _WIN32 >+#if defined(__linux__) && defined(__i386__) >+ /* Bug 141033 */ >+#else >+ struct sigaction sigActSIGCHLD; >+ >+ /* Cleanup our children when they exit */ >+ BZERO(&sigActSIGCHLD, sizeof(struct sigaction)); >+ sigActSIGCHLD.sa_handler = &cleanupChild; >+ sigaction(SIGCHLD, &sigActSIGCHLD, NULL); >+ >+ ra_mutexCreate(&process_lock); >+#endif /* __linux__ && __i386__ */ >+#endif /* _WIN32 */ >+ >+ return JNI_VERSION_1_2; >+} >+ >+ >+/* bugzilla 69642 start */ >+#ifndef _WIN32 >+#if defined(__linux__) && defined(__i386__) >+ /* Bug 141033 */ >+#else >+static void addProcessToList(PID childPID, JNIEnv *jenv, jobject jobj) { >+ child_process_list_t *entry = (child_process_list_t *)ra_malloc(sizeof(child_process_list_t)); >+ if (entry == NULL) { >+ return; >+ } >+ >+ entry->childProcessID = childPID; >+ entry->processObject = ENV(jenv)->NewGlobalRef(ENVPARM(jenv) jobj); >+ ra_mutexEnter(&process_lock); >+ entry->next = child_processes; >+ child_processes = entry; >+ ra_mutexExit(&process_lock); >+} >+ >+static jobject removeProcessFromList(PID childPID) { >+ child_process_list_t *cur; >+ child_process_list_t *prev = NULL; >+ jobject returnObj = (int)NULL; >+ ra_mutexEnter(&process_lock); >+ cur = child_processes; >+ while (cur != NULL) { >+ if (cur->childProcessID == childPID) { >+ if (prev != NULL) { >+ prev->next = cur->next; >+ } >+ else { >+ child_processes = cur->next; >+ } >+ returnObj = cur->processObject; >+ ra_free(cur); >+ break; >+ } >+ prev = cur; >+ cur = cur->next; >+ } >+ ra_mutexExit(&process_lock); >+ return returnObj; >+} >+#endif /* __linux__ && __i386__ */ >+#endif /* _WIN32 */ >+/* bugzilla 69642 end */ >+ >+/* >+ * This is called by the ProcessExecutorImpl to launch a process. The process object is obtained from the executor through JNI. >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_startProcess0 >+ (JNIEnv *jenv, jobject jobj) { >+ >+ char *exe = NULL; >+ char *cmdline = NULL; >+ char *location = NULL; >+ char *env = NULL; >+ jclass jcls = (int)NULL; >+ PID childPID = 0; /* The child process ID*/ >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ trcFile = fopen("startProcess.dbg", "w"); >+ fprintf(trcFile,"startProcess: start\n"); >+ fflush(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ ENV(jenv)->GetJavaVM(ENVPARM(jenv) &jvm); >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ >+ /* TODO will fix up the package name once it is finalized */ >+ if(jcls != (int)NULL) { >+/* jobject exeObj = NULL; */ >+ jfieldID exeObjID = (int)NULL; >+ jfieldID envObjID = (int)NULL; >+ >+ /* Find the IExecutableObject and get the exe, cmdline, and location for launch */ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ exeObjID = ENV(jenv)->GetFieldID(ENVPARM(jenv) jcls, "exeObj", "Lorg/eclipse/hyades/execution/core/IExecutableObject;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(exeObjID != (int)NULL) { >+ exeObj = ENV(jenv)->GetObjectField(ENVPARM(jenv) jobj, exeObjID); >+ if(exeObj != (int)NULL) { >+#ifdef __OS400__ >+ #pragma convert(819) /* Bug 68899 */ >+#endif >+ /* The returned strings are already in the native encoding */ >+ exe = callJNIStringMethod(jenv, exeObj, "getExe"); >+ cmdline = callJNIStringMethod(jenv, exeObj, "getCommandLine"); >+ location = callJNIStringMethod(jenv, exeObj, "getLocation"); >+#ifdef __OS400__ >+ #pragma convert(0) /* Bug 68899 */ >+#endif >+ >+ if(exe == NULL) { >+ return ERROR_JNI_LAUNCH_EXE_NAME; /* Can't resolve the exe name */ >+ } >+ if(cmdline == NULL) { >+ return ERROR_JNI_LAUNCH_CMD_LINE; /* Can't resolve the cmd line string */ >+ } >+ >+ /* RKD: If the location is NULL, we should just run in teh default location >+ if(location == NULL) { >+ return ERROR_JNI_LAUNCH_LOCATION; /* Can't resolve the location string >+ } >+ */ >+ } >+ else { >+ return ERROR_JNI_LAUNCH_EXE_OBJ; /* Can't find the exe obj */ >+ } >+ } >+ else { >+ return ERROR_JNI_LAUNCH_EXE_OBJ_ID; /* Can't find the exe obj id */ >+ } >+ >+ /* Find the processEnvironment array to construct the env parameter */ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envObjID = ENV(jenv)->GetFieldID(ENVPARM(jenv) jcls, "processEnvironment", "[Lorg/eclipse/hyades/execution/core/IOrderedProperty;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(envObjID != (int)NULL) { >+ jobjectArray envObjArray = (int)NULL; >+ >+ envObjArray = (jobjectArray)ENV(jenv)->GetObjectField(ENVPARM(jenv) jobj, envObjID); >+ if(envObjArray != (int)NULL) { >+ jsize numEnv; >+ >+ >+ numEnv = ENV(jenv)->GetArrayLength(ENVPARM(jenv) envObjArray); >+ if(numEnv) { >+ char *current; >+ jsize i; >+ jsize envBufferSize; >+ >+ envBufferSize=sizeof(char) * numEnv * 256; /* Estimate a max 256 char per environment */ >+ env = (char*)malloc(envBufferSize); >+ current = env; /* Pointer that moves to navigate the env block */ >+ BZERO(env,envBufferSize); >+ >+ for(i = 0; i < numEnv; i++) { >+ jclass propClass = (int)NULL; >+ jstring envName = (int)NULL; >+ jfieldID envNameID = (int)NULL; >+ jfieldID envValueID = (int)NULL; >+ jobject envObj = (int)NULL; >+ jobject envValues = (int)NULL; >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ propClass = ENV(jenv)->FindClass(ENVPARM(jenv) "org/eclipse/hyades/execution/core/impl/OrderedPropertyImpl"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(propClass == (int)NULL) { >+ return ERROR_JNI_LAUNCH_PROP_CLASSS; /* Can't find the property class */ >+ } >+ >+ envObj = ENV(jenv)->GetObjectArrayElement(ENVPARM(jenv) envObjArray, i); /* Get the object at index i */ >+ if(envObj == (int)NULL) { >+ return ERROR_JNI_LAUNCH_ENV_OBJARRAY; /* Can't find the env obj array */ >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envNameID = ENV(jenv)->GetFieldID(ENVPARM(jenv) propClass, "name", "Ljava/lang/String;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(envNameID == (int)NULL) { >+ return ERROR_JNI_LAUNCH_ENV_NAME_ID; /* Can't find the env name id */ >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envValueID = ENV(jenv)->GetFieldID(ENVPARM(jenv) propClass, "values", "Ljava/util/Vector;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(envValueID == (int)NULL) { >+ return ERROR_JNI_LAUNCH_ENV_VALUE_ID; /* Can't find the env value id */ >+ } >+ >+ envName = (jstring)ENV(jenv)->GetObjectField(ENVPARM(jenv) envObj, envNameID); >+ if(envName == (int)NULL) { >+ continue; /* Bug 143566 */ >+ /* return ERROR_JNI_LAUNCH_ENV_NAME; */ /* Can't find the env name */ >+ } >+ >+ envValues = ENV(jenv)->GetObjectField(ENVPARM(jenv) envObj, envValueID); >+ if(envValues == (int)NULL) { >+ return ERROR_JNI_LAUNCH_ENV_VALUE; /* Can't find the env value */ >+ } >+ >+ >+ if(envValues != (int)NULL) { >+ jstring envStr; >+ int j, size; >+ char* envname; >+ char* envvalue; >+ >+ /* get the environment name */ >+ envname = copyJavaStringToNative(jenv, envName); >+ if(envname != NULL) { >+ /* Ensure we have room in the buffer (include the '=' sign and null hense the 2) */ >+ while(current+strlen(envname)+2>env+envBufferSize) { >+ char *tempEnv; >+ jsize offset; >+ jsize newSize=envBufferSize<<1; >+ tempEnv=(char*)malloc(newSize); >+ >+ offset=current-env; >+ >+ memcpy(tempEnv, env, offset); >+ current=tempEnv+offset; >+ free(env); >+ env=tempEnv; >+ envBufferSize=newSize; >+ } >+ >+ /* Copy the env name to the buffer */ >+ memcpy(current, envname, strlen(envname)); >+ current += strlen(envname); >+#ifdef MVS >+#pragma convlit(suspend) >+#endif >+ *current='='; >+#ifdef MVS >+#pragma convlit(resume) >+#endif >+ current += 1; >+ ra_free(envname); /* Bug 103601 */ >+ envname=NULL; >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ size = callJNIIntMethod(jenv, envValues, "size"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ >+ /* Copy the values to the buffer */ >+ for(j = 0; j < size; j++) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envStr = (jstring)callJNIObjectMethod(jenv, envValues, "elementAt", j); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ >+ envvalue = copyJavaStringToNative(jenv, envStr); >+ if(envvalue != NULL) { >+ /* Ensure we have room in the buffer (include the path separator and double null terminator hense the 3) */ >+ while(current+strlen(envvalue)+3>env+envBufferSize) { >+ char *tempEnv; >+ jsize offset; >+ jsize newSize=envBufferSize<<1; >+ tempEnv=(char*)malloc(newSize); >+ >+ offset=current-env; >+ >+ memcpy(tempEnv, env, offset); >+ current=tempEnv+offset; >+ env=tempEnv; >+ envBufferSize=newSize; >+ } >+ >+ if(j > 0) { >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ *current=FILE_PATH_SEPARATOR; >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ current++; >+ } >+ >+ memcpy(current, envvalue, strlen(envvalue)); >+ current += strlen(envvalue); >+ >+ ra_free(envvalue); /* Bug 103601 */ >+ envvalue=NULL; >+ } /* envvalue != NULL */ >+ else { >+ /* envvalue == NULL */ >+ } >+ } /* for */ >+ *current='\0'; /* Finished appending all values */ >+ current++; >+ } /* envname != NULL */ >+ else { >+ /* envname == NULL */ >+ } >+ } >+ } >+ /* Copy an ending null when all properties are processed */ >+ *current='\0'; >+ current++; >+ } >+ } >+ else { >+ return ERROR_JNI_LAUNCH_ENV_OBJARRAY_ID; /* Can't find the env obj array id */ >+ } >+ } >+ else { >+ return ERROR_JNI_LAUNCH_ENV_OBJ_ID; /* Can't find the env obj id */ >+ } >+ } >+ else { >+ return ERROR_JNI_LAUNCH_EXE_CLS; /* Can't find the class */ >+ } >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(trcFile,"startProcess: launch process by calling hc_startProcess\n"); >+ fprintf(trcFile,"startProcess: exe = %s\n", exe); >+ fprintf(trcFile,"startProcess: cmdline = %s\n", cmdline); >+ fprintf(trcFile,"startProcess: location = %s\n", location); >+ fflush(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Attempt to launch process only if all required information exists. These are already checked above. */ >+ childPID = hc_startProcess(exe, cmdline, location, env, &console); >+ >+ /* bugzilla 69642 start */ >+#ifndef _WIN32 >+#if defined(__linux__) && defined(__i386__) >+ /* Bug 141033 */ >+#else >+ addProcessToList(childPID,jenv,jobj); >+#endif /* __linux__ && __i386__ */ >+#endif /* _WIN32 */ >+ /* bugzilla 69642 end */ >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(trcFile,"startProcess: started process - pid = %d\n", childPID); >+ fflush(trcFile); >+ fclose(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ return childPID; >+} >+ >+/* >+ * This is called by the ProcessExecutorImpl to kill a process. The pid to be kill is obtained from the executor through JNI. >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_killProcess0 >+ (JNIEnv *jenv, jobject jobj) { >+ >+ jclass jcls = (int)NULL; >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ >+ if(jcls != (int)NULL) { >+ jfieldID pidField = (int)NULL; >+ >+ /* Find the IExecutableObject and get the exe, cmdline, and location for launch */ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ pidField = ENV(jenv)->GetFieldID(ENVPARM(jenv) jcls, "pid", "I"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(pidField != (int)NULL) { >+ jint pid = 0; >+ >+ pid = ENV(jenv)->GetIntField(ENVPARM(jenv) jobj, pidField); >+ if(pid != 0) { >+ hc_killProcess(pid); >+ } >+ } >+ } >+ >+ return; >+} >+ >+/* >+ * This is called by the ProcessExecutorImpl to write a byte to the process's stdin stream. >+ */ >+JNIEXPORT void JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_writeToProcess0 >+ (JNIEnv *jenv, jobject jobj, jchar c) { >+ >+ hc_writeFileChar(console.in, (char)c); >+ >+ return; >+} >+ >+/* >+ * This is called by the ProcessExecutorImpl to read a byte from the process's stdout stream. >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessOutput0 >+ (JNIEnv *jenv, jobject jobj) { >+ char c[1]; >+ >+ if(hc_readFile(console.out, c, 1) <= 0) { >+ return (int)-1; >+ } >+ >+ return (int)c[0]; >+} >+ >+/* >+ * This is called by the ProcessExecutorImpl to read a byte from the process's stderr stream. >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_readFromProcessError0 >+ (JNIEnv *jenv, jobject jobj) { >+ char c[1]; >+ >+ if(hc_readFile(console.err, c, 1) <= 0) { >+ return (int)-1; >+ } >+ >+ return (int)c[0]; >+} >+ >+ >+/* >+ * This is called by the ProcessExecutorImpl to get the current process status. >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_hyades_execution_core_impl_ProcessExecutorImpl_getProcessStatus0 >+ (JNIEnv *jenv, jobject jobj, jint pid) { >+ >+ return hc_getProcessStatus(pid); >+} >+ >+ >+/* >+ * This is called by the ExecutionEnvironmentImpl to query the default system properties. >+ */ >+JNIEXPORT jobjectArray JNICALL Java_org_eclipse_hyades_execution_core_impl_ExecutionEnvironmentImpl_getNativeSystemEnvironment0 >+ (JNIEnv *jenv, jobject jobj) { >+ char sep[] = "="; >+ char *envName; >+ char *envValue; >+ int index = 0; >+ jclass envClass = (int)NULL; >+ jclass strClass = (int)NULL; >+ jobjectArray envArray = (int)NULL; >+ jmethodID envCtor = (int)NULL; >+ jmethodID appendValueID = (int)NULL; >+ jfieldID envNameID = (int)NULL; >+ jfieldID envValuesID = (int)NULL; >+ jobject envObj = (int)NULL; >+ jstring strObj = (int)NULL; >+ void* envStr = NULL; >+ int envOffset = 0; >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ trcFile = fopen("getenv.dbg", "w"); >+ fprintf(trcFile,"getNativeSystemEnvironment: start\n"); >+ fflush(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envClass = ENV(jenv)->FindClass(ENVPARM(jenv) "org/eclipse/hyades/execution/core/impl/OrderedPropertyImpl"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(envClass == (int)NULL) { >+ return (int)NULL; >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ strClass = ENV(jenv)->FindClass(ENVPARM(jenv) "java/lang/String"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(strClass == (int)NULL) { >+ return (int)NULL; >+ } >+ >+ envArray = ENV(jenv)->NewObjectArray(ENVPARM(jenv) MAX_ENV, envClass, (int)NULL); >+ if(envArray == (int)NULL) { >+ return (int)NULL; >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envCtor = ENV(jenv)->GetMethodID(ENVPARM(jenv) envClass, "<init>", "()V"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(envCtor == (int)NULL) { >+ return (int)NULL; >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ appendValueID = ENV(jenv)->GetMethodID(ENVPARM(jenv) envClass, "appendValue", "(Ljava/lang/Object;)V"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(appendValueID == (int)NULL) { >+ return (int)NULL; >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envNameID = ENV(jenv)->GetFieldID(ENVPARM(jenv) envClass, "name", "Ljava/lang/String;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(envNameID == (int)NULL) { >+ return (int)NULL; >+ } >+ >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ envValuesID = ENV(jenv)->GetFieldID(ENVPARM(jenv) envClass, "values", "Ljava/util/Vector;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(envValuesID == (int)NULL) { >+ return (int)NULL; >+ } >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(trcFile,"getNativeSystemEnvironment: about to get environment\n"); >+ fflush(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ /* Get the system environment */ >+ envStr = hc_getEnvironment(); >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(trcFile,"getNativeSystemEnvironment: got environment %p\n", envStr); >+ fflush(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ while(envOffset >= 0) { >+ /* Get the next name-value pair */ >+ envOffset = hc_getEnvironmentVariable(envStr, envOffset, &envName, &envValue); >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(trcFile,"getNativeSystemEnvironment: next envOffset = %d \n", envOffset); >+ fflush(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ if(envName != NULL) { >+ >+ /* Create the OrderedPropertyImpl object */ >+ envObj = ENV(jenv)->NewObject(ENVPARM(jenv) envClass, envCtor); >+ >+ /* Create a String object to store the property name and set it to the OrderedPropertyImpl object */ >+ strObj = ENV(jenv)->NewStringUTF(ENVPARM(jenv) envName); >+ ENV(jenv)->SetObjectField(ENVPARM(jenv) envObj, envNameID, strObj); >+ >+ /* Create a String object to store the property value and append it to the OrderedPropertyImpl object */ >+ if(envValue == NULL || *envValue == '\0') { >+ strObj = ENV(jenv)->NewStringUTF(ENVPARM(jenv) "\0"); /* Bug 68899 */ >+ } >+ else { >+ strObj = ENV(jenv)->NewStringUTF(ENVPARM(jenv) envValue); >+ } >+ ENV(jenv)->CallVoidMethod(ENVPARM(jenv) envObj, appendValueID, strObj); >+ >+ /* Add the completed OrderedPropertyImpl object to the array */ >+ ENV(jenv)->SetObjectArrayElement(ENVPARM(jenv) envArray, index, envObj); >+ >+ /* free the temporary space for the name and value */ >+ free(envName); >+ free(envValue); >+ >+ index++; >+ } >+ } >+ >+ #ifdef _DEBUG >+ #ifdef MVS >+ #pragma convlit(suspend) >+ #endif >+ fprintf(trcFile,"getNativeSystemEnvironment: %d environment variables were found\n", index); >+ fflush(trcFile); >+ fclose(trcFile); >+ #ifdef MVS >+ #pragma convlit(resume) >+ #endif >+ #endif >+ >+ return envArray; >+} >+ >+ >+/* >+ * JNI helper functions >+ */ >+ >+/* Call the CallObjectMethod with object type String and no arg */ >+char* callJNIStringMethod(JNIEnv *jenv, jobject jobj, char *method) { >+ char *rc = NULL; >+ jclass jcls = (int)NULL; >+ jmethodID jmethod = (int)NULL; >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ if(jcls != (int)NULL) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ jmethod = ENV(jenv)->GetMethodID(ENVPARM(jenv) jcls, method, "()Ljava/lang/String;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(jmethod != (int)NULL) { >+ jstring result=(jstring)ENV(jenv)->CallObjectMethod(ENVPARM(jenv) jobj, jmethod); >+ if(result != (int)NULL) { >+ rc = copyJavaStringToNative(jenv, result); >+ } >+ } >+ } >+ >+ return rc; >+} >+ >+/* Call the CallLongMethod with object type long and no arg */ >+long callJNILongMethod(JNIEnv *jenv, jobject jobj, char *method) { >+ long rc = 0; >+ jclass jcls = (int)NULL; >+ jmethodID jmethod = (int)NULL; >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ if(jcls != (int)NULL) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ jmethod = ENV(jenv)->GetMethodID(ENVPARM(jenv) jcls, method, "()J"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(jmethod != (int)NULL) { >+#if defined (__OS400__) >+ rc = (ENV(jenv)->CallLongMethod(ENVPARM(jenv) jobj, jmethod)).ll; >+#else >+ rc = (long)(ENV(jenv)->CallLongMethod(ENVPARM(jenv) jobj, jmethod)); >+#endif >+ } >+ } >+ >+ return rc; >+} >+ >+/* Call the CallIntMethod with object type int and no arg */ >+int callJNIIntMethod(JNIEnv *jenv, jobject jobj, char *method) { >+ int rc = 0; >+ jclass jcls = (int)NULL; >+ jmethodID jmethod = (int)NULL; >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ if(jcls != (int)NULL) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ jmethod = ENV(jenv)->GetMethodID(ENVPARM(jenv) jcls, method, "()I"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(jmethod != (int)NULL) { >+ rc = (int)(ENV(jenv)->CallIntMethod(ENVPARM(jenv) jobj, jmethod)); >+ } >+ } >+ >+ return rc; >+} >+ >+/* Call the CallShortMethod with object type short and no arg */ >+short callJNIShortMethod(JNIEnv *jenv, jobject jobj, char *method) { >+ short rc = 0; >+ jclass jcls = (int)NULL; >+ jmethodID jmethod = (int)NULL; >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ if(jcls != (int)NULL) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ jmethod = ENV(jenv)->GetMethodID(ENVPARM(jenv) jcls, method, "()S"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(jmethod != (int)NULL) { >+ rc = (short)(ENV(jenv)->CallShortMethod(ENVPARM(jenv) jobj, jmethod)); >+ } >+ } >+ >+ return rc; >+} >+ >+/* Call the CallVoidMethod with object type void and no arg */ >+void callJNIVoidMethod(JNIEnv *jenv, jobject jobj, char *method) { >+ jclass jcls = (int)NULL; >+ jmethodID jmethod = (int)NULL; >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ if(jcls != (int)NULL) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ jmethod = ENV(jenv)->GetMethodID(ENVPARM(jenv) jcls, method, "()V"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(jmethod != (int)NULL) { >+ ENV(jenv)->CallVoidMethod(ENVPARM(jenv) jobj, jmethod); >+ } >+ } >+} >+ >+/* Call the CallObjectMethod with object type Object and 1 arg */ >+jobject callJNIObjectMethod(JNIEnv *jenv, jobject jobj, char *method, int pos) { >+ jobject rc = 0; >+ jclass jcls = (int)NULL; >+ jmethodID jmethod = (int)NULL; >+ >+ jcls = ENV(jenv)->GetObjectClass(ENVPARM(jenv) jobj); >+ if(jcls != (int)NULL) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ jmethod = ENV(jenv)->GetMethodID(ENVPARM(jenv) jcls, method, "(I)Ljava/lang/Object;"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ if(jmethod != (int)NULL) { >+ rc = (jobject)(ENV(jenv)->CallObjectMethod(ENVPARM(jenv) jobj, jmethod, pos)); >+ } >+ } >+ >+ return rc; >+} >+ >+/* >+ * A signal handler routine. Called when a child exits. >+ */ >+/* bugzilla 69642 start */ >+void cleanupChild(int sig) { >+#ifndef _WIN32 >+#if defined(__linux__) && defined(__i386__) >+ /* Bug 141033 */ >+#else >+ JNIEnv *jenv; >+ int result, status; >+ PID childPID; >+ jobject processObj; >+ >+ /* Bug 73453: If somehow the jvm is not initialized, skip this function */ >+ if(jvm == NULL) { >+ return; >+ } >+ >+ childPID = wait(&status); >+ processObj = removeProcessFromList(childPID); >+ >+ /* Attach the current thread to the JVM */ >+#if defined __cplusplus && defined _HPUX >+ result = ENV(jvm)->AttachCurrentThread((void**)&jenv, NULL); >+#else >+ result = (*jvm)->AttachCurrentThread(jvm, (void**)&jenv, NULL); >+#endif >+ >+ if (processObj != (int)NULL) { >+ if(result == 0) { >+#ifdef __OS400__ >+#pragma convert(819) /* Bug 68899 */ >+#endif >+ callJNIVoidMethod(jenv, processObj, "processExited"); >+#ifdef __OS400__ >+#pragma convert(0) /* Bug 68899 */ >+#endif >+ } >+ ENV(jenv)->DeleteGlobalRef(ENVPARM(jenv) processObj); >+ } >+ >+#endif /* __linux__ && __i386__ */ >+#endif /* _WIN32 */ >+ >+ return; >+} >+/* bugzilla 69642 end */ >Index: src-native-new/src/agents/native/heapsnapshots/HeapSnapshotManager.h >=================================================================== >RCS file: src-native-new/src/agents/native/heapsnapshots/HeapSnapshotManager.h >diff -N src-native-new/src/agents/native/heapsnapshots/HeapSnapshotManager.h >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-native-new/src/agents/native/heapsnapshots/HeapSnapshotManager.h 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,35 @@ >+/********************************************************************** >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: HeapSnapshotManager.h,v 1.3 2005/02/25 22:17:34 hleung Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+#ifndef HEAP_SNAPSHOT_MANAGER_H >+#define HEAP_SNAPSHOT_MANAGER_H >+ >+#include <jvmpi.h> >+ >+typedef enum HeapDumpMode { >+ notAsking, >+ askingForDumpPopulation, >+ askingForDumpReferences, >+ askingForMarkGeneration >+} HeapDumpMode; >+ >+class HeapSnapshotManager { >+ public: >+ virtual char isStateless() const = 0; >+ virtual void handleHeapSnapshot(JNIEnv* env, >+ int dump_level, >+ char* begin, >+ char* end, >+ HeapDumpMode heapDumpMode) = 0; >+}; >+ >+#endif /* HEAP_SNAPSHOT_MANAGER_H */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 121658
:
61110
| 62142