[PATCH 0 of 2] Add systemtap tapset tests

Mark Wielaard mjw at redhat.com
Mon Mar 26 13:22:07 PDT 2012


On Mon, Mar 26, 2012 at 02:44:45PM -0400, Jon VanAlten wrote:
> > Jon, if you could take a look that would be appreciated. The changes
> > I made to your original were:
> > - Switched detect_probes from a negative test (see if the stap -l
> > fails)
> >   to a positive test (see if that stap -l output matches the expected
> >   probe name). And use -L to force expansion of all arguments.
> > - Added an explicit stap script run test to make sure the user has
> >   enough permissions (and if not skip the actual probe tests).
> > - Made the test program do a little more so method_compiled tests
> >   have enough time to detect all probe events (specifically run some
> >   triggers twice with a small Thread.sleep in between to give hotspot
> >   enough time to finish the jit compilation of a method).
> > 
> 
> Well, Present-Jon does see opportunities for improvements to the code
> that Past-Jon wrote way back then, but it does still look like it
> does what it is meant to do, and your improvements are sensible.  I
> approve :)

Thanks.

After merging with Andrew Hughes icedtea7 jdk7 u4 update I found one
thing that needed improving. The thread_start and thread_stop tests
had the thread id (tid) of the first user thread hard coded to 8.
But the new hotspot started even more background threads. So I made
the attached change to make the test accept any positive number tid.
(It should also apply cleanly to 6, where I will add it to keep things
in sync.)

I am happy the tests showed the hotspot update didn't break anything.
Next up is tweaking Andrew's introduction of SDTV3 and try to just
do the same thing as Solaris (aka SDTV1, Apple uses SDTv2 but systemtap
should just support the SDTV1 source level). Then lets see if we can
just get any changes left directly into hotspot instead of carrying
them as a patch in the tree.

Thanks Andrew for the patch tweaks, they were correct, as the tests showed.
The tweaking will be to get the diff as small as possible. And also thanks
for getting rid of systemtap-alloc-size-workaround.patch.

Cheers,

Mark
-------------- next part --------------
# HG changeset patch
# User Mark Wielaard <mark at klomp.org>
# Date 1332792442 -7200
# Node ID 81ebf494d83de2d260e6910a49facc6237bca674
# Parent  a5c9abaa3f1a4fc1f687d81c00d2eef98602147b
jstaptest.pl: thread_start and stop thread id can be any positive number.

tid was hard coded as being '8', but newer hotspot might start more
than 7 background threads before the first user thread is started.
So allow tid to be any positive number.

diff -r a5c9abaa3f1a -r 81ebf494d83d ChangeLog
--- a/ChangeLog	Mon Mar 26 19:33:38 2012 +0200
+++ b/ChangeLog	Mon Mar 26 22:07:22 2012 +0200
@@ -1,3 +1,8 @@
+2012-03-26  Mark Wielaard  <mjw at redhat.com>
+
+	* test/tapset/jstaptest.pl: thread_start and thread_stop thread id
+	can be any positive number.
+
 2012-03-23  Andrew John Hughes  <ahughes at redhat.com>
 
 	* patches/boot/pr39408.patch,
diff -r a5c9abaa3f1a -r 81ebf494d83d test/tapset/jstaptest.pl
--- a/test/tapset/jstaptest.pl	Mon Mar 26 19:33:38 2012 +0200
+++ b/test/tapset/jstaptest.pl	Mon Mar 26 22:07:22 2012 +0200
@@ -33,8 +33,8 @@
     ["hotspot.vm_init_begin", "\"%s\\n\",name", "^vm_init_begin\$"],
     ["hotspot.vm_init_end", "\"%s\\n\",name", "^vm_init_end\$"],
     ["hotspot.vm_shutdown", "\"%s\\n\",name", "^vm_shutdown\$"],
-    ["hotspot.thread_start", "\"%sname=%stid=%dd=%d\\n\",name,thread_name,id,is_daemon", "^thread_startname=Thread-0tid=8d=0\$"],
-    ["hotspot.thread_stop", "\"%sname=%stid=%dd=%d\\n\",name,thread_name,id,is_daemon", "^thread_stopname=Thread-0tid=8d=0\$"],
+    ["hotspot.thread_start", "\"%sname=%stid=%dd=%d\\n\",name,thread_name,id,is_daemon", "^thread_startname=Thread-0tid=[0-9]\\+d=0\$"],
+    ["hotspot.thread_stop", "\"%sname=%stid=%dd=%d\\n\",name,thread_name,id,is_daemon", "^thread_stopname=Thread-0tid=[0-9]\\+d=0\$"],
     ["hotspot.class_loaded", "\"%sclass=%ssh=%d\\n\",name,class,is_shared", "class_loadedclass=staptest/ClassUnloadedProbeTestersh=0"],
     ["hotspot.class_unloaded", "\"%sclass=%ssh=%d\\n\",name,class,is_shared", "class_unloadedclass=staptest/ClassUnloadedProbeTestersh=0"],
     ["hotspot.method_compile_begin", "\"%sclass=%smethod=%ssig=%s\\n\",name,class,method,sig", "method_compile_beginclass=staptest/SystemtapTestermethod=allocateForNoReasonsig=(I)Ljava/lang/String;"],


More information about the distro-pkg-dev mailing list