summaryrefslogtreecommitdiffstats
path: root/runtime/bench2/print_bench
diff options
context:
space:
mode:
authorhunt <hunt>2007-04-05 18:50:54 +0000
committerhunt <hunt>2007-04-05 18:50:54 +0000
commit8cee54154c8f4fdcf538f53d5342864b5e6d860f (patch)
tree935e7a34aa67d14f65cffc513a6abb7463f1f87e /runtime/bench2/print_bench
parent264d5549634a8d50ed3be219ad6496ab296933f8 (diff)
downloadsystemtap-steved-8cee54154c8f4fdcf538f53d5342864b5e6d860f.tar.gz
systemtap-steved-8cee54154c8f4fdcf538f53d5342864b5e6d860f.tar.xz
systemtap-steved-8cee54154c8f4fdcf538f53d5342864b5e6d860f.zip
2007-04-05 Martin Hunt <hunt@redhat.com>
* bench2/bench.rb (Stapbench::run): Check result code of "killall staprun". If it is nonzero, something happened to staprun. Print an error. (Stapbench::load): Define STP_NO_OVERLOAD. * bench2/README: Update. * bench2/print_bench: New set of tests.
Diffstat (limited to 'runtime/bench2/print_bench')
-rwxr-xr-xruntime/bench2/print_bench68
1 files changed, 68 insertions, 0 deletions
diff --git a/runtime/bench2/print_bench b/runtime/bench2/print_bench
new file mode 100755
index 00000000..a2a9c407
--- /dev/null
+++ b/runtime/bench2/print_bench
@@ -0,0 +1,68 @@
+#!/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 printf 100 chars
+test2 = Stapbench.new("printf 100 chars")
+test2.code = 'printf("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n")'
+test2.outfile="/dev/null"
+test2.run
+test2.print
+test2.trans=BULK
+test2.run
+test2.print
+
+# script test to print 100 chars
+test3 = Stapbench.new("print 100 chars")
+test3.code = "print(\"123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\\n\")"
+test3.outfile="/dev/null"
+test3.run
+test3.print
+test3.trans=BULK
+test3.run
+test3.print
+
+# script test to print 100 chars, 1 at a time
+test3a = Stapbench.new("print 100 chars, 1 at a time")
+test3a.code = "for (i=0; i < 100; i++) print(\"x\")"
+test3a.outfile="/dev/null"
+test3a.run
+test3a.print
+test3a.trans=BULK
+test3a.run
+test3a.print
+
+# script test to print 100 different chars, 1 at a time, using print_char
+test3b = Stapbench.new("print 100 different chars, 1 at a time, using print_char")
+test3b.code = "for (i = 0; i < 99; i++) print_char(i+32); print_char(10)"
+test3b.outfile="/dev/null"
+test3b.run
+test3b.print
+test3b.trans=BULK
+test3b.run
+test3b.print
+
+# script test to binary print 4 integers
+test4 = Stapbench.new("binary printf 4 integers (%b)")
+test4.code = "printf(\"%b%b%b%b\", 111,22,333,444)"
+test4.outfile="/dev/null"
+test4.run
+test4.print
+test4.trans = BULK
+test4.run
+test4.print
+
+# script test to binary print 4 integers
+test5 = Stapbench.new("_stp_print_binary 4 integers")
+test5.code = "stp_print_binary(4,111,22,333,444)"
+test5.outfile="/dev/null"
+test5.run
+test5.print
+test5.trans = BULK
+test5.run
+test5.print