< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GenerateEvents/genevents001/genevents001.cpp
Print this page
rev 51942 : [mq]: refactor
*** 97,113 ****
if (!nsk_jvmti_enableEvents(JVMTI_ENABLE, EVENTS_COUNT, eventsList, NULL)) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY0("Call GenerateEvents() to send missed events\n");
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(GenerateEvents, jvmti, JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
nsk_jvmti_setFailStatus();
}
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(GenerateEvents, jvmti, JVMTI_EVENT_DYNAMIC_CODE_GENERATED))) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY1("Disable events: %d events\n", EVENTS_COUNT);
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, eventsList, NULL)) {
--- 97,111 ----
if (!nsk_jvmti_enableEvents(JVMTI_ENABLE, EVENTS_COUNT, eventsList, NULL)) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY0("Call GenerateEvents() to send missed events\n");
! if (!NSK_JVMTI_VERIFY(jvmti->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
nsk_jvmti_setFailStatus();
}
! if (!NSK_JVMTI_VERIFY(jvmti->GenerateEvents(JVMTI_EVENT_DYNAMIC_CODE_GENERATED))) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY1("Disable events: %d events\n", EVENTS_COUNT);
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, eventsList, NULL)) {
*** 193,217 ****
/* add required capabilities */
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_compiled_method_load_events = 1;
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
return JNI_ERR;
}
/* set event callbacks */
{
jvmtiEventCallbacks eventCallbacks;
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.CompiledMethodLoad = callbackCompiledMethodLoad;
eventCallbacks.CompiledMethodUnload = callbackCompiledMethodUnload;
eventCallbacks.DynamicCodeGenerated = callbackDynamicCodeGenerated;
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(SetEventCallbacks, jvmti,
! &eventCallbacks, sizeof(eventCallbacks))))
return JNI_ERR;
}
return JNI_OK;
}
--- 191,212 ----
/* add required capabilities */
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_compiled_method_load_events = 1;
! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
}
/* set event callbacks */
{
jvmtiEventCallbacks eventCallbacks;
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.CompiledMethodLoad = callbackCompiledMethodLoad;
eventCallbacks.CompiledMethodUnload = callbackCompiledMethodUnload;
eventCallbacks.DynamicCodeGenerated = callbackDynamicCodeGenerated;
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return JNI_ERR;
}
return JNI_OK;
}
< prev index next >