ruby-prof 1.1.0-x64-mingw32 → 1.3.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +19 -1
  3. data/bin/ruby-prof +100 -152
  4. data/ext/ruby_prof/rp_aggregate_call_tree.c +59 -0
  5. data/ext/ruby_prof/rp_aggregate_call_tree.h +13 -0
  6. data/ext/ruby_prof/rp_allocation.c +67 -59
  7. data/ext/ruby_prof/rp_allocation.h +3 -3
  8. data/ext/ruby_prof/rp_call_tree.c +369 -0
  9. data/ext/ruby_prof/rp_call_tree.h +43 -0
  10. data/ext/ruby_prof/rp_call_trees.c +288 -0
  11. data/ext/ruby_prof/rp_call_trees.h +28 -0
  12. data/ext/ruby_prof/rp_measure_allocations.c +11 -13
  13. data/ext/ruby_prof/rp_measure_process_time.c +11 -13
  14. data/ext/ruby_prof/rp_measure_wall_time.c +17 -15
  15. data/ext/ruby_prof/rp_measurement.c +47 -40
  16. data/ext/ruby_prof/rp_measurement.h +7 -7
  17. data/ext/ruby_prof/rp_method.c +116 -255
  18. data/ext/ruby_prof/rp_method.h +31 -39
  19. data/ext/ruby_prof/rp_profile.c +311 -281
  20. data/ext/ruby_prof/rp_profile.h +1 -2
  21. data/ext/ruby_prof/rp_stack.c +113 -105
  22. data/ext/ruby_prof/rp_stack.h +17 -20
  23. data/ext/ruby_prof/rp_thread.c +136 -111
  24. data/ext/ruby_prof/rp_thread.h +12 -9
  25. data/ext/ruby_prof/ruby_prof.c +27 -23
  26. data/ext/ruby_prof/ruby_prof.h +9 -0
  27. data/ext/ruby_prof/vc/ruby_prof.vcxproj +11 -7
  28. data/lib/ruby-prof.rb +2 -3
  29. data/lib/ruby-prof/assets/call_stack_printer.html.erb +4 -7
  30. data/lib/ruby-prof/assets/graph_printer.html.erb +5 -6
  31. data/lib/ruby-prof/{call_info.rb → call_tree.rb} +6 -6
  32. data/lib/ruby-prof/call_tree_visitor.rb +36 -0
  33. data/lib/ruby-prof/measurement.rb +5 -2
  34. data/lib/ruby-prof/method_info.rb +3 -15
  35. data/lib/ruby-prof/printers/call_info_printer.rb +12 -10
  36. data/lib/ruby-prof/printers/call_stack_printer.rb +19 -22
  37. data/lib/ruby-prof/printers/call_tree_printer.rb +1 -1
  38. data/lib/ruby-prof/printers/dot_printer.rb +3 -3
  39. data/lib/ruby-prof/printers/graph_printer.rb +3 -4
  40. data/lib/ruby-prof/printers/multi_printer.rb +2 -2
  41. data/lib/ruby-prof/rack.rb +3 -0
  42. data/lib/ruby-prof/thread.rb +3 -18
  43. data/lib/ruby-prof/version.rb +1 -1
  44. data/ruby-prof.gemspec +7 -0
  45. data/test/alias_test.rb +42 -45
  46. data/test/basic_test.rb +0 -86
  47. data/test/{call_info_visitor_test.rb → call_tree_visitor_test.rb} +6 -5
  48. data/test/call_trees_test.rb +66 -0
  49. data/test/exclude_methods_test.rb +17 -12
  50. data/test/fiber_test.rb +197 -9
  51. data/test/gc_test.rb +36 -42
  52. data/test/inverse_call_tree_test.rb +175 -0
  53. data/test/line_number_test.rb +67 -70
  54. data/test/marshal_test.rb +7 -11
  55. data/test/measure_allocations_test.rb +224 -234
  56. data/test/measure_allocations_trace_test.rb +224 -234
  57. data/test/measure_memory_trace_test.rb +814 -469
  58. data/test/measure_process_time_test.rb +0 -64
  59. data/test/measure_times.rb +2 -0
  60. data/test/measure_wall_time_test.rb +34 -58
  61. data/test/pause_resume_test.rb +19 -10
  62. data/test/prime.rb +1 -3
  63. data/test/prime_script.rb +6 -0
  64. data/test/printers_test.rb +1 -1
  65. data/test/recursive_test.rb +50 -54
  66. data/test/start_stop_test.rb +19 -19
  67. data/test/test_helper.rb +3 -15
  68. data/test/thread_test.rb +11 -11
  69. data/test/unique_call_path_test.rb +25 -95
  70. metadata +19 -10
  71. data/ext/ruby_prof/rp_call_info.c +0 -271
  72. data/ext/ruby_prof/rp_call_info.h +0 -35
  73. data/lib/2.6.5/ruby_prof.so +0 -0
  74. data/lib/ruby-prof/call_info_visitor.rb +0 -38
  75. data/test/parser_timings.rb +0 -24
@@ -23,10 +23,6 @@ class MeasureAllocationsTraceTest < TestCase
23
23
  thread = result.threads.first
24
24
  assert_in_delta(20, thread.total_time, 1)
25
25
 
26
- root_methods = thread.root_methods
27
- assert_equal(1, root_methods.count)
28
- assert_equal("MeasureAllocationsTraceTest#test_allocations", root_methods[0].full_name)
29
-
30
26
  methods = result.threads.first.methods.sort.reverse
31
27
  assert_equal(13, methods.length)
32
28
 
@@ -38,28 +34,22 @@ class MeasureAllocationsTraceTest < TestCase
38
34
  assert_equal(0, method.self_time)
39
35
  assert_in_delta(20, method.children_time, 1)
40
36
 
41
- assert_equal(1, method.callers.length)
42
- call_info = method.callers[0]
43
- assert_nil(call_info.parent)
44
- assert_equal(20, call_info.total_time)
45
- assert_equal(0, call_info.wait_time)
46
- assert_equal(0, call_info.self_time)
47
- assert_equal(20, call_info.children_time)
48
-
49
- assert_equal(2, method.callees.length)
50
- call_info = method.callees[0]
51
- assert_equal('Class#new', call_info.target.full_name)
52
- assert_equal(1, call_info.total_time)
53
- assert_equal(0, call_info.wait_time)
54
- assert_equal(1, call_info.self_time)
55
- assert_equal(0, call_info.children_time)
56
-
57
- call_info = method.callees[1]
58
- assert_equal('Allocator#run', call_info.target.full_name)
59
- assert_equal(19, call_info.total_time)
60
- assert_equal(0, call_info.wait_time)
61
- assert_equal(0, call_info.self_time)
62
- assert_equal(19, call_info.children_time)
37
+ assert_equal(0, method.call_trees.callers.length)
38
+
39
+ assert_equal(2, method.call_trees.callees.length)
40
+ call_tree = method.call_trees.callees[0]
41
+ assert_equal('Class#new', call_tree.target.full_name)
42
+ assert_equal(1, call_tree.total_time)
43
+ assert_equal(0, call_tree.wait_time)
44
+ assert_equal(1, call_tree.self_time)
45
+ assert_equal(0, call_tree.children_time)
46
+
47
+ call_tree = method.call_trees.callees[1]
48
+ assert_equal('Allocator#run', call_tree.target.full_name)
49
+ assert_equal(19, call_tree.total_time)
50
+ assert_equal(0, call_tree.wait_time)
51
+ assert_equal(0, call_tree.self_time)
52
+ assert_equal(19, call_tree.children_time)
63
53
 
64
54
  # Method 1
65
55
  method = methods[1]
@@ -69,21 +59,21 @@ class MeasureAllocationsTraceTest < TestCase
69
59
  assert_equal(0, method.self_time)
70
60
  assert_equal(19, method.children_time)
71
61
 
72
- assert_equal(1, method.callers.length)
73
- call_info = method.callers[0]
74
- assert_equal('MeasureAllocationsTraceTest#test_allocations', call_info.parent.full_name)
75
- assert_equal(19, call_info.total_time)
76
- assert_equal(0, call_info.wait_time)
77
- assert_equal(0, call_info.self_time)
78
- assert_equal(19, call_info.children_time)
79
-
80
- assert_equal(1, method.callees.length)
81
- call_info = method.callees[0]
82
- assert_equal('Allocator#internal_run', call_info.target.full_name)
83
- assert_equal(19, call_info.total_time)
84
- assert_equal(0, call_info.wait_time)
85
- assert_equal(0, call_info.self_time)
86
- assert_equal(19, call_info.children_time)
62
+ assert_equal(1, method.call_trees.callers.length)
63
+ call_tree = method.call_trees.callers[0]
64
+ assert_equal('MeasureAllocationsTraceTest#test_allocations', call_tree.parent.target.full_name)
65
+ assert_equal(19, call_tree.total_time)
66
+ assert_equal(0, call_tree.wait_time)
67
+ assert_equal(0, call_tree.self_time)
68
+ assert_equal(19, call_tree.children_time)
69
+
70
+ assert_equal(1, method.call_trees.callees.length)
71
+ call_tree = method.call_trees.callees[0]
72
+ assert_equal('Allocator#internal_run', call_tree.target.full_name)
73
+ assert_equal(19, call_tree.total_time)
74
+ assert_equal(0, call_tree.wait_time)
75
+ assert_equal(0, call_tree.self_time)
76
+ assert_equal(19, call_tree.children_time)
87
77
 
88
78
  # Method 2
89
79
  method = methods[2]
@@ -93,35 +83,35 @@ class MeasureAllocationsTraceTest < TestCase
93
83
  assert_equal(0, method.self_time)
94
84
  assert_equal(19, method.children_time)
95
85
 
96
- assert_equal(1, method.callers.length)
97
- call_info = method.callers[0]
98
- assert_equal('Allocator#run', call_info.parent.full_name)
99
- assert_equal(19, call_info.total_time)
100
- assert_equal(0, call_info.wait_time)
101
- assert_equal(0, call_info.self_time)
102
- assert_equal(19, call_info.children_time)
103
-
104
- assert_equal(3, method.callees.length)
105
- call_info = method.callees[0]
106
- assert_equal('Allocator#make_arrays', call_info.target.full_name)
107
- assert_equal(10, call_info.total_time)
108
- assert_equal(0, call_info.wait_time)
109
- assert_equal(0, call_info.self_time)
110
- assert_equal(10, call_info.children_time)
111
-
112
- call_info = method.callees[1]
113
- assert_equal('Allocator#make_hashes', call_info.target.full_name)
114
- assert_equal(5, call_info.total_time)
115
- assert_equal(0, call_info.wait_time)
116
- assert_equal(0, call_info.self_time)
117
- assert_equal(5, call_info.children_time)
118
-
119
- call_info = method.callees[2]
120
- assert_equal('Allocator#make_strings', call_info.target.full_name)
121
- assert_equal(4, call_info.total_time)
122
- assert_equal(0, call_info.wait_time)
123
- assert_equal(1, call_info.self_time)
124
- assert_equal(3, call_info.children_time)
86
+ assert_equal(1, method.call_trees.callers.length)
87
+ call_tree = method.call_trees.callers[0]
88
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
89
+ assert_equal(19, call_tree.total_time)
90
+ assert_equal(0, call_tree.wait_time)
91
+ assert_equal(0, call_tree.self_time)
92
+ assert_equal(19, call_tree.children_time)
93
+
94
+ assert_equal(3, method.call_trees.callees.length)
95
+ call_tree = method.call_trees.callees[0]
96
+ assert_equal('Allocator#make_arrays', call_tree.target.full_name)
97
+ assert_equal(10, call_tree.total_time)
98
+ assert_equal(0, call_tree.wait_time)
99
+ assert_equal(0, call_tree.self_time)
100
+ assert_equal(10, call_tree.children_time)
101
+
102
+ call_tree = method.call_trees.callees[1]
103
+ assert_equal('Allocator#make_hashes', call_tree.target.full_name)
104
+ assert_equal(5, call_tree.total_time)
105
+ assert_equal(0, call_tree.wait_time)
106
+ assert_equal(0, call_tree.self_time)
107
+ assert_equal(5, call_tree.children_time)
108
+
109
+ call_tree = method.call_trees.callees[2]
110
+ assert_equal('Allocator#make_strings', call_tree.target.full_name)
111
+ assert_equal(4, call_tree.total_time)
112
+ assert_equal(0, call_tree.wait_time)
113
+ assert_equal(1, call_tree.self_time)
114
+ assert_equal(3, call_tree.children_time)
125
115
 
126
116
  # Method 3
127
117
  method = methods[3]
@@ -131,63 +121,63 @@ class MeasureAllocationsTraceTest < TestCase
131
121
  assert_equal(17, method.self_time)
132
122
  assert_equal(1, method.children_time)
133
123
 
134
- assert_equal(4, method.callers.length)
135
- call_info = method.callers[0]
136
- assert_equal('MeasureAllocationsTraceTest#test_allocations', call_info.parent.full_name)
137
- assert_equal(1, call_info.total_time)
138
- assert_equal(0, call_info.wait_time)
139
- assert_equal(1, call_info.self_time)
140
- assert_equal(0, call_info.children_time)
141
-
142
- call_info = method.callers[1]
143
- assert_equal('Integer#times', call_info.parent.full_name)
144
- assert_equal(10, call_info.total_time)
145
- assert_equal(0, call_info.wait_time)
146
- assert_equal(10, call_info.self_time)
147
- assert_equal(0, call_info.children_time)
148
-
149
- call_info = method.callers[2]
150
- assert_equal('Allocator#make_hashes', call_info.parent.full_name)
151
- assert_equal(5, call_info.total_time)
152
- assert_equal(0, call_info.wait_time)
153
- assert_equal(5, call_info.self_time)
154
- assert_equal(0, call_info.children_time)
155
-
156
- call_info = method.callers[3]
157
- assert_equal('Allocator#make_strings', call_info.parent.full_name)
158
- assert_equal(2, call_info.total_time)
159
- assert_equal(0, call_info.wait_time)
160
- assert_equal(1, call_info.self_time)
161
- assert_equal(1, call_info.children_time)
162
-
163
- assert_equal(4, method.callees.length)
164
- call_info = method.callees[0]
165
- assert_equal('BasicObject#initialize', call_info.target.full_name)
166
- assert_equal(0, call_info.total_time)
167
- assert_equal(0, call_info.wait_time)
168
- assert_equal(0, call_info.self_time)
169
- assert_equal(0, call_info.children_time)
170
-
171
- call_info = method.callees[1]
172
- assert_equal('Array#initialize', call_info.target.full_name)
173
- assert_equal(0, call_info.total_time)
174
- assert_equal(0, call_info.wait_time)
175
- assert_equal(0, call_info.self_time)
176
- assert_equal(0, call_info.children_time)
177
-
178
- call_info = method.callees[2]
179
- assert_equal('Hash#initialize', call_info.target.full_name)
180
- assert_equal(0, call_info.total_time)
181
- assert_equal(0, call_info.wait_time)
182
- assert_equal(0, call_info.self_time)
183
- assert_equal(0, call_info.children_time)
184
-
185
- call_info = method.callees[3]
186
- assert_equal('String#initialize', call_info.target.full_name)
187
- assert_equal(1, call_info.total_time)
188
- assert_equal(0, call_info.wait_time)
189
- assert_equal(1, call_info.self_time)
190
- assert_equal(0, call_info.children_time)
124
+ assert_equal(4, method.call_trees.callers.length)
125
+ call_tree = method.call_trees.callers[0]
126
+ assert_equal('MeasureAllocationsTraceTest#test_allocations', call_tree.parent.target.full_name)
127
+ assert_equal(1, call_tree.total_time)
128
+ assert_equal(0, call_tree.wait_time)
129
+ assert_equal(1, call_tree.self_time)
130
+ assert_equal(0, call_tree.children_time)
131
+
132
+ call_tree = method.call_trees.callers[1]
133
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
134
+ assert_equal(10, call_tree.total_time)
135
+ assert_equal(0, call_tree.wait_time)
136
+ assert_equal(10, call_tree.self_time)
137
+ assert_equal(0, call_tree.children_time)
138
+
139
+ call_tree = method.call_trees.callers[2]
140
+ assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
141
+ assert_equal(5, call_tree.total_time)
142
+ assert_equal(0, call_tree.wait_time)
143
+ assert_equal(5, call_tree.self_time)
144
+ assert_equal(0, call_tree.children_time)
145
+
146
+ call_tree = method.call_trees.callers[3]
147
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
148
+ assert_equal(2, call_tree.total_time)
149
+ assert_equal(0, call_tree.wait_time)
150
+ assert_equal(1, call_tree.self_time)
151
+ assert_equal(1, call_tree.children_time)
152
+
153
+ assert_equal(4, method.call_trees.callees.length)
154
+ call_tree = method.call_trees.callees[0]
155
+ assert_equal('BasicObject#initialize', call_tree.target.full_name)
156
+ assert_equal(0, call_tree.total_time)
157
+ assert_equal(0, call_tree.wait_time)
158
+ assert_equal(0, call_tree.self_time)
159
+ assert_equal(0, call_tree.children_time)
160
+
161
+ call_tree = method.call_trees.callees[1]
162
+ assert_equal('Array#initialize', call_tree.target.full_name)
163
+ assert_equal(0, call_tree.total_time)
164
+ assert_equal(0, call_tree.wait_time)
165
+ assert_equal(0, call_tree.self_time)
166
+ assert_equal(0, call_tree.children_time)
167
+
168
+ call_tree = method.call_trees.callees[2]
169
+ assert_equal('Hash#initialize', call_tree.target.full_name)
170
+ assert_equal(0, call_tree.total_time)
171
+ assert_equal(0, call_tree.wait_time)
172
+ assert_equal(0, call_tree.self_time)
173
+ assert_equal(0, call_tree.children_time)
174
+
175
+ call_tree = method.call_trees.callees[3]
176
+ assert_equal('String#initialize', call_tree.target.full_name)
177
+ assert_equal(1, call_tree.total_time)
178
+ assert_equal(0, call_tree.wait_time)
179
+ assert_equal(1, call_tree.self_time)
180
+ assert_equal(0, call_tree.children_time)
191
181
 
192
182
  # Method 4
193
183
  method = methods[4]
@@ -197,21 +187,21 @@ class MeasureAllocationsTraceTest < TestCase
197
187
  assert_equal(0, method.self_time)
198
188
  assert_equal(10, method.children_time)
199
189
 
200
- assert_equal(1, method.callers.length)
201
- call_info = method.callers[0]
202
- assert_equal('Allocator#internal_run', call_info.parent.full_name)
203
- assert_equal(10, call_info.total_time)
204
- assert_equal(0, call_info.wait_time)
205
- assert_equal(0, call_info.self_time)
206
- assert_equal(10, call_info.children_time)
207
-
208
- assert_equal(1, method.callees.length)
209
- call_info = method.callees[0]
210
- assert_equal('Integer#times', call_info.target.full_name)
211
- assert_equal(10, call_info.total_time)
212
- assert_equal(0, call_info.wait_time)
213
- assert_equal(0, call_info.self_time)
214
- assert_equal(10, call_info.children_time)
190
+ assert_equal(1, method.call_trees.callers.length)
191
+ call_tree = method.call_trees.callers[0]
192
+ assert_equal('Allocator#internal_run', call_tree.parent.target.full_name)
193
+ assert_equal(10, call_tree.total_time)
194
+ assert_equal(0, call_tree.wait_time)
195
+ assert_equal(0, call_tree.self_time)
196
+ assert_equal(10, call_tree.children_time)
197
+
198
+ assert_equal(1, method.call_trees.callees.length)
199
+ call_tree = method.call_trees.callees[0]
200
+ assert_equal('Integer#times', call_tree.target.full_name)
201
+ assert_equal(10, call_tree.total_time)
202
+ assert_equal(0, call_tree.wait_time)
203
+ assert_equal(0, call_tree.self_time)
204
+ assert_equal(10, call_tree.children_time)
215
205
 
216
206
  # Method 5
217
207
  method = methods[5]
@@ -221,21 +211,21 @@ class MeasureAllocationsTraceTest < TestCase
221
211
  assert_equal(0, method.self_time)
222
212
  assert_equal(10, method.children_time)
223
213
 
224
- assert_equal(1, method.callers.length)
225
- call_info = method.callers[0]
226
- assert_equal('Allocator#make_arrays', call_info.parent.full_name)
227
- assert_equal(10, call_info.total_time)
228
- assert_equal(0, call_info.wait_time)
229
- assert_equal(0, call_info.self_time)
230
- assert_equal(10, call_info.children_time)
231
-
232
- assert_equal(1, method.callees.length)
233
- call_info = method.callees[0]
234
- assert_equal('Class#new', call_info.target.full_name)
235
- assert_equal(10, call_info.total_time)
236
- assert_equal(0, call_info.wait_time)
237
- assert_equal(10, call_info.self_time)
238
- assert_equal(0, call_info.children_time)
214
+ assert_equal(1, method.call_trees.callers.length)
215
+ call_tree = method.call_trees.callers[0]
216
+ assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
217
+ assert_equal(10, call_tree.total_time)
218
+ assert_equal(0, call_tree.wait_time)
219
+ assert_equal(0, call_tree.self_time)
220
+ assert_equal(10, call_tree.children_time)
221
+
222
+ assert_equal(1, method.call_trees.callees.length)
223
+ call_tree = method.call_trees.callees[0]
224
+ assert_equal('Class#new', call_tree.target.full_name)
225
+ assert_equal(10, call_tree.total_time)
226
+ assert_equal(0, call_tree.wait_time)
227
+ assert_equal(10, call_tree.self_time)
228
+ assert_equal(0, call_tree.children_time)
239
229
 
240
230
  # Method 6
241
231
  method = methods[6]
@@ -245,21 +235,21 @@ class MeasureAllocationsTraceTest < TestCase
245
235
  assert_equal(0, method.self_time)
246
236
  assert_equal(5, method.children_time)
247
237
 
248
- assert_equal(1, method.callers.length)
249
- call_info = method.callers[0]
250
- assert_equal('Allocator#internal_run', call_info.parent.full_name)
251
- assert_equal(5, call_info.total_time)
252
- assert_equal(0, call_info.wait_time)
253
- assert_equal(0, call_info.self_time)
254
- assert_equal(5, call_info.children_time)
255
-
256
- assert_equal(1, method.callees.length)
257
- call_info = method.callees[0]
258
- assert_equal('Class#new', call_info.target.full_name)
259
- assert_equal(5, call_info.total_time)
260
- assert_equal(0, call_info.wait_time)
261
- assert_equal(5, call_info.self_time)
262
- assert_equal(0, call_info.children_time)
238
+ assert_equal(1, method.call_trees.callers.length)
239
+ call_tree = method.call_trees.callers[0]
240
+ assert_equal('Allocator#internal_run', call_tree.parent.target.full_name)
241
+ assert_equal(5, call_tree.total_time)
242
+ assert_equal(0, call_tree.wait_time)
243
+ assert_equal(0, call_tree.self_time)
244
+ assert_equal(5, call_tree.children_time)
245
+
246
+ assert_equal(1, method.call_trees.callees.length)
247
+ call_tree = method.call_trees.callees[0]
248
+ assert_equal('Class#new', call_tree.target.full_name)
249
+ assert_equal(5, call_tree.total_time)
250
+ assert_equal(0, call_tree.wait_time)
251
+ assert_equal(5, call_tree.self_time)
252
+ assert_equal(0, call_tree.children_time)
263
253
 
264
254
  # Method 7
265
255
  method = methods[7]
@@ -269,28 +259,28 @@ class MeasureAllocationsTraceTest < TestCase
269
259
  assert_equal(1, method.self_time)
270
260
  assert_equal(3, method.children_time)
271
261
 
272
- assert_equal(1, method.callers.length)
273
- call_info = method.callers[0]
274
- assert_equal('Allocator#internal_run', call_info.parent.full_name)
275
- assert_equal(4, call_info.total_time)
276
- assert_equal(0, call_info.wait_time)
277
- assert_equal(1, call_info.self_time)
278
- assert_equal(3, call_info.children_time)
279
-
280
- assert_equal(2, method.callees.length)
281
- call_info = method.callees[0]
282
- assert_equal('String#*', call_info.target.full_name)
283
- assert_equal(1, call_info.total_time)
284
- assert_equal(0, call_info.wait_time)
285
- assert_equal(1, call_info.self_time)
286
- assert_equal(0, call_info.children_time)
287
-
288
- call_info = method.callees[1]
289
- assert_equal('Class#new', call_info.target.full_name)
290
- assert_equal(2, call_info.total_time)
291
- assert_equal(0, call_info.wait_time)
292
- assert_equal(1, call_info.self_time)
293
- assert_equal(1, call_info.children_time)
262
+ assert_equal(1, method.call_trees.callers.length)
263
+ call_tree = method.call_trees.callers[0]
264
+ assert_equal('Allocator#internal_run', call_tree.parent.target.full_name)
265
+ assert_equal(4, call_tree.total_time)
266
+ assert_equal(0, call_tree.wait_time)
267
+ assert_equal(1, call_tree.self_time)
268
+ assert_equal(3, call_tree.children_time)
269
+
270
+ assert_equal(2, method.call_trees.callees.length)
271
+ call_tree = method.call_trees.callees[0]
272
+ assert_equal('String#*', call_tree.target.full_name)
273
+ assert_equal(1, call_tree.total_time)
274
+ assert_equal(0, call_tree.wait_time)
275
+ assert_equal(1, call_tree.self_time)
276
+ assert_equal(0, call_tree.children_time)
277
+
278
+ call_tree = method.call_trees.callees[1]
279
+ assert_equal('Class#new', call_tree.target.full_name)
280
+ assert_equal(2, call_tree.total_time)
281
+ assert_equal(0, call_tree.wait_time)
282
+ assert_equal(1, call_tree.self_time)
283
+ assert_equal(1, call_tree.children_time)
294
284
 
295
285
  # Method 8
296
286
  method = methods[8]
@@ -300,15 +290,15 @@ class MeasureAllocationsTraceTest < TestCase
300
290
  assert_equal(1, method.self_time)
301
291
  assert_equal(0, method.children_time)
302
292
 
303
- assert_equal(1, method.callers.length)
304
- call_info = method.callers[0]
305
- assert_equal('Allocator#make_strings', call_info.parent.full_name)
306
- assert_equal(1, call_info.total_time)
307
- assert_equal(0, call_info.wait_time)
308
- assert_equal(1, call_info.self_time)
309
- assert_equal(0, call_info.children_time)
293
+ assert_equal(1, method.call_trees.callers.length)
294
+ call_tree = method.call_trees.callers[0]
295
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
296
+ assert_equal(1, call_tree.total_time)
297
+ assert_equal(0, call_tree.wait_time)
298
+ assert_equal(1, call_tree.self_time)
299
+ assert_equal(0, call_tree.children_time)
310
300
 
311
- assert_equal(0, method.callees.length)
301
+ assert_equal(0, method.call_trees.callees.length)
312
302
 
313
303
  # Method 9
314
304
  method = methods[9]
@@ -318,15 +308,15 @@ class MeasureAllocationsTraceTest < TestCase
318
308
  assert_equal(1, method.self_time)
319
309
  assert_equal(0, method.children_time)
320
310
 
321
- assert_equal(1, method.callers.length)
322
- call_info = method.callers[0]
323
- assert_equal('Class#new', call_info.parent.full_name)
324
- assert_equal(1, call_info.total_time)
325
- assert_equal(0, call_info.wait_time)
326
- assert_equal(1, call_info.self_time)
327
- assert_equal(0, call_info.children_time)
311
+ assert_equal(1, method.call_trees.callers.length)
312
+ call_tree = method.call_trees.callers[0]
313
+ assert_equal('Class#new', call_tree.parent.target.full_name)
314
+ assert_equal(1, call_tree.total_time)
315
+ assert_equal(0, call_tree.wait_time)
316
+ assert_equal(1, call_tree.self_time)
317
+ assert_equal(0, call_tree.children_time)
328
318
 
329
- assert_equal(0, method.callees.length)
319
+ assert_equal(0, method.call_trees.callees.length)
330
320
 
331
321
  # Method 10
332
322
  method = methods[10]
@@ -336,15 +326,15 @@ class MeasureAllocationsTraceTest < TestCase
336
326
  assert_equal(0, method.self_time)
337
327
  assert_equal(0, method.children_time)
338
328
 
339
- assert_equal(1, method.callers.length)
340
- call_info = method.callers[0]
341
- assert_equal('Class#new', call_info.parent.full_name)
342
- assert_equal(0, call_info.total_time)
343
- assert_equal(0, call_info.wait_time)
344
- assert_equal(0, call_info.self_time)
345
- assert_equal(0, call_info.children_time)
329
+ assert_equal(1, method.call_trees.callers.length)
330
+ call_tree = method.call_trees.callers[0]
331
+ assert_equal('Class#new', call_tree.parent.target.full_name)
332
+ assert_equal(0, call_tree.total_time)
333
+ assert_equal(0, call_tree.wait_time)
334
+ assert_equal(0, call_tree.self_time)
335
+ assert_equal(0, call_tree.children_time)
346
336
 
347
- assert_equal(0, method.callees.length)
337
+ assert_equal(0, method.call_trees.callees.length)
348
338
 
349
339
  # Method 11
350
340
  method = methods[11]
@@ -354,15 +344,15 @@ class MeasureAllocationsTraceTest < TestCase
354
344
  assert_equal(0, method.self_time)
355
345
  assert_equal(0, method.children_time)
356
346
 
357
- assert_equal(1, method.callers.length)
358
- call_info = method.callers[0]
359
- assert_equal('Class#new', call_info.parent.full_name)
360
- assert_equal(0, call_info.total_time)
361
- assert_equal(0, call_info.wait_time)
362
- assert_equal(0, call_info.self_time)
363
- assert_equal(0, call_info.children_time)
347
+ assert_equal(1, method.call_trees.callers.length)
348
+ call_tree = method.call_trees.callers[0]
349
+ assert_equal('Class#new', call_tree.parent.target.full_name)
350
+ assert_equal(0, call_tree.total_time)
351
+ assert_equal(0, call_tree.wait_time)
352
+ assert_equal(0, call_tree.self_time)
353
+ assert_equal(0, call_tree.children_time)
364
354
 
365
- assert_equal(0, method.callees.length)
355
+ assert_equal(0, method.call_trees.callees.length)
366
356
 
367
357
  # Method 12
368
358
  method = methods[12]
@@ -372,14 +362,14 @@ class MeasureAllocationsTraceTest < TestCase
372
362
  assert_equal(0, method.self_time)
373
363
  assert_equal(0, method.children_time)
374
364
 
375
- assert_equal(1, method.callers.length)
376
- call_info = method.callers[0]
377
- assert_equal('Class#new', call_info.parent.full_name)
378
- assert_equal(0, call_info.total_time)
379
- assert_equal(0, call_info.wait_time)
380
- assert_equal(0, call_info.self_time)
381
- assert_equal(0, call_info.children_time)
365
+ assert_equal(1, method.call_trees.callers.length)
366
+ call_tree = method.call_trees.callers[0]
367
+ assert_equal('Class#new', call_tree.parent.target.full_name)
368
+ assert_equal(0, call_tree.total_time)
369
+ assert_equal(0, call_tree.wait_time)
370
+ assert_equal(0, call_tree.self_time)
371
+ assert_equal(0, call_tree.children_time)
382
372
 
383
- assert_equal(0, method.callees.length)
373
+ assert_equal(0, method.call_trees.callees.length)
384
374
  end
385
375
  end