Issues with dtrace enabled in OpenJdk 9
pujarimahesh_kumar at yahoo.com
Tue May 12 08:21:47 UTC 2015
I think I have mixed up things, like thinking SDT and dtrace4linux as same, but there are not as pointed out by Staffan.
So first I build jdk9 with not having SDT headers i.e. not having systemtap-dev. Build was success as expected.
Next I did a build having SDT headers in path (i.e. I having installed systemtap and systemtap-dev), as pointed out by David, dtrace will be enabled by default, it seems its working as expected, i.e. dtrace was enabled but the build failed with below error.
In file included from /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/utilities/dtrace.hpp:49:0,
../generated/dtracefiles/hotspot.h:14:5: error: "_DTRACE_VERSION" is not defined [-Werror=undef]
To fix this, I re-configured with "--with-extra-cflags=-D_DTRACE_VERSION=true" and did "make all LOG=info", now compilation are success but linking failed (lot of them), few of the logs as below
classLoadingService.o: In function `ClassLoadingService::notify_class_unloaded(InstanceKlass*)':
/mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/services/classLoadingService.cpp:119: undefined reference to `__dtrace_hotspot___class__unloaded'
classLoadingService.o: In function `ClassLoadingService::notify_class_loaded(InstanceKlass*, bool)':
/mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/services/classLoadingService.cpp:144: undefined reference to `__dtrace_hotspot___class__loaded'
compileBroker.o: In function `CompileBroker::invoke_compiler_on_method(CompileTask*)':
/mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/compiler/compileBroker.cpp:1927: undefined reference to `__dtrace_hotspot___method__compile__begin'
Do I need to install some other libraries, what am I missing here.
thanks and regards,Mahesh Pujari
On Monday, May 11, 2015 5:08 PM, Staffan Larsen <staffan.larsen at oracle.com> wrote:
Note that SDT and dtrace4linux are different things. As far as I know, no one has tried dtrace4linux with Hotspot so you are in uncharted territories. SDT should work (if installed). Oracle Linux also has an implementation of Dtrace that I think is different from dtrace4linux. This is also untested.
> On 11 maj 2015, at 13:21, David Holmes <david.holmes at oracle.com> wrote:
> On 11/05/2015 8:51 PM, Mahesh Pujari wrote:
>> Thanks for replying back Erik.
>> I ran as you stated i.e. using "make DTRACE_ENABLED=true" but then I realized that the configure that I was running would do the same i.e. by having CFLAGS=-DDTRACE_ENABLED=1.
> No it isn't the same. The linux/makefiles/dtrace.make looks for DTRACE_ENABLED and will define additional targets if it is set, as well as setting -DDTRACE_ENABLED. If you just set the define then you miss other things.
> But that aside you don't set DTRACE_ENABLED either. dtrace will be enabled if the SDT header file is found. If you just do a build without trying to force dtrace on what does the log show?
>> When I make (using your approach and passing enable in configure), I end up with lots and lots of "undefined reference to" errors during make, seems I am missing something, below are some error from build.logs.
>> classLoadingService.o: In function `ClassLoadingService::notify_class_unloaded(InstanceKlass*)':
>> /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/services/classLoadingService.cpp:119: undefined reference to `__dtrace_hotspot___class__unloaded'
>> classLoadingService.o: In function `ClassLoadingService::notify_class_loaded(InstanceKlass*, bool)':
>> /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/services/classLoadingService.cpp:144: undefined reference to `__dtrace_hotspot___class__loaded'
>> compileBroker.o: In function `CompileBroker::invoke_compiler_on_method(CompileTask*)':
>> /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/compiler/compileBroker.cpp:1927: undefined reference to `__dtrace_hotspot___method__compile__begin'
>> /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/compiler/compileBroker.cpp:2028: undefined reference to `__dtrace_hotspot___method__compile__end'
>> thanks and regards,Mahesh Pujari
>> On Monday, May 11, 2015 3:53 PM, Erik Joelsson <erik.joelsson at oracle.com> wrote:
>> I don't have any experience building with dtrace support, but the
>> Hotspot makefiles seem to imply that it can be achieved by running:
>> make DTRACE_ENABLED=true
>> That variable will trigger the appropriate preprocessor flags to be
>> added at least. See hotspot/make/linux/makefiles/dtrace.make.
>> The jdk libraries do not support dtrace AFAIK.
>> On 2015-05-11 11:47, Mahesh Pujari wrote:
>>> Hi all,
>>> I am trying make OpenJdk 9 with dtrace enabled, on my Ubuntu machine (installed with https://github.com/dtrace4linux/linux), with configuration as below (and I am noob).
>>> ./configure --enable-option-checking=fatal --with-debug-level=slowdebug --with-target-bits=64 --disable-zip-debug-info --with-boot-jdk=/mnt/ubuntu/setup/jdk1.8.0 CFLAGS=-DDTRACE_ENABLED=1 --with-extra-cflags=-D_DTRACE_VERSION=1
>>> Below is my system info (using uname -a)Linux PHP0045 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
>>> When I do "make all", I end up in error as below...
>>> vmThread.o: In function `VMOperationQueue::add(VM_Operation*)':
>>> /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/runtime/vmThread.cpp:156: undefined reference to `__dtrace_hotspot___vmops__request'
>>> vmThread.o: In function `VMThread::evaluate_operation(VM_Operation*)':
>>> /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/runtime/vmThread.cpp:354: undefined reference to `__dtrace_hotspot___vmops__begin'
>>> /mnt/ubuntu/dev/jdk9/hotspot/src/share/vm/runtime/vmThread.cpp:374: undefined reference to `__dtrace_hotspot___vmops__end'......
>>> Can some one direct me about what I might be missing. Can we actually build dtrace with enabled on Ubuntu, if not what other way I can do tracing (may be using systemtap, any pointers please). Am I on right track? (please direct).
>>> thanks and regards,Mahesh Pujari
More information about the build-dev