This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Better systemtap java integration - added hotspot tapset


Hi,

IcedTea contained some support for trace markers since a while. But it
wasn't very convenient to use with systemtap. Systemtap 0.9.7 contains
an important bugfix that makes shared library probeing (libjvm.so)
better. I wrote a hotspot.stp tapset that takes advantage of the markers
(which are the same as dtrace uses) inside libjvm.so and that exposes
the various arguments and some convenient aggregates to make tracing
hotspot with systemtap very easy and powerful.

2009-04-28  Mark Wielaard  <mjw@redhat.com>

   * tapset/hotspot.stp.in: New systemtap tapset for hotspot.
   * configure.ac: Add check for abs-install-dir when
   --enable-systemtap is given.
   * Makefile.am (icedtea.stamp): Install tapsets.
   (icedtea-debug.stamp): Likewise.
   * .hgignore: Add tapset/hotspot.stp.

When configuring with --enable-systemtap this will now install a
tapset/hotspot.stp in the j2sdk-image directory. If you are going to
install in some other permanent location, such as distributions, then
there is a new --with-abs-install-dir option that can be used (for most
distros this should be set to /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/).
The probes are placed in both client and server libjvm.so, so you can
use either.

The tapset makes available the following probes:

hotspot.gc_begin
hotspot.gc_end
hotspot.mem_pool_gc_begin
hotspot.mem_pool_gc_end
hotspot.object_alloc (*)
hotspot.vm_init_begin
hotspot.vm_init_end
hotspot.vm_shutdown
hotspot.thread_start
hotspot.thread_stop
hotspot.class_loaded
hotspot.class_unloaded
hotspot.method_compile_begin
hotspot.method_compile_end
hotspot.monitor_wait (*)
hotspot.monitor_waited (*)
hotspot.monitor_notify (*)
hotspot.monitor_notifyAll (*)
hotspot.monitor_contended_enter (*)
hotspot.monitor_contended_entered (*)
hotspot.monitor_contended_exit (*)

The are all documented in the hotspot.stp tapset. Each probe makes at
least its name and a full probestr variable available that can be used
to quickly get all arguments of each probe. Variables that aren't used
are optimized away and will not be evaluated, making the tapset both
convenient and efficient. probes marked with a (*) are only triggered
when java has been started with -XX:+ExtendedDTraceProbes.

Some examples from a trace of HelloWorld (lots of output trimmed):
stap -I j2sdk-image/tapset -e 'probe hotspot.* {log(probestr)}' \
  -c 'j2sdk-image/bin/java HelloWorld'

vm_init_begin
class_loaded(class='java/lang/Object',classloader_id=0x0,is_shared=0)
class_loaded(class='java/io/Serializable',classloader_id=0x0,is_shared=0)
class_loaded(class='java/lang/Comparable',classloader_id=0x0,is_shared=0)
class_loaded(class='java/lang/CharSequence',classloader_id=0x0,is_shared=0)
class_loaded(class='java/lang/String',classloader_id=0x0,is_shared=0)
thread_start(thread_name='Reference Handler',id=2,native_id=22685,is_daemon=1)
thread_start(thread_name='Finalizer',id=3,native_id=22686,is_daemon=1)
vm_init_end
thread_start(thread_name='Signal Dispatcher',id=4,native_id=22687,is_daemon=1)
thread_start(thread_name='CompilerThread0',id=5,native_id=22688,is_daemon=1)
thread_start(thread_name='Low Memory Detector',id=6,native_id=22689,is_daemon=1)
method_compile_begin(compiler='C1',class='java/lang/String',method='hashCode',sig='()I')
method_compile_end(compiler='C1',class='java/lang/String',method='hashCode',sig='()I')
method_compile_begin(compiler='C1',class='java/lang/String',method='indexOf',sig='(II)I')
method_compile_end(compiler='C1',class='java/lang/String',method='indexOf',sig='(II)I')
thread_stop(thread_name='Signal Dispatcher',id=4,native_id=22687,is_daemon=1)
vm_shutdown

And with -XX:+ExtendedDTraceProbes added you will also get information like:

object_alloc(thread_id=1,class='[Ljava/security/cert/Certificate;',size=0x21)
object_alloc(thread_id=7,class='java/util/Collections$EmptyList',size=0x1f)
monitor_wait(thread_id=2,id=0x817feb4,class='java/lang/ref/Reference$Lock',timeout=0)
monitor_wait(thread_id=3,id=0x8180b34,class='java/lang/ref/ReferenceQueue$Lock',timeout=0)

And on larger programs you can see the various garbage collectors and
monitor contention in play:

gc_begin(is_full=0)
gc_end
mem_pool_gc_begin(manager='Copy',pool='Code Cache',initial=163840,used=785856,committed=786432,max=33554432)
mem_pool_gc_begin(manager='Copy',pool='Eden Space',initial=917504,used=917504,committed=917504,max=33030144)
mem_pool_gc_begin(manager='Copy',pool='Survivor Space',initial=65536,used=65536,committed=65536,max=4128768)
mem_pool_gc_begin(manager='Copy',pool='Tenured Gen',initial=4194304,used=784640,committed=4194304,max=495583232)
mem_pool_gc_begin(manager='Copy',pool='Perm Gen',initial=12582912,used=8340016,committed=12582912,max=67108864)
mem_pool_gc_end(manager='Copy',pool='Code Cache',initial=163840,used=785856,committed=786432,max=33554432)
mem_pool_gc_end(manager='Copy',pool='Eden Space',initial=917504,used=0,committed=917504,max=33030144)
mem_pool_gc_end(manager='Copy',pool='Survivor Space',initial=65536,used=65536,committed=65536,max=4128768)
mem_pool_gc_end(manager='Copy',pool='Tenured Gen',initial=4194304,used=1016496,committed=4194304,max=495583232)
mem_pool_gc_end(manager='Copy',pool='Perm Gen',initial=12582912,used=8340016,committed=12582912,max=67108864)
monitor_notifyAll(thread_id=1,id=0x9da26bc,class='java/lang/Object')
monitor_contended_exit(thread_id=1,id=0x9da26bc,class='java/lang/Object')
monitor_waited(thread_id=11,id=0x9da26bc,class='java/lang/Object')
monitor_wait(thread_id=11,id=0x9da26bc,class='java/lang/Object',timeout=0)
monitor_contended_enter(thread_id=12,id=0x9e3a7b0,class='java/awt/Component$AWTTreeLock')
monitor_contended_exit(thread_id=1,id=0x9e3a7b0,class='java/awt/Component$AWTTreeLock')
monitor_contended_exit(thread_id=1,id=0x9e3a7b0,class='java/awt/Component$AWTTreeLock')
monitor_contended_entered(thread_id=12,id=0x9e3a7b0,class='java/awt/Component$AWTTreeLock')
monitor_notifyAll(thread_id=1,id=0x9da26bc,class='java/lang/Object')

I'll write a followup post with some issues that could be improved to
make this even more useful and enable even more probes.

Feedback on the installation appreciated. Is the current location OK, or
should it go into a shared/system systemtap tapset directory (so it is
automagically picked up instead of needed -I)? Does this setup work for
distro packagers?

Cheers,

Mark
diff -r 6123e2454ad9 -r df5a8e49d157 Makefile.am
--- a/Makefile.am	Tue Apr 28 05:50:02 2009 -0400
+++ b/Makefile.am	Tue Apr 28 16:53:58 2009 +0200
@@ -1161,6 +1161,11 @@
 	cp -r netbeans/nbbuild/netbeans_visualvm/profiler3 \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/lib/visualvm	
 endif
+if ENABLE_SYSTEMTAP
+	mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset ; \
+	cp $(abs_top_srcdir)/tapset/*.stp \
+	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset
+endif
 	cp $(abs_top_srcdir)/rt/net/sourceforge/jnlp/resources/about.jnlp \
 	  extra-lib/about.jar \
 	  $(BUILD_OUTPUT_DIR)/j2re-image/lib ; \
@@ -1228,6 +1233,11 @@
 	cp -r netbeans/nbbuild/netbeans_visualvm/profiler3 \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/lib/visualvm
 endif
+if ENABLE_SYSTEMTAP
+	mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset ; \
+	cp $(abs_top_srcdir)/tapset/*.stp \
+	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset
+endif
 	cp $(abs_top_srcdir)/rt/net/sourceforge/jnlp/resources/default.jnlp \
 	  extra-lib/about.jar \
 	  $(BUILD_OUTPUT_DIR)-debug/j2re-image/lib ; \
diff -r 6123e2454ad9 -r df5a8e49d157 configure.ac
--- a/configure.ac	Tue Apr 28 05:50:02 2009 -0400
+++ b/configure.ac	Tue Apr 28 16:53:58 2009 +0200
@@ -362,6 +362,23 @@
 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'],
                 [SDT_H_FOUND='no';
                    AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
+
+  AC_MSG_CHECKING([for absolute java home install dir])
+  AC_ARG_WITH([abs-install-dir],
+	      [AS_HELP_STRING([--with-abs-install-dir], 
+			      [The absolute path where the j2sdk-image dir will be installed])],
+	      [if test "x${withval}" = x; then
+		 ABS_JAVA_HOME_DIR="`pwd`/openjdk/build/${BUILD_OS_DIR}-${BUILD_ARCH_DIR}/j2sdk-image"
+	       else
+		 ABS_JAVA_HOME_DIR="${withval}"
+	       fi], [ABS_JAVA_HOME_DIR="`pwd`/openjdk/build/${BUILD_OS_DIR}-${BUILD_ARCH_DIR}/j2sdk-image"])
+  AC_MSG_RESULT([${ABS_JAVA_HOME_DIR}])
+  ABS_CLIENT_LIBJVM_SO="${ABS_JAVA_HOME_DIR}/jre/lib/${INSTALL_ARCH_DIR}/client/libjvm.so"
+  ABS_SERVER_LIBJVM_SO="${ABS_JAVA_HOME_DIR}/jre/lib/${INSTALL_ARCH_DIR}/server/libjvm.so"
+  AC_SUBST(ABS_JAVA_HOME_DIR)
+  AC_SUBST(ABS_CLIENT_LIBJVM_SO)
+  AC_SUBST(ABS_SERVER_LIBJVM_SO)
+  AC_CONFIG_FILES([tapset/hotspot.stp])
 fi
 
 dnl Check for libpng headers and libraries.
/* hotspot systemtap tapset.
   Copyright (C) 2009, Red Hat Inc.

This file is part of IcedTea.

IcedTea is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

IcedTea is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with IcedTea; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/

/*
 Currently only works with full path in process probes below.
 When things don't seem to work look if the correct
 jre/lib/[arch]/[client|server]/libjvm.so is used
 and exists under @ABS_JAVA_HOME_DIR@/.
 This version of hotspot.stp has been configured to instrument the
 libjvm.so for arch @INSTALL_ARCH_DIR@ installed at:
 @ABS_CLIENT_LIBJVM_SO@
 @ABS_SERVER_LIBJVM_SO@
 
 Each probe defines the probe name and a full probestr which consists
 of the probe name and between brackets all argument names and values.
 */

/* hotspot.gc_begin
 * Triggeres when a system wide garbage collection begins.
 * Sets is_full if this is a full garbage collect.
 */
probe hotspot.gc_begin =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__begin"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__begin")
{
  name = "gc_begin";
  is_full = $arg1;
  probestr = sprintf("%s(is_full=%d)", name, is_full);
}

/* hotspot.gc_end
   Triggers when a system wide garbage collection ends.
   Has no arguments.
 */
probe hotspot.gc_end =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("gc__begin"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("gc__begin")
{
  name = "gc_end";
  probestr = name;
}


/* hotspot.mem_pool_gc_begin
   Triggers when a memory pool collection begins.
   Sets manager to the manager name that controls this memory pool
   (e.g. 'Copy' or 'MarkSweepCompact'), pool to the pool name (e.g.
   'Code Cache', 'Eden Space', 'Survivor Space', 'Tenured Gen', or
   'Perm Gen'), initial to the initial byte size of the pool, used
   to the number bytes in use, committed to the number of committed
   pages and max to the maximum size of the pool.
 */
probe hotspot.mem_pool_gc_begin =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("mem__pool__gc__begin"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("mem__pool__gc__begin")
{
  name = "mem_pool_gc_begin";
  manager = user_string_n($arg1, $arg2);
  pool = user_string_n($arg3, $arg4);
  initial = $arg5;
  used = $arg6;
  committed = $arg7;
  max = $arg8;
  probestr = sprintf("%s(manager='%s',pool='%s',initial=%d,used=%d,committed=%d,max=%d)",
                     name, manager, pool, initial, used, committed, max);
}

/* hotspot.mem_pool_gc_end
   Triggers when a memory pool collection ends.
   Sets manager to the manager name that controls this memory pool
   (e.g. 'Copy' or 'MarkSweepCompact'), pool to the pool name (e.g.
   'Code Cache', 'Eden Space', 'Survivor Space', 'Tenured Gen', or
   'Perm Gen'), initial to the initial byte size of the pool, used
   to the number bytes in use, committed to the number of committed
   pages and max to the maximum size of the pool.
 */
probe hotspot.mem_pool_gc_end =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("mem__pool__gc__end"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("mem__pool__gc__end")
{
  name = "mem_pool_gc_end";
  manager = user_string_n($arg1, $arg2);
  pool = user_string_n($arg3, $arg4);
  initial = $arg5;
  used = $arg6;
  committed = $arg7;
  max = $arg8;
  probestr = sprintf("%s(manager='%s',pool='%s',initial=%d,used=%d,committed=%d,max=%d)",
                     name, manager, pool, initial, used, committed, max);
}

/* hotspot.object_alloc (extended probe)
   Triggers whenever an object is allocated.
   Sets thread_id to the current thread id, class to the class name
   of the object allocated, and size to the size of the object.
   Needs -XX:+ExtendedDTraceProbes.
 */
probe hotspot.object_alloc =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("object__alloc"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("object__alloc")
{
  name = "object_alloc";
  thread_id = $arg1;
  class = user_string_n($arg2, $arg3);
  size = $arg3;
  probestr = sprintf("%s(thread_id=%d,class='%s',size=0x%x)",
                     name, thread_id, class, size);
}

/* hotspot.vm_init_begin
   Triggers at the beginning of the virtual machine initialization.
   Has no arguments
 */
probe hotspot.vm_init_begin =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("vm__init__begin"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("vm__init__begin")
{
  name = "vm_init_begin";
  probestr = name;
}

/* hotspot.vm_init_end
   Triggers at the end of the virtual machine initialization.
   Has no arguments.
 */
probe hotspot.vm_init_end =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("vm__init__end"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("vm__init__end")
{
  name = "vm_init_end";
  probestr = name;
}

/* hotspot.vm_shutdown
   Triggers at the shutdown of the virtual machine initialization.
   Has no arguments.
 */
probe hotspot.vm_shutdown =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("vm__shutdown"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("vm__shutdown")
{
  name = "vm_shutdown";
  probestr = name;
}

/* hotspot.thread_start
   Triggers when a java thread is started.
   Sets name to the name of the thread, id to the java thread id,
   native_id to the os thread number and is_daemon if the thread
   is a daemon thread.
 */
probe hotspot.thread_start =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("thread__start"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("thread__start")
{
  name = "thread_start";
  thread_name = user_string_n($arg1, $arg2);
  id = $arg3;
  native_id = $arg4;
  is_daemon = $arg5;
  probestr = sprintf("%s(thread_name='%s',id=%d,native_id=%d,is_daemon=%d)",
                     name, thread_name, id, native_id, is_daemon);
}

/* hotspot.thread_stop
   Triggers when a java thread stops.
   Sets name to the name of the thread, id to the java thread id,
   native_id to the os thread number and is_daemon if the thread
   is a daemon thread.
 */
probe hotspot.thread_stop =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("thread__stop"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("thread__stop")
{
  name = "thread_stop";
  thread_name = user_string_n($arg1, $arg2);
  id = $arg3;
  native_id = $arg4;
  is_daemon = $arg5;
  probestr = sprintf("%s(thread_name='%s',id=%d,native_id=%d,is_daemon=%d)",
                     name, thread_name, id, native_id, is_daemon);
}

/* hotspot.class_loaded
   Triggers when a class is loaded.
   Sets name to the loaded class name, classloader_id to the id
   of the classloader that loaded this class and is_shared if the
   class was loaded from a shared archive.
 */
probe hotspot.class_loaded =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("class__loaded"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("class__loaded")
{
  name = "class_loaded";
  class = user_string_n($arg1, $arg2);
  classloader_id = $arg3;
  is_shared = $arg4;
  probestr = sprintf("%s(class='%s',classloader_id=0x%x,is_shared=%d)",
                     name, class, classloader_id, is_shared);
}

/* hotspot.class_unloaded
   Triggers when a class is unloaded.
   Sets name to the loaded class name, classloader_id to the id
   of the classloader that loaded this class and is_shared if the
   class was loaded from a shared archive.
 */
probe hotspot.class_unloaded =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("class__unloaded"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("class__unloaded")
{
  name = "class_unloaded";
  class = user_string_n($arg1, $arg2);
  classloader_id = $arg3;
  is_shared = $arg4;
  probestr = sprintf("%s(class='%s',classloader_id=0x%x,is_shared=%d)",
                     name, class, classloader_id, is_shared);
}

/* hotspot.method_compile_begin
   Triggers when a method is being compiled.
   Sets compiler to the name of the compiler (e.g. 'C1' or 'C2'),
   class to the name of the class, method to the name of the method,
   and sig to the signature string of the method.
*/
probe hotspot.method_compile_begin =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("method__compile__begin"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("method__compile__begin")
{
  name = "method_compile_begin";
  compiler = user_string_n($arg1, $arg2);
  class = user_string_n($arg3, $arg4);
  method = user_string_n($arg5, $arg6);
  sig = user_string_n($arg7, $arg8);
  probestr = name . "(compiler='" . compiler . "',class='" . class
           . "',method='" . method . "',sig='" . sig . "')";
}

/* hotspot.method_compile_end
   Triggers when a method has been compiled.
   Sets compiler to the name of the compiler (e.g. 'C1' or 'C2'),
   class to the name of the class, method to the name of the method,
   and sig to the signature string of the method.
*/
probe hotspot.method_compile_end =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("method__compile__end"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("method__compile__end")
{
  name = "method_compile_end";
  compiler = user_string_n($arg1, $arg2);
  class = user_string_n($arg3, $arg4);
  method = user_string_n($arg5, $arg6);
  sig = user_string_n($arg7, $arg8);
  probestr = name . "(compiler='" . compiler . "',class='" . class
           . "',method='" . method . "',sig='" . sig . "')";
}

/* hotspot.monitor_wait (extended probe)
   Triggers when a thread enters Object.wait().
   Sets thread_id to the current java thread, id to the unique id
   for this monitor, class to the class name of the object and
   timeout to the number of ms given (or zero for waiting indefinitely).
   Needs -XX:+ExtendedDTraceProbes.
 */
probe hotspot.monitor_wait =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("monitor__wait"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("monitor__wait")
{
  name = "monitor_wait";
  thread_id = $arg1;
  id = $arg2;
  class = user_string_n($arg3, $arg4);
  timeout = $arg5;
  probestr = sprintf("%s(thread_id=%d,id=0x%x,class='%s',timeout=%d)",
                     name, thread_id, id, class, timeout);
}

/* hotspot.monitor_waited (extended probe)
   Triggers when a thread exits Object.wait().
   Sets thread_id to the current java thread, id to the unique id
   for this monitor and class to the class name of the object.
   Needs -XX:+ExtendedDTraceProbes.
 */
probe hotspot.monitor_waited =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("monitor__waited"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("monitor__waited")
{
  name = "monitor_waited";
  thread_id = $arg1;
  id = $arg2;
  class = user_string_n($arg3, $arg4);
  probestr = sprintf("%s(thread_id=%d,id=0x%x,class='%s')",
                     name, thread_id, id, class);
}

/* Doesn't resolve atm.
   hotspot.monitor_notify (extended probe)
   Triggers when a thread calls Object.notify().
   Sets thread_id to the current java thread, id to the unique id
   for this monitor and class to the class name of the object.
   Needs -XX:+ExtendedDTraceProbes.
probe hotspot.monitor_notify =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("monitor__notify"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("monitor__notify")
{
  name = "monitor_notify";
  thread_id = $arg1;
  id = $arg2;
  class = user_string_n($arg3, $arg4);
  probestr = sprintf("%s(thread_id=%d,id=0x%x,class='%s')",
                     name, thread_id, id, class);
}
 */

/* hotspot.monitor_notifyAll (extended probe)
   Triggers when a thread calls Object.notifyAll().
   Sets thread_id to the current java thread, id to the unique id
   for this monitor and class to the class name of the object.
   Needs -XX:+ExtendedDTraceProbes.
 */
probe hotspot.monitor_notifyAll =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("monitor__notifyAll"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("monitor__notifyAll")
{
  name = "monitor_notifyAll";
  thread_id = $arg1;
  id = $arg2;
  class = user_string_n($arg3, $arg4);
  probestr = sprintf("%s(thread_id=%d,id=0x%x,class='%s')",
                     name, thread_id, id, class);
}

/* hotspot.monitor_contended_enter (extended probe)
   Triggers when a thread tries to acquire a monitor (syncronized block)
   which is currently held by another thread (that other thread will
   exit the monitor triggering hotspot.monitor_contended_exit at a
   later time).
   Sets thread_id to the current java thread, id to the unique id
   for this monitor and class to the class name of the object.
   Needs -XX:+ExtendedDTraceProbes.
 */
probe hotspot.monitor_contended_enter =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("monitor__contended__enter"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("monitor__contended__enter")
{
  name = "monitor_contended_enter";
  thread_id = $arg1;
  id = $arg2;
  class = user_string_n($arg3, $arg4);
  probestr = sprintf("%s(thread_id=%d,id=0x%x,class='%s')",
                     name, thread_id, id, class);
}

/* hotspot.monitor_contended_enter (extended probe)
   Triggers when a thread acquires a contended monotor (after
   hotspot.monitor_contended_enter has been triggered on this thread,
   and the other thread triggered a hotspot.monitor_contended_exit).
   Sets thread_id to the current java thread, id to the unique id
   for this monitor and class to the class name of the object.
   Needs -XX:+ExtendedDTraceProbes.
 */
probe hotspot.monitor_contended_entered =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("monitor__contended__entered"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("monitor__contended__entered")
{
  name = "monitor_contended_entered";
  thread_id = $arg1;
  id = $arg2;
  class = user_string_n($arg3, $arg4);
  probestr = sprintf("%s(thread_id=%d,id=0x%x,class='%s')",
                     name, thread_id, id, class);
}

/* hotspot.monitor_contended_exit (extended probe)
   Triggers when a thread tries to exit a monitor (synchronized block)
   that another thread wants to enter (the other thread has triggered
   hotspot.monitor_contended_enter).
   Sets thread_id to the current java thread, id to the unique id
   for this monitor and class to the class name of the object.
   Needs -XX:+ExtendedDTraceProbes.
 */
probe hotspot.monitor_contended_exit =
  process("@ABS_CLIENT_LIBJVM_SO@").mark("monitor__contended__exit"),
  process("@ABS_SERVER_LIBJVM_SO@").mark("monitor__contended__exit")
{
  name = "monitor_contended_exit";
  thread_id = $arg1;
  id = $arg2;
  class = user_string_n($arg3, $arg4);
  probestr = sprintf("%s(thread_id=%d,id=0x%x,class='%s')",
                     name, thread_id, id, class);
}

// Doesn't work yet.
// method__entry
// method__return

// Missing
// compiled__method__load
// compiled__method__unload

// Extra private probes
// hashtable__new_entry

// safepoint__begin
// safepoint__end

// cms__initmark__begin
// cms__initmark__end
// cms__remark__begin
// cms__remark__end

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]