summaryrefslogtreecommitdiffstats
path: root/runtime/probes/bench/run_bench
diff options
context:
space:
mode:
authorhunt <hunt>2005-07-13 06:34:00 +0000
committerhunt <hunt>2005-07-13 06:34:00 +0000
commitfa60355b7aacd1f4b10f1497792787288c0632ff (patch)
tree5ab2cee9aae848540ba784848b8ecc494bc3c021 /runtime/probes/bench/run_bench
parentf8220a7b945a3be7975fb2610ca1c79119594534 (diff)
downloadsystemtap-steved-fa60355b7aacd1f4b10f1497792787288c0632ff.tar.gz
systemtap-steved-fa60355b7aacd1f4b10f1497792787288c0632ff.tar.xz
systemtap-steved-fa60355b7aacd1f4b10f1497792787288c0632ff.zip
2005-07-12 Martin Hunt <hunt@redhat.com>
* bench/run_bench (do_time): Use ttest instead of "time". Fix processor computation. * bench/ttest.c: Like "time.c" except takes an argument to adjust loop size. Also computes system time + user time instead of real time. Added a warmup loop to get consistent results from cpus which adjust speed based on load. * bench/time.c: Replaced by ttest.c
Diffstat (limited to 'runtime/probes/bench/run_bench')
-rwxr-xr-xruntime/probes/bench/run_bench19
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/probes/bench/run_bench b/runtime/probes/bench/run_bench
index 48a60adb..471da231 100755
--- a/runtime/probes/bench/run_bench
+++ b/runtime/probes/bench/run_bench
@@ -1,7 +1,7 @@
#!/usr/bin/tclsh
# -*- tcl -*-
-proc do_time {module} {
+proc do_time {module n} {
# start kprobes
if {[catch {exec ../../stpd/stpd -mq $module.ko > xxx &} pid]} {
puts $pid
@@ -11,7 +11,7 @@ proc do_time {module} {
exec sleep 2
# get the timings while kprobes running
- if {[catch {exec ./time} res2]} {
+ if {[catch {exec ./ttest $n} res2]} {
puts $res2
exit -1
}
@@ -25,7 +25,7 @@ proc do_time {module} {
}
-set nproc [exec grep processor /proc/cpuinfo | wc -l]
+set nproc [exec grep ^processor /proc/cpuinfo | wc -l]
if {![catch {exec grep "physical id" /proc/cpuinfo} phyid]} {
foreach phy [split $phyid \n] {
set cpu($phy) 1
@@ -52,7 +52,7 @@ if {[catch {exec ./check_modules} res]} {
}
# get the timings without kprobes
-if {[catch {exec ./time} res1]} {
+if {[catch {exec ./ttest 4} res1]} {
puts $res1
exit -1
}
@@ -60,7 +60,7 @@ if {[catch {exec ./time} res1]} {
set r_overhead [lindex $res1 0]
set w_overhead [lindex $res1 1]
-set res2 [do_time bench]
+set res2 [do_time bench 4]
set t_kprobe [expr [lindex $res2 0] - $r_overhead]
set t_jprobe [expr [lindex $res2 1] - $w_overhead]
@@ -69,7 +69,7 @@ puts "Kprobes overhead = $t_kprobe ns"
puts "--------------------------------------"
if {[file exists bench_ret.ko]} {
- set res2 [do_time bench_ret]
+ set res2 [do_time bench_ret 4]
set t_ret [expr [lindex $res2 0] - $r_overhead]
set t_entret [expr [lindex $res2 1] - $w_overhead]
@@ -78,7 +78,7 @@ if {[file exists bench_ret.ko]} {
puts "--------------------------------------"
}
-set res2 [do_time bench_multi]
+set res2 [do_time bench_multi 4]
set t_k2 [expr [lindex $res2 0] - $r_overhead]
set t_k4 [expr [lindex $res2 1] - $w_overhead]
@@ -86,7 +86,7 @@ puts "2 kprobes on same func = $t_k2 ns"
puts "4 kprobes on same func = $t_k4 ns"
puts "--------------------------------------"
-set res2 [do_time bench_io1]
+set res2 [do_time bench_io1 1]
# subtract function call overhead and kprobe overhead
set t_printf [expr [lindex $res2 0] - $r_overhead - $t_kprobe]
set t_print [expr [lindex $res2 1] - $w_overhead - $t_kprobe]
@@ -97,7 +97,7 @@ puts "_stp_print on 100 chars = $t_print ns"
puts "--------------------------------------"
exec sleep 4
-set res2 [do_time bench_io2]
+set res2 [do_time bench_io2 1]
# subtract function call overhead and kprobe overhead
set t_printf [expr [lindex $res2 0] - $r_overhead - $t_kprobe]
set t_print [expr [lindex $res2 1] - $w_overhead - $t_kprobe]
@@ -108,3 +108,4 @@ puts "_stp_print on 100 chars = $t_print ns"
puts "--------------------------------------"
exec rm xxx
+exec /bin/rm -f stpd_cpu*