summaryrefslogtreecommitdiffstats
path: root/runtime/bench2
diff options
context:
space:
mode:
authorhunt <hunt>2006-09-18 17:03:33 +0000
committerhunt <hunt>2006-09-18 17:03:33 +0000
commitaa14db816a565c3a1e958f1c1f82692707fae673 (patch)
treedbfb7cedc5c0f800ee831cf166a24f56bbbbe7f3 /runtime/bench2
parent1cb28d0992e3f5d3a91daeb3f7ff8991f41b68ed (diff)
downloadsystemtap-steved-aa14db816a565c3a1e958f1c1f82692707fae673.tar.gz
systemtap-steved-aa14db816a565c3a1e958f1c1f82692707fae673.tar.xz
systemtap-steved-aa14db816a565c3a1e958f1c1f82692707fae673.zip
2006-09-18 Martin Hunt <hunt@redhat.com>
* bench2/bench.rb: Remove the deprecated "-m" option to stpd. Also, don't use merge mode for relayfs. * bench2/run_binary_print: New test. Compare various ways of printing binary data.
Diffstat (limited to 'runtime/bench2')
-rw-r--r--runtime/bench2/bench.rb13
-rwxr-xr-xruntime/bench2/run_binary_print40
2 files changed, 48 insertions, 5 deletions
diff --git a/runtime/bench2/bench.rb b/runtime/bench2/bench.rb
index 91ecfc74..4b8bc2ff 100644
--- a/runtime/bench2/bench.rb
+++ b/runtime/bench2/bench.rb
@@ -121,6 +121,8 @@ class Bench
@@minfreq = 0
def cleanup
+ system('sudo killall -HUP stpd &> /dev/null')
+ system('sudo /sbin/rmmod bench &> /dev/null')
`/bin/rm -f stap.out` if File.exists?("stap.out")
`/bin/rm -f bench.stp` if File.exists?("bench.stp")
`/bin/rm -rf #{@dir}` unless @dir.nil?
@@ -128,8 +130,8 @@ class Bench
end
def load
- args = "-rmq -b 8"
- if @trans == RELAYFS then args = "-mq" end
+ args = "-q -b 8"
+ if @trans == RELAYFS then args = "-q" end
fork do exec "sudo #{@@stpd} #{args} #{@dir}/bench.ko > #{@dir}/xxx 2> #{@dir}/xxx.out" end
sleep 5
end
@@ -169,6 +171,7 @@ int probe_start(void)\n{\n return _stp_register_kprobes (kp, NUM_KPROBES);\n}\n
void probe_exit (void)\n{\n _stp_unregister_kprobes (kp, NUM_KPROBES); \n}\n"
rescue
puts "Error writing source file"
+ exit
ensure
f.close unless f.nil?
end
@@ -250,7 +253,7 @@ class Stapbench < Bench
def load
# we do this in several steps because the compilation phase can take a long time
args = "-kvvp4"
- if @trans == RELAYFS then args = "-bkvvp4" end
+ if @trans == RELAYFS then args = "-bMkvvp4" end
res = `stap #{args} -m bench bench.stp &> stap.out`
if $? != 0
puts "ERROR running stap\n#{res}"
@@ -265,8 +268,8 @@ class Stapbench < Bench
cleanup
exit
end
- args = "-rmq -b 8"
- if @trans == RELAYFS then args = "-mq" end
+ args = "-q -b 8"
+ if @trans == RELAYFS then args = "-q" end
fork do exec "sudo #{@@stpd} #{args} #{@dir}/bench.ko > #{@dir}/xxx 2> #{@dir}/xxx.out" end
sleep 5
end
diff --git a/runtime/bench2/run_binary_print b/runtime/bench2/run_binary_print
new file mode 100755
index 00000000..bbd83180
--- /dev/null
+++ b/runtime/bench2/run_binary_print
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+load './bench.rb'
+
+# script test with empty probe
+test0 = Stapbench.new("empty probe")
+test0.code = ""
+test0.run
+test0.print
+
+# script test to binary print 4 integers
+test1 = Stapbench.new("binary printf 4 integers (%8b)")
+test1.code = "printf(\"%8b%8b%8b%8b\", 111,22,333,444)"
+test1.run
+test1.print
+
+# script test to binary print 4 integers
+test2 = Stapbench.new("binary printf 4 integers (%4b)")
+test2.code = "printf(\"%4b%4b%4b%4b\", 111,22,333,444)"
+test2.run
+test2.print
+
+
+# script test to binary print 4 integers
+test3 = Stapbench.new("binary printf 4 integers (%b)")
+test3.code = "printf(\"%b%b%b%b\", 111,22,333,444)"
+test3.run
+test3.print
+test3.trans = RELAYFS
+test3.run
+test3.print
+
+# script test to binary print 4 integers
+test4 = Stapbench.new("_stp_print_binary 4 integers")
+test4.code = "stp_print_binary(4,111,22,333,444)"
+test4.run
+test4.print
+test4.trans = RELAYFS
+test4.run
+test4.print
+