ruby-prof 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +15 -0
- data/README.rdoc +36 -5
- data/bin/ruby-prof +7 -2
- data/doc/LICENSE.html +2 -1
- data/doc/README_rdoc.html +42 -8
- data/doc/Rack.html +2 -1
- data/doc/Rack/RubyProf.html +25 -18
- data/doc/Rack/RubyProf/RackProfiler.html +343 -0
- data/doc/RubyProf.html +14 -2
- data/doc/RubyProf/AbstractPrinter.html +91 -12
- data/doc/RubyProf/AggregateCallInfo.html +2 -1
- data/doc/RubyProf/CallInfo.html +18 -78
- data/doc/RubyProf/CallInfoPrinter.html +2 -1
- data/doc/RubyProf/CallInfoVisitor.html +2 -1
- data/doc/RubyProf/CallStackPrinter.html +35 -29
- data/doc/RubyProf/CallTreePrinter.html +98 -14
- data/doc/RubyProf/Cmd.html +11 -5
- data/doc/RubyProf/DeprecationWarnings.html +148 -0
- data/doc/RubyProf/DotPrinter.html +2 -1
- data/doc/RubyProf/FlatPrinter.html +2 -1
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +7 -5
- data/doc/RubyProf/GraphHtmlPrinter.html +18 -12
- data/doc/RubyProf/GraphPrinter.html +2 -1
- data/doc/RubyProf/MethodInfo.html +19 -88
- data/doc/RubyProf/MultiPrinter.html +231 -17
- data/doc/RubyProf/Profile.html +184 -39
- data/doc/RubyProf/Profile/ExcludeCommonMethods.html +411 -0
- data/doc/RubyProf/Profile/LegacyMethodElimination.html +158 -0
- data/doc/RubyProf/ProfileTask.html +2 -1
- data/doc/RubyProf/Thread.html +4 -39
- data/doc/created.rid +21 -19
- data/doc/css/fonts.css +6 -6
- data/doc/examples/flat_txt.html +2 -1
- data/doc/examples/graph_html.html +2 -1
- data/doc/examples/graph_txt.html +2 -1
- data/doc/index.html +47 -7
- data/doc/js/darkfish.js +7 -7
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +1 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +190 -80
- data/ext/ruby_prof/extconf.rb +4 -0
- data/ext/ruby_prof/rp_call_info.c +19 -1
- data/ext/ruby_prof/rp_call_info.h +8 -3
- data/ext/ruby_prof/rp_method.c +282 -57
- data/ext/ruby_prof/rp_method.h +28 -5
- data/ext/ruby_prof/rp_stack.c +69 -24
- data/ext/ruby_prof/rp_stack.h +21 -9
- data/ext/ruby_prof/rp_thread.c +4 -1
- data/ext/ruby_prof/ruby_prof.c +142 -39
- data/ext/ruby_prof/ruby_prof.h +3 -0
- data/lib/ruby-prof.rb +10 -0
- data/lib/ruby-prof/call_info.rb +0 -11
- data/lib/ruby-prof/method_info.rb +4 -12
- data/lib/ruby-prof/printers/abstract_printer.rb +19 -1
- data/lib/ruby-prof/printers/call_info_printer.rb +1 -1
- data/lib/ruby-prof/printers/call_stack_printer.rb +9 -4
- data/lib/ruby-prof/printers/call_tree_printer.rb +15 -2
- data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +23 -4
- data/lib/ruby-prof/printers/graph_html_printer.rb +10 -5
- data/lib/ruby-prof/printers/graph_printer.rb +2 -2
- data/lib/ruby-prof/printers/multi_printer.rb +44 -18
- data/lib/ruby-prof/profile.rb +13 -42
- data/lib/ruby-prof/profile/exclude_common_methods.rb +201 -0
- data/lib/ruby-prof/profile/legacy_method_elimination.rb +49 -0
- data/lib/ruby-prof/rack.rb +130 -51
- data/lib/ruby-prof/thread.rb +0 -6
- data/lib/ruby-prof/version.rb +1 -1
- data/ruby-prof.gemspec +4 -3
- data/test/aggregate_test.rb +1 -1
- data/test/exclude_methods_test.rb +146 -0
- data/test/line_number_test.rb +12 -3
- data/test/multi_printer_test.rb +23 -2
- data/test/no_method_class_test.rb +1 -1
- data/test/printers_test.rb +21 -1
- data/test/rack_test.rb +64 -0
- data/test/recursive_test.rb +15 -15
- data/test/test_helper.rb +11 -0
- metadata +20 -13
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -114,7 +115,7 @@ into RubyProf's internals.</p>
|
|
114
115
|
|
115
116
|
<footer id="validator-badges" role="contentinfo">
|
116
117
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
117
|
-
<p>Generated by <a href="
|
118
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
118
119
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
119
120
|
</footer>
|
120
121
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -192,7 +193,7 @@
|
|
192
193
|
|
193
194
|
<footer id="validator-badges" role="contentinfo">
|
194
195
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
195
|
-
<p>Generated by <a href="
|
196
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
196
197
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
197
198
|
</footer>
|
198
199
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -184,7 +185,7 @@
|
|
184
185
|
|
185
186
|
|
186
187
|
<div class="method-source-code" id="application-source">
|
187
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
188
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 168</span>
|
188
189
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">application</span>
|
189
190
|
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:application</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">$PROGRAM_NAME</span>
|
190
191
|
<span class="ruby-keyword">end</span></pre>
|
@@ -217,7 +218,7 @@
|
|
217
218
|
|
218
219
|
|
219
220
|
<div class="method-source-code" id="arguments-source">
|
220
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
221
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 172</span>
|
221
222
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">arguments</span>
|
222
223
|
<span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
|
223
224
|
<span class="ruby-keyword">end</span></pre>
|
@@ -250,7 +251,7 @@
|
|
250
251
|
|
251
252
|
|
252
253
|
<div class="method-source-code" id="base64_image-source">
|
253
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
254
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 214</span>
|
254
255
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">base64_image</span>
|
255
256
|
<span class="ruby-identifier">file</span> = <span class="ruby-identifier">open_asset</span>(<span class="ruby-string">'call_stack_printer.png'</span>)
|
256
257
|
<span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">file</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\n/</span>, <span class="ruby-string">''</span>)
|
@@ -284,7 +285,7 @@
|
|
284
285
|
|
285
286
|
|
286
287
|
<div class="method-source-code" id="color-source">
|
287
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
288
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 155</span>
|
288
289
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">color</span>(<span class="ruby-identifier">p</span>)
|
289
290
|
<span class="ruby-keyword">case</span> <span class="ruby-identifier">i</span> = <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_i</span>
|
290
291
|
<span class="ruby-keyword">when</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">5</span>
|
@@ -326,7 +327,7 @@
|
|
326
327
|
|
327
328
|
|
328
329
|
<div class="method-source-code" id="dump-source">
|
329
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
330
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 151</span>
|
330
331
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">dump</span>(<span class="ruby-identifier">ci</span>)
|
331
332
|
<span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">printf</span> <span class="ruby-string">"%s/%d t:%f s:%f w:%f \n"</span>, <span class="ruby-identifier">ci</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">object_id</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">total_time</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">self_time</span>, <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">wait_time</span>
|
332
333
|
<span class="ruby-keyword">end</span></pre>
|
@@ -359,7 +360,7 @@
|
|
359
360
|
|
360
361
|
|
361
362
|
<div class="method-source-code" id="expansion-source">
|
362
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
363
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 184</span>
|
363
364
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">expansion</span>
|
364
365
|
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:expansion</span>] <span class="ruby-operator">||</span> <span class="ruby-value">10.0</span>
|
365
366
|
<span class="ruby-keyword">end</span></pre>
|
@@ -392,7 +393,7 @@
|
|
392
393
|
|
393
394
|
|
394
395
|
<div class="method-source-code" id="graph_link-source">
|
395
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
396
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 132</span>
|
396
397
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">graph_link</span>(<span class="ruby-identifier">call_info</span>)
|
397
398
|
<span class="ruby-identifier">total_calls</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>.<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">t</span>, <span class="ruby-identifier">ci</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">called</span>}
|
398
399
|
<span class="ruby-identifier">href</span> = <span class="ruby-node">"#{@graph_html}##{method_href(call_info.target)}"</span>
|
@@ -428,15 +429,15 @@
|
|
428
429
|
|
429
430
|
|
430
431
|
<div class="method-source-code" id="link-source">
|
431
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
432
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 116</span>
|
432
433
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">link</span>(<span class="ruby-identifier">call_info</span>)
|
433
434
|
<span class="ruby-identifier">method</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>
|
434
435
|
<span class="ruby-identifier">file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">source_file</span>)
|
435
436
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">file</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\/ruby_runtime$/</span>
|
436
437
|
<span class="ruby-identifier">h</span>(<span class="ruby-identifier">name</span>(<span class="ruby-identifier">call_info</span>))
|
437
438
|
<span class="ruby-keyword">else</span>
|
438
|
-
<span class="ruby-keyword">if</span> <span class="ruby-
|
439
|
-
<span class="ruby-node">"<a href=\"
|
439
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@editor</span>
|
440
|
+
<span class="ruby-node">"<a href=\"#{@editor}://"</span> <span class="ruby-node">"open?url=file://#{file}&line=#{method.line}\">"</span> <span class="ruby-node">"#{h(name(call_info))}</a>"</span>
|
440
441
|
<span class="ruby-keyword">else</span>
|
441
442
|
<span class="ruby-node">"<a href=\"file://#{file}##{method.line}\">#{h(name(call_info))}</a>"</span>
|
442
443
|
<span class="ruby-keyword">end</span>
|
@@ -471,7 +472,7 @@
|
|
471
472
|
|
472
473
|
|
473
474
|
<div class="method-source-code" id="method_href-source">
|
474
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
475
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 139</span>
|
475
476
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">method</span>)
|
476
477
|
<span class="ruby-identifier">h</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/[><#\.\?=:]/</span>,<span class="ruby-string">"_"</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"_"</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@current_thread_id</span>.<span class="ruby-identifier">to_s</span>)
|
477
478
|
<span class="ruby-keyword">end</span></pre>
|
@@ -504,7 +505,7 @@
|
|
504
505
|
|
505
506
|
|
506
507
|
<div class="method-source-code" id="name-source">
|
507
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
508
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 111</span>
|
508
509
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">name</span>(<span class="ruby-identifier">call_info</span>)
|
509
510
|
<span class="ruby-identifier">method</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">target</span>
|
510
511
|
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>
|
@@ -538,7 +539,7 @@
|
|
538
539
|
|
539
540
|
|
540
541
|
<div class="method-source-code" id="open_asset-source">
|
541
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
542
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 204</span>
|
542
543
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">open_asset</span>(<span class="ruby-identifier">file</span>)
|
543
544
|
<span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">'../../assets'</span>, <span class="ruby-keyword">__FILE__</span>), <span class="ruby-identifier">file</span>)
|
544
545
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">path</span>, <span class="ruby-string">'rb'</span>).<span class="ruby-identifier">read</span>
|
@@ -592,16 +593,21 @@
|
|
592
593
|
Default value is 10.0
|
593
594
|
|
594
595
|
:application - a String to overide the name of the application,
|
595
|
-
as it appears on the report
|
596
|
+
as it appears on the report.
|
597
|
+
|
598
|
+
:editor_uri - Specifies editor uri scheme used for opening files
|
599
|
+
e.g. :atm or :mvim. For OS X default is :txmt.
|
600
|
+
Use RUBY_PROF_EDITOR_URI environment variable to overide.</pre>
|
596
601
|
|
597
602
|
|
598
603
|
|
599
604
|
|
600
605
|
<div class="method-source-code" id="print-source">
|
601
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
606
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 41</span>
|
602
607
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">output</span> = <span class="ruby-constant">STDOUT</span>, <span class="ruby-identifier">options</span> = {})
|
603
608
|
<span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span>
|
604
609
|
<span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
610
|
+
<span class="ruby-ivar">@editor</span> = <span class="ruby-identifier">editor_uri</span>
|
605
611
|
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@graph_html</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:graph</span>)
|
606
612
|
<span class="ruby-ivar">@graph_html</span> = <span class="ruby-string">"file://"</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@graph_html</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@graph_html</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">==</span><span class="ruby-string">"/"</span>
|
607
613
|
<span class="ruby-keyword">end</span>
|
@@ -615,7 +621,7 @@
|
|
615
621
|
<span class="ruby-ivar">@result</span>.<span class="ruby-identifier">threads</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">thread</span><span class="ruby-operator">|</span>
|
616
622
|
<span class="ruby-ivar">@current_thread_id</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>
|
617
623
|
<span class="ruby-ivar">@overall_time</span> = <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">total_time</span>
|
618
|
-
|
624
|
+
<span class="ruby-identifier">thread_info</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"Thread: #{thread.id}"</span>)
|
619
625
|
<span class="ruby-identifier">thread_info</span> <span class="ruby-operator"><<</span> <span class="ruby-node">", Fiber: #{thread.fiber_id}"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>
|
620
626
|
<span class="ruby-identifier">thread_info</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" (#{"%4.2f%%" % ((@overall_time/@overall_threads_time)*100)} ~ #{@overall_time})"</span>
|
621
627
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">"<div class=\"thread\">#{thread_info}</div>"</span>
|
@@ -663,7 +669,7 @@
|
|
663
669
|
|
664
670
|
|
665
671
|
<div class="method-source-code" id="print_commands-source">
|
666
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
672
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 233</span>
|
667
673
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_commands</span>
|
668
674
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value"><<-"end_commands"
|
669
675
|
<div id=\"commands\">
|
@@ -705,7 +711,7 @@ end_commands</span>
|
|
705
711
|
|
706
712
|
|
707
713
|
<div class="method-source-code" id="print_css-source">
|
708
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
714
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 209</span>
|
709
715
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_css</span>
|
710
716
|
<span class="ruby-identifier">html</span> = <span class="ruby-identifier">open_asset</span>(<span class="ruby-string">'call_stack_printer.css.html'</span>)
|
711
717
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">html</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'%s'</span>, <span class="ruby-identifier">base64_image</span>)
|
@@ -739,7 +745,7 @@ end_commands</span>
|
|
739
745
|
|
740
746
|
|
741
747
|
<div class="method-source-code" id="print_footer-source">
|
742
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
748
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 200</span>
|
743
749
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_footer</span>
|
744
750
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'<div id="sentinel"></div></div></body></html>'</span>
|
745
751
|
<span class="ruby-keyword">end</span></pre>
|
@@ -772,7 +778,7 @@ end_commands</span>
|
|
772
778
|
|
773
779
|
|
774
780
|
<div class="method-source-code" id="print_header-source">
|
775
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
781
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 188</span>
|
776
782
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_header</span>
|
777
783
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">"<html><head>"</span>
|
778
784
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">'<meta http-equiv="content-type" content="text/html; charset=utf-8">'</span>
|
@@ -813,7 +819,7 @@ end_commands</span>
|
|
813
819
|
|
814
820
|
|
815
821
|
<div class="method-source-code" id="print_help-source">
|
816
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
822
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 246</span>
|
817
823
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_help</span>
|
818
824
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value"><<-'end_help'
|
819
825
|
<div style="display: none;" id="help">
|
@@ -860,7 +866,7 @@ end_help</span>
|
|
860
866
|
|
861
867
|
|
862
868
|
<div class="method-source-code" id="print_java_script-source">
|
863
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
869
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 219</span>
|
864
870
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_java_script</span>
|
865
871
|
<span class="ruby-identifier">html</span> = <span class="ruby-identifier">open_asset</span>(<span class="ruby-string">'call_stack_printer.js.html'</span>)
|
866
872
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">html</span>
|
@@ -894,7 +900,7 @@ end_help</span>
|
|
894
900
|
|
895
901
|
|
896
902
|
<div class="method-source-code" id="print_stack-source">
|
897
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
903
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 78</span>
|
898
904
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_stack</span>(<span class="ruby-identifier">call_info</span>, <span class="ruby-identifier">parent_time</span>)
|
899
905
|
<span class="ruby-identifier">total_time</span> = <span class="ruby-identifier">call_info</span>.<span class="ruby-identifier">total_time</span>
|
900
906
|
<span class="ruby-identifier">percent_parent</span> = (<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">parent_time</span>)<span class="ruby-operator">*</span><span class="ruby-value">100</span>
|
@@ -956,7 +962,7 @@ end_help</span>
|
|
956
962
|
|
957
963
|
|
958
964
|
<div class="method-source-code" id="print_title_bar-source">
|
959
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
965
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 224</span>
|
960
966
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_title_bar</span>
|
961
967
|
<span class="ruby-ivar">@output</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value"><<-"end_title_bar"
|
962
968
|
<div id="titlebar">
|
@@ -994,7 +1000,7 @@ end_title_bar</span>
|
|
994
1000
|
|
995
1001
|
|
996
1002
|
<div class="method-source-code" id="sum-source">
|
997
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
1003
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 147</span>
|
998
1004
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sum</span>(<span class="ruby-identifier">a</span>)
|
999
1005
|
<span class="ruby-identifier">a</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0.0</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">s</span>,<span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span><span class="ruby-identifier">t</span>}
|
1000
1006
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1027,7 +1033,7 @@ end_title_bar</span>
|
|
1027
1033
|
|
1028
1034
|
|
1029
1035
|
<div class="method-source-code" id="threshold-source">
|
1030
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
1036
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 180</span>
|
1031
1037
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">threshold</span>
|
1032
1038
|
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:threshold</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1.0</span>
|
1033
1039
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1060,7 +1066,7 @@ end_title_bar</span>
|
|
1060
1066
|
|
1061
1067
|
|
1062
1068
|
<div class="method-source-code" id="title-source">
|
1063
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
1069
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 176</span>
|
1064
1070
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">title</span>
|
1065
1071
|
<span class="ruby-ivar">@title</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:title</span>) <span class="ruby-operator">||</span> <span class="ruby-string">"ruby-prof call tree"</span>
|
1066
1072
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1093,7 +1099,7 @@ end_title_bar</span>
|
|
1093
1099
|
|
1094
1100
|
|
1095
1101
|
<div class="method-source-code" id="total_time-source">
|
1096
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line
|
1102
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_stack_printer.rb, line 143</span>
|
1097
1103
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">total_time</span>(<span class="ruby-identifier">call_infos</span>)
|
1098
1104
|
<span class="ruby-identifier">sum</span>(<span class="ruby-identifier">call_infos</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">ci</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ci</span>.<span class="ruby-identifier">total_time</span>})
|
1099
1105
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1115,7 +1121,7 @@ end_title_bar</span>
|
|
1115
1121
|
|
1116
1122
|
<footer id="validator-badges" role="contentinfo">
|
1117
1123
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
1118
|
-
<p>Generated by <a href="
|
1124
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
1119
1125
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1120
1126
|
</footer>
|
1121
1127
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
11
12
|
</script>
|
12
13
|
|
13
14
|
<script src="../js/jquery.js"></script>
|
@@ -70,6 +71,8 @@
|
|
70
71
|
|
71
72
|
<ul class="link-list" role="directory">
|
72
73
|
|
74
|
+
<li ><a href="#method-c-needs_dir-3F">::needs_dir?</a>
|
75
|
+
|
73
76
|
<li ><a href="#method-i-base_name">#base_name</a>
|
74
77
|
|
75
78
|
<li ><a href="#method-i-convert">#convert</a>
|
@@ -96,6 +99,8 @@
|
|
96
99
|
|
97
100
|
<li ><a href="#method-i-remove_subsidiary_files_from_previous_profile_runs">#remove_subsidiary_files_from_previous_profile_runs</a>
|
98
101
|
|
102
|
+
<li ><a href="#method-i-validate_print_params">#validate_print_params</a>
|
103
|
+
|
99
104
|
</ul>
|
100
105
|
</div>
|
101
106
|
|
@@ -131,6 +136,47 @@ would appear as a separate profile.</p>
|
|
131
136
|
|
132
137
|
|
133
138
|
|
139
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
140
|
+
<header>
|
141
|
+
<h3>Public Class Methods</h3>
|
142
|
+
</header>
|
143
|
+
|
144
|
+
|
145
|
+
<div id="method-c-needs_dir-3F" class="method-detail ">
|
146
|
+
|
147
|
+
<div class="method-heading">
|
148
|
+
<span class="method-name">needs_dir?</span><span
|
149
|
+
class="method-args">()</span>
|
150
|
+
|
151
|
+
<span class="method-click-advice">click to toggle source</span>
|
152
|
+
|
153
|
+
</div>
|
154
|
+
|
155
|
+
|
156
|
+
<div class="method-description">
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<div class="method-source-code" id="needs_dir-3F-source">
|
164
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 90</span>
|
165
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">needs_dir?</span>
|
166
|
+
<span class="ruby-keyword">true</span>
|
167
|
+
<span class="ruby-keyword">end</span></pre>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
</div>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</div>
|
176
|
+
|
177
|
+
|
178
|
+
</section>
|
179
|
+
|
134
180
|
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
135
181
|
<header>
|
136
182
|
<h3>Public Instance Methods</h3>
|
@@ -156,7 +202,7 @@ would appear as a separate profile.</p>
|
|
156
202
|
|
157
203
|
|
158
204
|
<div class="method-source-code" id="base_name-source">
|
159
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
205
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 94</span>
|
160
206
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">base_name</span>
|
161
207
|
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:profile</span>] <span class="ruby-operator">||</span> <span class="ruby-string">"profile"</span>
|
162
208
|
<span class="ruby-keyword">end</span></pre>
|
@@ -189,7 +235,7 @@ would appear as a separate profile.</p>
|
|
189
235
|
|
190
236
|
|
191
237
|
<div class="method-source-code" id="convert-source">
|
192
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
238
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 69</span>
|
193
239
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">value</span>)
|
194
240
|
(<span class="ruby-identifier">value</span> <span class="ruby-operator">*</span> <span class="ruby-ivar">@value_scale</span>).<span class="ruby-identifier">round</span>
|
195
241
|
<span class="ruby-keyword">end</span></pre>
|
@@ -280,7 +326,7 @@ would appear as a separate profile.</p>
|
|
280
326
|
|
281
327
|
|
282
328
|
<div class="method-source-code" id="file-source">
|
283
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
329
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 73</span>
|
284
330
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">file</span>(<span class="ruby-identifier">method</span>)
|
285
331
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">source_file</span>)
|
286
332
|
<span class="ruby-keyword">end</span></pre>
|
@@ -313,7 +359,7 @@ would appear as a separate profile.</p>
|
|
313
359
|
|
314
360
|
|
315
361
|
<div class="method-source-code" id="file_name_for_thread-source">
|
316
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
362
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 104</span>
|
317
363
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">file_name_for_thread</span>(<span class="ruby-identifier">thread</span>)
|
318
364
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Fiber</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">object_id</span>
|
319
365
|
[<span class="ruby-identifier">base_name</span>, <span class="ruby-string">"callgrind.out"</span>, <span class="ruby-identifier">$$</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">"."</span>)
|
@@ -350,7 +396,7 @@ would appear as a separate profile.</p>
|
|
350
396
|
|
351
397
|
|
352
398
|
<div class="method-source-code" id="file_path_for_thread-source">
|
353
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
399
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 112</span>
|
354
400
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">file_path_for_thread</span>(<span class="ruby-identifier">thread</span>)
|
355
401
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">file_name_for_thread</span>(<span class="ruby-identifier">thread</span>))
|
356
402
|
<span class="ruby-keyword">end</span></pre>
|
@@ -383,7 +429,7 @@ would appear as a separate profile.</p>
|
|
383
429
|
|
384
430
|
|
385
431
|
<div class="method-source-code" id="path-source">
|
386
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
432
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 86</span>
|
387
433
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">path</span>
|
388
434
|
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-string">"."</span>
|
389
435
|
<span class="ruby-keyword">end</span></pre>
|
@@ -418,6 +464,7 @@ would appear as a separate profile.</p>
|
|
418
464
|
<div class="method-source-code" id="print-source">
|
419
465
|
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 45</span>
|
420
466
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">options</span> = {})
|
467
|
+
<span class="ruby-identifier">validate_print_params</span>(<span class="ruby-identifier">options</span>)
|
421
468
|
<span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>)
|
422
469
|
<span class="ruby-identifier">determine_event_specification_and_value_scale</span>
|
423
470
|
<span class="ruby-identifier">print_threads</span>
|
@@ -451,7 +498,7 @@ would appear as a separate profile.</p>
|
|
451
498
|
|
452
499
|
|
453
500
|
<div class="method-source-code" id="print_headers-source">
|
454
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
501
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 116</span>
|
455
502
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_headers</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">thread</span>)
|
456
503
|
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{@event_specification}\n\n"</span>
|
457
504
|
<span class="ruby-comment"># this doesn't work. kcachegrind does not fully support the spec.</span>
|
@@ -486,11 +533,11 @@ would appear as a separate profile.</p>
|
|
486
533
|
|
487
534
|
|
488
535
|
<div class="method-source-code" id="print_method-source">
|
489
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
536
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 122</span>
|
490
537
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_method</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">method</span>)
|
491
538
|
<span class="ruby-comment"># Print out the file and method name</span>
|
492
539
|
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"fl=#{file(method)}\n"</span>
|
493
|
-
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"fn=#{
|
540
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"fn=#{method.calltree_name}\n"</span>
|
494
541
|
|
495
542
|
<span class="ruby-comment"># Now print out the function line number and its self time</span>
|
496
543
|
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{method.line} #{convert(method.self_time)}\n"</span>
|
@@ -498,7 +545,7 @@ would appear as a separate profile.</p>
|
|
498
545
|
<span class="ruby-comment"># Now print out all the children methods</span>
|
499
546
|
<span class="ruby-identifier">method</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">callee</span><span class="ruby-operator">|</span>
|
500
547
|
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"cfl=#{file(callee.target)}\n"</span>
|
501
|
-
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"cfn=#{
|
548
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"cfn=#{callee.target.calltree_name}\n"</span>
|
502
549
|
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"calls=#{callee.called} #{callee.line}\n"</span>
|
503
550
|
|
504
551
|
<span class="ruby-comment"># Print out total times here!</span>
|
@@ -535,7 +582,7 @@ would appear as a separate profile.</p>
|
|
535
582
|
|
536
583
|
|
537
584
|
<div class="method-source-code" id="print_thread-source">
|
538
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
585
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 77</span>
|
539
586
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_thread</span>(<span class="ruby-identifier">thread</span>)
|
540
587
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_path_for_thread</span>(<span class="ruby-identifier">thread</span>), <span class="ruby-string">"w"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
541
588
|
<span class="ruby-identifier">print_headers</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">thread</span>)
|
@@ -573,7 +620,7 @@ would appear as a separate profile.</p>
|
|
573
620
|
|
574
621
|
|
575
622
|
<div class="method-source-code" id="print_threads-source">
|
576
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
623
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 60</span>
|
577
624
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_threads</span>
|
578
625
|
<span class="ruby-identifier">remove_subsidiary_files_from_previous_profile_runs</span>
|
579
626
|
<span class="ruby-comment"># TODO: merge fibers of a given thread here, instead of relying</span>
|
@@ -611,7 +658,7 @@ would appear as a separate profile.</p>
|
|
611
658
|
|
612
659
|
|
613
660
|
<div class="method-source-code" id="remove_subsidiary_files_from_previous_profile_runs-source">
|
614
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line
|
661
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 98</span>
|
615
662
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">remove_subsidiary_files_from_previous_profile_runs</span>
|
616
663
|
<span class="ruby-identifier">pattern</span> = [<span class="ruby-identifier">base_name</span>, <span class="ruby-string">"callgrind.out"</span>, <span class="ruby-identifier">$$</span>, <span class="ruby-string">"*"</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">"."</span>)
|
617
664
|
<span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">pattern</span>))
|
@@ -624,6 +671,43 @@ would appear as a separate profile.</p>
|
|
624
671
|
|
625
672
|
|
626
673
|
|
674
|
+
</div>
|
675
|
+
|
676
|
+
|
677
|
+
<div id="method-i-validate_print_params" class="method-detail ">
|
678
|
+
|
679
|
+
<div class="method-heading">
|
680
|
+
<span class="method-name">validate_print_params</span><span
|
681
|
+
class="method-args">(options)</span>
|
682
|
+
|
683
|
+
<span class="method-click-advice">click to toggle source</span>
|
684
|
+
|
685
|
+
</div>
|
686
|
+
|
687
|
+
|
688
|
+
<div class="method-description">
|
689
|
+
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
<div class="method-source-code" id="validate_print_params-source">
|
696
|
+
<pre><span class="ruby-comment"># File lib/ruby-prof/printers/call_tree_printer.rb, line 52</span>
|
697
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">validate_print_params</span>(<span class="ruby-identifier">options</span>)
|
698
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">IO</span>)
|
699
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"#{self.class.name}#print cannot print to IO objects"</span>
|
700
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
701
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"#{self.class.name}#print requires an options hash"</span>
|
702
|
+
<span class="ruby-keyword">end</span>
|
703
|
+
<span class="ruby-keyword">end</span></pre>
|
704
|
+
</div>
|
705
|
+
|
706
|
+
</div>
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
|
627
711
|
</div>
|
628
712
|
|
629
713
|
|
@@ -635,7 +719,7 @@ would appear as a separate profile.</p>
|
|
635
719
|
|
636
720
|
<footer id="validator-badges" role="contentinfo">
|
637
721
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
638
|
-
<p>Generated by <a href="
|
722
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
639
723
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
640
724
|
</footer>
|
641
725
|
|