RFR: 8352251: Implement Cooperative JFR Sampling [v16]

Martin Doerr mdoerr at openjdk.org
Tue May 6 21:16:17 UTC 2025


On Mon, 5 May 2025 08:50:35 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> Greetings,
>> 
>> This is the implementation of JEP [JDK-8350338 Cooperative JFR Sampling](https://bugs.openjdk.org/browse/JDK-8350338).
>> 
>> Implementations in this change set are provided and have been tested on the following platforms:
>> 
>> - windows-x64
>> - windows-x64-debug
>> - linux-x64
>> - linux-x64-debug
>> - macosx-x64
>> - macosx-x64-debug
>> - linux-aarch64
>> - linux-aarch64-debug
>> - macosx-aarch64
>> - macosx-aarch64-debug
>> 
>> Testing: tier1-6, jdk_jfr, stress testing.
>> 
>> Platform porters note:
>> Some platform-specific code needs to be provided, mainly in the interpreter. Take a look at the following files for changes:
>> 
>> - src/hotspot/cpu/x86/frame_x86.cpp
>> - src/hotspot/cpu/x86/interp_masm_x86.cpp
>> - src/hotspot/cpu/x86/interp_masm_x86.hpp
>> - src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp
>> - src/hotspot/cpu/x86/macroAssembler_x86.cpp
>> - src/hotspot/cpu/x86/macroAssembler_x86.hpp
>> - src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
>> - src/hotspot/cpu/x86/templateTable_x86.cpp
>> - src/hotspot/os_cpu/linux_x86/javaThread_linux_x86.hpp
>> 
>> Thanks
>> Markus
>
> Markus Grönlund has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 19 commits:
> 
>  - Merge branch 'master' into 8352251
>  - Configuration and test for jdk.SafepointLatency event
>  - include guards
>  - push back pd constants into pd code
>  - Attempt to build Windows-AARCH64
>  - No invariants for sender_for_interpreter_frame
>  - zero
>  - Merge branch 'master' into 8352251
>  - Refine SamplingLatency event description
>  - Update default.jfc
>  - ... and 9 more: https://git.openjdk.org/jdk/compare/8511220f...e448090e

Ok, seems like the issue is that you still need some fields of the old top frame's interpreter state. It is still usable on PPC64 after the top frame has been popped off because the ABI allows using some space below the SP which will still contain the required state fields. Seems like other platforms don't guarantee to preserve space below SP (could probably get overwritten by a signal handler).
I think your version is not nicely implementable on platforms which don't have an FP register, but I'll take a look and think about it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24296#issuecomment-2856002242


More information about the hotspot-jfr-dev mailing list