ruby-prof 0.18.0-x64-mingw32 → 1.1.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +32 -0
  3. data/LICENSE +2 -2
  4. data/README.rdoc +1 -483
  5. data/Rakefile +3 -6
  6. data/bin/ruby-prof +65 -30
  7. data/ext/ruby_prof/extconf.rb +6 -38
  8. data/ext/ruby_prof/rp_allocation.c +279 -0
  9. data/ext/ruby_prof/rp_allocation.h +31 -0
  10. data/ext/ruby_prof/rp_call_info.c +129 -283
  11. data/ext/ruby_prof/rp_call_info.h +16 -34
  12. data/ext/ruby_prof/rp_measure_allocations.c +25 -49
  13. data/ext/ruby_prof/rp_measure_memory.c +21 -56
  14. data/ext/ruby_prof/rp_measure_process_time.c +35 -39
  15. data/ext/ruby_prof/rp_measure_wall_time.c +36 -19
  16. data/ext/ruby_prof/rp_measurement.c +230 -0
  17. data/ext/ruby_prof/rp_measurement.h +50 -0
  18. data/ext/ruby_prof/rp_method.c +389 -389
  19. data/ext/ruby_prof/rp_method.h +34 -39
  20. data/ext/ruby_prof/rp_profile.c +895 -0
  21. data/ext/ruby_prof/rp_profile.h +37 -0
  22. data/ext/ruby_prof/rp_stack.c +103 -80
  23. data/ext/ruby_prof/rp_stack.h +5 -12
  24. data/ext/ruby_prof/rp_thread.c +143 -83
  25. data/ext/ruby_prof/rp_thread.h +15 -6
  26. data/ext/ruby_prof/ruby_prof.c +11 -757
  27. data/ext/ruby_prof/ruby_prof.h +4 -47
  28. data/ext/ruby_prof/vc/ruby_prof.vcxproj +10 -8
  29. data/lib/{2.6.3 → 2.6.5}/ruby_prof.so +0 -0
  30. data/lib/ruby-prof.rb +2 -18
  31. data/lib/ruby-prof/assets/call_stack_printer.html.erb +713 -0
  32. data/lib/ruby-prof/assets/call_stack_printer.png +0 -0
  33. data/lib/ruby-prof/assets/graph_printer.html.erb +356 -0
  34. data/lib/ruby-prof/call_info.rb +35 -93
  35. data/lib/ruby-prof/call_info_visitor.rb +19 -21
  36. data/lib/ruby-prof/compatibility.rb +37 -107
  37. data/lib/ruby-prof/exclude_common_methods.rb +198 -0
  38. data/lib/ruby-prof/measurement.rb +14 -0
  39. data/lib/ruby-prof/method_info.rb +52 -83
  40. data/lib/ruby-prof/printers/abstract_printer.rb +73 -50
  41. data/lib/ruby-prof/printers/call_info_printer.rb +13 -3
  42. data/lib/ruby-prof/printers/call_stack_printer.rb +62 -145
  43. data/lib/ruby-prof/printers/call_tree_printer.rb +20 -12
  44. data/lib/ruby-prof/printers/dot_printer.rb +5 -5
  45. data/lib/ruby-prof/printers/flat_printer.rb +6 -24
  46. data/lib/ruby-prof/printers/graph_html_printer.rb +6 -192
  47. data/lib/ruby-prof/printers/graph_printer.rb +13 -15
  48. data/lib/ruby-prof/printers/multi_printer.rb +66 -23
  49. data/lib/ruby-prof/profile.rb +10 -3
  50. data/lib/ruby-prof/rack.rb +0 -3
  51. data/lib/ruby-prof/thread.rb +12 -12
  52. data/lib/ruby-prof/version.rb +1 -1
  53. data/ruby-prof.gemspec +2 -2
  54. data/test/abstract_printer_test.rb +0 -27
  55. data/test/alias_test.rb +129 -0
  56. data/test/basic_test.rb +41 -40
  57. data/test/call_info_visitor_test.rb +3 -3
  58. data/test/dynamic_method_test.rb +0 -2
  59. data/test/fiber_test.rb +11 -17
  60. data/test/gc_test.rb +96 -0
  61. data/test/line_number_test.rb +120 -39
  62. data/test/marshal_test.rb +119 -0
  63. data/test/measure_allocations.rb +30 -0
  64. data/test/measure_allocations_test.rb +371 -12
  65. data/test/measure_allocations_trace_test.rb +385 -0
  66. data/test/measure_memory_trace_test.rb +756 -0
  67. data/test/measure_process_time_test.rb +821 -33
  68. data/test/measure_times.rb +54 -0
  69. data/test/measure_wall_time_test.rb +349 -145
  70. data/test/multi_printer_test.rb +1 -34
  71. data/test/parser_timings.rb +24 -0
  72. data/test/pause_resume_test.rb +5 -5
  73. data/test/prime.rb +2 -0
  74. data/test/printer_call_stack_test.rb +28 -0
  75. data/test/printer_call_tree_test.rb +31 -0
  76. data/test/printer_flat_test.rb +68 -0
  77. data/test/printer_graph_html_test.rb +60 -0
  78. data/test/printer_graph_test.rb +41 -0
  79. data/test/printers_test.rb +32 -166
  80. data/test/printing_recursive_graph_test.rb +26 -72
  81. data/test/recursive_test.rb +72 -77
  82. data/test/stack_printer_test.rb +2 -15
  83. data/test/start_stop_test.rb +22 -25
  84. data/test/test_helper.rb +5 -248
  85. data/test/thread_test.rb +11 -54
  86. data/test/unique_call_path_test.rb +16 -28
  87. data/test/yarv_test.rb +1 -0
  88. metadata +28 -36
  89. data/examples/flat.txt +0 -50
  90. data/examples/graph.dot +0 -84
  91. data/examples/graph.html +0 -823
  92. data/examples/graph.txt +0 -139
  93. data/examples/multi.flat.txt +0 -23
  94. data/examples/multi.graph.html +0 -760
  95. data/examples/multi.grind.dat +0 -114
  96. data/examples/multi.stack.html +0 -547
  97. data/examples/stack.html +0 -547
  98. data/ext/ruby_prof/rp_measure.c +0 -40
  99. data/ext/ruby_prof/rp_measure.h +0 -45
  100. data/ext/ruby_prof/rp_measure_cpu_time.c +0 -136
  101. data/ext/ruby_prof/rp_measure_gc_runs.c +0 -73
  102. data/ext/ruby_prof/rp_measure_gc_time.c +0 -60
  103. data/lib/ruby-prof/aggregate_call_info.rb +0 -76
  104. data/lib/ruby-prof/assets/call_stack_printer.css.html +0 -117
  105. data/lib/ruby-prof/assets/call_stack_printer.js.html +0 -385
  106. data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +0 -83
  107. data/lib/ruby-prof/profile/exclude_common_methods.rb +0 -207
  108. data/lib/ruby-prof/profile/legacy_method_elimination.rb +0 -50
  109. data/test/aggregate_test.rb +0 -136
  110. data/test/block_test.rb +0 -74
  111. data/test/call_info_test.rb +0 -78
  112. data/test/issue137_test.rb +0 -63
  113. data/test/measure_cpu_time_test.rb +0 -212
  114. data/test/measure_gc_runs_test.rb +0 -32
  115. data/test/measure_gc_time_test.rb +0 -36
  116. data/test/measure_memory_test.rb +0 -33
  117. data/test/method_elimination_test.rb +0 -84
  118. data/test/module_test.rb +0 -45
  119. data/test/stack_test.rb +0 -138
@@ -1,114 +0,0 @@
1
- events: wall_time
2
-
3
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
4
- fn=Array#first
5
- 0 1
6
-
7
- fl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
8
- fn=Object#find_largest
9
- 31 3
10
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
11
- cfn=Array#first
12
- calls=1 32
13
- 32 1
14
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
15
- cfn=Integer#upto
16
- calls=1 36
17
- 36 11
18
-
19
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
20
- fn=Integer#upto
21
- 0 2582
22
-
23
- fl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
24
- fn=Object#is_prime
25
- 16 92
26
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
27
- cfn=Integer#upto
28
- calls=200 18
29
- 18 2571
30
-
31
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
32
- fn=Array#select
33
- 0 84
34
- cfl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
35
- cfn=Object#is_prime
36
- calls=200 26
37
- 26 2663
38
-
39
- fl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
40
- fn=Object#find_primes
41
- 24 2
42
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
43
- cfn=Array#select
44
- calls=1 25
45
- 25 2747
46
-
47
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
48
- fn=Kernel#respond_to_missing?
49
- 0 30
50
-
51
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
52
- fn=Kernel#rand
53
- 0 87
54
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
55
- cfn=Kernel#respond_to_missing?
56
- calls=200 10
57
- 10 30
58
-
59
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
60
- fn=Array#each_index
61
- 0 70
62
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
63
- cfn=Kernel#rand
64
- calls=200 10
65
- 10 118
66
-
67
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
68
- fn=Array#initialize
69
- 0 2
70
-
71
- fl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
72
- fn=Class#new
73
- 0 4
74
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
75
- cfn=Array#initialize
76
- calls=1 8
77
- 8 2
78
-
79
- fl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
80
- fn=Object#make_random_array
81
- 7 3
82
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
83
- cfn=Class#new
84
- calls=1 8
85
- 8 6
86
- cfl=/Users/stefan.kaes/src/ruby-prof/ruby_runtime
87
- cfn=Array#each_index
88
- calls=1 9
89
- 9 188
90
-
91
- fl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
92
- fn=Object#run_primes
93
- 45 2
94
- cfl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
95
- cfn=Object#make_random_array
96
- calls=1 47
97
- 47 197
98
- cfl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
99
- cfn=Object#find_primes
100
- calls=1 50
101
- 50 2749
102
- cfl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
103
- cfn=Object#find_largest
104
- calls=1 53
105
- 53 15
106
-
107
- fl=/Users/stefan.kaes/src/ruby-prof/test/printers_test.rb
108
- fn=PrintersTest#setup
109
- 14 5
110
- cfl=/Users/stefan.kaes/src/ruby-prof/test/prime.rb
111
- cfn=Object#run_primes
112
- calls=1 14
113
- 14 2963
114
-
@@ -1,547 +0,0 @@
1
- <html><head>
2
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
3
- <title>ruby-prof call tree</title>
4
- <style type="text/css">
5
- <!--
6
- body {
7
- font-size:70%;
8
- padding:0;
9
- margin:5px;
10
- margin-right:0px;
11
- margin-left:0px;
12
- background: #ffffff;
13
- }
14
- ul {
15
- margin-left:0px;
16
- margin-top:0px;
17
- margin-bottom:0px;
18
- padding-left:0px;
19
- list-style-type:none;
20
- }
21
- li {
22
- margin-left:11px;
23
- padding:0px;
24
- white-space:nowrap;
25
- border-top:1px solid #cccccc;
26
- border-left:1px solid #cccccc;
27
- border-bottom:none;
28
- }
29
- .thread {
30
- margin-left:11px;
31
- background:#708090;
32
- padding-top:3px;
33
- padding-left:12px;
34
- padding-bottom:2px;
35
- border-left:1px solid #CCCCCC;
36
- border-top:1px solid #CCCCCC;
37
- font-weight:bold;
38
- }
39
- .hidden {
40
- display:none;
41
- width:0px;
42
- height:0px;
43
- margin:0px;
44
- padding:0px;
45
- border-style:none;
46
- }
47
- .color01 { background:#adbdeb }
48
- .color05 { background:#9daddb }
49
- .color0 { background:#8d9dcb }
50
- .color1 { background:#89bccb }
51
- .color2 { background:#56e3e7 }
52
- .color3 { background:#32cd70 }
53
- .color4 { background:#a3d53c }
54
- .color5 { background:#c4cb34 }
55
- .color6 { background:#dcb66d }
56
- .color7 { background:#cda59e }
57
- .color8 { background:#be9d9c }
58
- .color9 { background:#cf947a }
59
- #commands {
60
- font-size:10pt;
61
- padding:10px;
62
- margin-left:11px;
63
- margin-bottom:0px;
64
- margin-top:0px;
65
- background:#708090;
66
- border-top:1px solid #cccccc;
67
- border-left:1px solid #cccccc;
68
- border-bottom:none;
69
- }
70
- #titlebar {
71
- font-size:10pt;
72
- padding:10px;
73
- margin-left:11px;
74
- margin-bottom:0px;
75
- margin-top:10px;
76
- background:#8090a0;
77
- border-top:1px solid #cccccc;
78
- border-left:1px solid #cccccc;
79
- border-bottom:none;
80
- }
81
- #help {
82
- font-size:10pt;
83
- padding:10px;
84
- margin-left:11px;
85
- margin-bottom:0px;
86
- margin-top:0px;
87
- background:#8090a0;
88
- display:none;
89
- border-top:1px solid #cccccc;
90
- border-left:1px solid #cccccc;
91
- border-bottom:none;
92
- }
93
- #sentinel {
94
- height: 400px;
95
- margin-left:11px;
96
- background:#8090a0;
97
- border-top:1px solid #cccccc;
98
- border-left:1px solid #cccccc;
99
- border-bottom:none;
100
- }
101
- input { margin-left:10px; }
102
-
103
- .toggle {
104
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAJCAMAAAD0FKf3AAAAA3NCSVQICAjb4U/gAAAAb1BMVEX///98jcR8jMV4jMB7jcR7jcR8jcT////7/f/3/P/0+vzx+v7s9vzq9Pzm8Prk7vzi7fnj5/Pc5vTb5vbg5PHW4fHV3/XS3fLM1+3K1e/G0e3EzuzCzey8x+m8xuystuSqtt98jsR8jcR7jcQAAADWswcWAAAAJXRSTlMAVVVV3e7u////////////////////////////////////////Vv4VOQAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAACVSURBVAiZPc/hDoIwDATgobCWgZsWgSGidOz9n9F1CPfrki+5tIqPXHSQVMVZFH8/sx/Is16X9zR2vtQPAMC6LxVnco5Dpvtt40QRGrspnueBqDUcdmrEMILtknkiQkQOU5RAsn9RPGRKNkLOxiibIEauNSYZy2CNyerGRngtsilkiLXP9Cx1bzuAZU13Himq/a3rWX4VVRPEuDWiLQAAAABJRU5ErkJggg==) no-repeat left center;
105
- float:left;
106
- width:9px;
107
- height:9px;
108
- margin:2px 1px 1px 1px;
109
- }
110
-
111
- .toggle.minus {
112
- background-position: -9px 0;
113
- }
114
-
115
- .toggle.plus {
116
- background-position: -18px 0;
117
- }
118
-
119
- -->
120
- </style>
121
- <script type="text/javascript">
122
- /*
123
- Copyright (C) 2005,2009 Stefan Kaes
124
- skaes@railsexpress.de
125
- */
126
-
127
- function rootNode() {
128
- return currentThread;
129
- }
130
-
131
- function showUL(node, show) {
132
- var lis = node.childNodes;
133
- var l = lis.length;
134
- for (var i=0; i < l ; i++ ) {
135
- toggle(lis[i], show);
136
- }
137
- }
138
-
139
- function findUlChild(li){
140
- var ul = li.childNodes[2];
141
- while (ul && ul.nodeName != "UL") {
142
- ul = ul.nextSibling;
143
- }
144
- return ul;
145
- }
146
-
147
- function isLeafNode(li) {
148
- var img = li.firstChild;
149
- return (img.className.indexOf('empty') > -1);
150
- }
151
-
152
- function toggle(li, show) {
153
- if (isLeafNode(li))
154
- return;
155
-
156
- var img = li.firstChild;
157
- img.className = 'toggle ';
158
- img.className += show ? 'minus' : 'plus';
159
-
160
- var ul = findUlChild(li);
161
- if (ul) {
162
- ul.style.display = show ? 'block' : 'none';
163
- showUL(ul, true);
164
- }
165
- }
166
-
167
- function toggleLI(li) {
168
- var img = li.firstChild;
169
- if (img.className.indexOf("minus")>-1)
170
- toggle(li, false);
171
- else {
172
- if (img.className.indexOf("plus")>-1)
173
- toggle(li, true);
174
- }
175
- }
176
-
177
- function aboveThreshold(text, threshold) {
178
- var match = text.match(/\d+[.,]\d+/);
179
- return (match && parseFloat(match[0].replace(/,/, '.'))>=threshold);
180
- }
181
-
182
- function setThresholdLI(li, threshold) {
183
- var img = li.firstChild;
184
- var text = img.nextSibling;
185
- var ul = findUlChild(li);
186
-
187
- var visible = aboveThreshold(text.nodeValue, threshold) ? 1 : 0;
188
-
189
- var count = 0;
190
- if (ul) {
191
- count = setThresholdUL(ul, threshold);
192
- }
193
- if (count>0) {
194
- img.className = 'toggle minus';
195
- }
196
- else {
197
- img.className = 'toggle empty';
198
- }
199
- if (visible) {
200
- li.style.display = 'block'
201
- }
202
- else {
203
- li.style.display = 'none'
204
- }
205
- return visible;
206
- }
207
-
208
- function setThresholdUL(node, threshold) {
209
- var lis = node.childNodes;
210
- var l = lis.length;
211
-
212
- var count = 0;
213
- for ( var i = 0; i < l ; i++ ) {
214
- count = count + setThresholdLI(lis[i], threshold);
215
- }
216
-
217
- var visible = (count > 0) ? 1 : 0;
218
- if (visible) {
219
- node.style.display = 'block';
220
- }
221
- else {
222
- node.style.display = 'none';
223
- }
224
- return visible;
225
- }
226
-
227
- function toggleChildren(img, event) {
228
- event.cancelBubble=true;
229
- if (img.className.indexOf('empty') > -1)
230
- return;
231
-
232
- var minus = (img.className.indexOf('minus') > -1);
233
-
234
- if (minus) {
235
- img.className = 'toggle plus';
236
- }
237
- else
238
- img.className = 'toggle minus';
239
-
240
- var li = img.parentNode;
241
- var ul = findUlChild(li);
242
- if (ul) {
243
- if (minus)
244
- ul.style.display = 'none';
245
- else
246
- ul.style.display = 'block';
247
- }
248
- if (minus)
249
- moveSelectionIfNecessary(li);
250
- }
251
-
252
- function showChildren(li) {
253
- var img = li.firstChild;
254
- if (img.className.indexOf('empty') > -1)
255
- return;
256
- img.className = 'toggle minus';
257
-
258
- var ul = findUlChild(li);
259
- if (ul) {
260
- ul.style.display = 'block';
261
- }
262
- }
263
-
264
- function setThreshold() {
265
- var tv = document.getElementById("threshold").value;
266
- if (tv.match(/[0-9]+([.,][0-9]+)?/)) {
267
- var f = parseFloat(tv.replace(/,/, '.'));
268
- var threads = document.getElementsByName("thread");
269
- var l = threads.length;
270
- for ( var i = 0; i < l ; i++ ) {
271
- setThresholdUL(threads[i], f);
272
- }
273
- var p = selectedNode;
274
- while (p && p.style.display=='none')
275
- p=p.parentNode.parentNode;
276
- if (p && p.nodeName=="LI")
277
- selectNode(p);
278
- }
279
- else {
280
- alert("Please specify a decimal number as threshold value!");
281
- }
282
- }
283
-
284
- function expandAll(event) {
285
- toggleAll(event, true);
286
- }
287
-
288
- function collapseAll(event) {
289
- toggleAll(event, false);
290
- selectNode(rootNode(), null);
291
- }
292
-
293
- function toggleAll(event, show) {
294
- event.cancelBubble=true;
295
- var threads = document.getElementsByName("thread");
296
- var l = threads.length;
297
- for ( var i = 0; i < l ; i++ ) {
298
- showUL(threads[i], show);
299
- }
300
- }
301
-
302
- function toggleHelp(node) {
303
- var help = document.getElementById("help");
304
- if (node.value == "Show Help") {
305
- node.value = "Hide Help";
306
- help.style.display = 'block';
307
- }
308
- else {
309
- node.value = "Show Help";
310
- help.style.display = 'none';
311
- }
312
- }
313
-
314
- var selectedNode = null;
315
- var selectedColor = null;
316
- var selectedThread = null;
317
-
318
- function descendentOf(a,b){
319
- while (a!=b && b!=null)
320
- b=b.parentNode;
321
- return (a==b);
322
- }
323
-
324
- function moveSelectionIfNecessary(node){
325
- if (descendentOf(node, selectedNode))
326
- selectNode(node, null);
327
- }
328
-
329
- function selectNode(node, event) {
330
- if (event) {
331
- event.cancelBubble = true;
332
- thread = findThread(node);
333
- selectThread(thread);
334
- }
335
- if (selectedNode) {
336
- selectedNode.style.background = selectedColor;
337
- }
338
- selectedNode = node;
339
- selectedColor = node.style.background;
340
- selectedNode.style.background = "red";
341
- selectedNode.scrollIntoView();
342
- window.scrollBy(0,-400);
343
- }
344
-
345
- function moveUp(){
346
- move(selectedNode.previousSibling);
347
- }
348
-
349
- function moveDown(){
350
- move(selectedNode.nextSibling);
351
- }
352
-
353
- function move(p) {
354
- while (p && p.style.display == 'none')
355
- p = p.nextSibling;
356
- if (p && p.nodeName == "LI") {
357
- selectNode(p, null);
358
- }
359
- }
360
-
361
- function moveLeft(){
362
- var p = selectedNode.parentNode.parentNode;
363
- if (p && p.nodeName=="LI") {
364
- selectNode(p, null);
365
- }
366
- }
367
-
368
- function moveRight(){
369
- if (!isLeafNode(selectedNode)) {
370
- showChildren(selectedNode);
371
- var ul = findUlChild(selectedNode);
372
- if (ul) {
373
- selectNode(ul.firstChild, null);
374
- }
375
- }
376
- }
377
-
378
- function moveForward(){
379
- if (isLeafNode(selectedNode)) {
380
- var p = selectedNode;
381
- while ((p.nextSibling == null || p.nextSibling.style.display=='none') && p.nodeName=="LI") {
382
- p = p.parentNode.parentNode;
383
- }
384
- if (p.nodeName=="LI")
385
- selectNode(p.nextSibling, null);
386
- }
387
- else {
388
- moveRight();
389
- }
390
- }
391
-
392
- function isExpandedNode(li){
393
- var img = li.firstChild;
394
- return(img.className.indexOf('minus')>-1);
395
- }
396
-
397
- function moveBackward(){
398
- var p = selectedNode;
399
- var q = p.previousSibling;
400
- while (q != null && q.style.display=='none')
401
- q = q.previousSibling;
402
- if (q == null) {
403
- p = p.parentNode.parentNode;
404
- } else {
405
- while (!isLeafNode(q) && isExpandedNode(q)) {
406
- q = findUlChild(q).lastChild;
407
- while (q.style.display=='none')
408
- q = q.previousSibling;
409
- }
410
- p = q;
411
- }
412
- if (p.nodeName=="LI")
413
- selectNode(p, null);
414
- }
415
-
416
- function moveHome() {
417
- selectNode(currentThread);
418
- }
419
-
420
- var currentThreadIndex = null;
421
-
422
- function findThread(node){
423
- while (node && !node.parentNode.nodeName.match(/BODY|DIV/g)) {
424
- node = node.parentNode;
425
- }
426
- return node.firstChild;
427
- }
428
-
429
- function selectThread(node){
430
- var threads = document.getElementsByName("thread");
431
- currentThread = node;
432
- for (var i=0; i<threads.length; i++) {
433
- if (threads[i]==currentThread.parentNode)
434
- currentThreadIndex = i;
435
- }
436
- }
437
-
438
- function nextThread(){
439
- var threads = document.getElementsByName("thread");
440
- if (currentThreadIndex==threads.length-1)
441
- currentThreadIndex = 0;
442
- else
443
- currentThreadIndex += 1
444
- currentThread = threads[currentThreadIndex].firstChild;
445
- selectNode(currentThread, null);
446
- }
447
-
448
- function previousThread(){
449
- var threads = document.getElementsByName("thread");
450
- if (currentThreadIndex==0)
451
- currentThreadIndex = threads.length-1;
452
- else
453
- currentThreadIndex -= 1
454
- currentThread = threads[currentThreadIndex].firstChild;
455
- selectNode(currentThread, null);
456
- }
457
-
458
- function switchThread(node, event){
459
- event.cancelBubble = true;
460
- selectThread(node.nextSibling.firstChild);
461
- selectNode(currentThread, null);
462
- }
463
-
464
- function handleKeyEvent(event){
465
- var code = event.charCode ? event.charCode : event.keyCode;
466
- var str = String.fromCharCode(code);
467
- switch (str) {
468
- case "a": moveLeft(); break;
469
- case "s": moveDown(); break;
470
- case "d": moveRight(); break;
471
- case "w": moveUp(); break;
472
- case "f": moveForward(); break;
473
- case "b": moveBackward(); break;
474
- case "x": toggleChildren(selectedNode.firstChild, event); break;
475
- case "*": toggleLI(selectedNode); break;
476
- case "n": nextThread(); break;
477
- case "h": moveHome(); break;
478
- case "p": previousThread(); break;
479
- }
480
- }
481
- document.onkeypress=function(event){ handleKeyEvent(event) };
482
-
483
- window.onload=function(){
484
- var images = document.querySelectorAll(".toggle");
485
- for (var i=0; i<images.length; i++) {
486
- var img = images[i];
487
- img.onclick = function(event){ toggleChildren(this, event); return false; };
488
- }
489
- var divs = document.getElementsByTagName("div");
490
- for (i=0; i<divs.length; i++) {
491
- var div = divs[i];
492
- if (div.className == "thread")
493
- div.onclick = function(event){ switchThread(this, event) };
494
- }
495
- var lis = document.getElementsByTagName("li");
496
- for (var i=0; i<lis.length; i++) {
497
- lis[i].onclick = function(event){ selectNode(this, event); };
498
- }
499
- var threads = document.getElementsByName("thread");;
500
- currentThreadIndex = 0;
501
- currentThread = threads[0].firstChild;
502
- selectNode(currentThread, null);
503
- };
504
-
505
- </script>
506
- </head><body><div style="display: inline-block;">
507
- <div id="titlebar">
508
- Call tree for application <b>primes </b><br/>
509
- Generated on 2015-04-24 11:52:24 +0200 with options {:application=&gt;&quot;primes&quot;}<br/>
510
- </div>
511
- <div id="commands">
512
- <span style="font-size: 11pt; font-weight: bold;">Threshold:</span>
513
- <input value="1.0" size="3" id="threshold" type="text">
514
- <input value="Apply" onclick="setThreshold();" type="submit">
515
- <input value="Expand All" onclick="expandAll(event);" type="submit">
516
- <input value="Collapse All" onclick="collapseAll(event);" type="submit">
517
- <input value="Show Help" onclick="toggleHelp(this);" type="submit">
518
- </div>
519
- <div style="display: none;" id="help">
520
- &#8226; Enter a decimal value <i>d</i> into the threshold field and click "Apply"
521
- to hide all nodes marked with time values lower than <i>d</i>.<br>
522
- &#8226; Click on "Expand All" for full tree expansion.<br>
523
- &#8226; Click on "Collapse All" to show only top level nodes.<br>
524
- &#8226; Use a, s, d, w as in Quake or Urban Terror to navigate the tree.<br>
525
- &#8226; Use f and b to navigate the tree in preorder forward and backwards.<br>
526
- &#8226; Use x to toggle visibility of a subtree.<br>
527
- &#8226; Use * to expand/collapse a whole subtree.<br>
528
- &#8226; Use h to navigate to thread root.<br>
529
- &#8226; Use n and p to navigate between threads.<br>
530
- &#8226; Click on background to move focus to a subtree.<br>
531
- </div>
532
- <div class="thread">Thread: 70140045951280, Fiber: 70140054192180 (100.00% ~ 0.0029680728912353516)</div><ul name="thread"><li class="color9" style="display:block"><a href="#" class="toggle minus" ></a><span> 100.00% (100.00%) <a href="txmt://open?url=file:///Users/stefan.kaes/src/ruby-prof/test/printers_test.rb&line=14">PrintersTest#setup</a> [1 calls, <a href='multi.graph.html#PrintersTest_setup_70140054192180'>1</a> total]</span>
533
- <ul><li class="color9" style="display:block"><a href="#" class="toggle minus" ></a><span> 99.82% (99.82%) <a href="txmt://open?url=file:///Users/stefan.kaes/src/ruby-prof/test/prime.rb&line=45">Object#run_primes</a> [1 calls, <a href='multi.graph.html#Object_run_primes_70140054192180'>1</a> total]</span>
534
- <ul><li class="color9" style="display:block"><a href="#" class="toggle minus" ></a><span> 92.62% (92.78%) <a href="txmt://open?url=file:///Users/stefan.kaes/src/ruby-prof/test/prime.rb&line=24">Object#find_primes</a> [1 calls, <a href='multi.graph.html#Object_find_primes_70140054192180'>1</a> total]</span>
535
- <ul><li class="color9" style="display:block"><a href="#" class="toggle minus" ></a><span> 92.55% (99.93%) Array#select [1 calls, <a href='multi.graph.html#Array_select_70140054192180'>1</a> total]</span>
536
- <ul><li class="color8" style="display:block"><a href="#" class="toggle minus" ></a><span> 89.73% (96.95%) <a href="txmt://open?url=file:///Users/stefan.kaes/src/ruby-prof/test/prime.rb&line=16">Object#is_prime</a> [200 calls, <a href='multi.graph.html#Object_is_prime_70140054192180'>200</a> total]</span>
537
- <ul><li class="color8" style="display:block"><a href="#" class="toggle empty" ></a><span> 86.63% (96.54%) Integer#upto [200 calls, <a href='multi.graph.html#Integer_upto_70140054192180'>201</a> total]</span>
538
- </li></ul></li></ul></li></ul></li><li class="color05" style="display:block"><a href="#" class="toggle plus" ></a><span> 6.64% (6.65%) <a href="txmt://open?url=file:///Users/stefan.kaes/src/ruby-prof/test/prime.rb&line=7">Object#make_random_array</a> [1 calls, <a href='multi.graph.html#Object_make_random_array_70140054192180'>1</a> total]</span>
539
- <ul style="display:none"><li class="color05" style="display:block"><a href="#" class="toggle plus" ></a><span> 6.33% (95.40%) Array#each_index [1 calls, <a href='multi.graph.html#Array_each_index_70140054192180'>1</a> total]</span>
540
- <ul style="display:none"><li class="color01" style="display:block"><a href="#" class="toggle plus" ></a><span> 3.96% (62.56%) Kernel#rand [200 calls, <a href='multi.graph.html#Kernel_rand_70140054192180'>200</a> total]</span>
541
- <ul style="display:none"><li class="color01" style="display:block"><a href="#" class="toggle empty" ></a><span> 1.02% (25.76%) Kernel#respond_to_missing? [200 calls, <a href='multi.graph.html#Kernel_respond_to_missing__70140054192180'>200</a> total]</span>
542
- </li></ul></li></ul></li><li class="color01" style="display:none"><a href="#" class="toggle empty" ></a><span> 0.20% (3.03%) Class#new [1 calls, <a href='multi.graph.html#Class_new_70140054192180'>1</a> total]</span>
543
- <ul style="display:none"><li class="color01" style="display:none"><a href="#" class="toggle empty" ></a><span> 0.06% (32.00%) Array#initialize [1 calls, <a href='multi.graph.html#Array_initialize_70140054192180'>1</a> total]</span>
544
- </li></ul></li></ul></li><li class="color01" style="display:none"><a href="#" class="toggle empty" ></a><span> 0.51% (0.51%) <a href="txmt://open?url=file:///Users/stefan.kaes/src/ruby-prof/test/prime.rb&line=31">Object#find_largest</a> [1 calls, <a href='multi.graph.html#Object_find_largest_70140054192180'>1</a> total]</span>
545
- <ul style="display:none"><li class="color01" style="display:none"><a href="#" class="toggle empty" ></a><span> 0.37% (73.02%) Integer#upto [1 calls, <a href='multi.graph.html#Integer_upto_70140054192180'>201</a> total]</span>
546
- </li><li class="color01" style="display:none"><a href="#" class="toggle empty" ></a><span> 0.03% (6.35%) Array#first [1 calls, <a href='multi.graph.html#Array_first_70140054192180'>1</a> total]</span>
547
- </li></ul></li></ul></li></ul></li></ul><div id="sentinel"></div></div></body></html>