G'Day dtrace-discuss,

I saw an opportunity to demo DTrace recently, but jstack() for the Oracle JVM keeps returning incomplete stacks. I've tried a number of different JDK versions from 6 to 8, and options including libdtrace_forceload.so. Anyone know of a JDK version or workaround that does jstack() reliably?

# dtrace -n 'profile-99 /execname == "java"/ { @[jstack(100, 8000)] = count(); }'
[...]
              org/mozilla/javascript/ScriptableObject.createSlot(Ljava/lang/String;II)Lorg/mozilla/javascript/ScriptableObject$Slot;*
              0x884acce8200002da
                1

              sun/nio/ch/SocketChannelImpl.read(Ljava/nio/ByteBuffer;)I*
              0xffffffff20007f4b
                1

              org/mozilla/javascript/ScriptRuntime.newObjectLiteral([Ljava/lang/Object;[Ljava/lang/Object;[ILorg/mozilla/javascript/Context;Lorg/mozilla/javascript/Scriptable;)Lorg/mozilla/javascript/Scriptable;*
              0xa20000041
                1
[...]

A flame graph based on this output is more than 50% stacks like this. It looks a lot like omit frame pointer optimization, but there is no -XX:-omit-frame-pointer option I can find. :-)

I can use other profilers, but wanted to give DTrace a shot at this. Thanks,

Brendan

--