1158 // Input parameter: |
1158 // Input parameter: |
1159 // ids - array of thread IDs; NULL indicates all live threads |
1159 // ids - array of thread IDs; NULL indicates all live threads |
1160 // locked_monitors - if true, dump locked object monitors |
1160 // locked_monitors - if true, dump locked object monitors |
1161 // locked_synchronizers - if true, dump locked JSR-166 synchronizers |
1161 // locked_synchronizers - if true, dump locked JSR-166 synchronizers |
1162 // |
1162 // |
1163 JVM_ENTRY(jobjectArray, jmm_DumpThreads(JNIEnv *env, jlongArray thread_ids, jboolean locked_monitors, jboolean locked_synchronizers)) |
1163 JVM_ENTRY(jobjectArray, jmm_DumpThreads(JNIEnv *env, jlongArray thread_ids, jboolean locked_monitors, |
|
1164 jboolean locked_synchronizers, jint maxDepth)) |
1164 ResourceMark rm(THREAD); |
1165 ResourceMark rm(THREAD); |
1165 |
1166 |
1166 // make sure the AbstractOwnableSynchronizer klass is loaded before taking thread snapshots |
1167 // make sure the AbstractOwnableSynchronizer klass is loaded before taking thread snapshots |
1167 java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(CHECK_NULL); |
1168 java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(CHECK_NULL); |
1168 |
1169 |
1179 |
1180 |
1180 // obtain thread dump of a specific list of threads |
1181 // obtain thread dump of a specific list of threads |
1181 do_thread_dump(&dump_result, |
1182 do_thread_dump(&dump_result, |
1182 ids_ah, |
1183 ids_ah, |
1183 num_threads, |
1184 num_threads, |
1184 -1, /* entire stack */ |
1185 maxDepth, /* stack depth */ |
1185 (locked_monitors ? true : false), /* with locked monitors */ |
1186 (locked_monitors ? true : false), /* with locked monitors */ |
1186 (locked_synchronizers ? true : false), /* with locked synchronizers */ |
1187 (locked_synchronizers ? true : false), /* with locked synchronizers */ |
1187 CHECK_NULL); |
1188 CHECK_NULL); |
1188 } else { |
1189 } else { |
1189 // obtain thread dump of all threads |
1190 // obtain thread dump of all threads |
1190 VM_ThreadDump op(&dump_result, |
1191 VM_ThreadDump op(&dump_result, |
1191 -1, /* entire stack */ |
1192 maxDepth, /* stack depth */ |
1192 (locked_monitors ? true : false), /* with locked monitors */ |
1193 (locked_monitors ? true : false), /* with locked monitors */ |
1193 (locked_synchronizers ? true : false) /* with locked synchronizers */); |
1194 (locked_synchronizers ? true : false) /* with locked synchronizers */); |
1194 VMThread::execute(&op); |
1195 VMThread::execute(&op); |
1195 } |
1196 } |
1196 |
1197 |
2235 }; |
2236 }; |
2236 #endif // INCLUDE_MANAGEMENT |
2237 #endif // INCLUDE_MANAGEMENT |
2237 |
2238 |
2238 void* Management::get_jmm_interface(int version) { |
2239 void* Management::get_jmm_interface(int version) { |
2239 #if INCLUDE_MANAGEMENT |
2240 #if INCLUDE_MANAGEMENT |
2240 if (version == JMM_VERSION_1_0) { |
2241 if (version == JMM_VERSION) { |
2241 return (void*) &jmm_interface; |
2242 return (void*) &jmm_interface; |
2242 } |
2243 } |
2243 #endif // INCLUDE_MANAGEMENT |
2244 #endif // INCLUDE_MANAGEMENT |
2244 return NULL; |
2245 return NULL; |
2245 } |
2246 } |