Skip to content

Commit

Permalink
fix no analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Applencourt committed Oct 1, 2024
1 parent 5e3721b commit e2a19ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions integration_tests/general.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
}
12 changes: 8 additions & 4 deletions xprof/xprof.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -744,7 +744,7 @@ def gm_processing(folder)

fo.close
end
exit($?.success? ? $EXIT_CODE_USER_BINARY : $?.exitstatus)
$?.exitstatus
end

#
Expand Down Expand Up @@ -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

0 comments on commit e2a19ba

Please sign in to comment.