/hg/release/icedtea6-1.5: 9 new changesets

mjw at icedtea.classpath.org mjw at icedtea.classpath.org
Thu Dec 17 13:42:05 PST 2009


changeset 85ecc550df1f in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=85ecc550df1f
author: Mark Wielaard <mark at klomp.org>
date: Wed Aug 05 20:43:00 2009 +0200

	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.


changeset e77f7270fd22 in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=e77f7270fd22
author: Mark Wielaard <mark at klomp.org>
date: Thu Dec 17 16:54:20 2009 +0100

	Move NEWS about systemtap support from 1.6 to 1.5.4.


changeset 58b7ae54c4de in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=58b7ae54c4de
author: Mark Wielaard <mark at klomp.org>
date: Wed Oct 14 15:42:32 2009 +0200

	Enable systemtap JNI tracing.

	2009-10-14 Mark Wielaard <mjw at redhat.com>

	 * configure.ac: When enabling systemtap support check
	sys/sdt.h and g++ are recent enough to allow probes in class
	constructors and destructors.
	        * patches/icedtea-systemtap.patch: Enable compiling probes in
	jni.cpp. Rewrite Set<prim>Field and SetStatic<prim>Field macros
	to use DTRACE_PROBE interface directly instead of generating
	dtrace implementation calls. Clean up dtrace.hpp.
	        * tapset/hotspot.stp.in: Enable hotspot.monitor_notify. Fix up
	comments.


changeset 397c2dcd4a51 in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=397c2dcd4a51
author: Mark Wielaard <mark at klomp.org>
date: Mon Oct 19 21:23:00 2009 +0200

	JNI GetObjectArrayElement mark probe ret value shadowed.

	2009-10-19 Mark Wielaard <mjw at redhat.com>

	 * patches/icedtea-systemtap.patch: Add fix for
	GetObjectArrayElement return probe ret value.


changeset 6bb9237570f2 in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=6bb9237570f2
author: Mark Wielaard <mark at klomp.org>
date: Mon Oct 19 21:49:33 2009 +0200

	Fix JNI DEFINE_NEWSCALARARRAY usage of DT_RETURN_MARK_DECL_FOR.

	2009-10-19 Mark Wielaard <mjw at redhat.com>

	 * patches/icedtea-systemtap.patch: Add fix for JNI
	DEFINE_NEWSCALARARRAY uses DT_RETURN_MARK_DECL_FOR.


changeset 292aecacc3f7 in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=292aecacc3f7
author: Mark Wielaard <mark at klomp.org>
date: Mon Oct 19 23:19:26 2009 +0200

	Add hotspot_jni tapset.

	2009-10-19 Mark Wielaard <mjw at redhat.com>

	 * tapset/hotspot_jni.stp.in: New tapset.
	       * scripts/jni_create_stap.c: New file.
	       * scripts/jni_desc: Likewise.
	       * configure.ac (AC_CONFIG_FILES): Add tapset/hotspot_jni.stp.
	       * Makefile.am (EXTRA_DIST): Add tapsets and scripts.
	(stamps/icedtea.stamp): Handle tapset/hotspot_jni.stp.in.
	(stamps/icedtea-debug.stamp): Likewise.


changeset 31398144ad0b in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=31398144ad0b
author: Mark Wielaard <mark at klomp.org>
date: Tue Oct 13 11:13:46 2009 +0200

	tapsets/hotspot.stp.in (hotspot.gc_end): Match gc__end, not begin.


changeset ff13d97de406 in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=ff13d97de406
author: Mark Wielaard <mark at klomp.org>
date: Sun Dec 13 22:32:25 2009 +0100

	Add systemtap jstack support.

	* Makefile.am (stamps/icedtea.stamp): Install jstack.stp. (stamps
	/icedtea-debug.stamp): Likewise.
	* configure.ac (AC_CONFIG_FILES): Add tapset/jstack.stp.
	* tapset/jstack.stp.in: New tapset.


changeset 60f5ceb2ad2e in /hg/release/icedtea6-1.5
details: http://icedtea.classpath.org/hg/release/icedtea6-1.5?cmd=changeset;node=60f5ceb2ad2e
author: doko at ubuntu.com
date: Thu Aug 27 17:48:27 2009 +0200

	2009-08-27 Kees Cook <kees at canonical.com>

	 * patches/hotspot/default/icedtea-gcc-stack-markings.patch:
	New. Adding stack markings to the x86 assembly for not using
	executable stack.


diffstat:

12 files changed, 9834 insertions(+), 60 deletions(-)
ChangeLog                                                |   59 
INSTALL                                                  |    1 
Makefile.am                                              |   25 
NEWS                                                     |    4 
configure.ac                                             |   39 
patches/hotspot/default/icedtea-gcc-stack-markings.patch |   14 
patches/icedtea-systemtap.patch                          |  108 
scripts/jni_create_stap.c                                |  190 
scripts/jni_desc                                         | 1471 ++
tapset/hotspot.stp.in                                    |   96 
tapset/hotspot_jni.stp.in                                | 7384 ++++++++++++++
tapset/jstack.stp.in                                     |  503 

diffs (truncated from 10091 to 500 lines):

diff -r b0bb743c12d1 -r 60f5ceb2ad2e ChangeLog
--- a/ChangeLog	Thu Dec 17 16:24:09 2009 +0000
+++ b/ChangeLog	Thu Aug 27 17:48:27 2009 +0200
@@ -3,6 +3,65 @@ 2009-12-17  Andrew Haley  <aph at redhat.co
 	* Makefile.am (ICEDTEA_PATCHES): Add rename-execvpe.patch,
 	icedtea-6897844-xshm.patch,
 	icedtea-linux-separate-debuginfo.patch.
+
+2009-08-27  Kees Cook <kees at canonical.com>
+
+	* patches/hotspot/default/icedtea-gcc-stack-markings.patch: New.
+	Adding stack markings to the x86 assembly for not using executable
+	stack.
+
+2009-12-13  Mark Wielaard  <mjw at redhat.com>
+
+	* Makefile.am (stamps/icedtea.stamp): Install jstack.stp.
+	(stamps/icedtea-debug.stamp): Likewise.
+	* configure.ac (AC_CONFIG_FILES): Add tapset/jstack.stp.
+	* tapset/jstack.stp.in: New tapset.
+
+2009-10-13  Mark Wielaard  <mjw at redhat.com>
+
+	* tapsets/hotspot.stp.in (hotspot.gc_end): Match gc__end, not begin.
+
+2009-10-19  Mark Wielaard  <mjw at redhat.com>
+
+	* tapset/hotspot_jni.stp.in: New tapset.
+	* scripts/jni_create_stap.c: New file.
+	* scripts/jni_desc: Likewise.
+	* configure.ac (AC_CONFIG_FILES): Add tapset/hotspot_jni.stp.
+	* Makefile.am (EXTRA_DIST): Add tapsets and scripts.
+	(stamps/icedtea.stamp): Handle tapset/hotspot_jni.stp.in.
+	(stamps/icedtea-debug.stamp): Likewise.
+
+2009-10-19  Mark Wielaard  <mjw at redhat.com>
+
+	* patches/icedtea-systemtap.patch: Add fix for JNI
+	DEFINE_NEWSCALARARRAY uses DT_RETURN_MARK_DECL_FOR.
+
+2009-10-19  Mark Wielaard  <mjw at redhat.com>
+
+	* patches/icedtea-systemtap.patch: Add fix for GetObjectArrayElement
+	return probe ret value.
+
+2009-10-14  Mark Wielaard  <mjw at redhat.com>
+
+	* configure.ac: When enabling systemtap support check sys/sdt.h
+	and g++ are recent enough to allow probes in class constructors
+	and destructors.
+	* patches/icedtea-systemtap.patch: Enable compiling probes in
+	jni.cpp. Rewrite Set<prim>Field and SetStatic<prim>Field macros
+	to use DTRACE_PROBE interface directly instead of generating
+	dtrace implementation calls. Clean up dtrace.hpp.
+	* tapset/hotspot.stp.in: Enable hotspot.monitor_notify. Fix up
+	comments.
+
+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-12-10  Andrew Haley  <aph at redhat.com>
 
diff -r b0bb743c12d1 -r 60f5ceb2ad2e INSTALL
--- a/INSTALL	Thu Dec 17 16:24:09 2009 +0000
+++ b/INSTALL	Thu Aug 27 17:48:27 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 b0bb743c12d1 -r 60f5ceb2ad2e Makefile.am
--- a/Makefile.am	Thu Dec 17 16:24:09 2009 +0000
+++ b/Makefile.am	Thu Aug 27 17:48:27 2009 +0200
@@ -106,7 +106,11 @@ EXTRA_DIST = rt generated \
 	HACKING pulseaudio fsg.sh \
 	plugin \
 	hotspot.map \
-	autogen.sh
+	autogen.sh \
+	tapset/hotspot.stp.in \
+	tapset/hotspot_jni.stp.in \
+	scripts/jni_create_stap.c \
+	scripts/jni_desc
 
 # The Binary plugs directory is called jdk1.7.0 for historical reasons. The
 # name is completely irrelevant; only contains the plugs to build IcedTea.
@@ -706,6 +710,7 @@ ICEDTEA_PATCHES += \
 	patches/icedtea-disable-cc-incompatible-sanity-checks.patch \
 	patches/icedtea-explicit-target-arch.patch \
 	patches/openjdk/6648816.patch \
+	patches/hotspot/$(HSBUILD)/icedtea-gcc-stack-markings.patch \
 	$(DISTRIBUTION_PATCHES)
 
 stamps/extract.stamp: stamps/download.stamp
@@ -1215,10 +1220,17 @@ if ENABLE_SYSTEMTAP
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot.stp \
 	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
+	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
-	fi
+	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	fi; \
+	cp $(abs_top_builddir)/tapset/jstack.stp \
+	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
 endif
 	@echo "IcedTea is served:" $(BUILD_OUTPUT_DIR)
 	mkdir -p stamps
@@ -1300,10 +1312,17 @@ if ENABLE_SYSTEMTAP
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot.stp \
 	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
+	  sed -e '/\/client\/libjvm.so/d' \
+	    < $(abs_top_builddir)/tapset/hotspot_jni.stp \
+	    > $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
 	else \
 	  cp $(abs_top_builddir)/tapset/hotspot.stp \
 	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot.stp; \
-	fi
+	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
+	fi; \
+	cp $(abs_top_builddir)/tapset/jstack.stp \
+	  $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
 endif
 	@echo "IcedTea (debug build) is served:" \
 	  $(BUILD_OUTPUT_DIR)-debug
diff -r b0bb743c12d1 -r 60f5ceb2ad2e NEWS
--- a/NEWS	Thu Dec 17 16:24:09 2009 +0000
+++ b/NEWS	Thu Aug 27 17:48:27 2009 +0200
@@ -1,3 +1,7 @@ New in release 1.5.3 (2009-11-09)
+New in release 1.5.4
+
+- Added java method tracing using systemtap version 0.9.9+.
+
 New in release 1.5.3 (2009-11-09)
 - Latest security updates:
   - (CVE-2009-3728) ICC_Profile file existence detection information leak (6631533)
diff -r b0bb743c12d1 -r 60f5ceb2ad2e configure.ac
--- a/configure.ac	Thu Dec 17 16:24:09 2009 +0000
+++ b/configure.ac	Thu Aug 27 17:48:27 2009 +0200
@@ -382,6 +382,43 @@ AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUN
                 [SDT_H_FOUND='no';
                    AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
 
+ AC_MSG_CHECKING([working sys/sdt.h and g++ support])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/sdt.h>
+class ProbeClass
+{
+private:
+  int& ref;
+  const char *name;
+
+public:
+  ProbeClass(int& v, const char *n) : ref(v), name(n)
+  {
+    DTRACE_PROBE2(_test_, cons, name, ref);
+  }
+
+  void method(int min)
+  {
+    DTRACE_PROBE3(_test_, meth, name, ref, min);
+    ref -= min;
+  }
+
+  ~ProbeClass()
+  {
+    DTRACE_PROBE2(_test_, dest, name, ref);
+  }
+};
+]],
+[[
+  int i = 64;
+  DTRACE_PROBE1(_test_, call, i);
+  ProbeClass inst = ProbeClass(i, "call");
+  inst.method(24);
+]])], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([systemtap sdt.h or g++ too old])])
+  AC_LANG_RESTORE
+
   AC_MSG_CHECKING([for absolute java home install dir])
   AC_ARG_WITH([abs-install-dir],
 	      [AS_HELP_STRING([--with-abs-install-dir], 
@@ -398,6 +435,8 @@ AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUN
   AC_SUBST(ABS_CLIENT_LIBJVM_SO)
   AC_SUBST(ABS_SERVER_LIBJVM_SO)
   AC_CONFIG_FILES([tapset/hotspot.stp])
+  AC_CONFIG_FILES([tapset/hotspot_jni.stp])
+  AC_CONFIG_FILES([tapset/jstack.stp])
 fi
 
 dnl Check for libpng headers and libraries.
diff -r b0bb743c12d1 -r 60f5ceb2ad2e patches/hotspot/default/icedtea-gcc-stack-markings.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/hotspot/default/icedtea-gcc-stack-markings.patch	Thu Aug 27 17:48:27 2009 +0200
@@ -0,0 +1,14 @@
+--- openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s~	2009-08-06 01:08:57.000000000 -0700
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.s	2009-08-06 01:09:27.000000000 -0700
+@@ -650,3 +650,4 @@ _Atomic_cmpxchg_long:
+         popl     %ebx
+         ret
+ 
++.section        .note.GNU-stack, "", @progbits
+--- openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s~	2009-08-06 01:08:57.000000000 -0700
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.s	2009-08-06 01:09:27.000000000 -0700
+@@ -400,3 +400,4 @@ _Atomic_cmpxchg_long:
+         addq     $4,%rdx
+         jg       4b
+         ret
++.section        .note.GNU-stack, "", @progbits
diff -r b0bb743c12d1 -r 60f5ceb2ad2e patches/icedtea-systemtap.patch
--- a/patches/icedtea-systemtap.patch	Thu Dec 17 16:24:09 2009 +0000
+++ b/patches/icedtea-systemtap.patch	Thu Aug 27 17:48:27 2009 +0200
@@ -9,40 +9,59 @@ 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 @@
-  *
-  */
+--- openjdk/hotspot/src/share/vm/prims/jni.cpp	2009-10-13 15:34:52.499809508 +0200
++++ openjdk/hotspot/src/share/vm/prims/jni.cpp	2009-10-13 15:31:26.117823588 +0200
+@@ -1747,10 +1744,7 @@
+ JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \
+   JNIWrapper("Set" XSTR(Result) "Field"); \
+ \
+-  HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \
+-    ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
+-  HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \
+-    ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
++  FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value),DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \
+ \
+   oop o = JNIHandles::resolve_non_null(obj); \
+   klassOop k = o->klass(); \
+@@ -1924,10 +1918,7 @@
+ \
+ JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \
+   JNIWrapper("SetStatic" XSTR(Result) "Field"); \
+-  HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\
+-    ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
+-  HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \
+-    ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
++  FP_SELECT_##Result(DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value),DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \
+ \
+   JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \
+   assert(id->is_static_field_id(), "invalid static field id"); \
+@@ -2116,7 +2101,7 @@
+   DT_RETURN_MARK(GetObjectArrayElement, jobject, (const jobject&)ret);
+   objArrayOop a = objArrayOop(JNIHandles::resolve_non_null(array));
+   if (a->is_within_bounds(index)) {
+-    jobject ret = JNIHandles::make_local(env, a->obj_at(index));
++    ret = JNIHandles::make_local(env, a->obj_at(index));
+     return ret;
+   } else {
+     char buf[jintAsStringSize];
+@@ -2150,14 +2150,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
-@@ -22,6 +22,12 @@
-  *
-  */
- 
-+#ifdef __GNUC__
-+// Unfortunately the gcc c preprocessor doesn't like some of the
-+// FP_SELECT defines below, so for now we make sure to disable them.
-+#undef DTRACE_ENABLED
-+#endif
-+
- # include "incls/_precompiled.incl"
- # include "incls/_jni.cpp.incl"
- 
+ #define DEFINE_NEWSCALARARRAY(Return,Allocator,Result) \
+ \
+-  DT_RETURN_MARK_DECL_FOR(Result, New##Result##Array, Return);\
++  DT_RETURN_MARK_DECL(New##Result##Array, Return);\
+ \
+ JNI_ENTRY(Return, \
+           jni_New##Result##Array(JNIEnv *env, jsize len)) \
+   JNIWrapper("New" XSTR(Result) "Array"); \
+   DTRACE_PROBE2(hotspot_jni, New##Result##Array__entry, env, len);\
+   Return ret = NULL;\
+-  DT_RETURN_MARK_FOR(Result, New##Result##Array, Return, (const Return&)ret);\
++  DT_RETURN_MARK(New##Result##Array, Return, (const Return&)ret);\
+ \
+   oop obj= oopFactory::Allocator(len, CHECK_0); \
+   ret = (Return) JNIHandles::make_local(env, obj); \
+
 diff -r 945bf7540697 src/share/vm/utilities/dtrace.hpp
 --- openjdk/hotspot/src/share/vm/utilities/dtrace.hpp	Thu Jan 22 14:42:01 2009 -0800
 +++ openjdk/hotspot/src/share/vm/utilities/dtrace.hpp	Mon Feb 02 13:47:34 2009 +0100
@@ -70,7 +89,7 @@ diff -r 945bf7540697 src/share/vm/utilit
  
  #define DTRACE_ONLY(x)
  #define NOT_DTRACE(x) x
-@@ -40,9 +41,15 @@
+@@ -40,9 +41,16 @@
  #define DTRACE_PROBE3(a,b,c,d,e) {;}
  #define DTRACE_PROBE4(a,b,c,d,e,f) {;}
  #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;}
@@ -78,6 +97,7 @@ diff -r 945bf7540697 src/share/vm/utilit
 +#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;}
 +#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;}
 +#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;}
++#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;}
  
  #endif
  
@@ -86,30 +106,28 @@ diff -r 945bf7540697 src/share/vm/utilit
  #define HS_DTRACE_PROBE_FN(provider,name)\
    __dtrace_##provider##___##name
  
-@@ -50,6 +57,13 @@
+@@ -50,6 +58,11 @@
    DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args)
  #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \
    DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args)
 +#else
 +// Systemtap dtrace compatible probes on GNU/Linux don't.
-+#define HS_DTRACE_PROBE_FN(provider,name)
-+
 +#define HS_DTRACE_PROBE_DECL_N(provider,name,args)
 +#define HS_DTRACE_PROBE_CDECL_N(provider,name,args)
 +#endif 
  
  /* Dtrace probe declarations */
  #define HS_DTRACE_PROBE_DECL(provider,name) \
-@@ -91,6 +105,8 @@
+@@ -88,6 +101,8 @@
+     uintptr_t,uintptr_t,uintptr_t))
+ 
+ /* Dtrace probe definitions */
++#if defined(SOLARIS)
++// Solaris dtrace uses actual function calls.
  #define HS_DTRACE_PROBE_N(provider,name, args) \
    DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args)
  
-+#if defined(SOLARIS)
-+// Solaris dtrace uses actual function calls.
- #define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name)
- #define HS_DTRACE_PROBE0(provider,name)\
-   HS_DTRACE_PROBE_N(provider,name,())
-@@ -123,3 +139,27 @@
+@@ -123,3 +138,29 @@
    HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
      (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
      (uintptr_t)a8,(uintptr_t)a9))
@@ -136,6 +154,8 @@ diff -r 945bf7540697 src/share/vm/utilit
 +  DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)
 +#define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
 +  DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
++#define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
++  DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
 +#endif
 --- openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2009-03-04 14:39:43.000000000 +0100
 +++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp	2009-03-04 22:11:37.000000000 +0100
diff -r b0bb743c12d1 -r 60f5ceb2ad2e scripts/jni_create_stap.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/jni_create_stap.c	Thu Aug 27 17:48:27 2009 +0200
@@ -0,0 +1,190 @@
+/* jni_create_stap.c -- Parses jni_desc into hotspot_jni.stp.in
+   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.
+*/
+
+// g++ -o jni_create_stap jni_create_stap
+// ./jni_create_stap < jni_desc > hotspot_jni.stp.in
+// (Don't forget to add header plus documentation)
+
+// data file:
+// JNIProbeName<space>Description
+// arg1_name<space><type><space>Description
+// arg2_name...
+// [ret<space><type><space>Description]
+// blank line
+//
+// Notes:
+// JNIProbeName doesn't include __entry or __return.
+// ret is the the return argument (if there is a __return probe)
+// <type>/representation is one of:
+// v - void, s - string, x - hex number, d - number
+// void is only used for return ret arguments.
+
+#include <iostream>
+#include <iterator>
+#include <string>
+#include <vector>
+using namespace std;
+
+struct probe
+{
+  string name;
+  string desc;
+  vector<string> args;
+  vector<char> types;
+  vector<string> descs;
+};
+
+int
+main()
+{
+  vector<probe> probes;
+
+  string line;
+  size_t index;
+  while (getline (cin, line))
+    {
+      if (line.size () == 0 || line[0] == '#')
+	continue;
+      probe p;
+      // probe name and description
+      index = line.find (' ');
+      p.name = line.substr (0, index);
+      p.desc = line.substr (index + 1);
+      
+      // arguments
+      while (getline (cin, line) && line.size () != 0)
+	{
+	  if (line[0] == '#')
+	    continue;
+	  
+	  index = line.find (' ');
+	  p.args.push_back (line.substr (0, index));
+	  p.types.push_back (line[index + 1]);
+	  p.descs.push_back (line.substr (index + 3));
+	}
+
+      probes.push_back (p);
+    }
+
+  vector<probe>::iterator it = probes.begin();
+  while (it != probes.end())
+    {
+      // Output probe entry
+      probe p = *it;
+      cout << "/* hotspot.jni." << p.name << endl;
+      cout << " * " << p.desc << endl;
+      cout << " *" << endl;
+      for (index = 0; index < p.args.size (); index++)
+	{
+	  if (p.args[index] == "ret")
+	    continue;
+	  cout << " * " << p.args[index] << " - " << p.descs[index] << endl;
+	}
+      cout << " */" << endl;
+      cout << "probe hotspot.jni." << p.name << " =" << endl;
+      cout << "  process(\"@ABS_CLIENT_LIBJVM_SO@\").mark(\""
+	   << p.name << "__entry" << "\")," << endl;
+      cout << "  process(\"@ABS_SERVER_LIBJVM_SO@\").mark(\""
+	   << p.name << "__entry" << "\")" << endl;
+      cout << "{" << endl;
+      cout << "  name = \"" << p.name << '"' << endl;



More information about the distro-pkg-dev mailing list