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.
- checksums.yaml +4 -4
- data/CHANGES +32 -0
- data/LICENSE +2 -2
- data/README.rdoc +1 -483
- data/Rakefile +3 -6
- data/bin/ruby-prof +65 -30
- data/ext/ruby_prof/extconf.rb +6 -38
- data/ext/ruby_prof/rp_allocation.c +279 -0
- data/ext/ruby_prof/rp_allocation.h +31 -0
- data/ext/ruby_prof/rp_call_info.c +129 -283
- data/ext/ruby_prof/rp_call_info.h +16 -34
- data/ext/ruby_prof/rp_measure_allocations.c +25 -49
- data/ext/ruby_prof/rp_measure_memory.c +21 -56
- data/ext/ruby_prof/rp_measure_process_time.c +35 -39
- data/ext/ruby_prof/rp_measure_wall_time.c +36 -19
- data/ext/ruby_prof/rp_measurement.c +230 -0
- data/ext/ruby_prof/rp_measurement.h +50 -0
- data/ext/ruby_prof/rp_method.c +389 -389
- data/ext/ruby_prof/rp_method.h +34 -39
- data/ext/ruby_prof/rp_profile.c +895 -0
- data/ext/ruby_prof/rp_profile.h +37 -0
- data/ext/ruby_prof/rp_stack.c +103 -80
- data/ext/ruby_prof/rp_stack.h +5 -12
- data/ext/ruby_prof/rp_thread.c +143 -83
- data/ext/ruby_prof/rp_thread.h +15 -6
- data/ext/ruby_prof/ruby_prof.c +11 -757
- data/ext/ruby_prof/ruby_prof.h +4 -47
- data/ext/ruby_prof/vc/ruby_prof.vcxproj +10 -8
- data/lib/{2.6.3 → 2.6.5}/ruby_prof.so +0 -0
- data/lib/ruby-prof.rb +2 -18
- data/lib/ruby-prof/assets/call_stack_printer.html.erb +713 -0
- data/lib/ruby-prof/assets/call_stack_printer.png +0 -0
- data/lib/ruby-prof/assets/graph_printer.html.erb +356 -0
- data/lib/ruby-prof/call_info.rb +35 -93
- data/lib/ruby-prof/call_info_visitor.rb +19 -21
- data/lib/ruby-prof/compatibility.rb +37 -107
- data/lib/ruby-prof/exclude_common_methods.rb +198 -0
- data/lib/ruby-prof/measurement.rb +14 -0
- data/lib/ruby-prof/method_info.rb +52 -83
- data/lib/ruby-prof/printers/abstract_printer.rb +73 -50
- data/lib/ruby-prof/printers/call_info_printer.rb +13 -3
- data/lib/ruby-prof/printers/call_stack_printer.rb +62 -145
- data/lib/ruby-prof/printers/call_tree_printer.rb +20 -12
- data/lib/ruby-prof/printers/dot_printer.rb +5 -5
- data/lib/ruby-prof/printers/flat_printer.rb +6 -24
- data/lib/ruby-prof/printers/graph_html_printer.rb +6 -192
- data/lib/ruby-prof/printers/graph_printer.rb +13 -15
- data/lib/ruby-prof/printers/multi_printer.rb +66 -23
- data/lib/ruby-prof/profile.rb +10 -3
- data/lib/ruby-prof/rack.rb +0 -3
- data/lib/ruby-prof/thread.rb +12 -12
- data/lib/ruby-prof/version.rb +1 -1
- data/ruby-prof.gemspec +2 -2
- data/test/abstract_printer_test.rb +0 -27
- data/test/alias_test.rb +129 -0
- data/test/basic_test.rb +41 -40
- data/test/call_info_visitor_test.rb +3 -3
- data/test/dynamic_method_test.rb +0 -2
- data/test/fiber_test.rb +11 -17
- data/test/gc_test.rb +96 -0
- data/test/line_number_test.rb +120 -39
- data/test/marshal_test.rb +119 -0
- data/test/measure_allocations.rb +30 -0
- data/test/measure_allocations_test.rb +371 -12
- data/test/measure_allocations_trace_test.rb +385 -0
- data/test/measure_memory_trace_test.rb +756 -0
- data/test/measure_process_time_test.rb +821 -33
- data/test/measure_times.rb +54 -0
- data/test/measure_wall_time_test.rb +349 -145
- data/test/multi_printer_test.rb +1 -34
- data/test/parser_timings.rb +24 -0
- data/test/pause_resume_test.rb +5 -5
- data/test/prime.rb +2 -0
- data/test/printer_call_stack_test.rb +28 -0
- data/test/printer_call_tree_test.rb +31 -0
- data/test/printer_flat_test.rb +68 -0
- data/test/printer_graph_html_test.rb +60 -0
- data/test/printer_graph_test.rb +41 -0
- data/test/printers_test.rb +32 -166
- data/test/printing_recursive_graph_test.rb +26 -72
- data/test/recursive_test.rb +72 -77
- data/test/stack_printer_test.rb +2 -15
- data/test/start_stop_test.rb +22 -25
- data/test/test_helper.rb +5 -248
- data/test/thread_test.rb +11 -54
- data/test/unique_call_path_test.rb +16 -28
- data/test/yarv_test.rb +1 -0
- metadata +28 -36
- data/examples/flat.txt +0 -50
- data/examples/graph.dot +0 -84
- data/examples/graph.html +0 -823
- data/examples/graph.txt +0 -139
- data/examples/multi.flat.txt +0 -23
- data/examples/multi.graph.html +0 -760
- data/examples/multi.grind.dat +0 -114
- data/examples/multi.stack.html +0 -547
- data/examples/stack.html +0 -547
- data/ext/ruby_prof/rp_measure.c +0 -40
- data/ext/ruby_prof/rp_measure.h +0 -45
- data/ext/ruby_prof/rp_measure_cpu_time.c +0 -136
- data/ext/ruby_prof/rp_measure_gc_runs.c +0 -73
- data/ext/ruby_prof/rp_measure_gc_time.c +0 -60
- data/lib/ruby-prof/aggregate_call_info.rb +0 -76
- data/lib/ruby-prof/assets/call_stack_printer.css.html +0 -117
- data/lib/ruby-prof/assets/call_stack_printer.js.html +0 -385
- data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +0 -83
- data/lib/ruby-prof/profile/exclude_common_methods.rb +0 -207
- data/lib/ruby-prof/profile/legacy_method_elimination.rb +0 -50
- data/test/aggregate_test.rb +0 -136
- data/test/block_test.rb +0 -74
- data/test/call_info_test.rb +0 -78
- data/test/issue137_test.rb +0 -63
- data/test/measure_cpu_time_test.rb +0 -212
- data/test/measure_gc_runs_test.rb +0 -32
- data/test/measure_gc_time_test.rb +0 -36
- data/test/measure_memory_test.rb +0 -33
- data/test/method_elimination_test.rb +0 -84
- data/test/module_test.rb +0 -45
- data/test/stack_test.rb +0 -138
data/examples/stack.html
DELETED
@@ -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=>"primes"}<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
|
-
• 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
|
-
• Click on "Expand All" for full tree expansion.<br>
|
523
|
-
• Click on "Collapse All" to show only top level nodes.<br>
|
524
|
-
• Use a, s, d, w as in Quake or Urban Terror to navigate the tree.<br>
|
525
|
-
• Use f and b to navigate the tree in preorder forward and backwards.<br>
|
526
|
-
• Use x to toggle visibility of a subtree.<br>
|
527
|
-
• Use * to expand/collapse a whole subtree.<br>
|
528
|
-
• Use h to navigate to thread root.<br>
|
529
|
-
• Use n and p to navigate between threads.<br>
|
530
|
-
• 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, 1 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, 1 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, 1 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, 1 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, 200 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, 201 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, 1 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, 1 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, 200 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, 200 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, 1 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, 1 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, 1 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, 201 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, 1 total]</span>
|
547
|
-
</li></ul></li></ul></li></ul></li></ul><div id="sentinel"></div></div></body></html>
|