< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t003/sp06t003.cpp

Print this page
rev 52100 : 8212082: Remove the NSK_CPP_STUB macros for remaining vmTestbase/jvmti/[sS]*
Summary:
Reviewed-by:

*** 141,152 **** /** * Generate missed events (COMPILED_METHOD_LOAD only). */ static int generateEvents() { ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(GenerateEvents, jvmti, JVMTI_EVENT_COMPILED_METHOD_LOAD))) { nsk_jvmti_setFailStatus(); return NSK_FALSE; } return NSK_TRUE; } --- 141,151 ---- /** * Generate missed events (COMPILED_METHOD_LOAD only). */ static int generateEvents() { ! if (!NSK_JVMTI_VERIFY(jvmti->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD))) { nsk_jvmti_setFailStatus(); return NSK_FALSE; } return NSK_TRUE; }
*** 175,186 **** threadsDesc[i].location = NSK_JVMTI_INVALID_JLOCATION; threadsDesc[i].methodCompiled = NSK_FALSE; } /* get all live threads */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(GetAllThreads, jvmti, &allThreadsCount, &allThreadsList))) return NSK_FALSE; if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL)) return NSK_FALSE; --- 174,184 ---- threadsDesc[i].location = NSK_JVMTI_INVALID_JLOCATION; threadsDesc[i].methodCompiled = NSK_FALSE; } /* get all live threads */ ! if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&allThreadsCount, &allThreadsList))) return NSK_FALSE; if (!NSK_VERIFY(allThreadsCount > 0 && allThreadsList != NULL)) return NSK_FALSE;
*** 189,200 **** jvmtiThreadInfo threadInfo; if (!NSK_VERIFY(allThreadsList[i] != NULL)) return NSK_FALSE; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo))) return NSK_FALSE; if (threadInfo.name != NULL) { int j; --- 187,197 ---- jvmtiThreadInfo threadInfo; if (!NSK_VERIFY(allThreadsList[i] != NULL)) return NSK_FALSE; ! if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo))) return NSK_FALSE; if (threadInfo.name != NULL) { int j;
*** 207,218 **** } } } /* deallocate all threads list */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)allThreadsList))) return NSK_FALSE; /* check if all tested threads found */ found = 0; for (i = 0; i < THREADS_COUNT; i++) { --- 204,214 ---- } } } /* deallocate all threads list */ ! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)allThreadsList))) return NSK_FALSE; /* check if all tested threads found */ found = 0; for (i = 0; i < THREADS_COUNT; i++) {
*** 229,244 **** /* get threads class and frame method */ NSK_DISPLAY0("Find tested methods:\n"); for (i = 0; i < THREADS_COUNT; i++) { if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = ! NSK_CPP_STUB2(GetObjectClass, jni, threadsDesc[i].thread)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].method = ! NSK_CPP_STUB4(GetMethodID, jni, threadsDesc[i].cls, ! threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL)) return NSK_FALSE; NSK_DISPLAY4(" thread #%d (%s): 0x%p (%s)\n", i, threadsDesc[i].threadName, (void*)threadsDesc[i].method, --- 225,239 ---- /* get threads class and frame method */ NSK_DISPLAY0("Find tested methods:\n"); for (i = 0; i < THREADS_COUNT; i++) { if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = ! jni->GetObjectClass(threadsDesc[i].thread)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].method = ! jni->GetMethodID(threadsDesc[i].cls, threadsDesc[i].methodName, threadsDesc[i].methodSig)) != NULL)) return NSK_FALSE; NSK_DISPLAY4(" thread #%d (%s): 0x%p (%s)\n", i, threadsDesc[i].threadName, (void*)threadsDesc[i].method,
*** 246,259 **** } /* make global refs */ for (i = 0; i < THREADS_COUNT; i++) { if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread) ! NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].thread)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = (jclass) ! NSK_CPP_STUB2(NewGlobalRef, jni, threadsDesc[i].cls)) != NULL)) return NSK_FALSE; } NSK_DISPLAY0("Enable tested events\n"); if (!nsk_jvmti_enableEvents(JVMTI_ENABLE, EVENTS_COUNT, eventsList, NULL)) --- 241,254 ---- } /* make global refs */ for (i = 0; i < THREADS_COUNT; i++) { if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].thread = (jthread) ! jni->NewGlobalRef(threadsDesc[i].thread)) != NULL)) return NSK_FALSE; if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls = (jclass) ! jni->NewGlobalRef(threadsDesc[i].cls)) != NULL)) return NSK_FALSE; } NSK_DISPLAY0("Enable tested events\n"); if (!nsk_jvmti_enableEvents(JVMTI_ENABLE, EVENTS_COUNT, eventsList, NULL))
*** 269,285 **** int i; for (i = 0; i < THREADS_COUNT; i++) { if (suspend) { NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(SuspendThread, jvmti, threadsDesc[i].thread))) nsk_jvmti_setFailStatus(); } else { NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(ResumeThread, jvmti, threadsDesc[i].thread))) nsk_jvmti_setFailStatus(); } } return NSK_TRUE; } --- 264,278 ---- int i; for (i = 0; i < THREADS_COUNT; i++) { if (suspend) { NSK_DISPLAY2(" suspend thread #%d (%s)\n", i, threadsDesc[i].threadName); ! if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(threadsDesc[i].thread))) nsk_jvmti_setFailStatus(); } else { NSK_DISPLAY2(" resume thread #%d (%s)\n", i, threadsDesc[i].threadName); ! if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(threadsDesc[i].thread))) nsk_jvmti_setFailStatus(); } } return NSK_TRUE; }
*** 310,331 **** strcpy(kind, threadsDesc[i].methodCompiled ? "compiled " : "not compiled "); strcat(kind, kind0); NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName); /* get frame count */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(GetFrameCount, jvmti, ! threadsDesc[i].thread, &frameCount))) { nsk_jvmti_setFailStatus(); return NSK_TRUE; } NSK_DISPLAY1(" frameCount: %d\n", (int)frameCount); /* get stack trace */ if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB6(GetStackTrace, jvmti, threadsDesc[i].thread, ! 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) { nsk_jvmti_setFailStatus(); return NSK_TRUE; } NSK_DISPLAY1(" stack depth: %d\n", (int)frameStackSize); --- 303,321 ---- strcpy(kind, threadsDesc[i].methodCompiled ? "compiled " : "not compiled "); strcat(kind, kind0); NSK_DISPLAY2(" thread #%d (%s):\n", i, threadsDesc[i].threadName); /* get frame count */ ! if (!NSK_JVMTI_VERIFY(jvmti->GetFrameCount(threadsDesc[i].thread, &frameCount))) { nsk_jvmti_setFailStatus(); return NSK_TRUE; } NSK_DISPLAY1(" frameCount: %d\n", (int)frameCount); /* get stack trace */ if (!NSK_JVMTI_VERIFY( ! jvmti->GetStackTrace(threadsDesc[i].thread, 0, MAX_STACK_SIZE, frameStack, &frameStackSize))) { nsk_jvmti_setFailStatus(); return NSK_TRUE; } NSK_DISPLAY1(" stack depth: %d\n", (int)frameStackSize);
*** 341,352 **** NSK_DISPLAY3(" %d frame: method: 0x%p, location: %ld\n", j, (void*)frameStack[j].method, (long)frameStack[j].location); /* query frame location */ if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB5(GetFrameLocation, jvmti, threadsDesc[i].thread, ! j, &qMethod, &qLocation))) { nsk_jvmti_setFailStatus(); continue; } NSK_DISPLAY2(" queried: method: 0x%p, location: %ld\n", --- 331,341 ---- NSK_DISPLAY3(" %d frame: method: 0x%p, location: %ld\n", j, (void*)frameStack[j].method, (long)frameStack[j].location); /* query frame location */ if (!NSK_JVMTI_VERIFY( ! jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))) { nsk_jvmti_setFailStatus(); continue; } NSK_DISPLAY2(" queried: method: 0x%p, location: %ld\n",
*** 402,413 **** if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, eventsList, NULL)) return NSK_FALSE; NSK_DISPLAY0("Dispose global references to threads\n"); for (i = 0; i < THREADS_COUNT; i++) { ! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].thread)); ! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadsDesc[i].cls)); } return NSK_TRUE; } --- 391,402 ---- if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, eventsList, NULL)) return NSK_FALSE; NSK_DISPLAY0("Dispose global references to threads\n"); for (i = 0; i < THREADS_COUNT; i++) { ! NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread)); ! NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].cls)); } return NSK_TRUE; }
*** 536,558 **** { jvmtiCapabilities caps; memset(&caps, 0, sizeof(caps)); caps.can_suspend = 1; caps.can_generate_compiled_method_load_events = 1; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) return JNI_ERR; } { jvmtiEventCallbacks eventCallbacks; memset(&eventCallbacks, 0, sizeof(eventCallbacks)); eventCallbacks.CompiledMethodLoad = callbackCompiledMethodLoad; eventCallbacks.CompiledMethodUnload = callbackCompiledMethodUnload; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(SetEventCallbacks, jvmti, ! &eventCallbacks, sizeof(eventCallbacks)))) return JNI_ERR; } if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL))) return JNI_ERR; --- 525,544 ---- { jvmtiCapabilities caps; memset(&caps, 0, sizeof(caps)); caps.can_suspend = 1; caps.can_generate_compiled_method_load_events = 1; ! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) return JNI_ERR; } { jvmtiEventCallbacks eventCallbacks; memset(&eventCallbacks, 0, sizeof(eventCallbacks)); eventCallbacks.CompiledMethodLoad = callbackCompiledMethodLoad; eventCallbacks.CompiledMethodUnload = callbackCompiledMethodUnload; ! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) return JNI_ERR; } if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL))) return JNI_ERR;
< prev index next >