battleblow / openjdk-jdk11u

BSD port of OpenJDK 11
GNU General Public License v2.0
9 stars 8 forks source link

dtrace aarch64 #62

Open klaus4 opened 5 years ago

klaus4 commented 5 years ago

Although dtrace is implemented on FreeBSD / aarch64, we get:

dtrace: failed to link script /root/openjdk-jdk11u/build/bsd-aarch64-normal-server-fastdebug/hotspot/variant-server/support/dtrace/dtrace.od: an error was encountered while processing / root / openjdk jdk11u / build / bsd-aarch64-normal-server-fast debug / hotspot / variant-server / libjvm / objs / classLoadingService.o dt_modtext: /usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c (811): aarch64 not implemented

- from here: https://github.com/freebsd/freebsd/blob/master/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c

at Oracle looks better for aarch64: https://github.com/oracle/dtrace-utils/blob/master/libdtrace/dt_link.c (dt_link.c implements aarch64) Well, since this is in the kernel, we probably can not do much from here except maybe a bug report with patch. But maybe there is another possibility .. ?

no idea what NetBSD / OpenBSD looks like with dtrace / aarch64

battleblow commented 5 years ago

The only thing we can really is to disable dtrace for aarch64. There is already a configuration option to do that and I'm not sure adding logic to do it automatically is worthwhile. It is something we'll need to do in the FreeBSD ports system though.

Did you create a FreeBSD bug report for adding aarch64 support?

klaus4 commented 5 years ago

Mikael & others have addressed the problem for another application at the time The bug has been "fixed" by disabling dtrace under aarch64 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224271 This should perhaps be warmed up again, I still try to hack a patch (takes "a little bit" longer with often make buildkernel), if I can not manage a patch in the next few days, I will send a new bug report without patch but with hint to the Oracle sources.

klaus4 commented 5 years ago

O.K, I've added new bug-report now : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239805

klaus4 commented 5 years ago

small "water level message" ( `ve compiled openjdk11/aarch64 with dtrace enabled) : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239805#c1

... see you later with further tests

klaus4 commented 5 years ago

details_dump_etc.txt

klaus4 commented 5 years ago
root@generic:~ # uname -a
FreeBSD generic 13.0-CURRENT FreeBSD 13.0-CURRENT #4 14aef6dfca9-c262785(master)-dirty: Sun Sep 22 01:31:32 UTC 2019     root@generic:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC  arm64
 # java  -XX:+DTraceMethodProbes -version
openjdk version "11.0.5-internal" 2019-10-15
OpenJDK Runtime Environment (fastdebug build 11.0.5-internal+0-adhoc.root.openjdk-jdk11u)
OpenJDK 64-Bit Server VM (fastdebug build 11.0.5-internal+0-adhoc.root.openjdk-jdk11u, mixed mode)
 # java -XX:+DTraceMonitorProbes -version
openjdk version "11.0.5-internal" 2019-10-15
OpenJDK Runtime Environment (fastdebug build 11.0.5-internal+0-adhoc.root.openjdk-jdk11u)
OpenJDK 64-Bit Server VM (fastdebug build 11.0.5-internal+0-adhoc.root.openjdk-jdk11u, mixed mode)

it will core-dump in :

#java -XX:+DTraceAllocProbes -version ( which is the 3rd part of -XX:+ExtendedDTraceProbes )

so the crash comes from here :

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp : 3616 src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp:2523

`ve filed another bug report : https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241028#c0

because we even cannot test on any pid-provider

klaus4 commented 4 years ago

one step forward: dt_link.c merged into fbsd13-current : https://github.com/freebsd/freebsd/commit/2ade50c4604d177da75b805a24d65bf06af13bf4 for testing openjdk has to be compiled with :

--enable-dtrace \
--with-extra-ldflags='-Wl,-z,notext'  \

I'm now working on the fasttrap- implementation, some steps forward but not yet ready.. when fasttrap/pid-provider is ready I guess we will have to adjust -XX:+ExtendedDTraceProbes inside here ..