< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t003/sp02t003.cpp
Print this page
rev 52100 : 8212082: Remove the NSK_CPP_STUB macros for remaining vmTestbase/jvmti/[sS]*
Summary:
Reviewed-by:
*** 157,168 ****
threadsDesc[i].method = (jmethodID)NULL;
threadsDesc[i].location = NSK_JVMTI_INVALID_JLOCATION;
}
/* 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;
--- 157,167 ----
threadsDesc[i].method = (jmethodID)NULL;
threadsDesc[i].location = NSK_JVMTI_INVALID_JLOCATION;
}
/* 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;
*** 172,183 ****
if (!NSK_VERIFY(allThreadsList[i] != NULL))
return NSK_FALSE;
/* get thread name (info) */
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(GetThreadInfo, jvmti, allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
if (threadInfo.name != NULL) {
int j;
--- 171,181 ----
if (!NSK_VERIFY(allThreadsList[i] != NULL))
return NSK_FALSE;
/* get thread name (info) */
! if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(allThreadsList[i], &threadInfo)))
return NSK_FALSE;
/* find by name */
if (threadInfo.name != NULL) {
int j;
*** 191,202 ****
}
}
}
/* 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++) {
--- 189,199 ----
}
}
}
/* 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++) {
*** 213,228 ****
/* get threads class and frame method */
NSK_DISPLAY0("Find tested methods:\n");
for (i = 0; i < THREADS_COUNT; i++) {
/* get thread class */
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls =
! NSK_CPP_STUB2(GetObjectClass, jni, threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
/* get frame method */
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): %p (%s)\n",
i, threadsDesc[i].threadName,
(void*)threadsDesc[i].method,
--- 210,224 ----
/* get threads class and frame method */
NSK_DISPLAY0("Find tested methods:\n");
for (i = 0; i < THREADS_COUNT; i++) {
/* get thread class */
if (!NSK_JNI_VERIFY(jni, (threadsDesc[i].cls =
! jni->GetObjectClass(threadsDesc[i].thread)) != NULL))
return NSK_FALSE;
/* get frame method */
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): %p (%s)\n",
i, threadsDesc[i].threadName,
(void*)threadsDesc[i].method,
*** 230,243 ****
}
/* 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;
}
return NSK_TRUE;
}
--- 226,239 ----
}
/* 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;
}
return NSK_TRUE;
}
*** 249,265 ****
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;
}
--- 245,259 ----
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;
}
*** 286,307 ****
int j;
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);
--- 280,298 ----
int j;
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);
*** 317,328 ****
NSK_DISPLAY3(" %d frame: method: %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: %p, location: %ld\n",
--- 308,318 ----
NSK_DISPLAY3(" %d frame: method: %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: %p, location: %ld\n",
*** 373,384 ****
static int clean() {
int i;
/* dispose global references to threads */
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;
}
--- 363,374 ----
static int clean() {
int i;
/* dispose global references to threads */
for (i = 0; i < THREADS_COUNT; i++) {
! NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].thread));
! NSK_TRACE(jni->DeleteGlobalRef(threadsDesc[i].cls));
}
return NSK_TRUE;
}
*** 451,462 ****
/* add specific capabilities for suspending thread */ {
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
return JNI_ERR;
}
/* register agent proc and arg */
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
--- 441,451 ----
/* add specific capabilities for suspending thread */ {
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
/* register agent proc and arg */
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
< prev index next >