RFR: 8369283: Improve trace logs in safepoint machinery [v8]
Aleksey Shipilev
shade at openjdk.org
Thu Oct 9 12:18:23 UTC 2025
> During the performance investigations in safepoint machinery (notably [JDK-8350324](https://bugs.openjdk.org/browse/JDK-8350324)), I found the trace logging lacking. It would be good to improve it in order to finely profile various microscopic things like thread list walks, the blocking/resuming of Java threads, etc. For [JDK-8350324](https://bugs.openjdk.org/browse/JDK-8350324), for example, I want to be able to measure the Java thread delays if they assist in avalanche wakeups.
>
> This leans heavily on unified logging and invariant clocks to do the right thing, but I think it is a fair compromise for simplicity. The configuration I found most useful for testing is:
>
>
> -Xlog:async -Xlog:safepoint=trace:file=safepoint.log:uptimenanos
>
>
> My tentative plan is to visualize this more comprehensively with a little tool that digests that log.
>
> I am open for bikeshedding on logging wording. The log example is in the comment below.
>
> Additional testing:
> - [x] Ad-hoc log peeking
> - [x] Linux x86_64 server fastdebug, `tier1`
> - [x] Linux x86_64 server fastdebug, `all`
Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:
- Thread PIDs in logs
- Merge branch 'master' into JDK-8369283-safepoint-logs
- Do not bother changing the existing logging wording for "initiated"
- Put polling exception tracing back with minor reformat
- Touchups
- A bit more verbose
- Rethink safepoint sync logging
- Update src/hotspot/share/runtime/safepoint.cpp
Co-authored-by: David Holmes <62092539+dholmes-ora at users.noreply.github.com>
- Cannot allocate for Thread::name + adjust debug levels
- Work
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27673/files
- new: https://git.openjdk.org/jdk/pull/27673/files/cccd8a32..80ec06a3
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27673&range=07
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27673&range=06-07
Stats: 5929 lines in 148 files changed: 4393 ins; 839 del; 697 mod
Patch: https://git.openjdk.org/jdk/pull/27673.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27673/head:pull/27673
PR: https://git.openjdk.org/jdk/pull/27673
More information about the hotspot-dev
mailing list