166 // Implementation of "threaddump" command - essentially a remote ctrl-break |
166 // Implementation of "threaddump" command - essentially a remote ctrl-break |
167 // See also: ThreadDumpDCmd class |
167 // See also: ThreadDumpDCmd class |
168 // |
168 // |
169 static jint thread_dump(AttachOperation* op, outputStream* out) { |
169 static jint thread_dump(AttachOperation* op, outputStream* out) { |
170 bool print_concurrent_locks = false; |
170 bool print_concurrent_locks = false; |
171 if (op->arg(0) != NULL && strcmp(op->arg(0), "-l") == 0) { |
171 bool print_extended_info = false; |
172 print_concurrent_locks = true; |
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 } |
173 } |
181 } |
174 |
182 |
175 // thread stacks |
183 // thread stacks |
176 VM_PrintThreads op1(out, print_concurrent_locks); |
184 VM_PrintThreads op1(out, print_concurrent_locks, print_extended_info); |
177 VMThread::execute(&op1); |
185 VMThread::execute(&op1); |
178 |
186 |
179 // JNI global handles |
187 // JNI global handles |
180 VM_PrintJNI op2(out); |
188 VM_PrintJNI op2(out); |
181 VMThread::execute(&op2); |
189 VMThread::execute(&op2); |