Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 191b69342ef2
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 775b79dc9446
Choose a head ref
  • 6 commits
  • 2 files changed
  • 1 contributor

Commits on Feb 8, 2016

  1. Copy the full SHA
    b75956c View commit details
  2. [Truffle] Typo.

    chrisseaton committed Feb 8, 2016
    Copy the full SHA
    b2c56e7 View commit details
  3. Copy the full SHA
    3364d6e View commit details
  4. Copy the full SHA
    4fdfef9 View commit details
  5. Copy the full SHA
    053e754 View commit details
  6. Copy the full SHA
    775b79d View commit details
Showing with 54 additions and 13 deletions.
  1. +53 −12 tool/jt.rb
  2. +1 −1 truffle/src/main/java/org/jruby/truffle/language/Options.java
65 changes: 53 additions & 12 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
JDEBUG = "-J-agentlib:jdwp=transport=dt_socket,server=y,address=#{JDEBUG_PORT},suspend=y"
JDEBUG_TEST = "-Dmaven.surefire.debug=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=#{JDEBUG_PORT} -Xnoagent -Djava.compiler=NONE"
JEXCEPTION = "-Xtruffle.exceptions.print_java=true"
METRICS_REPS = 10

# wait for sub-processes to handle the interrupt
trap(:INT) {}
@@ -142,7 +143,11 @@ module ShellUtils
private

def raw_sh(*args)
puts "$ #{printable_cmd(args)}"
if args.last == :no_print_cmd
args.pop
else
puts "$ #{printable_cmd(args)}"
end
result = system(*args)
unless result
$stderr.puts "FAILED (#{$?}): #{printable_cmd(args)}"
@@ -245,8 +250,7 @@ def help
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'
puts ' by bench9000, eg all, classic, chunky, 3, 5, 10, 15 - default is 5'
puts 'jt findbugs run findbugs'
puts 'jt findbugs report run findbugs and generate an HTML report'
puts 'jt metrics alloc ... how much memory is allocated running a program (use -X-T to test normal JRuby)'
puts 'jt install ..../graal/mx/suite.py install a JRuby distribution into an mx suite'
puts
puts 'you can also put build or rebuild in front of any command'
@@ -540,16 +544,53 @@ def bench(command, *args)
end
raw_sh env_vars, "ruby", *bench_args, *args
end

def findbugs(report=nil)
case report
when 'report'
sh 'tool/truffle-findbugs.sh', '--report'
sh 'open', 'truffle-findbugs-report.html'
when nil
sh 'tool/truffle-findbugs.sh'

def metrics(command, *args)
case command
when 'alloc'
metrics_alloc *args
else
raise ArgumentError, command
end
end

def metrics_alloc(*args)
samples = []
METRICS_REPS.times do
print '.' if STDOUT.tty?
r, w = IO.pipe
run '-Xtruffle.metrics.memory_used_on_exit=true', '-J-verbose:gc', *args, {err: w, out: w}, :no_print_cmd
w.close
samples.push memory_allocated(r.read)
r.close
end
puts if STDOUT.tty?
puts "#{human_size(samples.inject(:+)/samples.size)}, range #{human_size(samples.max-samples.min)}"
end

def memory_allocated(trace)
allocated = 0
trace.lines do |line|
case line
when /(\d+)K->(\d+)K/
before = $1.to_i * 1024
after = $2.to_i * 1024
collected = before - after
allocated += collected
when /^allocated (\d+)$/
allocated += $1.to_i
end
end
allocated
end

def human_size(bytes)
if bytes < 1024
"#{bytes} B"
elsif bytes < 1024**2
"#{(bytes/1024.0).round(2)} KB"
else
raise ArgumentError, report
"#{(bytes/1024.0**2).round(2)} MB"
end
end

Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ public class Options {
public final boolean BACKTRACES_OMIT_UNUSED = org.jruby.util.cli.Options.TRUFFLE_BACKTRACES_OMIT_UNUSED.load();
public final boolean INCLUDE_CORE_FILE_CALLERS_IN_SET_TRACE_FUNC = org.jruby.util.cli.Options.TRUFFLE_INCLUDE_CORE_FILE_CALLERS_IN_SET_TRACE_FUNC.load();

// Call garph
// Call graph

public final boolean CALL_GRAPH = org.jruby.util.cli.Options.TRUFFLE_CALL_GRAPH.load();
public final String CALL_GRAPH_WRITE = org.jruby.util.cli.Options.TRUFFLE_CALL_GRAPH_WRITE.load();