< prev index next >

src/hotspot/share/services/attachListener.cpp

Print this page
rev 50748 : Thread Dump Extension (memory allocation)


 151 // etc. In theory this command should only post a DataDumpRequest to any
 152 // JVMTI environment that has enabled this event. However it's useful to
 153 // trigger the SIGBREAK handler.
 154 
 155 static jint data_dump(AttachOperation* op, outputStream* out) {
 156   if (!ReduceSignalUsage) {
 157     AttachListener::pd_data_dump();
 158   } else {
 159     if (JvmtiExport::should_post_data_dump()) {
 160       JvmtiExport::post_data_dump();
 161     }
 162   }
 163   return JNI_OK;
 164 }
 165 
 166 // Implementation of "threaddump" command - essentially a remote ctrl-break
 167 // See also: ThreadDumpDCmd class
 168 //
 169 static jint thread_dump(AttachOperation* op, outputStream* out) {
 170   bool print_concurrent_locks = false;
 171   if (op->arg(0) != NULL && strcmp(op->arg(0), "-l") == 0) {



 172     print_concurrent_locks = true;
 173   }





 174 
 175   // thread stacks
 176   VM_PrintThreads op1(out, print_concurrent_locks);
 177   VMThread::execute(&op1);
 178 
 179   // JNI global handles
 180   VM_PrintJNI op2(out);
 181   VMThread::execute(&op2);
 182 
 183   // Deadlock detection
 184   VM_FindDeadlocks op3(out);
 185   VMThread::execute(&op3);
 186 
 187   return JNI_OK;
 188 }
 189 
 190 // A jcmd attach operation request was received, which will now
 191 // dispatch to the diagnostic commands used for serviceability functions.
 192 static jint jcmd(AttachOperation* op, outputStream* out) {
 193   Thread* THREAD = Thread::current();
 194   // All the supplied jcmd arguments are stored as a single
 195   // string (op->arg(0)). This is parsed by the Dcmd framework.
 196   DCmd::parse_and_execute(DCmd_Source_AttachAPI, out, op->arg(0), ' ', THREAD);




 151 // etc. In theory this command should only post a DataDumpRequest to any
 152 // JVMTI environment that has enabled this event. However it's useful to
 153 // trigger the SIGBREAK handler.
 154 
 155 static jint data_dump(AttachOperation* op, outputStream* out) {
 156   if (!ReduceSignalUsage) {
 157     AttachListener::pd_data_dump();
 158   } else {
 159     if (JvmtiExport::should_post_data_dump()) {
 160       JvmtiExport::post_data_dump();
 161     }
 162   }
 163   return JNI_OK;
 164 }
 165 
 166 // Implementation of "threaddump" command - essentially a remote ctrl-break
 167 // See also: ThreadDumpDCmd class
 168 //
 169 static jint thread_dump(AttachOperation* op, outputStream* out) {
 170   bool print_concurrent_locks = false;
 171   bool print_extended_info = false;
 172   if (op->arg(0) != NULL) {
 173     for (int i = 0; op->arg(0)[i] != 0; ++i) {
 174       if (op->arg(0)[i] == 'l') {
 175         print_concurrent_locks = true;
 176       }
 177       if (op->arg(0)[i] == 'e') {
 178         print_extended_info = true;
 179       }
 180     }
 181   }
 182 
 183   // thread stacks
 184   VM_PrintThreads op1(out, print_concurrent_locks, print_extended_info);
 185   VMThread::execute(&op1);
 186 
 187   // JNI global handles
 188   VM_PrintJNI op2(out);
 189   VMThread::execute(&op2);
 190 
 191   // Deadlock detection
 192   VM_FindDeadlocks op3(out);
 193   VMThread::execute(&op3);
 194 
 195   return JNI_OK;
 196 }
 197 
 198 // A jcmd attach operation request was received, which will now
 199 // dispatch to the diagnostic commands used for serviceability functions.
 200 static jint jcmd(AttachOperation* op, outputStream* out) {
 201   Thread* THREAD = Thread::current();
 202   // All the supplied jcmd arguments are stored as a single
 203   // string (op->arg(0)). This is parsed by the Dcmd framework.
 204   DCmd::parse_and_execute(DCmd_Source_AttachAPI, out, op->arg(0), ' ', THREAD);


< prev index next >