Permalink
Browse files

Support an extra profile printer arg

  • Loading branch information...
1 parent 7b730a2 commit 4883082ff1d3f73666c284e8c4bce4a2a12b36c1 @jeremy jeremy committed Jun 24, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 tools/profile
View
@@ -63,7 +63,9 @@ after = GC.allocated_size
usage = (after - before) / 1024.0
if mode
- if RubyProf.const_defined?(:CallStackPrinter)
+ if printer = ARGV.shift
+ RubyProf.const_get("#{printer.to_s.classify}Printer").new(results).print($stdout)
+ elsif RubyProf.const_defined?(:CallStackPrinter)
File.open("#{File.basename(path, '.rb')}.#{mode}.html", 'w') do |out|
RubyProf::CallStackPrinter.new(results).print(out)
end

0 comments on commit 4883082

Please sign in to comment.