changeset in /hg/icedtea6: Add systemtap java method tracing sup...
Mark Wielaard
mark at klomp.org
Wed Aug 5 11:40:54 PDT 2009
changeset 8a0ea636a6e5 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=8a0ea636a6e5
description:
Add systemtap java method tracing support.
2009-08-05 Mark Wielaard <mjw at redhat.com>
* patches/icedtea-systemtap.patch: Remove workaround for nmethod.cpp.
* tapset/hotspot.stp.in: Add tapset functions for
hotspot.method_entry, hotspot.method_return,
hotspot.compiled_method_load and hotspot.compiled_method_unload.
* NEWS: Metion new support for java method tracing.
* INSTALL: Add that java method tracing support needs systemtap
0.9.9 or higher.
diffstat:
5 files changed, 93 insertions(+), 25 deletions(-)
ChangeLog | 10 ++++
INSTALL | 1
NEWS | 4 +
patches/icedtea-systemtap.patch | 18 --------
tapset/hotspot.stp.in | 85 +++++++++++++++++++++++++++++++++++----
diffs (162 lines):
diff -r 2f1cdccc2d63 -r 8a0ea636a6e5 ChangeLog
--- a/ChangeLog Wed Aug 05 19:35:37 2009 +0200
+++ b/ChangeLog Wed Aug 05 20:43:00 2009 +0200
@@ -1,3 +1,13 @@ 2009-08-05 Matthias Klose <doko at ubuntu
+2009-08-05 Mark Wielaard <mjw at redhat.com>
+
+ * patches/icedtea-systemtap.patch: Remove workaround for nmethod.cpp.
+ * tapset/hotspot.stp.in: Add tapset functions for
+ hotspot.method_entry, hotspot.method_return,
+ hotspot.compiled_method_load and hotspot.compiled_method_unload.
+ * NEWS: Metion new support for java method tracing.
+ * INSTALL: Add that java method tracing support needs systemtap
+ 0.9.9 or higher.
+
2009-08-05 Matthias Klose <doko at ubuntu.com>
* Makefile.am (ABS_SOURCE_DIRS): Add $(abs_top_builddir)/rt.
diff -r 2f1cdccc2d63 -r 8a0ea636a6e5 INSTALL
--- a/INSTALL Wed Aug 05 19:35:37 2009 +0200
+++ b/INSTALL Wed Aug 05 20:43:00 2009 +0200
@@ -48,6 +48,7 @@ you cannot move that to another location
you cannot move that to another location without adjusting the paths
in the tapset/hotspot.stp file. For example:
--enable-systemtap --with-abs-install-dir=/usr/lib/jvm/java-1.6.0-openjdk
+(Java method tracing works starting with systemtap 0.9.9)
See ./configure --help if you need to override the defaults.
diff -r 2f1cdccc2d63 -r 8a0ea636a6e5 NEWS
--- a/NEWS Wed Aug 05 19:35:37 2009 +0200
+++ b/NEWS Wed Aug 05 20:43:00 2009 +0200
@@ -1,3 +1,7 @@ New in release 1.5 (2009-05-20)
+New in release 1.6 (UNRELEASED)
+
+- Added java method tracing using systemtap version 0.9.9+.
+
New in release 1.5 (2009-05-20)
- Static trace support through systemtap.
diff -r 2f1cdccc2d63 -r 8a0ea636a6e5 patches/icedtea-systemtap.patch
--- a/patches/icedtea-systemtap.patch Wed Aug 05 19:35:37 2009 +0200
+++ b/patches/icedtea-systemtap.patch Wed Aug 05 20:43:00 2009 +0200
@@ -9,24 +9,6 @@ diff -r 945bf7540697 make/linux/makefile
+CFLAGS += -DDTRACE_ENABLED
+
+# It doesn't support HAVE_DTRACE_H though.
-diff -r 945bf7540697 src/share/vm/code/nmethod.cpp
---- openjdk/hotspot/src/share/vm/code/nmethod.cpp Thu Jan 22 14:42:01 2009 -0800
-+++ openjdk/hotspot/src/share/vm/code/nmethod.cpp Mon Feb 02 13:47:34 2009 +0100
-@@ -22,6 +22,14 @@
- *
- */
-
-+#ifdef __GNUC__
-+// GCC seems to have some trouble with the inserted probes.
-+// error: _probe_compiled__method__unload causes a section type conflict
-+// error: compiled__method__unload_probe_name causes a section type conflict
-+// So disable probe insertion for now.
-+#undef DTRACE_ENABLED
-+#endif
-+
- # include "incls/_precompiled.incl"
- # include "incls/_nmethod.cpp.incl"
-
diff -r 945bf7540697 src/share/vm/prims/jni.cpp
--- openjdk/hotspot/src/share/vm/prims/jni.cpp Thu Jan 22 14:42:01 2009 -0800
+++ openjdk/hotspot/src/share/vm/prims/jni.cpp Mon Feb 02 13:47:34 2009 +0100
diff -r 2f1cdccc2d63 -r 8a0ea636a6e5 tapset/hotspot.stp.in
--- a/tapset/hotspot.stp.in Wed Aug 05 19:35:37 2009 +0200
+++ b/tapset/hotspot.stp.in Wed Aug 05 20:43:00 2009 +0200
@@ -409,13 +409,84 @@ probe hotspot.monitor_contended_exit =
name, thread_id, id, class);
}
-// Doesn't work yet.
-// method__entry
-// method__return
-
-// Missing
-// compiled__method__load
-// compiled__method__unload
+/* hotspot.method_entry (extended probe)
+ Triggers when a method is entered.
+ Sets thread_id to the current java thread id, class to the name of
+ the class, method to the name of the method, and sig to the
+ signature string of the method.
+ Needs -XX:+ExtendedDTraceProbes.
+*/
+probe hotspot.method_entry =
+ process("@ABS_CLIENT_LIBJVM_SO@").mark("method__entry"),
+ process("@ABS_SERVER_LIBJVM_SO@").mark("method__entry")
+{
+ name = "method_entry";
+ thread_id = $arg1;
+ class = user_string_n($arg2, $arg3);
+ method = user_string_n($arg4, $arg5);
+ sig = user_string_n($arg6, $arg7);
+ probestr = sprintf("%s(thread_id=%d,class='%s',method='%s',sig='%s')",
+ name, thread_id, class, method, sig);
+}
+
+/* hotspot.method_return (extended probe)
+ Triggers when a method returns.
+ Sets thread_id to the current java thread id, class to the name of
+ the class, method to the name of the method, and sig to the
+ signature string of the method.
+ Needs -XX:+ExtendedDTraceProbes.
+*/
+probe hotspot.method_return =
+ process("@ABS_CLIENT_LIBJVM_SO@").mark("method__return"),
+ process("@ABS_SERVER_LIBJVM_SO@").mark("method__return")
+{
+ name = "method_return";
+ thread_id = $arg1;
+ class = user_string_n($arg2, $arg3);
+ method = user_string_n($arg4, $arg5);
+ sig = user_string_n($arg6, $arg7);
+ probestr = sprintf("%s(thread_id=%d,class='%s',method='%s',sig='%s')",
+ name, thread_id, class, method, sig);
+}
+
+/* hotspot.compiled_method_load
+ Triggers when a compiled method is loaded.
+ Sets class to the name of the class, method to the name of the
+ method, sig to the signature string of the method, code to the
+ address where the code is loaded and size to the number of bytes of
+ code.
+*/
+probe hotspot.compiled_method_load =
+ process("@ABS_CLIENT_LIBJVM_SO@").mark("compiled__method__load"),
+ process("@ABS_SERVER_LIBJVM_SO@").mark("compiled__method__load")
+{
+ name = "compiled_method_load";
+ class = user_string_n($arg1, $arg2);
+ method = user_string_n($arg3, $arg4);
+ sig = user_string_n($arg5, $arg6);
+ code = $arg7;
+ size = $arg8;
+ probestr = sprintf("%s(class='%s',method='%s',sig='%s',code=0x%x,size=%d)",
+ name, class, method, sig, code, size);
+}
+
+/* hotspot.compiled_method_unload
+ Triggers when a compiled method is unloaded.
+ Sets class to the name of the class, method to the name of the
+ method, sig to the signature string of the method.
+*/
+probe hotspot.compiled_method_unload =
+ process("@ABS_CLIENT_LIBJVM_SO@").mark("compiled__method__unload"),
+ process("@ABS_SERVER_LIBJVM_SO@").mark("compiled__method__unload")
+{
+ name = "compiled_method_unload";
+ class = user_string_n($arg1, $arg2);
+ method = user_string_n($arg3, $arg4);
+ sig = user_string_n($arg5, $arg6);
+ probestr = sprintf("%s(class='%s',method='%s',sig='%s')",
+ name, class, method, sig);
+}
+
// Extra private probes
// hashtable__new_entry
More information about the distro-pkg-dev
mailing list