doc/RubyProf/Cmd.html in ruby-prof-0.14.1 vs doc/RubyProf/Cmd.html in ruby-prof-0.14.2
- old
+ new
@@ -283,19 +283,19 @@
<span class="ruby-string">"Usage: ruby-prof [options] <script.rb> [--] [profiled-script-command-line-options]"</span>
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-string">""</span>
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-string">"Options:"</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-p printer'</span>, <span class="ruby-string">'--printer=printer'</span>, [<span class="ruby-value">:flat</span>, <span class="ruby-value">:flat_with_line_numbers</span>, <span class="ruby-value">:graph</span>, <span class="ruby-value">:graph_html</span>, <span class="ruby-value">:call_tree</span>, <span class="ruby-value">:call_stack</span>, <span class="ruby-value">:dot</span>],
- <span class="ruby-string">'Select a printer:'</span>,
- <span class="ruby-string">' flat - Prints a flat profile as text (default).'</span>,
- <span class="ruby-string">' flat_with_line_numbers - same as flat, with line numbers.'</span>,
- <span class="ruby-string">' graph - Prints a graph profile as text.'</span>,
- <span class="ruby-string">' graph_html - Prints a graph profile as html.'</span>,
- <span class="ruby-string">' call_tree - format for KCacheGrind'</span>,
- <span class="ruby-string">' call_stack - prints a HTML visualization of the call tree'</span>,
- <span class="ruby-string">' dot - Prints a graph profile as a dot file'</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-p printer'</span>, <span class="ruby-string">'--printer=printer'</span>, [<span class="ruby-value">:flat</span>, <span class="ruby-value">:flat_with_line_numbers</span>, <span class="ruby-value">:graph</span>, <span class="ruby-value">:graph_html</span>, <span class="ruby-value">:call_tree</span>, <span class="ruby-value">:call_stack</span>, <span class="ruby-value">:dot</span>],
+ <span class="ruby-string">'Select a printer:'</span>,
+ <span class="ruby-string">' flat - Prints a flat profile as text (default).'</span>,
+ <span class="ruby-string">' flat_with_line_numbers - same as flat, with line numbers.'</span>,
+ <span class="ruby-string">' graph - Prints a graph profile as text.'</span>,
+ <span class="ruby-string">' graph_html - Prints a graph profile as html.'</span>,
+ <span class="ruby-string">' call_tree - format for KCacheGrind'</span>,
+ <span class="ruby-string">' call_stack - prints a HTML visualization of the call tree'</span>,
+ <span class="ruby-string">' dot - Prints a graph profile as a dot file'</span>
) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">printer</span><span class="ruby-operator">|</span>
<span class="ruby-keyword">case</span> <span class="ruby-identifier">printer</span>
<span class="ruby-keyword">when</span> <span class="ruby-value">:flat</span>
@@ -313,33 +313,33 @@
<span class="ruby-keyword">when</span> <span class="ruby-value">:dot</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">printer</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">DotPrinter</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-m min_percent'</span>, <span class="ruby-string">'--min_percent=min_percent'</span>, <span class="ruby-constant">Float</span>,
- <span class="ruby-string">'The minimum percent a method must take before '</span>,
- <span class="ruby-string">' being included in output reports.'</span>,
- <span class="ruby-string">' this option is not supported for call tree.'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">min_percent</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-m min_percent'</span>, <span class="ruby-string">'--min_percent=min_percent'</span>, <span class="ruby-constant">Float</span>,
+ <span class="ruby-string">'The minimum percent a method must take before '</span>,
+ <span class="ruby-string">' being included in output reports.'</span>,
+ <span class="ruby-string">' this option is not supported for call tree.'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">min_percent</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">min_percent</span> = <span class="ruby-identifier">min_percent</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-f path'</span>, <span class="ruby-string">'--file=path'</span>,
- <span class="ruby-string">'Output results to a file instead of standard out.'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-f path'</span>, <span class="ruby-string">'--file=path'</span>,
+ <span class="ruby-string">'Output results to a file instead of standard out.'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">file</span> = <span class="ruby-identifier">file</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">old_wd</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'--mode=measure_mode'</span>,
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'--mode=measure_mode'</span>,
[<span class="ruby-value">:process</span>, <span class="ruby-value">:wall</span>, <span class="ruby-value">:cpu</span>, <span class="ruby-value">:allocations</span>, <span class="ruby-value">:memory</span>, <span class="ruby-value">:gc_runs</span>, <span class="ruby-value">:gc_time</span>],
- <span class="ruby-string">'Select what ruby-prof should measure:'</span>,
- <span class="ruby-string">' process - Process time (default).'</span>,
- <span class="ruby-string">' wall - Wall time.'</span>,
- <span class="ruby-string">' cpu - CPU time (Pentium and PowerPCs only).'</span>,
- <span class="ruby-string">' allocations - Object allocations (requires patched Ruby interpreter).'</span>,
- <span class="ruby-string">' memory - Allocated memory in KB (requires patched Ruby interpreter).'</span>,
- <span class="ruby-string">' gc_runs - Number of garbage collections (requires patched Ruby interpreter).'</span>,
- <span class="ruby-string">' gc_time - Time spent in garbage collection (requires patched Ruby interpreter).'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">measure_mode</span><span class="ruby-operator">|</span>
+ <span class="ruby-string">'Select what ruby-prof should measure:'</span>,
+ <span class="ruby-string">' process - Process time (default).'</span>,
+ <span class="ruby-string">' wall - Wall time.'</span>,
+ <span class="ruby-string">' cpu - CPU time (Pentium and PowerPCs only).'</span>,
+ <span class="ruby-string">' allocations - Object allocations (requires patched Ruby interpreter).'</span>,
+ <span class="ruby-string">' memory - Allocated memory in KB (requires patched Ruby interpreter).'</span>,
+ <span class="ruby-string">' gc_runs - Number of garbage collections (requires patched Ruby interpreter).'</span>,
+ <span class="ruby-string">' gc_time - Time spent in garbage collection (requires patched Ruby interpreter).'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">measure_mode</span><span class="ruby-operator">|</span>
<span class="ruby-keyword">case</span> <span class="ruby-identifier">measure_mode</span>
<span class="ruby-keyword">when</span> <span class="ruby-value">:process</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">PROCESS_TIME</span>
<span class="ruby-keyword">when</span> <span class="ruby-value">:wall</span>
@@ -355,16 +355,16 @@
<span class="ruby-keyword">when</span> <span class="ruby-value">:gc_time</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">measure_mode</span> = <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GC_TIME</span>
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-s sort_mode'</span>, <span class="ruby-string">'--sort=sort_mode'</span>, [<span class="ruby-value">:total</span>, <span class="ruby-value">:self</span>, <span class="ruby-value">:wait</span>, <span class="ruby-value">:child</span>],
- <span class="ruby-string">'Select how ruby-prof results should be sorted:'</span>,
- <span class="ruby-string">' total - Total time'</span>,
- <span class="ruby-string">' self - Self time'</span>,
- <span class="ruby-string">' wait - Wait time'</span>,
- <span class="ruby-string">' child - Child time'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sort_mode</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-s sort_mode'</span>, <span class="ruby-string">'--sort=sort_mode'</span>, [<span class="ruby-value">:total</span>, <span class="ruby-value">:self</span>, <span class="ruby-value">:wait</span>, <span class="ruby-value">:child</span>],
+ <span class="ruby-string">'Select how ruby-prof results should be sorted:'</span>,
+ <span class="ruby-string">' total - Total time'</span>,
+ <span class="ruby-string">' self - Self time'</span>,
+ <span class="ruby-string">' wait - Wait time'</span>,
+ <span class="ruby-string">' child - Child time'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sort_mode</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">sort_method</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">sort_mode</span>
<span class="ruby-keyword">when</span> <span class="ruby-value">:total</span>
<span class="ruby-value">:total_time</span>
<span class="ruby-keyword">when</span> <span class="ruby-value">:self</span>
@@ -395,37 +395,37 @@
<span class="ruby-identifier">puts</span> <span class="ruby-string">"ruby_prof "</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
<span class="ruby-identifier">exit</span>
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-v"</span>,<span class="ruby-string">"Show version, set $VERBOSE to true, profile script if option given"</span>) <span class="ruby-keyword">do</span>
- <span class="ruby-identifier">puts</span> <span class="ruby-string">"ruby version: "</span> <span class="ruby-operator">+</span> [<span class="ruby-constant">RUBY_PATCHLEVEL</span>, <span class="ruby-constant">RUBY_PLATFORM</span>, <span class="ruby-constant">RUBY_VERSION</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">"ruby version: "</span> <span class="ruby-operator">+</span> [<span class="ruby-constant">RUBY_PATCHLEVEL</span>, <span class="ruby-constant">RUBY_PLATFORM</span>, <span class="ruby-constant">RUBY_VERSION</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
<span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">"-d"</span>, <span class="ruby-string">"Set $DEBUG to true"</span>) <span class="ruby-keyword">do</span>
<span class="ruby-identifier">$DEBUG</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-R lib'</span>, <span class="ruby-string">'--require-noprof lib'</span>, <span class="ruby-string">'require a specific library (not profiled)'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lib</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-R lib'</span>, <span class="ruby-string">'--require-noprof lib'</span>, <span class="ruby-string">'require a specific library (not profiled)'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lib</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">pre_libs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">lib</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-E code'</span>, <span class="ruby-string">'--eval-noprof code'</span>, <span class="ruby-string">'execute the ruby statements (not profiled)'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">code</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-E code'</span>, <span class="ruby-string">'--eval-noprof code'</span>, <span class="ruby-string">'execute the ruby statements (not profiled)'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">code</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">pre_execs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">code</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-x regexp'</span>, <span class="ruby-string">'--exclude regexp'</span>, <span class="ruby-string">'exclude methods by regexp (see method elimination)'</span>) <span class="ruby-keyword">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">meth</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-x regexp'</span>, <span class="ruby-string">'--exclude regexp'</span>, <span class="ruby-string">'exclude methods by regexp (see method elimination)'</span>) <span class="ruby-keyword">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">meth</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods</span> <span class="ruby-operator">||=</span> []
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">meth</span>)
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-X file'</span>, <span class="ruby-string">'--exclude-file file'</span>, <span class="ruby-string">'exclude methods by regexp listed in file (see method elimination)'</span>) <span class="ruby-keyword">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'-X file'</span>, <span class="ruby-string">'--exclude-file file'</span>, <span class="ruby-string">'exclude methods by regexp listed in file (see method elimination)'</span>) <span class="ruby-keyword">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods_files</span> <span class="ruby-operator">||=</span> []
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods_files</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">file</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'--exclude-common-cycles'</span>, <span class="ruby-string">'make common iterators like Integer#times appear inlined'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">meth</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'--exclude-common-cycles'</span>, <span class="ruby-string">'make common iterators like Integer#times appear inlined'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">meth</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods</span> <span class="ruby-operator">||=</span> []
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods</span> <span class="ruby-operator">+=</span> <span class="ruby-node">%w{
Integer#times
Integer#upto
Integer#downto
@@ -452,13 +452,13 @@
Enumerable#reverse_each
Enumerable#inject
Enumerable#collect
Enumerable#reduce
}</span>
- <span class="ruby-comment">#TODO: may be the whole Enumerable module should be excluded via 'Enumerable#.*', we need feedback on use cases.</span>
+ <span class="ruby-comment">#TODO: may be the whole Enumerable module should be excluded via 'Enumerable#.*', we need feedback on use cases.</span>
<span class="ruby-keyword">end</span>
- <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'--exclude-common-callbacks'</span>, <span class="ruby-string">'make common callbacks invocations like Integer#times appear inlined so you can see call origins in graph'</span>) <span class="ruby-keyword">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">meth</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">'--exclude-common-callbacks'</span>, <span class="ruby-string">'make common callbacks invocations like Integer#times appear inlined so you can see call origins in graph'</span>) <span class="ruby-keyword">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">meth</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods</span> <span class="ruby-operator">||=</span> []
<span class="ruby-identifier">options</span>.<span class="ruby-identifier">eliminate_methods</span> <span class="ruby-operator">+=</span> <span class="ruby-node">%w{
Method#call
Proc#call
ActiveSupport::Callbacks::ClassMethods#__run_callback