You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by mo...@apache.org on 2009/09/30 10:47:28 UTC

svn commit: r820239 - /incubator/kato/trunk/org.apache.kato/kato.native/kato.native.cjvmti/src/main/native/cjvmti.c

Author: monteith
Date: Wed Sep 30 10:47:28 2009
New Revision: 820239

URL: http://svn.apache.org/viewvc?rev=820239&view=rev
Log:
Merge in changes from Paul Sobek - support to change frame and reference depth.

Modified:
    incubator/kato/trunk/org.apache.kato/kato.native/kato.native.cjvmti/src/main/native/cjvmti.c

Modified: incubator/kato/trunk/org.apache.kato/kato.native/kato.native.cjvmti/src/main/native/cjvmti.c
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.native/kato.native.cjvmti/src/main/native/cjvmti.c?rev=820239&r1=820238&r2=820239&view=diff
==============================================================================
--- incubator/kato/trunk/org.apache.kato/kato.native/kato.native.cjvmti/src/main/native/cjvmti.c (original)
+++ incubator/kato/trunk/org.apache.kato/kato.native/kato.native.cjvmti/src/main/native/cjvmti.c Wed Sep 30 10:47:28 2009
@@ -353,7 +353,7 @@
 int initAgent(){
 	static int dumpCount;
 	time_t creationTime;
-	INT64 longCreationTime;
+	__int64 longCreationTime;
 	struct tm  * dumpTime;
 	char fileName[50];
 	int nameType = 0; // Switches between timestamping the file and not
@@ -392,8 +392,8 @@
 	fwrite(&endianCheck, sizeof(int), 1, variableFile);
 	fprintf(variableFile, "CJVMTI V0.01");
 
-	longCreationTime = (INT64) creationTime; // Ensure that time is written as a long long.
-	fwrite(&longCreationTime, sizeof(INT64), 1, variableFile);
+	longCreationTime = (_int64) creationTime; // Ensure that time is written as a long long.
+	fwrite(&longCreationTime, sizeof(_int64), 1, variableFile);
 	dumpCount++;
 	return 1;
 }
@@ -404,6 +404,8 @@
 	jvmtiError err;
 	jvmtiCapabilities caps;
 	jvmtiEventCallbacks callbacks;
+	char * frameDepthChar;
+	char * referenceDepthChar;
 
 
 	printf("CJVMTI v0.1 \n");
@@ -460,6 +462,31 @@
 	_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
 	_CrtDumpMemoryLeaks();
 #endif
+
+	if (options != NULL){
+		frameDepthChar = strtok(options, ",");
+		referenceDepthChar = strtok(NULL, ",");
+		if (frameDepthChar == NULL || referenceDepthChar == NULL)
+		{
+			maxReferenceDepth = 0;
+			maxFrameDepth = 0;
+			printf("Unlimited frame depth and reference depth set\n");
+			return JNI_OK;
+		}
+
+		maxFrameDepth = atoi(frameDepthChar);
+		maxReferenceDepth = atoi(referenceDepthChar);
+		if (maxFrameDepth != 0 || maxReferenceDepth != 0)
+		{
+			printf("Frame Depth %s ReferenceDepth %s \n", frameDepthChar, referenceDepthChar);
+		}else{
+			printf("Unlimited frame depth and reference depth set\n");
+		}
+	}else{
+		maxReferenceDepth = 0;
+		maxFrameDepth = 0;
+		printf("Unlimited frame depth and reference depth set\n");
+	}
 	return JNI_OK;
 }