どちらも, private method である java.lang.Thread.dumpThreads() を呼び出して処理を行っている. これはネイティブメソッドになっており, 最終的には VM_ThreadDump によるダンプ処理が行われる (See: VM_ThreadDump).
java.lang.Thread.getStackTrace() -> JVM_DumpThreads() (= java.lang.Thread.dumpThreads()) -> ThreadService::dump_stack_traces() -> VMThread::execute() -> (See: here for details) -> VM_ThreadDump::doit_prologue() -> VM_ThreadDump::doit() -> VM_ThreadDump::snapshot_thread() -> ThreadSnapshot::dump_stack_at_safepoint() -> ThreadStackTrace::dump_stack_at_safepointr() -> ThreadStackTrace::add_stack_frame() -> StackFrameInfo::StackFrameInfo() -> VM_ThreadDump::doit_epilogue()
java.lang.Thread.getAllStackTraces() -> JVM_DumpThreads() (= java.lang.Thread.dumpThreads()) -> (同上)
See: here for details
See: here for details
java.lang.Thread.dumpThreads() は JVM_DumpThreads() で実装されている.
((cite: jdk/src/share/native/java/lang/Thread.c))
static JNINativeMethod methods[] = {
...
{"dumpThreads", "([" THD ")[[" STE, (void *)&JVM_DumpThreads},
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
(#Under Construction) See: here for details
See: here for details
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.