Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JFR ThreadDump support #20301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thallium
Copy link
Contributor

@thallium thallium commented Oct 3, 2024

Note that NativeLibrary is only supported on Linux at this moment.

@thallium
Copy link
Contributor Author

thallium commented Oct 3, 2024

Sample ThreadDump output:

jdk.ThreadDump {
  startTime = 15:37:23.141 (2024-10-03)
  result = "0x1aa00 javaTID: 2 osTID: 2881523
0x1e700 javaTID: 4 osTID: 2881525
0x22400 javaTID: 5 osTID: 2881526
0x26100 javaTID: 6 osTID: 2881527
0x29e00 javaTID: 7 osTID: 2881528
0x2db00 javaTID: 8 osTID: 2881529
0x31800 javaTID: 9 osTID: 2881530
0x35500 javaTID: 10 osTID: 2881531
0x39200 javaTID: 11 osTID: 2881532
0x3cf00 javaTID: 12 osTID: 2881533
0x40c00 javaTID: 13 osTID: 2881534
0x144300 javaTID: 3 osTID: 2881596
0x213500 javaTID: 14 osTID: 2881640
0x217200 javaTID: 15 osTID: 2881641
0x223000 javaTID: 16 osTID: 2881642
0x226d00 javaTID: 17 osTID: 2881643
0x22aa00 javaTID: 18 osTID: 2881644
0x22e700 javaTID: 19 osTID: 2881645
0x232400 javaTID: 20 osTID: 2881646
0x236100 javaTID: 21 osTID: 2881647
0x239e00 javaTID: 22 osTID: 2881648
0x23db00 javaTID: 23 osTID: 2881649
0x26a600 javaTID: 26 osTID: 2881651
0x26e300 javaTID: 27 osTID: 2881652
Number of threads: 24"
}

Also FYI @tajila

@tajila
Copy link
Contributor

tajila commented Oct 10, 2024

Sample ThreadDump output:

The RI version also outputs stacktraces

@thallium thallium force-pushed the threaddump branch 2 times, most recently from 238a5e5 to 6856a4a Compare November 5, 2024 19:06
@tajila
Copy link
Contributor

tajila commented Nov 7, 2024

can you please split this into two PRs one for thread ump and another for native lib support

@thallium thallium changed the title Add JFR ThreadDump and NativeLibrary support Add JFR ThreadDump support Nov 8, 2024
@thallium
Copy link
Contributor Author

thallium commented Nov 8, 2024

Opened PR for native library: #20543

@thallium
Copy link
Contributor Author

Sample output:

"main" J9VMThread: 0x1aa00 tid: 2 nid: 2878591 prio: 5 state: R
at com/ibm/oti/vm/VM.jfrDump(Native Method)
at JFRTest.main(JFRTest.java:26(Compiled Code))

"JIT Compilation Thread-000" J9VMThread: 0x1e700 tid: 4 nid: 2878593 prio: 10 state: R

"JIT Compilation Thread-001 Suspended" J9VMThread: 0x22400 tid: 5 nid: 2878594 prio: 10 state: R

"JIT Compilation Thread-002 Suspended" J9VMThread: 0x26100 tid: 6 nid: 2878595 prio: 10 state: R

"JIT Compilation Thread-003 Suspended" J9VMThread: 0x29e00 tid: 7 nid: 2878596 prio: 10 state: R

"JIT Compilation Thread-004 Suspended" J9VMThread: 0x2db00 tid: 8 nid: 2878597 prio: 10 state: R

"JIT Compilation Thread-005 Suspended" J9VMThread: 0x31800 tid: 9 nid: 2878598 prio: 10 state: R

"JIT Compilation Thread-006 Suspended" J9VMThread: 0x35500 tid: 10 nid: 2878599 prio: 10 state: R

"JIT Diagnostic Compilation Thread-007 Suspended" J9VMThread: 0x39200 tid: 11 nid: 2878600 prio: 10 state: R

"JIT-SamplerThread" J9VMThread: 0x3cf00 tid: 12 nid: 2878656 prio: 10 state: CW

"IProfiler" J9VMThread: 0x40c00 tid: 13 nid: 2878657 prio: 5 state: R

"Common-Cleaner" J9VMThread: 0x144300 tid: 3 nid: 2878695 prio: 8 state: CW waiting on: java/lang/ref/ReferenceQueue@0x70623c8f8
at java/lang/Object.waitImpl(Native Method)
at java/lang/Object.wait(Object.java:255)
at java/lang/Object.wait(Object.java:221)
at java/lang/ref/ReferenceQueue.remove(ReferenceQueue.java:140)
at jdk/internal/ref/CleanerImpl.run(CleanerImpl.java:140)
at java/lang/Thread.runWith(Thread.java:1608)
at java/lang/Thread.run(Thread.java:1595)
at jdk/internal/misc/InnocuousThread.run(InnocuousThread.java:186)

"Finalizer thread" J9VMThread: 0x213500 tid: 15 nid: 2878697 prio: 5 state: R

"Concurrent Mark Helper" J9VMThread: 0x217200 tid: 14 nid: 2878698 prio: 1 state: R

"GC Worker" J9VMThread: 0x21af00 tid: 16 nid: 2878699 prio: 5 state: R

"GC Worker" J9VMThread: 0x21ec00 tid: 17 nid: 2878700 prio: 5 state: R

"GC Worker" J9VMThread: 0x222900 tid: 18 nid: 2878701 prio: 5 state: R

"GC Worker" J9VMThread: 0x226600 tid: 19 nid: 2878702 prio: 5 state: R

"GC Worker" J9VMThread: 0x22a300 tid: 20 nid: 2878703 prio: 5 state: R

"GC Worker" J9VMThread: 0x22e000 tid: 21 nid: 2878704 prio: 5 state: R

"GC Worker" J9VMThread: 0x231d00 tid: 22 nid: 2878705 prio: 5 state: R

"JFR sampler" J9VMThread: 0x235a00 tid: 23 nid: 2878706 prio: 5 state: R

"Attach API update file access time" J9VMThread: 0x26a500 tid: 26 nid: 2878708 prio: 5 state: CW
at java/lang/Thread.sleepImpl(Native Method)
at java/lang/Thread.sleep(Thread.java:516)
at openj9/internal/tools/attach/target/AttachHandler$1.run(AttachHandler.java:348)

"Attach API wait loop" J9VMThread: 0x26e200 tid: 27 nid: 2878709 prio: 10 state: R
at openj9/internal/tools/attach/target/IPC.waitSemaphore(Native Method)
at openj9/internal/tools/attach/target/CommonDirectory.waitSemaphore(CommonDirectory.java:264)
at openj9/internal/tools/attach/target/WaitLoop.waitForNotification(WaitLoop.java:66)
at openj9/internal/tools/attach/target/WaitLoop.run(WaitLoop.java:157)

Number of threads: 24

@tajila is there anything else we need to add to the output?

Signed-off-by: Gengchen Tuo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants