On Tue, 3 Mar 2026 09:17:54 GMT, Yasumasa Suenaga <[email protected]> wrote:
>> SA supports DWARF in jhsdb to unwind native call frames on Linux AMD64. It >> is better if DWARF is supported on other architectures. This RFE aims to >> implement it on AArch64. >> >> This make a big change, so I assembled in 5 commits: >> >> - Unify terminology to "sender" >> - >> https://github.com/YaSuenag/jdk/commit/9cab52f778a678b283533fa2129bdec378111abb >> - Several words ("next", "sender", no prefix) are used around frame >> related code in SA, >> thus the commit unified to "sender" to follow manner in HotSpot. >> - Separate DWARF implementation from Linux AMD64 >> - >> https://github.com/YaSuenag/jdk/commit/6c90a74e507bc6cf7068b4d74ffded6d516e4865 >> - DWARF related code can be separate as platform-independent. >> - ~~DWARF parser improvement~~ **Done in >> [JDK-8377947](https://bugs.openjdk.org/browse/JDK-8377947)** >> - >> ~~https://github.com/YaSuenag/jdk/commit/979eb7c0dc87c057fb1c0ca88c4ea217d04f09ca~~ >> - ~~Track all of registers' offset from CFA~~ >> - ~~Remember states when DWARF parser see `DW_CFA_restore_state` in each >> time~~ >> - Use DWARF on AArch64 >> - >> https://github.com/YaSuenag/jdk/commit/b4bd2f3f372cfe2a796a558a4eeada0d57318067 >> - Ignore PAC (PACA) >> - >> https://github.com/YaSuenag/jdk/commit/8ad3ee82da34a3a6ff0407997904079cced5f9f3 >> - Ignore AArch64 specific DWARF instructions >> (`DW_CFA_AARCH64_negate_ra_state`, `DW_CFA_AARCH64_negate_ra_state_with_pc`, >> `DW_CFA_AARCH64_set_ra_state`) >> - Mixed jstack might not work on PAC (Pointer Authentication Code) >> enabled platform (it is same with current SA) because SA does not decode >> PAC. We need to support it if possible (but I do not have PAC enabled Linux >> machines). >> - And also this commit disables TestJhsdbJstackMixedCore.java on AArch64 >> because it does not work on Fedora 43 AArch64. PC (program counter) points >> out of function in some case because the another function begins immediately >> after the end of interest function. If the function ends with `bl`, PC >> points beginning of next function. (I confirmed that with assembly code >> generated by GCC 15) >> >> >> I tested this change on following platforms: >> - Fedora 43 AMD64 >> - Oracle Linux 8.10 AMD64 >> - Fedora 43 AArch64 >> - Rocky Linux 9.5 AArch64 >> >> I tested serviceability/sa on each platforms. On Fedora 43 AArch64 on >> Raspberry Pi 4, TestJhsdbJstackMixedWithXComp.java timed out, but I believe >> it was caused by machine performance. I didn't see any warnings/errors on >> other platforms. In addition, my crash examples ... > > Yasumasa Suenaga has updated the pull request incrementally with one > additional commit since the last revision: > > Exclude DWARF related code from source list when the build runs on > unsupported platforms make/modules/jdk.hotspot.agent/Lib.gmk line 58: > 56: endif > 57: > 58: ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64 aarch64), > true+true) There is an `Or` function in Utils.gmk that you can use here, although I don't see any examples of it being put to use. I do see "$(call And..." being used. make/modules/jdk.hotspot.agent/Lib.gmk line 63: > 61: LIBSAPROC_EXCLUDE_FILES := DwarfParser.cpp dwarf.cpp > 62: endif > 63: This seems to build fine on riscv64. However, I only have access to the cross toolchain to build with. I don't have any access to any hosts to test on. You might want to work with the various porters to see if the want to get this working on their ports (riscv64, PowerPC, and s390), and at least test the current changes to make sure that nothing is currently broken. The only thing I can do is make sure riscv64 builds. I can't run any tests, and I have no access to PowerPc and s390 toolchains. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29731#discussion_r2879512200 PR Review Comment: https://git.openjdk.org/jdk/pull/29731#discussion_r2879516107
