RFR: 8352251: Implement JEP 518: JFR Cooperative Sampling [v16]

Markus Grönlund mgronlun at openjdk.org
Tue May 13 20:22:56 UTC 2025


On Tue, 13 May 2025 20:03:14 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> > 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.
> 
> Update: I was thinking about emulating `make_sender_fp_current` by modifying the Back Chain: `std(sender_fp, _abi0(callers_sp), R1_SP);`. This would also hide the top frame from the sampler such that it doesn't sample the top frame after the return safepoint check. However, this would break concurrent thread stack processing (used by ZGC and ShenandoahGC) which relies on the Back Chain:
> 
> https://github.com/openjdk/jdk/blob/e7ce661adb01fba4bb690d51cc2858c822008654/src/hotspot/share/runtime/stackWatermark.inline.hpp#L104
> 
> Maybe we can find a way to discard samples after the return safepoint check?

Why would it break stack watermark processing for only this platform? Stack watermark processing relies on the ljf, not the CPU context. That's why we (still) set the ljf to the frame to be popped, and provide the sender java fp as a separate field.

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

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


More information about the hotspot-jfr-dev mailing list