Skip to content

Commit

Permalink
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -201,7 +201,7 @@ def help
puts 'jt tag all spec/ruby/language tag all specs in this file, without running them'
puts 'jt untag spec/ruby/language untag passing specs in this directory'
puts 'jt untag spec/ruby/language/while_spec.rb untag passing specs in this file'
puts 'jt bench debug [--ruby-backtrace] benchmark run a single benchmark with options for compiler debugging'
puts 'jt bench debug [--ruby-backtrace] [vm-args] benchmark run a single benchmark with options for compiler debugging'
puts 'jt bench reference [benchmarks] run a set of benchmarks and record a reference point'
puts 'jt bench compare [benchmarks] run a set of benchmarks and compare against a reference point'
puts ' benchmarks can be any benchmarks or group of benchmarks supported'
@@ -418,13 +418,24 @@ def bench(command, *args)
bench_args = ["#{bench_dir}/bin/bench9000"]
case command
when 'debug'
vm_args = ['-G:+TraceTruffleCompilation', '-G:+DumpOnError']
if args.delete '--ruby-backtrace'
compilation_exceptions_behaviour = "-J-G:+TruffleCompilationExceptionsAreThrown"
vm_args.push '-G:+TruffleCompilationExceptionsAreThrown'
else
compilation_exceptions_behaviour = "-J-G:+TruffleCompilationExceptionsAreFatal"
vm_args.push '-G:+TruffleCompilationExceptionsAreFatal'
end
remaining_args = []
args.each do |arg|
if arg.start_with? '-'
vm_args.push arg
else
remaining_args.push arg
end
end
env_vars["JRUBY_OPTS"] = vm_args.map{ |a| '-J' + a }.join(' ')
bench_args += ['score', '--config', "#{bench_dir}/benchmarks/default.config.rb", 'jruby-dev-truffle-graal', '--show-commands', '--show-samples']
raise 'specify a single benchmark for run - eg classic-fannkuch-redux' if args.size != 1
raise 'specify a single benchmark for run - eg classic-fannkuch-redux' if remaining_args.size != 1
args = remaining_args
when 'reference'
bench_args += ['reference', '--config', "#{bench_dir}/benchmarks/default.config.rb", 'jruby-dev-truffle-graal', '--show-commands']
args << "5" if args.empty?

3 comments on commit 9b65b7e

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomaswue you can now do for example

$ jt bench debug classic-fannkuch-redux -Djvmci.option.TruffleFunctionInlining=false

@thomaswue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@eregon
Copy link
Member

@eregon eregon commented on 9b65b7e Jan 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -G: syntax also works BTW:
jt bench debug classic-fannkuch-redux -G:-TruffleFunctionInlining

Sorry, something went wrong.

Please sign in to comment.