/hg/icedtea: 3 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Wed May 5 10:04:20 PDT 2010


changeset bed100099e7e in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=bed100099e7e
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 6c93a1363c3c in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=6c93a1363c3c
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 2451197e481e in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=2451197e481e
author: Andrew John Hughes <ahughes at redhat.com>
date: Wed May 05 18:04:06 2010 +0100

	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.


diffstat:

7 files changed, 9108 insertions(+), 2 deletions(-)
ChangeLog                       |   20 
Makefile.am                     |   16 
configure.ac                    |    1 
patches/icedtea-systemtap.patch |   28 
scripts/jni_create_stap.c       |  190 +
scripts/jni_desc                | 1471 +++++++
tapset/hotspot_jni.stp.in       | 7384 +++++++++++++++++++++++++++++++++++++++

diffs (truncated from 9180 to 500 lines):

diff -r 116ddf482a23 -r 2451197e481e ChangeLog
--- a/ChangeLog	Wed Oct 14 15:42:32 2009 +0200
+++ b/ChangeLog	Wed May 05 18:04:06 2010 +0100
@@ -1,3 +1,23 @@ 2009-10-14  Mark Wielaard  <mjw at redhat.c
+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
diff -r 116ddf482a23 -r 2451197e481e Makefile.am
--- a/Makefile.am	Wed Oct 14 15:42:32 2009 +0200
+++ b/Makefile.am	Wed May 05 18:04:06 2010 +0100
@@ -704,7 +704,11 @@ EXTRA_DIST = $(GENERATED_FILES) $(top_sr
 	IcedTeaPlugin.cc \
 	HACKING $(PULSEAUDIO_SRCS) fsg.sh \
 	$(abs_top_srcdir)/plugin $(top_srcdir)/netx \
-	hotspot.map autogen.sh
+	hotspot.map autogen.sh \
+	tapset/hotspot.stp.in \
+	tapset/hotspot_jni.stp.in \
+	scripts/jni_create_stap.c \
+	scripts/jni_desc
 
 # Top-Level Targets
 # =================
@@ -1806,9 +1810,14 @@ 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; \
+	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
 	fi
 endif
 if ENABLE_NSS
@@ -1882,9 +1891,14 @@ if ENABLE_SYSTEMTAP
 	  sed -e '/\/client\/libjvm.so/d' \
 	    < $(abs_top_builddir)/tapset/hotspot.stp \
 	    > $(BUILD_OUTPUT_DIR)-debug/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)-debug/j2sdk-image/tapset/hotspot.stp; \
+	  cp $(abs_top_builddir)/tapset/hotspot_jni.stp \
+	    $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
 	fi
 endif
 if ENABLE_NSS
diff -r 116ddf482a23 -r 2451197e481e configure.ac
--- a/configure.ac	Wed Oct 14 15:42:32 2009 +0200
+++ b/configure.ac	Wed May 05 18:04:06 2010 +0100
@@ -379,6 +379,7 @@ public:
   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])
 fi
 
 dnl Check for libpng headers and libraries.
diff -r 116ddf482a23 -r 2451197e481e patches/icedtea-systemtap.patch
--- a/patches/icedtea-systemtap.patch	Wed Oct 14 15:42:32 2009 +0200
+++ b/patches/icedtea-systemtap.patch	Wed May 05 18:04:06 2010 +0100
@@ -35,7 +35,33 @@ diff -r 945bf7540697 make/linux/makefile
  \
    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 @@
+ 
+ #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
diff -r 116ddf482a23 -r 2451197e481e scripts/jni_create_stap.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/jni_create_stap.c	Wed May 05 18:04:06 2010 +0100
@@ -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;
+      for (index = 0; index < p.args.size (); index++)
+	{
+	  if (p.args[index] == "ret")
+	    continue;
+	  cout << "  " << p.args[index] << " = ";
+	  if (p.types[index] == 's')
+	    cout << "user_string(" << "$arg" << (index + 1) << ")" << endl;
+	  else
+	    cout << "$arg" << (index + 1) << endl;
+	}
+      cout << "  probestr = sprintf(\"%s(";
+      for (index = 0; index < p.args.size (); index++)
+	{
+	  if (p.args[index] == "ret")
+            continue;
+	  cout << p.args[index] << '=';
+	  if (p.types[index] == 's')
+	    cout << "'%s'";
+	  else if (p.types[index] == 'x')
+	    cout << "0x%x";
+	  else
+	    cout << "%" << p.types[index];
+	  if (index != p.args.size () - 1 && p.args[index + 1] != "ret")
+	    cout << ',';
+	}
+      cout << ")\", name";
+      for (index = 0; index < p.args.size (); index++)
+        {
+          if (p.args[index] == "ret")
+            continue;
+	  cout << ", " << p.args[index];
+	}
+      cout << ")" << endl;
+      cout << "}" << endl;
+
+      // Output return probe if it exists
+      if (p.args.size () > 0 && p.args[p.args.size () - 1] == "ret")
+	{
+	  char type = p.types[p.args.size () - 1];
+	  cout << endl;
+	  cout << "/* hotspot.jni." << p.name << ".return" << endl;
+	  cout << " * " << p.desc << " Return." << endl;
+	  if (type != 'v')
+	    {
+	      cout << " *" << endl;
+	      cout << " * ret - " << p.descs[p.args.size() - 1] << endl;
+	    }
+	  cout << " */" << endl;
+
+	  cout << "probe hotspot.jni." << p.name << ".return =" << endl;
+	  cout << "  process(\"@ABS_CLIENT_LIBJVM_SO@\").mark(\""
+	       << p.name << "__return" << "\")," << endl;
+	  cout << "  process(\"@ABS_SERVER_LIBJVM_SO@\").mark(\""
+	       << p.name << "__return" << "\")" << endl;
+	  cout << "{" << endl;
+	  cout << "  name = \"" << p.name << '"' << endl;
+	  if (type == 's')
+	    {
+	      cout << "  ret = user_string($arg1)" << endl;
+	      cout << "  retstr = ret" << endl;
+	    }
+	  else if (type == 'x')
+	    {
+	      cout << "  ret = $arg1" << endl;
+	      cout << "  retstr = sprintf(\"0x%x\", ret)" << endl;
+	    }
+	  else if (type != 'v')
+	    {
+	      cout << "  ret = $arg1" << endl;
+	      cout << "  retstr = sprint(ret)" << endl;
+	    }
+	  else
+	    {
+	      cout << "  retstr = \"\"" << endl;
+	    }
+	  cout << "}" << endl;
+	}
+
+      cout << endl;
+      ++it;
+    }
+}
diff -r 116ddf482a23 -r 2451197e481e scripts/jni_desc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/jni_desc	Wed May 05 18:04:06 2010 +0100
@@ -0,0 +1,1471 @@
+# jni_desc -- Descriptor file of JNI probe points for 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.
+
+# 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, only FatalError never returns)
+# <type>/representation is one of:
+# v - void, s - string, x - hex number, d - number
+# void is only used for return ret arguments.
+
+AllocObject Allocate object without calling any constructors.
+env x JNIEnv pointer.
+clazz x jclass pointer.
+ret x jobject reference to allocated object or NULL
+
+AttachCurrentThreadAsDaemon Attach the current thread as daemon.
+vm x JavaVM pointer.
+penv x pointer to JNIEnv pointer.
+args x pointer to JavaVMAttachArgs struct.
+ret d Zero on success, negative on error.
+
+AttachCurrentThread Attach the current thread.
+vm x JavaVM pointer.
+penv x pointer to JNIEnv pointer.
+args x pointer to JavaVMAttachArgs struct.
+ret d Zero on success, negative on error.
+
+CallBooleanMethodA Call virtual method returning a boolean using an array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallBooleanMethod Call virtual method returning a boolean.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallBooleanMethodV Call virtual method returning a boolean using va_list as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallByteMethodA Call virtual method returning a byte using an array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallByteMethod Call virtual method returning a byte.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallByteMethodV Call virtual method returning a byte using va_list as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallCharMethodA Call virtual method returning a char using an array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallCharMethod Call virtual method returning a char.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallCharMethodV Call virtual method returning a char using va_list as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallDoubleMethodA Call virtual method returning a double using an array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret v The result of the method call.
+
+CallDoubleMethod Call virtual method returning a double.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret v The result of the method call.
+
+CallDoubleMethodV Call virtual method returning a double using va_list as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret v The result of the method call.
+
+CallFloatMethodA Call virtual method returning a float using an array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret v The result of the method call.
+
+CallFloatMethod Call virtual method returning a float.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret v The result of the method call.
+
+CallFloatMethodV Call virtual method returning a float using va_list as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret v The result of the method call.
+
+CallIntMethodA Call virtual method returning a int using an array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallIntMethod Call virtual method returning a int.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallIntMethodV Call virtual method returning a int using va_list as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallLongMethodA Call virtual method returning a long using an array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallLongMethod Call virtual method returning a long.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallLongMethodV Call virtual method returning a long using va_list as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.
+methodid x ID of the method to call.
+ret d The result of the method call.
+
+CallObjectMethodA Call virtual method returning a object using array as arguments.
+env x JNIEnv pointer.
+obj x jobject reference.



More information about the distro-pkg-dev mailing list