diff --git a/integration_tests/general.bats b/integration_tests/general.bats index 8e7f3c8b..b4784770 100644 --- a/integration_tests/general.bats +++ b/integration_tests/general.bats @@ -71,4 +71,7 @@ teardown_file() { @test "exit_code_propagated" { run $IPROF -- bash -c "exit 55" [ "$status" == 55 ] + + run $IPROF --no-analysis -- bash -c "exit 55" + [ "$status" == 55 ] } diff --git a/xprof/xprof.rb.in b/xprof/xprof.rb.in index 54db070e..d649cc22 100755 --- a/xprof/xprof.rb.in +++ b/xprof/xprof.rb.in @@ -13,7 +13,7 @@ PREFIX = '@prefix@' DATAROOTDIR = File.join(PREFIX, 'share') DATADIR = DATAROOTDIR -$EXIT_CODE_USER_BINARY = 0 +$EXIT_CODE_XPROF = 0 $LOAD_PATH.unshift(DATADIR) if File.directory?(DATADIR) require 'open3' @@ -687,7 +687,7 @@ def trace_and_on_node_processing(usr_argv) # Launch User Command begin - $EXIT_CODE_USER_BINARY = launch_usr_bin(h, usr_argv) + $EXIT_CODE_XPROF |= launch_usr_bin(h, usr_argv) rescue Errno::ENOENT teardown_lttng(syncd) raise @@ -744,7 +744,7 @@ def gm_processing(folder) fo.close end - exit($?.success? ? $EXIT_CODE_USER_BINARY : $?.exitstatus) + $?.exitstatus end # @@ -865,8 +865,12 @@ if __FILE__ == $PROGRAM_NAME # Right now, `replay` means no tracing. # But we don't have a way of disabling post-processing folder = OPTIONS.include?(:replay) ? OPTIONS[:replay] || last_trace_saved : trace_and_on_node_processing(ARGV) + if mpi_master? warn("THAPI: Trace location: #{folder}") - gm_processing(folder) if OPTIONS[:analysis] + $EXIT_CODE_XPROF |= gm_processing(folder) if OPTIONS[:analysis] end + + exit($EXIT_CODE_XPROF) + end