RFR: JDK-8329663: hs_err file event log entry for thread adding/exiting prints Java thread related pointer twice
David Holmes
dholmes at openjdk.org
Fri Apr 5 05:40:08 UTC 2024
On Thu, 4 Apr 2024 12:48:59 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> Currently the entries for adding / exiting threads look like this :
>
> Event: 81.296 Thread 0x00007fd8300c13b0 Thread added: 0x00007fd8300c13b0
>
> Event: 81.296 Thread 0x00007fd954000fe0 Thread exited: 0x00007fd954000fe0
>
> The hex number describing the thread is printed twice, this should be simplified or the current thread AND and added/exited thread could be printed.
Changes requested by dholmes (Reviewer).
> The hex number describing the thread is printed twice, this should be simplified or the current thread AND and added/exited thread could be printed.
This may be okay in JBS before you decide which way to go, but the PR description should reflect the actual change you made. Thanks
src/hotspot/share/runtime/threads.cpp line 1084:
> 1082:
> 1083: // Since Events::log uses a lock, we grab it outside the Threads_lock
> 1084: Events::log(Thread::current(), "exited thread: " INTPTR_FORMAT, p2i(p));
Most of the time a thread "exits" itself so `Thread::current() == p` in that case. Only in two error cases is a newly created thread removed by the thread that added it. So this revised wording doesn't really make sense for the majority of cases. I think it makes sense to report the thread doing the add/remove as well as the thread being added/removed, so I would suggest replacing `exited` with `removed`.
That said any change here may disrupt existing log parsing, including tests, so that needs to be considered.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18627#pullrequestreview-1981975600
PR Comment: https://git.openjdk.org/jdk/pull/18627#issuecomment-2038985481
PR Review Comment: https://git.openjdk.org/jdk/pull/18627#discussion_r1552951101
More information about the hotspot-runtime-dev
mailing list