[jdk17u-dev] RFR: 8350106: [PPC] Avoid ticks_unknown_not_Java AsyncGetCallTrace() if JavaFrameAnchor::_last_Java_pc not set

Richard Reingruber rrich at openjdk.org
Mon Sep 29 14:55:47 UTC 2025


On Mon, 29 Sep 2025 14:25:56 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> This pull request contains a backport of commit [d5908231](https://github.com/openjdk/jdk21u-dev/commit/d5908231ebc16f443b3fc9b2ebf03cc4deb67373) from the [openjdk/jdk21u-dev](https://git.openjdk.org/jdk21u-dev) repository.
>> 
>> There are a few trivial adaptations
>> * of copyright headers
>> * of the hunk that includes os.inline.hpp because of a diff in the context
>> * and because `frame::abi_minframe` was renamed `frame::common_abi` in higher releases
>> 
>> In addition to these there's a non-trivial adaptation. In jdk17, we cannot use the frame constructor that takes a `pc` as 2nd argument because it requires it not to be `nullptr`. The appropriate [frame constructor to use](https://github.com/openjdk/jdk17u-dev/blob/dca33960959f71ef646d346e328acd27196f5bef/src/hotspot/cpu/ppc/frame_ppc.inline.hpp#L61) is the one that takes `sp` as single argument. It reads the pc from the frames `lr` slot just as [`frame::setup()`](https://github.com/openjdk/jdk21u-dev/blob/43c84df4a3d73ca3b0aeddc738d2e2f0e9f5145a/src/hotspot/cpu/ppc/frame_ppc.inline.hpp#L40) in jdk21.
>> 
>> This pr depends on https://github.com/openjdk/jdk17u-dev/pull/3949.
>> 
>> Risk is low because the patch is small and ppc only and the changed method `JavaThread::pd_get_top_frame_for_profiling()` is only used when profiling with jfr or async-profiler.
>> 
>> The backport passed our CI testing: JTReg tests: tier1-4 of hotspot and jdk. All of Langtools and jaxp. JCK, SPECjvm2008, SPECjbb2015, Renaissance Suite, and SAP specific tests.
>> Testing was done with fastdebug builds on the main platforms and also on Linux/PPC64le.
>
> src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp line 68:
> 
>> 66:       }
>> 67:       // The last java pc will be found in the abi part of the last java frame.
>> 68:       *fr_addr = frame(sp);
> 
> I'm not a big fan of this diff, but the alternatives (changing frame constructor or determining pc here) are probably not better. So, ok.

+1

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

PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/3957#discussion_r2388282575


More information about the jdk-updates-dev mailing list