< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/DynamicCodeGenerated/dyncodgen001/dyncodgen001.cpp

Print this page
rev 51942 : [mq]: refactor


  99 }
 100 #endif
 101 jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
 102     jvmtiEnv* jvmti = NULL;
 103     jvmtiEventCallbacks callbacks;
 104 
 105     /* init framework and parse options */
 106     if (!NSK_VERIFY(nsk_jvmti_parseOptions(options)))
 107         return JNI_ERR;
 108 
 109     timeout = nsk_jvmti_getWaitTime() * 60000;
 110     NSK_DISPLAY1("Timeout: %d msc\n", (int)timeout);
 111 
 112     /* create JVMTI environment */
 113     if (!NSK_VERIFY((jvmti =
 114             nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
 115         return JNI_ERR;
 116 
 117     memset(&callbacks, 0, sizeof(callbacks));
 118     callbacks.DynamicCodeGenerated = &DynamicCodeGenerated;
 119     if (!NSK_JVMTI_VERIFY(
 120             NSK_CPP_STUB3(SetEventCallbacks, jvmti,
 121                 &callbacks, sizeof(callbacks))))
 122         return JNI_ERR;
 123 
 124     /* enable DynamicCodeGenerated event */
 125     if (!NSK_JVMTI_VERIFY(
 126             NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
 127                 JVMTI_EVENT_DYNAMIC_CODE_GENERATED, NULL)))
 128         return JNI_ERR;
 129 
 130     /* register agent proc and arg */
 131     if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
 132         return JNI_ERR;
 133 
 134     return JNI_OK;
 135 }
 136 
 137 /* ========================================================================== */
 138 
 139 }


  99 }
 100 #endif
 101 jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
 102     jvmtiEnv* jvmti = NULL;
 103     jvmtiEventCallbacks callbacks;
 104 
 105     /* init framework and parse options */
 106     if (!NSK_VERIFY(nsk_jvmti_parseOptions(options)))
 107         return JNI_ERR;
 108 
 109     timeout = nsk_jvmti_getWaitTime() * 60000;
 110     NSK_DISPLAY1("Timeout: %d msc\n", (int)timeout);
 111 
 112     /* create JVMTI environment */
 113     if (!NSK_VERIFY((jvmti =
 114             nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
 115         return JNI_ERR;
 116 
 117     memset(&callbacks, 0, sizeof(callbacks));
 118     callbacks.DynamicCodeGenerated = &DynamicCodeGenerated;
 119     if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))


 120         return JNI_ERR;
 121 
 122     /* enable DynamicCodeGenerated event */
 123     if (!NSK_JVMTI_VERIFY(
 124             jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_DYNAMIC_CODE_GENERATED, NULL)))

 125         return JNI_ERR;
 126 
 127     /* register agent proc and arg */
 128     if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
 129         return JNI_ERR;
 130 
 131     return JNI_OK;
 132 }
 133 
 134 /* ========================================================================== */
 135 
 136 }
< prev index next >