comparison src/share/vm/services/management.cpp @ 6856:9855b7e559ae

Merge
author collins
date Fri, 12 Oct 2012 10:49:39 -0700
parents d8ce2825b193 fb19af007ffc
children 070d523b96a7
comparison
equal deleted inserted replaced
6842:b9a9ed0f8eeb 6856:9855b7e559ae
70 70
71 jmmOptionalSupport Management::_optional_support = {0}; 71 jmmOptionalSupport Management::_optional_support = {0};
72 TimeStamp Management::_stamp; 72 TimeStamp Management::_stamp;
73 73
74 void management_init() { 74 void management_init() {
75 #if INCLUDE_MANAGEMENT
75 Management::init(); 76 Management::init();
76 ThreadService::init(); 77 ThreadService::init();
77 RuntimeService::init(); 78 RuntimeService::init();
78 ClassLoadingService::init(); 79 ClassLoadingService::init();
79 } 80 #else
81 ThreadService::init();
82 // Make sure the VM version is initialized
83 // This is normally called by RuntimeService::init().
84 // Since that is conditionalized out, we need to call it here.
85 Abstract_VM_Version::initialize();
86 #endif // INCLUDE_MANAGEMENT
87 }
88
89 #if INCLUDE_MANAGEMENT
80 90
81 void Management::init() { 91 void Management::init() {
82 EXCEPTION_MARK; 92 EXCEPTION_MARK;
83 93
84 // These counters are for java.lang.management API support. 94 // These counters are for java.lang.management API support.
110 _optional_support.isOtherThreadCpuTimeSupported = 0; 120 _optional_support.isOtherThreadCpuTimeSupported = 0;
111 } 121 }
112 122
113 _optional_support.isBootClassPathSupported = 1; 123 _optional_support.isBootClassPathSupported = 1;
114 _optional_support.isObjectMonitorUsageSupported = 1; 124 _optional_support.isObjectMonitorUsageSupported = 1;
115 #ifndef SERVICES_KERNEL 125 #if INCLUDE_SERVICES
116 // This depends on the heap inspector 126 // This depends on the heap inspector
117 _optional_support.isSynchronizerUsageSupported = 1; 127 _optional_support.isSynchronizerUsageSupported = 1;
118 #endif // SERVICES_KERNEL 128 #endif // INCLUDE_SERVICES
119 _optional_support.isThreadAllocatedMemorySupported = 1; 129 _optional_support.isThreadAllocatedMemorySupported = 1;
120 130
121 // Registration of the diagnostic commands 131 // Registration of the diagnostic commands
122 DCmdRegistrant::register_dcmds(); 132 DCmdRegistrant::register_dcmds();
123 DCmdRegistrant::register_dcmds_ext(); 133 DCmdRegistrant::register_dcmds_ext();
2106 mgr->set_notification_enabled(enabled?true:false); 2116 mgr->set_notification_enabled(enabled?true:false);
2107 JVM_END 2117 JVM_END
2108 2118
2109 // Dump heap - Returns 0 if succeeds. 2119 // Dump heap - Returns 0 if succeeds.
2110 JVM_ENTRY(jint, jmm_DumpHeap0(JNIEnv *env, jstring outputfile, jboolean live)) 2120 JVM_ENTRY(jint, jmm_DumpHeap0(JNIEnv *env, jstring outputfile, jboolean live))
2111 #ifndef SERVICES_KERNEL 2121 #if INCLUDE_SERVICES
2112 ResourceMark rm(THREAD); 2122 ResourceMark rm(THREAD);
2113 oop on = JNIHandles::resolve_external_guard(outputfile); 2123 oop on = JNIHandles::resolve_external_guard(outputfile);
2114 if (on == NULL) { 2124 if (on == NULL) {
2115 THROW_MSG_(vmSymbols::java_lang_NullPointerException(), 2125 THROW_MSG_(vmSymbols::java_lang_NullPointerException(),
2116 "Output file name cannot be null.", -1); 2126 "Output file name cannot be null.", -1);
2124 if (dumper.dump(name) != 0) { 2134 if (dumper.dump(name) != 0) {
2125 const char* errmsg = dumper.error_as_C_string(); 2135 const char* errmsg = dumper.error_as_C_string();
2126 THROW_MSG_(vmSymbols::java_io_IOException(), errmsg, -1); 2136 THROW_MSG_(vmSymbols::java_io_IOException(), errmsg, -1);
2127 } 2137 }
2128 return 0; 2138 return 0;
2129 #else // SERVICES_KERNEL 2139 #else // INCLUDE_SERVICES
2130 return -1; 2140 return -1;
2131 #endif // SERVICES_KERNEL 2141 #endif // INCLUDE_SERVICES
2132 JVM_END 2142 JVM_END
2133 2143
2134 JVM_ENTRY(jobjectArray, jmm_GetDiagnosticCommands(JNIEnv *env)) 2144 JVM_ENTRY(jobjectArray, jmm_GetDiagnosticCommands(JNIEnv *env))
2135 ResourceMark rm(THREAD); 2145 ResourceMark rm(THREAD);
2136 GrowableArray<const char *>* dcmd_list = DCmdFactory::DCmd_list(); 2146 GrowableArray<const char *>* dcmd_list = DCmdFactory::DCmd_list();
2293 jmm_GetDiagnosticCommands, 2303 jmm_GetDiagnosticCommands,
2294 jmm_GetDiagnosticCommandInfo, 2304 jmm_GetDiagnosticCommandInfo,
2295 jmm_GetDiagnosticCommandArgumentsInfo, 2305 jmm_GetDiagnosticCommandArgumentsInfo,
2296 jmm_ExecuteDiagnosticCommand 2306 jmm_ExecuteDiagnosticCommand
2297 }; 2307 };
2308 #endif // INCLUDE_MANAGEMENT
2298 2309
2299 void* Management::get_jmm_interface(int version) { 2310 void* Management::get_jmm_interface(int version) {
2311 #if INCLUDE_MANAGEMENT
2300 if (version == JMM_VERSION_1_0) { 2312 if (version == JMM_VERSION_1_0) {
2301 return (void*) &jmm_interface; 2313 return (void*) &jmm_interface;
2302 } 2314 }
2315 #endif // INCLUDE_MANAGEMENT
2303 return NULL; 2316 return NULL;
2304 } 2317 }