RFR: 8367953: JFR sampler threads does not appear in thread dump
I tried to get thread dump of the process which is enabled JFR, then I got strange thread dump like this: os_prio=0 cpu=64.47ms elapsed=20.34s tid=0x00007ff7cd3ffae0 nid=59812 runnable os_prio=0 cpu=12.76ms elapsed=20.34s tid=0x00007ff7cd3ff5a0 nid=59811 runnable Thread name is lacked in the dump (and lacks of LF in addition). I checked them with `ps -eL -o pid,tid,comm`, then I was aware they were JFR sampler threads. 59789 59811 JFR CPU Sampler 59789 59812 JFR Sampler Thr So they should be shown like this: "JFR Sampler Thread" os_prio=0 cpu=25.59ms elapsed=8.77s tid=0x00007f5f45626a50 nid=62979 runnable "JFR CPU Sampler Thread" os_prio=0 cpu=4.78ms elapsed=8.78s tid=0x00007f5f45626060 nid=62978 runnable They are implemented in `JfrSamplerThread` and `JfrCPUSamplerThread`, extends `NonJavaThread`. They do not have `print_on()`, so `Thread::print_on()` would be used - it would not print thread name. Other child class of `NonJavaThread` like `WatcherThread` overrides `print_on` to show thread name. Thus both of JFR sampler threads should do so. ------------- Commit messages: - Remove override qualifier - 8367953: JFR sampler threads does not appear in thread dump Changes: https://git.openjdk.org/jdk/pull/27357/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27357&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367953 Stats: 14 lines in 2 files changed: 14 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27357.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27357/head:pull/27357 PR: https://git.openjdk.org/jdk/pull/27357
On Thu, 18 Sep 2025 05:30:27 GMT, Yasumasa Suenaga <ysuenaga@openjdk.org> wrote:
I tried to get thread dump of the process which is enabled JFR, then I got strange thread dump like this:
os_prio=0 cpu=64.47ms elapsed=20.34s tid=0x00007ff7cd3ffae0 nid=59812 runnable os_prio=0 cpu=12.76ms elapsed=20.34s tid=0x00007ff7cd3ff5a0 nid=59811 runnable
Thread name is lacked in the dump (and lacks of LF in addition). I checked them with `ps -eL -o pid,tid,comm`, then I was aware they were JFR sampler threads.
59789 59811 JFR CPU Sampler 59789 59812 JFR Sampler Thr
So they should be shown like this:
"JFR Sampler Thread" os_prio=0 cpu=25.59ms elapsed=8.77s tid=0x00007f5f45626a50 nid=62979 runnable
"JFR CPU Sampler Thread" os_prio=0 cpu=4.78ms elapsed=8.78s tid=0x00007f5f45626060 nid=62978 runnable
They are implemented in `JfrSamplerThread` and `JfrCPUSamplerThread`, extends `NonJavaThread`. They do not have `print_on()`, so `Thread::print_on()` would be used - it would not print thread name.
Other child class of `NonJavaThread` like `WatcherThread` overrides `print_on` to show thread name. Thus both of JFR sampler threads should do so.
PING: Can I get reviewer(s)? Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27357#issuecomment-3331097046
On Thu, 18 Sep 2025 05:30:27 GMT, Yasumasa Suenaga <ysuenaga@openjdk.org> wrote:
I tried to get thread dump of the process which is enabled JFR, then I got strange thread dump like this:
os_prio=0 cpu=64.47ms elapsed=20.34s tid=0x00007ff7cd3ffae0 nid=59812 runnable os_prio=0 cpu=12.76ms elapsed=20.34s tid=0x00007ff7cd3ff5a0 nid=59811 runnable
Thread name is lacked in the dump (and lacks of LF in addition). I checked them with `ps -eL -o pid,tid,comm`, then I was aware they were JFR sampler threads.
59789 59811 JFR CPU Sampler 59789 59812 JFR Sampler Thr
So they should be shown like this:
"JFR Sampler Thread" os_prio=0 cpu=25.59ms elapsed=8.77s tid=0x00007f5f45626a50 nid=62979 runnable
"JFR CPU Sampler Thread" os_prio=0 cpu=4.78ms elapsed=8.78s tid=0x00007f5f45626060 nid=62978 runnable
They are implemented in `JfrSamplerThread` and `JfrCPUSamplerThread`, extends `NonJavaThread`. They do not have `print_on()`, so `Thread::print_on()` would be used - it would not print thread name.
Other child class of `NonJavaThread` like `WatcherThread` overrides `print_on` to show thread name. Thus both of JFR sampler threads should do so.
Marked as reviewed by mgronlun (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27357#pullrequestreview-3278362053
On Thu, 18 Sep 2025 05:30:27 GMT, Yasumasa Suenaga <ysuenaga@openjdk.org> wrote:
I tried to get thread dump of the process which is enabled JFR, then I got strange thread dump like this:
os_prio=0 cpu=64.47ms elapsed=20.34s tid=0x00007ff7cd3ffae0 nid=59812 runnable os_prio=0 cpu=12.76ms elapsed=20.34s tid=0x00007ff7cd3ff5a0 nid=59811 runnable
Thread name is lacked in the dump (and lacks of LF in addition). I checked them with `ps -eL -o pid,tid,comm`, then I was aware they were JFR sampler threads.
59789 59811 JFR CPU Sampler 59789 59812 JFR Sampler Thr
So they should be shown like this:
"JFR Sampler Thread" os_prio=0 cpu=25.59ms elapsed=8.77s tid=0x00007f5f45626a50 nid=62979 runnable
"JFR CPU Sampler Thread" os_prio=0 cpu=4.78ms elapsed=8.78s tid=0x00007f5f45626060 nid=62978 runnable
They are implemented in `JfrSamplerThread` and `JfrCPUSamplerThread`, extends `NonJavaThread`. They do not have `print_on()`, so `Thread::print_on()` would be used - it would not print thread name.
Other child class of `NonJavaThread` like `WatcherThread` overrides `print_on` to show thread name. Thus both of JFR sampler threads should do so.
This pull request has now been integrated. Changeset: 64c46d8e Author: Yasumasa Suenaga <ysuenaga@openjdk.org> URL: https://git.openjdk.org/jdk/commit/64c46d8efc27911b8667c3974275c075cf79a311 Stats: 14 lines in 2 files changed: 14 ins; 0 del; 0 mod 8367953: JFR sampler threads does not appear in thread dump Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/27357
participants (2)
-
Markus Grönlund
-
Yasumasa Suenaga