20050720 mercredi juillet 20, 2005

Dtrace on Mustang

Mustang (Java SE 6) will come with Dtrace support built-in but right now the situation is a bit tricky. First of all, Dtrace is a Solaris 10 feature, so you need either Solaris 10 or OpenSolaris, nothing older and by the way both are free! dtrace -l gives the list of available probes, that's a long list. It varies from setup to setup, on my system it is more than 38.000 available probes! It is easier to use dtrace ---l | wc -l, which only gives the number of available probes (+1 as there is a header). If you browse Mustang source tree, you will find Dtrace probes in the code but also some .d files, which are used to define probes. So, it is clear, current Mustang build already have some sort of Dtrace support built-in (again, on Solaris 10 only) Now, if you use one of the latest Sparc Mustang EA build and if you count the number of available probes while the JVM is running and not running, you will see that you get the same number of probes. That clearly means that the JVM doesn't have any probes. At first, I though that maybe Dtrace support has to be activated by using a JVM param. switch. I browsed in the Mustang tree, and couldn't really find anything about this. So probes should be available by default, which make sense as probes doesn't add overhead. You want them all the time, even in production. I can only thing about some high-grade security deployment where you would want to disable probes. So what is the trick to use the Mustang built-in probes? Well, it took me some time to figure this. The Mustang Solaris Build Instruction clearly says that Solaris 8 is the official build platform. And of course, Solaris 8 doesn't have Dtrace support! (*) So you have to build Mustang on Solaris 10 to get the Dtrace support. It took me a few hours, but I managed to go through the Mustang build process, and now have my own Solaris 10 Mustang build (based on b42 source tree). While the JVM is running (without any no specific JVM param.), counting the probes gives me an additional +- 500 probes!! To get the list of Java related probes, you either have to know provider name, probe name, etc. dtrace -l | grep hotspot or just do a diff of available probes with JVM off and JVM running, this should point you where to look at. dtrace -l > jvm_off.txt java -jar Java2Demo.jar dtrace -l > jvm_running.txt diff jvm_off.txt jvm_running.txt give :
... 7 hotspot_jni7001 libjvm.so jni_ReleaseLongArrayElements ReleaseLongArrayElements_entry 8 hotspot_jni7001 libjvm.so jni_GetLongArrayRegion GetLongArrayRegion_entry 9 hotspot_jni7001 libjvm.so jni_CallStaticObjectMethod CallStaticObjectMethod_return 10 hotspot_jni7001 libjvm.so jni_CallShortMethod CallShortMethod_return 11 hotspot_jni7001 libjvm.so jni_CallObjectMethodV CallObjectMethodV_return 12 hotspot_jni7001 libjvm.so jni_CallNonvirtualIntMethod CallNonvirtualIntMethod_entry 13 hotspot_jni7001 libjvm.so jni_IsSameObject IsSameObject_return 14 hotspot_jni7001 libjvm.so jni_GetDoubleArrayElements GetDoubleArrayElements_entry 15 hotspot_jni7001 libjvm.so jni_GetDirectBufferAddress GetDirectBufferAddress_return 16 hotspot_jni7001 libjvm.so jni_SetFloatArrayRegion SetFloatArrayRegion_return ...
Check here for the list of probes in build 42. Keep in mind that it is evolving, things can be added or dropped! Note that Mustang for Solaris x64 is built on Solaris 10 so the EA Mustang build on this platform have out-of-the-box Dtrace support! No need to build your own Sol10 build! And keep in mind that JVM-TI agent based approach should also work on JDK 6.0 EA JVM (JVM-PI is not supported above JDK 5.0) (*) According to Kelly, work is ongoing to be able to compile Dtrace probes on Solaris 8 (it is compiling Dtrace on Sol8, and not using Dtrace on Sol8!) Tags: ( juil. 20 2005, 02:04:09 AM PDT ) Permalink Comments [0]
Trackback URL: http://blogs.sun.com/delabassee/entry/dtrace_on_mustang
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed