RFR: 8358318: JFR: Tighten up PlatformTracer initialization
Aleksey Shipilev
shade at openjdk.org
Mon Jun 2 11:25:36 UTC 2025
Started as SonarCloud complaint that MethodSetting.apply initializes a static field. But I think there is a larger problem here, which I completely missed during [JDK-8352738](https://bugs.openjdk.org/browse/JDK-8352738) review: the `PlatformTracer` initialization can technically run several times, AFAICS. This PR tightens up the initialization. It also allows us to call `ensureInitialized` from other places, if we ever find a need.
Additional testing:
- [x] Linux x86_64 server fastdebug, `jdk_jfr`
-------------
Commit messages:
- Fix
Changes: https://git.openjdk.org/jdk/pull/25584/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25584&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8358318
Stats: 21 lines in 2 files changed: 15 ins; 5 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/25584.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25584/head:pull/25584
PR: https://git.openjdk.org/jdk/pull/25584
More information about the hotspot-jfr-dev
mailing list