aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-06-24 01:08:12 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2010-06-24 01:08:12 -0700
commit4883082ff1d3f73666c284e8c4bce4a2a12b36c1 (patch)
tree01f98a2e81f1f5b987f9aa99c33e149d3c3bcad0 /tools
parent7b730a2f1b9be71695c1a01efc1fd05e98757736 (diff)
downloadrails-4883082ff1d3f73666c284e8c4bce4a2a12b36c1.tar.gz
rails-4883082ff1d3f73666c284e8c4bce4a2a12b36c1.tar.bz2
rails-4883082ff1d3f73666c284e8c4bce4a2a12b36c1.zip
Support an extra profile printer arg
Diffstat (limited to 'tools')
-rwxr-xr-xtools/profile4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/profile b/tools/profile
index c86cedcbf4..a6e3b41900 100755
--- a/tools/profile
+++ b/tools/profile
@@ -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