ruby-prof 0.7.9 → 0.7.10
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.
- data/README +8 -7
- data/Rakefile +5 -5
- data/bin/ruby-prof +20 -3
- data/ext/ruby_prof.c +2 -3
- data/ext/version.h +2 -2
- data/lib/ruby-prof.rb +4 -5
- data/lib/ruby-prof/flat_printer.rb +1 -1
- data/lib/ruby-prof/flat_printer_with_line_numbers.rb +63 -0
- data/lib/ruby-prof/graph_printer.rb +3 -10
- data/lib/ruby-prof/symbol_to_proc.rb +0 -1
- data/test/aggregate_test.rb +1 -1
- data/test/basic_test.rb +2 -2
- data/test/printers_test.rb +18 -3
- data/test/recursive_test.rb +12 -15
- data/test/thread_test.rb +2 -2
- metadata +3 -2
data/README
CHANGED
@@ -65,7 +65,7 @@ particular segments of code.
|
|
65
65
|
|
66
66
|
# Print a flat profile to text
|
67
67
|
printer = RubyProf::FlatPrinter.new(result)
|
68
|
-
printer.print(STDOUT
|
68
|
+
printer.print(STDOUT)
|
69
69
|
|
70
70
|
Alternatively, you can use a block to tell ruby-prof what
|
71
71
|
to profile:
|
@@ -245,6 +245,7 @@ the {KCachegrind}[link:http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/Kcach
|
|
245
245
|
Reports are created by printers. Supported printers include:
|
246
246
|
|
247
247
|
* RubyProf::FlatPrinter - Creates a flat report in text format
|
248
|
+
* RubyProf::FlatPrinterWithLineNumbers - same as above but more verbose
|
248
249
|
* RubyProf::GraphPrinter - Creates a call graph report in text format
|
249
250
|
* RubyProf::GraphHtmlPrinter - Creates a call graph report in HTML (separate files per thread)
|
250
251
|
* RubyProf::CallTreePrinter - Creates a call tree report compatible with KCachegrind.
|
@@ -375,23 +376,23 @@ You can also directly set the cpu frequency by calling:
|
|
375
376
|
Recursive calls occur when method A calls method A and cycles
|
376
377
|
occur when method A calls method B calls method C calls method A.
|
377
378
|
ruby-prof detects both direct recursive calls and cycles. Both
|
378
|
-
are indicated in reports by a
|
379
|
+
are indicated in reports by a "d number" in parentheses following a method
|
379
380
|
name. For example, here is a flat profile from the test method
|
380
|
-
RecursiveTest#test_recursive:
|
381
381
|
|
382
|
+
RecursiveTest#test_recursive:
|
382
383
|
|
383
384
|
%self total self wait child calls name
|
384
385
|
100.00 2.00 2.00 0.00 0.00 2 Kernel#sleep
|
385
386
|
0.00 2.00 0.00 0.00 2.00 0 RecursiveTest#test_cycle
|
386
387
|
0.00 0.00 0.00 0.00 0.00 2 Fixnum#==
|
387
388
|
0.00 0.00 0.00 0.00 0.00 2 Fixnum#-
|
388
|
-
0.00 1.00 0.00 0.00 1.00 1 Object#sub_cycle
|
389
|
+
0.00 1.00 0.00 0.00 1.00 1 Object#sub_cycle(d1)
|
389
390
|
0.00 2.00 0.00 0.00 2.00 1 Object#sub_cycle
|
390
391
|
0.00 2.00 0.00 0.00 2.00 1 Object#cycle
|
391
|
-
0.00 1.00 0.00 0.00 1.00 1 Object#cycle
|
392
|
+
0.00 1.00 0.00 0.00 1.00 1 Object#cycle(d1)
|
392
393
|
|
393
|
-
Notice the presence of Object#cycle and Object#cycle
|
394
|
-
the method was either recursively called (directly or indirectly).
|
394
|
+
Notice the presence of Object#cycle and Object#cycle(d1). The d1 means
|
395
|
+
depth 1 -- the method was either recursively called (directly or indirectly).
|
395
396
|
|
396
397
|
However, the self time values for recursive calls should always
|
397
398
|
be accurate. It is also believed that the total times are
|
data/Rakefile
CHANGED
@@ -123,9 +123,9 @@ end
|
|
123
123
|
|
124
124
|
require 'fileutils'
|
125
125
|
|
126
|
-
desc 'Build ruby_prof.so
|
126
|
+
desc 'Build ext/ruby_prof.so'
|
127
127
|
task :build do
|
128
|
-
build(
|
128
|
+
build(false)
|
129
129
|
end
|
130
130
|
|
131
131
|
def build(with_debug)
|
@@ -143,9 +143,9 @@ def build(with_debug)
|
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
-
desc 'build ruby_prof.so'
|
147
|
-
task :
|
148
|
-
build(
|
146
|
+
desc 'build ruby_prof.so with verbose symbols enabled'
|
147
|
+
task :build_with_debug do
|
148
|
+
build(true)
|
149
149
|
end
|
150
150
|
|
151
151
|
task :clean do
|
data/bin/ruby-prof
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
# Options:
|
12
12
|
# -p, --printer=printer Select a printer:
|
13
13
|
# flat - Prints a flat profile as text (default).
|
14
|
+
# flat_with_line_numbers - Above, with line numbers
|
14
15
|
# graph - Prints a graph profile as text.
|
15
16
|
# graph_html - Prints a graph profile as html.
|
16
17
|
# call_tree - format for KCacheGrind
|
@@ -35,6 +36,8 @@
|
|
35
36
|
# --specialized-instruction Turn on specialized instruction.
|
36
37
|
# -h, --help Show help message
|
37
38
|
# --version Show version
|
39
|
+
# -v Show version, set $VERBOSE to true, run file
|
40
|
+
# -d Set $DEBUG to true
|
38
41
|
#
|
39
42
|
#
|
40
43
|
# See also: {flat profiles}[link:files/examples/flat_txt.html], {graph profiles}[link:files/examples/graph_txt.html], {html graph profiles}[link:files/examples/graph_html.html]
|
@@ -60,17 +63,21 @@ opts = OptionParser.new do |opts|
|
|
60
63
|
opts.separator "Options:"
|
61
64
|
|
62
65
|
|
63
|
-
opts.on('-p printer', '--printer=printer', [:flat, :graph, :graph_html, :call_tree],
|
66
|
+
opts.on('-p printer', '--printer=printer', [:flat, :flat_with_line_numbers, :graph, :graph_html, :call_tree],
|
64
67
|
'Select a printer:',
|
65
68
|
' flat - Prints a flat profile as text (default).',
|
69
|
+
' flat_with_line_numbers - same as flat, with line numbers.',
|
66
70
|
' graph - Prints a graph profile as text.',
|
67
71
|
' graph_html - Prints a graph profile as html.',
|
68
|
-
' call_tree - format for KCacheGrind'
|
72
|
+
' call_tree - format for KCacheGrind'
|
73
|
+
) do |printer|
|
69
74
|
|
70
75
|
|
71
76
|
case printer
|
72
77
|
when :flat
|
73
78
|
options.printer = RubyProf::FlatPrinter
|
79
|
+
when :flat_with_line_numbers
|
80
|
+
options.printer = RubyProf::FlatPrinterWithLineNumbers
|
74
81
|
when :graph
|
75
82
|
options.printer = RubyProf::GraphPrinter
|
76
83
|
when :graph_html
|
@@ -136,10 +143,20 @@ opts = OptionParser.new do |opts|
|
|
136
143
|
exit
|
137
144
|
end
|
138
145
|
|
139
|
-
opts.on_tail("
|
146
|
+
opts.on_tail("--version", "Show version #{RubyProf::VERSION}") do
|
140
147
|
puts "ruby_prof " + RubyProf::VERSION
|
141
148
|
exit
|
142
149
|
end
|
150
|
+
|
151
|
+
opts.on("-v","Show version, set $VERBOSE to true, profile script") do
|
152
|
+
puts "ruby_prof " + RubyProf::VERSION
|
153
|
+
puts "ruby " + RUBY_DESCRIPTION
|
154
|
+
$VERBOSE= true
|
155
|
+
end
|
156
|
+
|
157
|
+
opts.on("-d", "Set $DEBUG to true") do
|
158
|
+
$DEBUG = true
|
159
|
+
end
|
143
160
|
end
|
144
161
|
|
145
162
|
begin
|
data/ext/ruby_prof.c
CHANGED
@@ -149,8 +149,7 @@ method_name(ID mid, int depth)
|
|
149
149
|
if (depth > 0)
|
150
150
|
{
|
151
151
|
char buffer[65];
|
152
|
-
sprintf(buffer, "d%i", depth);
|
153
|
-
rb_str_cat2(result, "-");
|
152
|
+
sprintf(buffer, "(d%i)", depth);
|
154
153
|
rb_str_cat2(result, buffer);
|
155
154
|
}
|
156
155
|
|
@@ -1208,7 +1207,7 @@ prof_event_hook(rb_event_flag_t event, NODE *node, VALUE self, ID mid, VALUE kla
|
|
1208
1207
|
// sometimes frames don't have line and source somehow [like blank]
|
1209
1208
|
// if we hit one there's not much we can do...I guess...
|
1210
1209
|
// or maybe we don't have one because we're at the top or something.
|
1211
|
-
while( frame->call_info->target->key->mid && frame->call_info->target->key->klass && ((frame->call_info->target->key->mid != mid) || (frame->call_info->target->key->klass != klass))){
|
1210
|
+
while( frame && frame->call_info->target->key->mid && frame->call_info->target->key->klass && ((frame->call_info->target->key->mid != mid) || (frame->call_info->target->key->klass != klass))){
|
1212
1211
|
frame = pop_frame(thread_data, now);
|
1213
1212
|
}
|
1214
1213
|
#endif
|
data/ext/version.h
CHANGED
data/lib/ruby-prof.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
require File.dirname(__FILE__) + "/../ext/ruby_prof.so
|
1
|
+
require File.dirname(__FILE__) + "/../ext/ruby_prof" # .so
|
2
2
|
|
3
3
|
require "ruby-prof/method_info"
|
4
4
|
require "ruby-prof/call_info"
|
5
5
|
require "ruby-prof/aggregate_call_info"
|
6
6
|
require "ruby-prof/flat_printer"
|
7
|
+
require "ruby-prof/flat_printer_with_line_numbers"
|
7
8
|
require "ruby-prof/graph_printer"
|
8
9
|
require "ruby-prof/graph_html_printer"
|
9
10
|
require "ruby-prof/call_tree_printer"
|
10
|
-
require "ruby-prof/symbol_to_proc"
|
11
|
-
|
12
|
-
#require "ruby-prof/test"
|
11
|
+
require "ruby-prof/symbol_to_proc" # for 1.8's benefit
|
13
12
|
|
14
13
|
module RubyProf
|
15
14
|
# See if the user specified the clock mode via
|
@@ -46,4 +45,4 @@ module RubyProf
|
|
46
45
|
end
|
47
46
|
end
|
48
47
|
|
49
|
-
RubyProf::figure_measure_mode
|
48
|
+
RubyProf::figure_measure_mode
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'ruby-prof/abstract_printer'
|
2
|
+
|
3
|
+
module RubyProf
|
4
|
+
# Generates flat[link:files/examples/flat_txt.html] profile reports as text.
|
5
|
+
# To use the flat printer with line numbers:
|
6
|
+
#
|
7
|
+
# result = RubyProf.profile do
|
8
|
+
# [code to profile]
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
# printer = RubyProf::FlatPrinterWithLineNumbers.new(result)
|
12
|
+
# printer.print(STDOUT, 0)
|
13
|
+
#
|
14
|
+
class FlatPrinterWithLineNumbers < FlatPrinter
|
15
|
+
|
16
|
+
def print_methods(thread_id, methods)
|
17
|
+
# Get total time
|
18
|
+
toplevel = methods.max
|
19
|
+
total_time = toplevel.total_time
|
20
|
+
if total_time == 0
|
21
|
+
total_time = 0.01
|
22
|
+
end
|
23
|
+
|
24
|
+
# Now sort methods by largest self time,
|
25
|
+
# not total time like in other printouts
|
26
|
+
methods = methods.sort do |m1, m2|
|
27
|
+
m1.self_time <=> m2.self_time
|
28
|
+
end.reverse
|
29
|
+
|
30
|
+
@output << "Thread ID: %d\n" % thread_id
|
31
|
+
@output << "Total: %0.6f\n" % total_time
|
32
|
+
@output << "\n"
|
33
|
+
@output << " %self total self wait child calls name\n"
|
34
|
+
|
35
|
+
sum = 0
|
36
|
+
methods.each do |method|
|
37
|
+
self_percent = (method.self_time / total_time) * 100
|
38
|
+
next if self_percent < min_percent
|
39
|
+
|
40
|
+
sum += method.self_time
|
41
|
+
#self_time_called = method.called > 0 ? method.self_time/method.called : 0
|
42
|
+
#total_time_called = method.called > 0? method.total_time/method.called : 0
|
43
|
+
|
44
|
+
@output << "%6.2f %8.2f %8.2f %8.2f %8.2f %8d %s " % [
|
45
|
+
method.self_time / total_time * 100, # %self
|
46
|
+
method.total_time, # total
|
47
|
+
method.self_time, # self
|
48
|
+
method.wait_time, # wait
|
49
|
+
method.children_time, # children
|
50
|
+
method.called, # calls
|
51
|
+
method_name(method), # name
|
52
|
+
method.source_file, # filename
|
53
|
+
method.line # line in said file
|
54
|
+
]
|
55
|
+
if method.source_file != 'ruby_runtime'
|
56
|
+
@output << " %s:%s" % [method.source_file, method.line]
|
57
|
+
end
|
58
|
+
@output << "\n"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
@@ -11,13 +11,7 @@ module RubyProf
|
|
11
11
|
# printer = RubyProf::GraphPrinter.new(result, 5)
|
12
12
|
# printer.print(STDOUT, 0)
|
13
13
|
#
|
14
|
-
# The constructor takes two arguments.
|
15
|
-
# a RubyProf::Result object generated from a profiling
|
16
|
-
# run. The second is the minimum %total (the methods
|
17
|
-
# total time divided by the overall total time) that
|
18
|
-
# a method must take for it to be printed out in
|
19
|
-
# the report. Use this parameter to eliminate methods
|
20
|
-
# that are not important to the overall profiling results.
|
14
|
+
# The constructor takes two arguments. See the README
|
21
15
|
|
22
16
|
class GraphPrinter < AbstractPrinter
|
23
17
|
PERCENTAGE_WIDTH = 8
|
@@ -38,9 +32,8 @@ module RubyProf
|
|
38
32
|
@result.threads.each do |thread_id, methods|
|
39
33
|
top = methods.max
|
40
34
|
|
41
|
-
thread_time = 0.01
|
42
|
-
|
43
|
-
|
35
|
+
thread_time = [top.total_time, 0.01].max
|
36
|
+
|
44
37
|
@thread_times[thread_id] = thread_time
|
45
38
|
end
|
46
39
|
end
|
data/test/aggregate_test.rb
CHANGED
@@ -115,7 +115,7 @@ class AggregateTest < Test::Unit::TestCase
|
|
115
115
|
assert_in_delta(3, call_info.total_time, 0.05)
|
116
116
|
assert_in_delta(0, call_info.wait_time, 0.01)
|
117
117
|
assert_in_delta(0, call_info.self_time, 0.05)
|
118
|
-
assert_in_delta(3, call_info.children_time, 0.
|
118
|
+
assert_in_delta(3, call_info.children_time, 0.05)
|
119
119
|
assert_equal(3, call_info.called)
|
120
120
|
end
|
121
121
|
end
|
data/test/basic_test.rb
CHANGED
@@ -137,7 +137,7 @@ class BasicTest < Test::Unit::TestCase
|
|
137
137
|
|
138
138
|
methods = result.threads.values.first.sort.reverse
|
139
139
|
assert_equal(6, methods.length)
|
140
|
-
names = methods.map
|
140
|
+
names = methods.map(&:full_name)
|
141
141
|
assert_equal('BasicTest#test_instance_methods', names[0])
|
142
142
|
assert_equal('C1#hello', names[1])
|
143
143
|
assert_equal('Kernel#sleep', names[2])
|
@@ -218,7 +218,7 @@ class BasicTest < Test::Unit::TestCase
|
|
218
218
|
|
219
219
|
methods = result.threads.values.first.sort.reverse
|
220
220
|
assert_equal(6, methods.length)
|
221
|
-
names = methods.map
|
221
|
+
names = methods.map(&:full_name)
|
222
222
|
assert_equal('BasicTest#test_module_instance_methods', names[0])
|
223
223
|
assert_equal('M1#hello', names[1])
|
224
224
|
assert_equal('Kernel#sleep', names[2])
|
data/test/printers_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
3
|
require 'ruby-prof'
|
4
|
-
require 'prime'
|
4
|
+
require './prime'
|
5
5
|
|
6
6
|
# -- Tests ----
|
7
7
|
class PrintersTest < Test::Unit::TestCase
|
@@ -16,6 +16,9 @@ class PrintersTest < Test::Unit::TestCase
|
|
16
16
|
printer = RubyProf::FlatPrinter.new(@result)
|
17
17
|
printer.print(STDOUT)
|
18
18
|
|
19
|
+
printer = RubyProf::FlatPrinterWithLineNumbers.new(@result)
|
20
|
+
printer.print(STDOUT)
|
21
|
+
|
19
22
|
printer = RubyProf::GraphHtmlPrinter.new(@result)
|
20
23
|
printer.print
|
21
24
|
|
@@ -24,20 +27,32 @@ class PrintersTest < Test::Unit::TestCase
|
|
24
27
|
|
25
28
|
printer = RubyProf::CallTreePrinter.new(@result)
|
26
29
|
printer.print(STDOUT)
|
27
|
-
|
30
|
+
|
28
31
|
# we should get here
|
29
32
|
assert(true)
|
30
33
|
end
|
31
34
|
|
32
35
|
def test_flat_string
|
36
|
+
output = helper_test_flat_string RubyProf::FlatPrinter
|
37
|
+
assert_no_match(/prime.rb/, output)
|
38
|
+
end
|
39
|
+
|
40
|
+
def helper_test_flat_string klass
|
33
41
|
output = ''
|
34
42
|
|
35
|
-
printer =
|
43
|
+
printer = klass.new(@result)
|
36
44
|
assert_nothing_raised { printer.print(output) }
|
37
45
|
|
38
46
|
assert_match(/Thread ID: -?\d+/i, output)
|
39
47
|
assert_match(/Total: \d+\.\d+/i, output)
|
40
48
|
assert_match(/Object#run_primes/i, output)
|
49
|
+
output
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_flat_string_with_numbers
|
53
|
+
output = helper_test_flat_string RubyProf::FlatPrinterWithLineNumbers
|
54
|
+
assert_match(/prime.rb/, output)
|
55
|
+
assert_no_match(/ruby_runtime:0/, output)
|
41
56
|
end
|
42
57
|
|
43
58
|
def test_graph_html_string
|
data/test/recursive_test.rb
CHANGED
@@ -84,11 +84,11 @@ class RecursiveTest < Test::Unit::TestCase
|
|
84
84
|
assert_equal(0, call_info.children.length)
|
85
85
|
|
86
86
|
call_info = method.call_infos[1]
|
87
|
-
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple
|
87
|
+
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple(d1)->Kernel#sleep', call_info.call_sequence)
|
88
88
|
assert_equal(0, call_info.children.length)
|
89
89
|
|
90
90
|
method = methods[3]
|
91
|
-
assert_equal('Object#simple
|
91
|
+
assert_equal('Object#simple(d1)', method.full_name)
|
92
92
|
assert_equal(1, method.called)
|
93
93
|
assert_in_delta(1, method.total_time, 0.01)
|
94
94
|
assert_in_delta(0, method.self_time, 0.01)
|
@@ -97,7 +97,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
97
97
|
|
98
98
|
assert_equal(1, method.call_infos.length)
|
99
99
|
call_info = method.call_infos[0]
|
100
|
-
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple
|
100
|
+
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple(d1)', call_info.call_sequence)
|
101
101
|
if RUBY_VERSION < '1.9'
|
102
102
|
assert_equal(3, call_info.children.length)
|
103
103
|
|
@@ -115,7 +115,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
115
115
|
assert_equal(0, call_info.children.length)
|
116
116
|
|
117
117
|
call_info = method.call_infos[1]
|
118
|
-
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple
|
118
|
+
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple(d1)->Fixnum#-', call_info.call_sequence)
|
119
119
|
assert_equal(0, call_info.children.length)
|
120
120
|
|
121
121
|
method = methods[5]
|
@@ -132,7 +132,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
132
132
|
assert_equal(0, call_info.children.length)
|
133
133
|
|
134
134
|
call_info = method.call_infos[1]
|
135
|
-
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple
|
135
|
+
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple(d1)->Fixnum#==', call_info.call_sequence)
|
136
136
|
assert_equal(0, call_info.children.length)
|
137
137
|
|
138
138
|
else
|
@@ -208,11 +208,11 @@ class RecursiveTest < Test::Unit::TestCase
|
|
208
208
|
assert_equal(0, call_info.children.length)
|
209
209
|
|
210
210
|
call_info = method.call_infos[1]
|
211
|
-
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle
|
211
|
+
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle(d1)->Object#sub_cycle(d1)->Kernel#sleep', call_info.call_sequence)
|
212
212
|
assert_equal(0, call_info.children.length)
|
213
213
|
|
214
214
|
method = methods[4]
|
215
|
-
assert_equal('Object#cycle
|
215
|
+
assert_equal('Object#cycle(d1)', method.full_name)
|
216
216
|
assert_equal(1, method.called)
|
217
217
|
assert_in_delta(1, method.total_time, 0.05)
|
218
218
|
assert_in_delta(0, method.self_time, 0.01)
|
@@ -221,20 +221,17 @@ class RecursiveTest < Test::Unit::TestCase
|
|
221
221
|
|
222
222
|
assert_equal(1, method.call_infos.length)
|
223
223
|
call_info = method.call_infos[0]
|
224
|
-
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle
|
224
|
+
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle(d1)', call_info.call_sequence)
|
225
225
|
assert_equal(1, call_info.children.length)
|
226
226
|
|
227
227
|
method = methods[5]
|
228
|
-
assert_equal('Object#sub_cycle
|
228
|
+
assert_equal('Object#sub_cycle(d1)', method.full_name)
|
229
229
|
assert_equal(1, method.called)
|
230
230
|
assert_in_delta(1, method.total_time, 0.01)
|
231
231
|
assert_in_delta(0, method.self_time, 0.01)
|
232
232
|
assert_in_delta(0, method.wait_time, 0.01)
|
233
|
-
assert_in_delta(1, method.children_time, 0.01)
|
234
|
-
|
235
|
-
assert_equal(1, method.call_infos.length)
|
236
233
|
call_info = method.call_infos[0]
|
237
|
-
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle
|
234
|
+
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle(d1)->Object#sub_cycle(d1)', call_info.call_sequence)
|
238
235
|
if RUBY_VERSION < '1.9'
|
239
236
|
assert_equal(3, call_info.children.length)
|
240
237
|
method = methods[6]
|
@@ -251,7 +248,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
251
248
|
assert_equal(0, call_info.children.length)
|
252
249
|
|
253
250
|
call_info = method.call_infos[1]
|
254
|
-
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle
|
251
|
+
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle(d1)->Object#sub_cycle(d1)->Fixnum#-', call_info.call_sequence)
|
255
252
|
assert_equal(0, call_info.children.length)
|
256
253
|
|
257
254
|
method = methods[7]
|
@@ -268,7 +265,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
268
265
|
assert_equal(0, call_info.children.length)
|
269
266
|
|
270
267
|
call_info = method.call_infos[1]
|
271
|
-
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle
|
268
|
+
assert_equal('RecursiveTest#test_cycle->Object#cycle->Object#sub_cycle->Object#cycle(d1)->Object#sub_cycle(d1)->Fixnum#==', call_info.call_sequence)
|
272
269
|
assert_equal(0, call_info.children.length)
|
273
270
|
else
|
274
271
|
assert_equal(1, call_info.children.length)
|
data/test/thread_test.rb
CHANGED
@@ -38,8 +38,8 @@ class ThreadTest < Test::Unit::TestCase
|
|
38
38
|
assert(thread_ids.include?(threads[1].object_id))
|
39
39
|
|
40
40
|
assert_instance_of(Thread, ObjectSpace._id2ref(thread_ids[0]))
|
41
|
-
assert(threads.include?
|
42
|
-
|
41
|
+
assert(threads.include?(ObjectSpace._id2ref(thread_ids[0])))
|
42
|
+
|
43
43
|
assert_instance_of(Thread, ObjectSpace._id2ref(thread_ids[1]))
|
44
44
|
assert(threads.include?(ObjectSpace._id2ref(thread_ids[1])))
|
45
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda, Charlie Savage, Roger Pack
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-22 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/ruby-prof/call_info.rb
|
68
68
|
- lib/ruby-prof/call_tree_printer.rb
|
69
69
|
- lib/ruby-prof/flat_printer.rb
|
70
|
+
- lib/ruby-prof/flat_printer_with_line_numbers.rb
|
70
71
|
- lib/ruby-prof/graph_html_printer.rb
|
71
72
|
- lib/ruby-prof/graph_printer.rb
|
72
73
|
- lib/ruby-prof/method_info.rb
|