[jdk8u-dev] Integrated: 6885993: Named Thread: introduce print() and print_on(outputStream* st) methods
Volker Simonis
simonis at openjdk.org
Fri Nov 25 11:08:38 UTC 2022
On Thu, 17 Nov 2022 10:06:12 GMT, Volker Simonis <simonis at openjdk.org> wrote:
> This is a backport of "[JDK-6885993: Named Thread: introduce print() and print_on(outputStream* st) methods](https://bugs.openjdk.org/browse/JDK-6885993)". I request the downport for parity with Oracle JDK 8 where it was backported to 8u351 (see [JDK-8285702](https://bugs.openjdk.org/browse/JDK-8285702)). The change is required as dependency of "[JDK-8073464: GC workers do not have thread names](https://bugs.openjdk.org/browse/JDK-8073464)" which I'll be requesting next ([JDK-8073464](https://bugs.openjdk.org/browse/JDK-8073464) has also been downported to Oracle jdk8u351).
>
> Both of these changes are required to fix the native names of internal threads like for example GC threads. This does not only simplify debugging, but also helps observability tools. Finally, these two changes fix the "sun.management.HotspotInternal" MxBean which returns the "[InternalThreadCpuTimes](https://stackoverflow.com/questions/3947467/with-recent-sun-jvms-1-6-is-it-possible-to-get-gc-thread-information/4113407#4113407)". The "InternalThreadCpuTimes" attribute returns a map with a thread-name to thread-cpu-time mapping but is currently broken in JDK 8 because internal threads without native names (e.g. GC threads) are all mapped to the same entry (i.e. "Unknown").
>
> The patch applies cleanly except for a single context mismatch in `vmThread.cpp`. I've attached a diff of this patch compared to the original JDK 9 patch to this PR for your convenience (see [6885993-jdk8-vs-jdk9.txt](https://github.com/openjdk/jdk8u-dev/files/10030290/6885993-jdk8-vs-jdk9.txt)).
This pull request has now been integrated.
Changeset: 9f2f0c22
Author: Volker Simonis <simonis at openjdk.org>
URL: https://git.openjdk.org/jdk8u-dev/commit/9f2f0c220b44d0693dc05c915fe62e824bceaddf
Stats: 75 lines in 14 files changed: 13 ins; 61 del; 1 mod
6885993: Named Thread: introduce print() and print_on(outputStream* st) methods
Eliminating duplicated code by introducing print_on(outputStream* st) methods in NamedThread
Reviewed-by: phh, andrew
Backport-of: 16a3e2f16d3ffc4dd66e93aa9d75055279499282
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/183
More information about the jdk8u-dev
mailing list