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">&quot;Usage: ruby-prof [options] &lt;script.rb&gt; [--] [profiled-script-command-line-options]&quot;</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-string">&quot;Options:&quot;</span> - <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-string">&#39;-p printer&#39;</span>, <span class="ruby-string">&#39;--printer=printer&#39;</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">&#39;Select a printer:&#39;</span>, - <span class="ruby-string">&#39; flat - Prints a flat profile as text (default).&#39;</span>, - <span class="ruby-string">&#39; flat_with_line_numbers - same as flat, with line numbers.&#39;</span>, - <span class="ruby-string">&#39; graph - Prints a graph profile as text.&#39;</span>, - <span class="ruby-string">&#39; graph_html - Prints a graph profile as html.&#39;</span>, - <span class="ruby-string">&#39; call_tree - format for KCacheGrind&#39;</span>, - <span class="ruby-string">&#39; call_stack - prints a HTML visualization of the call tree&#39;</span>, - <span class="ruby-string">&#39; dot - Prints a graph profile as a dot file&#39;</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">&#39;-m min_percent&#39;</span>, <span class="ruby-string">&#39;--min_percent=min_percent&#39;</span>, <span class="ruby-constant">Float</span>, - <span class="ruby-string">&#39;The minimum percent a method must take before &#39;</span>, - <span class="ruby-string">&#39; being included in output reports.&#39;</span>, - <span class="ruby-string">&#39; this option is not supported for call tree.&#39;</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">&#39;-f path&#39;</span>, <span class="ruby-string">&#39;--file=path&#39;</span>, - <span class="ruby-string">&#39;Output results to a file instead of standard out.&#39;</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">&#39;--mode=measure_mode&#39;</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">&#39;Select what ruby-prof should measure:&#39;</span>, - <span class="ruby-string">&#39; process - Process time (default).&#39;</span>, - <span class="ruby-string">&#39; wall - Wall time.&#39;</span>, - <span class="ruby-string">&#39; cpu - CPU time (Pentium and PowerPCs only).&#39;</span>, - <span class="ruby-string">&#39; allocations - Object allocations (requires patched Ruby interpreter).&#39;</span>, - <span class="ruby-string">&#39; memory - Allocated memory in KB (requires patched Ruby interpreter).&#39;</span>, - <span class="ruby-string">&#39; gc_runs - Number of garbage collections (requires patched Ruby interpreter).&#39;</span>, - <span class="ruby-string">&#39; gc_time - Time spent in garbage collection (requires patched Ruby interpreter).&#39;</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">&#39;-s sort_mode&#39;</span>, <span class="ruby-string">&#39;--sort=sort_mode&#39;</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">&#39;Select how ruby-prof results should be sorted:&#39;</span>, - <span class="ruby-string">&#39; total - Total time&#39;</span>, - <span class="ruby-string">&#39; self - Self time&#39;</span>, - <span class="ruby-string">&#39; wait - Wait time&#39;</span>, - <span class="ruby-string">&#39; child - Child time&#39;</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">&quot;ruby_prof &quot;</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">&quot;-v&quot;</span>,<span class="ruby-string">&quot;Show version, set $VERBOSE to true, profile script if option given&quot;</span>) <span class="ruby-keyword">do</span> - <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;ruby version: &quot;</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">&#39; &#39;</span>) + <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;ruby version: &quot;</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">&quot;-d&quot;</span>, <span class="ruby-string">&quot;Set $DEBUG to true&quot;</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">&#39;-R lib&#39;</span>, <span class="ruby-string">&#39;--require-noprof lib&#39;</span>, <span class="ruby-string">&#39;require a specific library (not profiled)&#39;</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">&lt;&lt;</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">&#39;-E code&#39;</span>, <span class="ruby-string">&#39;--eval-noprof code&#39;</span>, <span class="ruby-string">&#39;execute the ruby statements (not profiled)&#39;</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">&lt;&lt;</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">&#39;-x regexp&#39;</span>, <span class="ruby-string">&#39;--exclude regexp&#39;</span>, <span class="ruby-string">&#39;exclude methods by regexp (see method elimination)&#39;</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">&lt;&lt;</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">&#39;-X file&#39;</span>, <span class="ruby-string">&#39;--exclude-file file&#39;</span>, <span class="ruby-string">&#39;exclude methods by regexp listed in file (see method elimination)&#39;</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">&lt;&lt;</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">&#39;--exclude-common-cycles&#39;</span>, <span class="ruby-string">&#39;make common iterators like Integer#times appear inlined&#39;</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 &#39;Enumerable#.*&#39;, 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">&#39;--exclude-common-callbacks&#39;</span>, <span class="ruby-string">&#39;make common callbacks invocations like Integer#times appear inlined so you can see call origins in graph&#39;</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