diff options
author | hunt <hunt> | 2006-04-19 19:26:01 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-04-19 19:26:01 +0000 |
commit | cec2f7b0ea2b24098d36d0d31495b0f024cf5d19 (patch) | |
tree | a3a36ddb05cd632439cbb26511a04c6910e05a8c /runtime/bench2 | |
parent | ef9e124ad6da4b2e736cf00f7ecfc8827c96ecc8 (diff) | |
download | systemtap-steved-cec2f7b0ea2b24098d36d0d31495b0f024cf5d19.tar.gz systemtap-steved-cec2f7b0ea2b24098d36d0d31495b0f024cf5d19.tar.xz systemtap-steved-cec2f7b0ea2b24098d36d0d31495b0f024cf5d19.zip |
Print error and exit if "stap" fails.
Diffstat (limited to 'runtime/bench2')
-rw-r--r-- | runtime/bench2/bench.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/runtime/bench2/bench.rb b/runtime/bench2/bench.rb index 3a1efc7c..91ecfc74 100644 --- a/runtime/bench2/bench.rb +++ b/runtime/bench2/bench.rb @@ -210,11 +210,7 @@ obj-m := bench.o end puts "SystemTap BENCH2 \t" + `date` puts "kernel: " + `uname -r`.strip + " " + `uname -m`.strip - begin - puts IO.read("/etc/redhat-release") - rescue - end - + puts IO.read("/etc/redhat-release") if File.exists?("/etc/redhat-release") puts `uname -n`.strip + ": " + `uptime` puts "processors: #{nproc} #{cpuinfo}" @@ -255,7 +251,13 @@ class Stapbench < Bench # we do this in several steps because the compilation phase can take a long time args = "-kvvp4" if @trans == RELAYFS then args = "-bkvvp4" end - `stap #{args} -m bench bench.stp &> stap.out` + res = `stap #{args} -m bench bench.stp &> stap.out` + if $? != 0 + puts "ERROR running stap\n#{res}" + puts IO.read("stap.out") if File.exists?("stap.out") + cleanup + exit + end IO.foreach("stap.out") {|line| @dir = line if line =~ /Created temporary directory/} @dir = @dir.match(/"([^"]*)/)[1] if !File.exist?("#{@dir}/bench.ko") |