[jboss-svn-commits] JBL Code SVN: r29694 - labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Oct 20 10:09:06 EDT 2009


Author: adinn
Date: 2009-10-20 10:09:05 -0400 (Tue, 20 Oct 2009)
New Revision: 29694

Modified:
   labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ClassLoadMonitor.txt
   labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FileMonitor.txt
   labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FinalizeMonitor.txt
   labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/SocketMonitor.txt
   labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ThreadMonitor.txt
Log:
corrected some errors in sampe scritps and udpated instructions -- fixes for BYTEMAN-52

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ClassLoadMonitor.txt
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ClassLoadMonitor.txt	2009-10-20 14:08:55 UTC (rev 29693)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ClassLoadMonitor.txt	2009-10-20 14:09:05 UTC (rev 29694)
@@ -26,32 +26,19 @@
 # A byteman script which prints a stacktrace whenever ClassLoader.defineClass
 # is called.
 #
-# In order for this to run successfully the byteman jar and the byteman
-# samples jar need to be added to the bootstrap classpath using the
-# boot option to the -javaagent JVM command line argument. The script may
-# be loaded either at JVM startup, as shown below, or submitted dynamically
-# via the byteman listener (this requires use of the listener:true option)
+# to use ths script to trace execution of java program org.my.App execute
 #
-# to use ths script with java program org.my.App execute the following commands
-#
 #  -- set the directory in which byteman has been installed
 #  BYTEMAN_HOME= ...
 #
-#   -- we need to add byteman jar and samples jar to the boot path
-#   BYTEMAN_JAR=${BYTEMAN_HOME}/lib/byteman.jar
-#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-samples.jar
+#   -- identify the samples jar to the boot path
+#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-sample.jar
 #
 #   -- identify this script
 #   SCRIPT={BYTEMAN_HOME}/sample/scripts/ClassLoadMonitor.txt
 #
-#   -- setting this property enables transformation of java.lang classes!
-#   ALLOW_JAVA_LANG=-Dorg.jboss.byteman.quodlibet
+#  ${BYTEMAN_HOME}/bin/bmjava.sh -l $SCRIPT -b $SAMPLE_JAR org.my.App
 #
-#   -- compose the javaagent options and pass to the java command
-#   BYTEMAN_OPTS=-javaagent:${BYTEMAN_JAR}=script:${SCRIPT},boot:${BYTEMAN_JAR},boot:${SAMPLE_JAR}
-#   java ${ALLOW_JAVA_LANG} ${BYTEMAN_OPTS} org.my.App
-#
-#
 
 ########################################################################
 #

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FileMonitor.txt
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FileMonitor.txt	2009-10-20 14:08:55 UTC (rev 29693)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FileMonitor.txt	2009-10-20 14:09:05 UTC (rev 29694)
@@ -26,39 +26,26 @@
 # A byteman script which prints a stack trace whenever a file input or
 # output stream is created from a File instance or subsequently closed.
 #
-# In order for this to run successfully the byteman jar and the byteman
-# samples jar need to be added to the bootstrap classpath using the
-# boot option to the -javaagent JVM command line argument. The script may
-# be loaded either at JVM startup, as shown below, or submitted dynamically
-# via the byteman listener (this requires use of the listener:true option)
+# to use ths script to trace execution of java program org.my.App execute
 #
-# to use ths script with java program org.my.App execute the following commands
-#
 #  -- set the directory in which byteman has been installed
 #  BYTEMAN_HOME= ...
 #
-#   -- we need to add byteman jar and samples jar to the boot path
-#   BYTEMAN_JAR=${BYTEMAN_HOME}/lib/byteman.jar
-#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-samples.jar
+#   -- identify the samples jar to the boot path
+#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-sample.jar
 #
 #   -- identify this script
 #   SCRIPT={BYTEMAN_HOME}/sample/scripts/FileMonitor.txt
 #
-#   -- setting this property enables transformation of java.lang classes!
-#   ALLOW_JAVA_LANG=-Dorg.jboss.byteman.quodlibet
+#  ${BYTEMAN_HOME}/bin/bmjava.sh -l $SCRIPT -b $SAMPLE_JAR org.my.App
 #
-#   -- compose the javaagent options and pass to the java command
-#   BYTEMAN_OPTS=-javaagent:${BYTEMAN_JAR}=script:${SCRIPT},boot:${BYTEMAN_JAR},boot:${SAMPLE_JAR}
-#   java ${ALLOW_JAVA_LANG} ${BYTEMAN_OPTS} org.my.App
-#
-#
 
 ########################################################################
 #
-# Rule to trace create of file input stream
+# Rule to trace create of file input stream from File
 #
 
-RULE FileMonitor trace FileInputStream create
+RULE FileMonitor trace FileInputStream create from File
 CLASS java.io.FileInputStream
 METHOD <init>(java.io.File)
 HELPER org.jboss.byteman.sample.helper.StackTraceHelper
@@ -69,10 +56,24 @@
 
 ########################################################################
 #
-# Rule to trace create of file output stream
+# Rule to trace close of file input stream close
 #
 
-RULE FileMonitor trace FileOutputStream create
+RULE FileMonitor trace FileInputStream close
+CLASS java.io.FileInputStream
+METHOD close
+HELPER org.jboss.byteman.sample.helper.StackTraceHelper
+AT RETURN
+IF TRUE
+DO traceStack("*** Closed " + $0 + " in thread " + Thread.currentThread().getName() + "\n")
+ENDRULE
+
+########################################################################
+#
+# Rule to trace create of file output stream from File
+#
+
+RULE FileMonitor trace FileOutputStream create from File
 CLASS java.io.FileOutputStream
 METHOD <init>(java.io.File)
 HELPER org.jboss.byteman.sample.helper.StackTraceHelper
@@ -80,3 +81,31 @@
 IF TRUE
 DO traceStack("*** Opened " + $1.getPath() + " for write in thread " + Thread.currentThread().getName() + "\n")
 ENDRULE
+
+########################################################################
+#
+# Rule to trace create of file output stream from String
+#
+
+RULE FileMonitor trace FileOutputStream create from String
+CLASS java.io.FileOutputStream
+METHOD <init>(String, boolean)
+HELPER org.jboss.byteman.sample.helper.StackTraceHelper
+AT RETURN
+IF TRUE
+DO traceStack("*** Opened " + $1 + " for " + ($2 ? "write" : "append") +" in thread " + Thread.currentThread().getName() + "\n")
+ENDRULE
+
+########################################################################
+#
+# Rule to trace close of file output
+#
+
+RULE FileMonitor trace FileOutputStream close
+CLASS java.io.FileOutputStream
+METHOD <init>(String, boolean)
+HELPER org.jboss.byteman.sample.helper.StackTraceHelper
+AT RETURN
+IF TRUE
+DO traceStack("*** Closed " + $0 + " in thread " + Thread.currentThread().getName() + "\n")
+ENDRULE

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FinalizeMonitor.txt
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FinalizeMonitor.txt	2009-10-20 14:08:55 UTC (rev 29693)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/FinalizeMonitor.txt	2009-10-20 14:09:05 UTC (rev 29694)
@@ -23,34 +23,21 @@
 #
 # FinalizeMonitor
 #
-# A byteman script which tarecs calls to Object.finalize().
+# A byteman script which traces calls to Object.finalize().
 #
-# In order for this to run successfully the byteman jar and the byteman
-# samples jar need to be added to the bootstrap classpath using the
-# boot option to the -javaagent JVM command line argument. The script may
-# be loaded either at JVM startup, as shown below, or submitted dynamically
-# via the byteman listener (this requires use of the listener:true option)
+# to use ths script to trace execution of java program org.my.App execute
 #
-# to use ths script with java program org.my.App execute the following commands
-#
 #  -- set the directory in which byteman has been installed
 #  BYTEMAN_HOME= ...
 #
-#   -- we need to add byteman jar and samples jar to the boot path
-#   BYTEMAN_JAR=${BYTEMAN_HOME}/lib/byteman.jar
-#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-samples.jar
+#   -- identify the samples jar to the boot path
+#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-sample.jar
 #
 #   -- identify this script
 #   SCRIPT={BYTEMAN_HOME}/sample/scripts/FinalizeMonitor.txt
 #
-#   -- setting this property enables transformation of java.lang classes!
-#   ALLOW_JAVA_LANG=-Dorg.jboss.byteman.quodlibet
+#  ${BYTEMAN_HOME}/bin/bmjava.sh -l $SCRIPT -b $SAMPLE_JAR org.my.App
 #
-#   -- compose the javaagent options and pass to the java command
-#   BYTEMAN_OPTS=-javaagent:${BYTEMAN_JAR}=script:${SCRIPT},boot:${BYTEMAN_JAR},boot:${SAMPLE_JAR}
-#   java ${ALLOW_JAVA_LANG} ${BYTEMAN_OPTS} org.my.App
-#
-#
 
 ########################################################################
 #

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/SocketMonitor.txt
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/SocketMonitor.txt	2009-10-20 14:08:55 UTC (rev 29693)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/SocketMonitor.txt	2009-10-20 14:09:05 UTC (rev 29694)
@@ -25,32 +25,19 @@
 #
 # A byteman script which traces thread creation, start, run and exit
 #
-# In order for this to run successfully the byteman jar and the byteman
-# samples jar need to be added to the bootstrap classpath using the
-# boot option to the -javaagent JVM command line argument. The script may
-# be loaded either at JVM startup, as shown below, or submitted dynamically
-# via the byteman listener (this requires use of the listener:true option)
+# to use ths script to trace execution of java program org.my.App execute
 #
-# to use ths script with java program org.my.App execute the following commands
-#
 #  -- set the directory in which byteman has been installed
 #  BYTEMAN_HOME= ...
 #
-#   -- we need to add byteman jar and samples jar to the boot path
-#   BYTEMAN_JAR=${BYTEMAN_HOME}/lib/byteman.jar
-#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-samples.jar
+#   -- identify the samples jar to the boot path
+#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-sample.jar
 #
 #   -- identify this script
 #   SCRIPT={BYTEMAN_HOME}/sample/scripts/SocketMonitor.txt
 #
-#   -- setting this property enables transformation of java.lang classes!
-#   ALLOW_JAVA_LANG=-Dorg.jboss.byteman.quodlibet
+#  ${BYTEMAN_HOME}/bin/bmjava.sh -l $SCRIPT -b $SAMPLE_JAR org.my.App
 #
-#   -- compose the javaagent options and pass to the java command
-#   BYTEMAN_OPTS=-javaagent:${BYTEMAN_JAR}=script:${SCRIPT},boot:${BYTEMAN_JAR},boot:${SAMPLE_JAR}
-#   java ${ALLOW_JAVA_LANG} ${BYTEMAN_OPTS} org.my.App
-#
-#
 
 ########################################################################
 #

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ThreadMonitor.txt
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ThreadMonitor.txt	2009-10-20 14:08:55 UTC (rev 29693)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/sample/scripts/ThreadMonitor.txt	2009-10-20 14:09:05 UTC (rev 29694)
@@ -25,32 +25,19 @@
 #
 # A byteman script which traces thread creation, start, run and exit
 #
-# In order for this to run successfully the byteman jar and the byteman
-# samples jar need to be added to the bootstrap classpath using the
-# boot option to the -javaagent JVM command line argument. The script may
-# be loaded either at JVM startup, as shown below, or submitted dynamically
-# via the byteman listener (this requires use of the listener:true option)
+# to use ths script to trace execution of java program org.my.App execute
 #
-# to use ths script with java program org.my.App execute the following commands
-#
 #  -- set the directory in which byteman has been installed
 #  BYTEMAN_HOME= ...
 #
-#   -- we need to add byteman jar and samples jar to the boot path
-#   BYTEMAN_JAR=${BYTEMAN_HOME}/lib/byteman.jar
-#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-samples.jar
+#   -- identify the samples jar to the boot path
+#   SAMPLE_JAR=${BYTEMAN_HOME}/sample/lib/byteman-sample.jar
 #
 #   -- identify this script
 #   SCRIPT={BYTEMAN_HOME}/sample/scripts/ThreadMonitor.txt
 #
-#   -- setting this property enables transformation of java.lang classes!
-#   ALLOW_JAVA_LANG=-Dorg.jboss.byteman.quodlibet
+#  ${BYTEMAN_HOME}/bin/bmjava.sh -l $SCRIPT -b $SAMPLE_JAR org.my.App
 #
-#   -- compose the javaagent options and pass to the java command
-#   BYTEMAN_OPTS=-javaagent:${BYTEMAN_JAR}=script:${SCRIPT},boot:${BYTEMAN_JAR},boot:${SAMPLE_JAR}
-#   java ${ALLOW_JAVA_LANG} ${BYTEMAN_OPTS} org.my.App
-#
-#
 
 ########################################################################
 #



More information about the jboss-svn-commits mailing list