ruby-prof 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGES +500 -482
- data/LICENSE +24 -24
- data/README.rdoc +487 -485
- data/Rakefile +113 -113
- data/bin/ruby-prof +345 -345
- data/bin/ruby-prof-check-trace +45 -45
- data/examples/flat.txt +50 -50
- data/examples/graph.dot +84 -84
- data/examples/graph.html +823 -823
- data/examples/graph.txt +139 -139
- data/examples/multi.flat.txt +23 -23
- data/examples/multi.graph.html +760 -760
- data/examples/multi.grind.dat +114 -114
- data/examples/multi.stack.html +547 -547
- data/examples/stack.html +547 -547
- data/ext/ruby_prof/extconf.rb +68 -68
- data/ext/ruby_prof/rp_call_info.c +425 -425
- data/ext/ruby_prof/rp_call_info.h +53 -53
- data/ext/ruby_prof/rp_measure.c +40 -40
- data/ext/ruby_prof/rp_measure.h +45 -45
- data/ext/ruby_prof/rp_measure_allocations.c +76 -76
- data/ext/ruby_prof/rp_measure_cpu_time.c +136 -136
- data/ext/ruby_prof/rp_measure_gc_runs.c +73 -73
- data/ext/ruby_prof/rp_measure_gc_time.c +60 -60
- data/ext/ruby_prof/rp_measure_memory.c +77 -77
- data/ext/ruby_prof/rp_measure_process_time.c +71 -71
- data/ext/ruby_prof/rp_measure_wall_time.c +45 -45
- data/ext/ruby_prof/rp_method.c +630 -636
- data/ext/ruby_prof/rp_method.h +75 -75
- data/ext/ruby_prof/rp_stack.c +173 -173
- data/ext/ruby_prof/rp_stack.h +63 -63
- data/ext/ruby_prof/rp_thread.c +277 -276
- data/ext/ruby_prof/rp_thread.h +27 -27
- data/ext/ruby_prof/ruby_prof.c +794 -774
- data/ext/ruby_prof/ruby_prof.h +60 -59
- data/ext/ruby_prof/vc/ruby_prof.sln +20 -21
- data/ext/ruby_prof/vc/{ruby_prof_20.vcxproj → ruby_prof.vcxproj} +31 -0
- data/lib/ruby-prof.rb +68 -68
- data/lib/ruby-prof/aggregate_call_info.rb +76 -76
- data/lib/ruby-prof/assets/call_stack_printer.css.html +116 -116
- data/lib/ruby-prof/assets/call_stack_printer.js.html +384 -384
- data/lib/ruby-prof/call_info.rb +115 -115
- data/lib/ruby-prof/call_info_visitor.rb +40 -40
- data/lib/ruby-prof/compatibility.rb +179 -178
- data/lib/ruby-prof/method_info.rb +121 -121
- data/lib/ruby-prof/printers/abstract_printer.rb +104 -103
- data/lib/ruby-prof/printers/call_info_printer.rb +41 -41
- data/lib/ruby-prof/printers/call_stack_printer.rb +265 -265
- data/lib/ruby-prof/printers/call_tree_printer.rb +143 -143
- data/lib/ruby-prof/printers/dot_printer.rb +132 -132
- data/lib/ruby-prof/printers/flat_printer.rb +70 -70
- data/lib/ruby-prof/printers/flat_printer_with_line_numbers.rb +83 -83
- data/lib/ruby-prof/printers/graph_html_printer.rb +249 -249
- data/lib/ruby-prof/printers/graph_printer.rb +116 -116
- data/lib/ruby-prof/printers/multi_printer.rb +84 -84
- data/lib/ruby-prof/profile.rb +26 -26
- data/lib/ruby-prof/profile/exclude_common_methods.rb +207 -201
- data/lib/ruby-prof/profile/legacy_method_elimination.rb +50 -49
- data/lib/ruby-prof/rack.rb +174 -174
- data/lib/ruby-prof/task.rb +147 -147
- data/lib/ruby-prof/thread.rb +35 -35
- data/lib/ruby-prof/version.rb +3 -3
- data/lib/unprof.rb +10 -10
- data/ruby-prof.gemspec +58 -58
- data/test/abstract_printer_test.rb +53 -0
- data/test/aggregate_test.rb +136 -136
- data/test/basic_test.rb +128 -128
- data/test/block_test.rb +74 -74
- data/test/call_info_test.rb +78 -78
- data/test/call_info_visitor_test.rb +31 -31
- data/test/duplicate_names_test.rb +32 -32
- data/test/dynamic_method_test.rb +55 -55
- data/test/enumerable_test.rb +21 -21
- data/test/exceptions_test.rb +24 -16
- data/test/exclude_methods_test.rb +146 -146
- data/test/exclude_threads_test.rb +53 -53
- data/test/fiber_test.rb +79 -79
- data/test/issue137_test.rb +63 -63
- data/test/line_number_test.rb +80 -80
- data/test/measure_allocations_test.rb +26 -26
- data/test/measure_cpu_time_test.rb +212 -213
- data/test/measure_gc_runs_test.rb +32 -32
- data/test/measure_gc_time_test.rb +36 -36
- data/test/measure_memory_test.rb +33 -33
- data/test/measure_process_time_test.rb +61 -63
- data/test/measure_wall_time_test.rb +255 -255
- data/test/method_elimination_test.rb +84 -84
- data/test/module_test.rb +45 -45
- data/test/multi_printer_test.rb +104 -104
- data/test/no_method_class_test.rb +15 -15
- data/test/pause_resume_test.rb +166 -166
- data/test/prime.rb +54 -54
- data/test/printers_test.rb +275 -275
- data/test/printing_recursive_graph_test.rb +127 -127
- data/test/rack_test.rb +157 -157
- data/test/recursive_test.rb +215 -215
- data/test/singleton_test.rb +38 -38
- data/test/stack_printer_test.rb +77 -78
- data/test/stack_test.rb +138 -138
- data/test/start_stop_test.rb +112 -112
- data/test/test_helper.rb +267 -275
- data/test/thread_test.rb +187 -187
- data/test/unique_call_path_test.rb +202 -202
- data/test/yarv_test.rb +55 -55
- metadata +17 -96
- data/doc/LICENSE.html +0 -115
- data/doc/README_rdoc.html +0 -637
- data/doc/Rack.html +0 -96
- data/doc/Rack/RubyProf.html +0 -233
- data/doc/Rack/RubyProf/RackProfiler.html +0 -343
- data/doc/RubyProf.html +0 -974
- data/doc/RubyProf/AbstractPrinter.html +0 -625
- data/doc/RubyProf/AggregateCallInfo.html +0 -552
- data/doc/RubyProf/CallInfo.html +0 -579
- data/doc/RubyProf/CallInfoPrinter.html +0 -121
- data/doc/RubyProf/CallInfoVisitor.html +0 -199
- data/doc/RubyProf/CallStackPrinter.html +0 -1127
- data/doc/RubyProf/CallTreePrinter.html +0 -725
- data/doc/RubyProf/Cmd.html +0 -637
- data/doc/RubyProf/DeprecationWarnings.html +0 -148
- data/doc/RubyProf/DotPrinter.html +0 -258
- data/doc/RubyProf/FlatPrinter.html +0 -164
- data/doc/RubyProf/FlatPrinterWithLineNumbers.html +0 -210
- data/doc/RubyProf/GraphHtmlPrinter.html +0 -558
- data/doc/RubyProf/GraphPrinter.html +0 -140
- data/doc/RubyProf/MethodInfo.html +0 -676
- data/doc/RubyProf/MultiPrinter.html +0 -574
- data/doc/RubyProf/Profile.html +0 -908
- data/doc/RubyProf/Profile/ExcludeCommonMethods.html +0 -411
- data/doc/RubyProf/Profile/LegacyMethodElimination.html +0 -158
- data/doc/RubyProf/ProfileTask.html +0 -491
- data/doc/RubyProf/Thread.html +0 -275
- data/doc/created.rid +0 -33
- data/doc/css/fonts.css +0 -167
- data/doc/css/rdoc.css +0 -590
- data/doc/examples/flat_txt.html +0 -139
- data/doc/examples/graph_html.html +0 -910
- data/doc/examples/graph_txt.html +0 -248
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +0 -666
- data/doc/js/darkfish.js +0 -161
- data/doc/js/jquery.js +0 -4
- data/doc/js/navigation.js +0 -142
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +0 -109
- data/doc/js/search_index.js +0 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +0 -229
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +0 -1052
- data/examples/cachegrind.out.1 +0 -114
- data/examples/cachegrind.out.1.32313213 +0 -114
- data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +0 -108
- data/ext/ruby_prof/vc/ruby_prof_19.vcxproj +0 -110
data/doc/RubyProf/Profile.html
DELETED
@@ -1,908 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class RubyProf::Profile - ruby-prof</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "../";
|
11
|
-
var index_rel_prefix = "../";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="../js/jquery.js"></script>
|
15
|
-
<script src="../js/darkfish.js"></script>
|
16
|
-
|
17
|
-
<link href="../css/fonts.css" rel="stylesheet">
|
18
|
-
<link href="../css/rdoc.css" rel="stylesheet">
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<body id="top" role="document" class="class">
|
23
|
-
<nav role="navigation">
|
24
|
-
<div id="project-navigation">
|
25
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
-
<h2>
|
27
|
-
<a href="../index.html" rel="home">Home</a>
|
28
|
-
</h2>
|
29
|
-
|
30
|
-
<div id="table-of-contents-navigation">
|
31
|
-
<a href="../table_of_contents.html#pages">Pages</a>
|
32
|
-
<a href="../table_of_contents.html#classes">Classes</a>
|
33
|
-
<a href="../table_of_contents.html#methods">Methods</a>
|
34
|
-
</div>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
-
<form action="#" method="get" accept-charset="utf-8">
|
39
|
-
<div id="search-field-wrapper">
|
40
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
-
aria-autocomplete="list" aria-controls="search-results"
|
42
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<ul id="search-results" aria-label="Search Results"
|
47
|
-
aria-busy="false" aria-expanded="false"
|
48
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
-
</form>
|
50
|
-
</div>
|
51
|
-
|
52
|
-
</div>
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
<div id="class-metadata">
|
57
|
-
|
58
|
-
<div id="parent-class-section" class="nav-section">
|
59
|
-
<h3>Parent</h3>
|
60
|
-
|
61
|
-
|
62
|
-
<p class="link">Object
|
63
|
-
|
64
|
-
</div>
|
65
|
-
|
66
|
-
<div id="includes-section" class="nav-section">
|
67
|
-
<h3>Included Modules</h3>
|
68
|
-
|
69
|
-
<ul class="link-list">
|
70
|
-
|
71
|
-
|
72
|
-
<li><a class="include" href="Profile/LegacyMethodElimination.html">RubyProf::Profile::LegacyMethodElimination</a>
|
73
|
-
|
74
|
-
|
75
|
-
</ul>
|
76
|
-
</div>
|
77
|
-
|
78
|
-
|
79
|
-
<!-- Method Quickref -->
|
80
|
-
<div id="method-list-section" class="nav-section">
|
81
|
-
<h3>Methods</h3>
|
82
|
-
|
83
|
-
<ul class="link-list" role="directory">
|
84
|
-
|
85
|
-
<li ><a href="#method-c-new">::new</a>
|
86
|
-
|
87
|
-
<li ><a href="#method-c-profile">::profile</a>
|
88
|
-
|
89
|
-
<li ><a href="#method-i-exclude_common_methods-21">#exclude_common_methods!</a>
|
90
|
-
|
91
|
-
<li ><a href="#method-i-exclude_method-21">#exclude_method!</a>
|
92
|
-
|
93
|
-
<li ><a href="#method-i-exclude_methods-21">#exclude_methods!</a>
|
94
|
-
|
95
|
-
<li ><a href="#method-i-exclude_singleton_methods-21">#exclude_singleton_methods!</a>
|
96
|
-
|
97
|
-
<li ><a href="#method-i-pause">#pause</a>
|
98
|
-
|
99
|
-
<li ><a href="#method-i-paused-3F">#paused?</a>
|
100
|
-
|
101
|
-
<li ><a href="#method-i-profile">#profile</a>
|
102
|
-
|
103
|
-
<li ><a href="#method-i-resume">#resume</a>
|
104
|
-
|
105
|
-
<li ><a href="#method-i-running-3F">#running?</a>
|
106
|
-
|
107
|
-
<li ><a href="#method-i-start">#start</a>
|
108
|
-
|
109
|
-
<li ><a href="#method-i-stop">#stop</a>
|
110
|
-
|
111
|
-
<li ><a href="#method-i-threads">#threads</a>
|
112
|
-
|
113
|
-
</ul>
|
114
|
-
</div>
|
115
|
-
|
116
|
-
</div>
|
117
|
-
</nav>
|
118
|
-
|
119
|
-
<main role="main" aria-labelledby="class-RubyProf::Profile">
|
120
|
-
<h1 id="class-RubyProf::Profile" class="class">
|
121
|
-
class RubyProf::Profile
|
122
|
-
</h1>
|
123
|
-
|
124
|
-
<section class="description">
|
125
|
-
|
126
|
-
</section>
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
142
|
-
<header>
|
143
|
-
<h3>Public Class Methods</h3>
|
144
|
-
</header>
|
145
|
-
|
146
|
-
|
147
|
-
<div id="method-c-new" class="method-detail ">
|
148
|
-
|
149
|
-
|
150
|
-
<div class="method-heading">
|
151
|
-
<span class="method-callseq">
|
152
|
-
new()
|
153
|
-
</span>
|
154
|
-
|
155
|
-
<span class="method-click-advice">click to toggle source</span>
|
156
|
-
|
157
|
-
</div>
|
158
|
-
|
159
|
-
<div class="method-heading">
|
160
|
-
<span class="method-callseq">
|
161
|
-
new(options)
|
162
|
-
</span>
|
163
|
-
|
164
|
-
</div>
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
<div class="method-description">
|
169
|
-
|
170
|
-
<p>Returns a new profiler. Possible options for the options hash are:</p>
|
171
|
-
<dl class="rdoc-list note-list"><dt>measure_mode
|
172
|
-
<dd>
|
173
|
-
<p>Measure mode. Specifies the profile measure mode. If not specified,
|
174
|
-
defaults to RubyProf::WALL_TIME.</p>
|
175
|
-
</dd><dt>exclude_threads
|
176
|
-
<dd>
|
177
|
-
<p>Threads to exclude from the profiling results.</p>
|
178
|
-
</dd><dt>include_threads
|
179
|
-
<dd>
|
180
|
-
<p>Focus profiling on only the given threads. This will ignore all other
|
181
|
-
threads.</p>
|
182
|
-
</dd><dt>merge_fibers
|
183
|
-
<dd>
|
184
|
-
<p>Whether to merge all fibers under a given thread. This should be used when
|
185
|
-
profiling for a callgrind printer.</p>
|
186
|
-
</dd></dl>
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
<div class="method-source-code" id="new-source">
|
192
|
-
<pre>static VALUE
|
193
|
-
prof_initialize(int argc, VALUE *argv, VALUE self)
|
194
|
-
{
|
195
|
-
prof_profile_t* profile = prof_get_profile(self);
|
196
|
-
VALUE mode_or_options;
|
197
|
-
VALUE mode = Qnil;
|
198
|
-
VALUE exclude_threads = Qnil;
|
199
|
-
VALUE include_threads = Qnil;
|
200
|
-
VALUE merge_fibers = Qnil;
|
201
|
-
VALUE exclude_common = Qnil;
|
202
|
-
int i;
|
203
|
-
|
204
|
-
switch (rb_scan_args(argc, argv, "02", &mode_or_options, &exclude_threads)) {
|
205
|
-
case 0:
|
206
|
-
break;
|
207
|
-
case 1:
|
208
|
-
if (FIXNUM_P(mode_or_options)) {
|
209
|
-
mode = mode_or_options;
|
210
|
-
}
|
211
|
-
else {
|
212
|
-
Check_Type(mode_or_options, T_HASH);
|
213
|
-
mode = rb_hash_aref(mode_or_options, ID2SYM(rb_intern("measure_mode")));
|
214
|
-
merge_fibers = rb_hash_aref(mode_or_options, ID2SYM(rb_intern("merge_fibers")));
|
215
|
-
exclude_common = rb_hash_aref(mode_or_options, ID2SYM(rb_intern("exclude_common")));
|
216
|
-
exclude_threads = rb_hash_aref(mode_or_options, ID2SYM(rb_intern("exclude_threads")));
|
217
|
-
include_threads = rb_hash_aref(mode_or_options, ID2SYM(rb_intern("include_threads")));
|
218
|
-
}
|
219
|
-
break;
|
220
|
-
case 2:
|
221
|
-
Check_Type(exclude_threads, T_ARRAY);
|
222
|
-
break;
|
223
|
-
}
|
224
|
-
|
225
|
-
if (mode == Qnil) {
|
226
|
-
mode = INT2NUM(MEASURE_WALL_TIME);
|
227
|
-
} else {
|
228
|
-
Check_Type(mode, T_FIXNUM);
|
229
|
-
}
|
230
|
-
profile->measurer = prof_get_measurer(NUM2INT(mode));
|
231
|
-
profile->merge_fibers = merge_fibers != Qnil && merge_fibers != Qfalse;
|
232
|
-
|
233
|
-
if (exclude_threads != Qnil) {
|
234
|
-
Check_Type(exclude_threads, T_ARRAY);
|
235
|
-
assert(profile->exclude_threads_tbl == NULL);
|
236
|
-
profile->exclude_threads_tbl = threads_table_create();
|
237
|
-
for (i = 0; i < RARRAY_LEN(exclude_threads); i++) {
|
238
|
-
VALUE thread = rb_ary_entry(exclude_threads, i);
|
239
|
-
VALUE thread_id = rb_obj_id(thread);
|
240
|
-
st_insert(profile->exclude_threads_tbl, thread_id, Qtrue);
|
241
|
-
}
|
242
|
-
}
|
243
|
-
|
244
|
-
if (include_threads != Qnil) {
|
245
|
-
Check_Type(include_threads, T_ARRAY);
|
246
|
-
assert(profile->include_threads_tbl == NULL);
|
247
|
-
profile->include_threads_tbl = threads_table_create();
|
248
|
-
for (i = 0; i < RARRAY_LEN(include_threads); i++) {
|
249
|
-
VALUE thread = rb_ary_entry(include_threads, i);
|
250
|
-
VALUE thread_id = rb_obj_id(thread);
|
251
|
-
st_insert(profile->include_threads_tbl, thread_id, Qtrue);
|
252
|
-
}
|
253
|
-
}
|
254
|
-
|
255
|
-
if (RTEST(exclude_common)) {
|
256
|
-
prof_exclude_common_methods(self);
|
257
|
-
}
|
258
|
-
|
259
|
-
return self;
|
260
|
-
}</pre>
|
261
|
-
</div>
|
262
|
-
|
263
|
-
</div>
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
</div>
|
269
|
-
|
270
|
-
|
271
|
-
<div id="method-c-profile" class="method-detail ">
|
272
|
-
|
273
|
-
|
274
|
-
<div class="method-heading">
|
275
|
-
<span class="method-callseq">
|
276
|
-
profile(&block) → self
|
277
|
-
</span>
|
278
|
-
|
279
|
-
<span class="method-click-advice">click to toggle source</span>
|
280
|
-
|
281
|
-
</div>
|
282
|
-
|
283
|
-
<div class="method-heading">
|
284
|
-
<span class="method-callseq">
|
285
|
-
profile(options, &block) → self
|
286
|
-
</span>
|
287
|
-
|
288
|
-
</div>
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
<div class="method-description">
|
293
|
-
|
294
|
-
<p>Profiles the specified block and returns a <a
|
295
|
-
href="Profile.html">RubyProf::Profile</a> object. Arguments are passed to
|
296
|
-
<a href="Profile.html">Profile</a> initialize method.</p>
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
<div class="method-source-code" id="profile-source">
|
302
|
-
<pre>static VALUE
|
303
|
-
prof_profile_class(int argc, VALUE *argv, VALUE klass)
|
304
|
-
{
|
305
|
-
int result;
|
306
|
-
VALUE profile = rb_class_new_instance(argc, argv, cProfile);
|
307
|
-
|
308
|
-
if (!rb_block_given_p())
|
309
|
-
{
|
310
|
-
rb_raise(rb_eArgError, "A block must be provided to the profile method.");
|
311
|
-
}
|
312
|
-
|
313
|
-
prof_start(profile);
|
314
|
-
rb_protect(rb_yield, profile, &result);
|
315
|
-
return prof_stop(profile);
|
316
|
-
}</pre>
|
317
|
-
</div>
|
318
|
-
|
319
|
-
</div>
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
</div>
|
325
|
-
|
326
|
-
|
327
|
-
</section>
|
328
|
-
|
329
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
330
|
-
<header>
|
331
|
-
<h3>Public Instance Methods</h3>
|
332
|
-
</header>
|
333
|
-
|
334
|
-
|
335
|
-
<div id="method-i-exclude_common_methods-21" class="method-detail ">
|
336
|
-
|
337
|
-
<div class="method-heading">
|
338
|
-
<span class="method-name">exclude_common_methods!</span><span
|
339
|
-
class="method-args">()</span>
|
340
|
-
|
341
|
-
<span class="method-click-advice">click to toggle source</span>
|
342
|
-
|
343
|
-
</div>
|
344
|
-
|
345
|
-
|
346
|
-
<div class="method-description">
|
347
|
-
|
348
|
-
<p>Hides methods that, when represented as a call graph, have extremely large
|
349
|
-
in and out degrees and make navigation impossible.</p>
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
<div class="method-source-code" id="exclude_common_methods-21-source">
|
355
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/profile.rb, line 11</span>
|
356
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exclude_common_methods!</span>
|
357
|
-
<span class="ruby-constant">ExcludeCommonMethods</span>.<span class="ruby-identifier">apply!</span>(<span class="ruby-keyword">self</span>)
|
358
|
-
<span class="ruby-keyword">end</span></pre>
|
359
|
-
</div>
|
360
|
-
|
361
|
-
</div>
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
</div>
|
367
|
-
|
368
|
-
|
369
|
-
<div id="method-i-exclude_method-21" class="method-detail ">
|
370
|
-
|
371
|
-
<div class="method-heading">
|
372
|
-
<span class="method-name">exclude_method!</span><span
|
373
|
-
class="method-args">(p1, p2)</span>
|
374
|
-
|
375
|
-
<span class="method-click-advice">click to toggle source</span>
|
376
|
-
|
377
|
-
</div>
|
378
|
-
|
379
|
-
|
380
|
-
<div class="method-description">
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
<div class="method-source-code" id="exclude_method-21-source">
|
388
|
-
<pre>static VALUE
|
389
|
-
prof_exclude_method(VALUE self, VALUE klass, VALUE sym)
|
390
|
-
{
|
391
|
-
prof_profile_t* profile = prof_get_profile(self);
|
392
|
-
ID mid = SYM2ID(sym);
|
393
|
-
|
394
|
-
prof_method_key_t key;
|
395
|
-
prof_method_t *method;
|
396
|
-
|
397
|
-
if (profile->running == Qtrue)
|
398
|
-
{
|
399
|
-
rb_raise(rb_eRuntimeError, "RubyProf.start was already called");
|
400
|
-
}
|
401
|
-
|
402
|
-
method_key(&key, klass, mid);
|
403
|
-
method = method_table_lookup(profile->exclude_methods_tbl, &key);
|
404
|
-
|
405
|
-
if (!method) {
|
406
|
-
method = prof_method_create_excluded(klass, mid);
|
407
|
-
method_table_insert(profile->exclude_methods_tbl, method->key, method);
|
408
|
-
}
|
409
|
-
|
410
|
-
return self;
|
411
|
-
}</pre>
|
412
|
-
</div>
|
413
|
-
|
414
|
-
</div>
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
</div>
|
420
|
-
|
421
|
-
|
422
|
-
<div id="method-i-exclude_methods-21" class="method-detail ">
|
423
|
-
|
424
|
-
<div class="method-heading">
|
425
|
-
<span class="method-name">exclude_methods!</span><span
|
426
|
-
class="method-args">(mod, *method_or_methods)</span>
|
427
|
-
|
428
|
-
<span class="method-click-advice">click to toggle source</span>
|
429
|
-
|
430
|
-
</div>
|
431
|
-
|
432
|
-
|
433
|
-
<div class="method-description">
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
<div class="method-source-code" id="exclude_methods-21-source">
|
441
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/profile.rb, line 15</span>
|
442
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exclude_methods!</span>(<span class="ruby-identifier">mod</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">method_or_methods</span>)
|
443
|
-
[<span class="ruby-identifier">method_or_methods</span>].<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
444
|
-
<span class="ruby-identifier">exclude_method!</span>(<span class="ruby-identifier">mod</span>, <span class="ruby-identifier">name</span>)
|
445
|
-
<span class="ruby-keyword">end</span>
|
446
|
-
<span class="ruby-keyword">end</span></pre>
|
447
|
-
</div>
|
448
|
-
|
449
|
-
</div>
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
</div>
|
455
|
-
|
456
|
-
|
457
|
-
<div id="method-i-exclude_singleton_methods-21" class="method-detail ">
|
458
|
-
|
459
|
-
<div class="method-heading">
|
460
|
-
<span class="method-name">exclude_singleton_methods!</span><span
|
461
|
-
class="method-args">(mod, *method_or_methods)</span>
|
462
|
-
|
463
|
-
<span class="method-click-advice">click to toggle source</span>
|
464
|
-
|
465
|
-
</div>
|
466
|
-
|
467
|
-
|
468
|
-
<div class="method-description">
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
<div class="method-source-code" id="exclude_singleton_methods-21-source">
|
476
|
-
<pre><span class="ruby-comment"># File lib/ruby-prof/profile.rb, line 21</span>
|
477
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exclude_singleton_methods!</span>(<span class="ruby-identifier">mod</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">method_or_methods</span>)
|
478
|
-
<span class="ruby-identifier">exclude_methods!</span>(<span class="ruby-identifier">mod</span>.<span class="ruby-identifier">singleton_class</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">method_or_methods</span>)
|
479
|
-
<span class="ruby-keyword">end</span></pre>
|
480
|
-
</div>
|
481
|
-
|
482
|
-
</div>
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
</div>
|
488
|
-
|
489
|
-
|
490
|
-
<div id="method-i-pause" class="method-detail ">
|
491
|
-
|
492
|
-
|
493
|
-
<div class="method-heading">
|
494
|
-
<span class="method-callseq">
|
495
|
-
pause → self
|
496
|
-
</span>
|
497
|
-
|
498
|
-
<span class="method-click-advice">click to toggle source</span>
|
499
|
-
|
500
|
-
</div>
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
<div class="method-description">
|
505
|
-
|
506
|
-
<p>Pauses collecting profile data.</p>
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
<div class="method-source-code" id="pause-source">
|
512
|
-
<pre>static VALUE
|
513
|
-
prof_pause(VALUE self)
|
514
|
-
{
|
515
|
-
prof_profile_t* profile = prof_get_profile(self);
|
516
|
-
if (profile->running == Qfalse)
|
517
|
-
{
|
518
|
-
rb_raise(rb_eRuntimeError, "RubyProf is not running.");
|
519
|
-
}
|
520
|
-
|
521
|
-
if (profile->paused == Qfalse)
|
522
|
-
{
|
523
|
-
profile->paused = Qtrue;
|
524
|
-
profile->measurement_at_pause_resume = profile->measurer->measure();
|
525
|
-
st_foreach(profile->threads_tbl, pause_thread, (st_data_t) profile);
|
526
|
-
}
|
527
|
-
|
528
|
-
return self;
|
529
|
-
}</pre>
|
530
|
-
</div>
|
531
|
-
|
532
|
-
</div>
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
</div>
|
538
|
-
|
539
|
-
|
540
|
-
<div id="method-i-paused-3F" class="method-detail ">
|
541
|
-
|
542
|
-
|
543
|
-
<div class="method-heading">
|
544
|
-
<span class="method-callseq">
|
545
|
-
paused? → boolean
|
546
|
-
</span>
|
547
|
-
|
548
|
-
<span class="method-click-advice">click to toggle source</span>
|
549
|
-
|
550
|
-
</div>
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
<div class="method-description">
|
555
|
-
|
556
|
-
<p>Returns whether a profile is currently paused.</p>
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
<div class="method-source-code" id="paused-3F-source">
|
562
|
-
<pre>static VALUE
|
563
|
-
prof_paused(VALUE self)
|
564
|
-
{
|
565
|
-
prof_profile_t* profile = prof_get_profile(self);
|
566
|
-
return profile->paused;
|
567
|
-
}</pre>
|
568
|
-
</div>
|
569
|
-
|
570
|
-
</div>
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
</div>
|
576
|
-
|
577
|
-
|
578
|
-
<div id="method-i-profile" class="method-detail ">
|
579
|
-
|
580
|
-
|
581
|
-
<div class="method-heading">
|
582
|
-
<span class="method-callseq">
|
583
|
-
profile {block} → RubyProf::Result
|
584
|
-
</span>
|
585
|
-
|
586
|
-
<span class="method-click-advice">click to toggle source</span>
|
587
|
-
|
588
|
-
</div>
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
<div class="method-description">
|
593
|
-
|
594
|
-
<p>Profiles the specified block and returns a RubyProf::Result object.</p>
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
<div class="method-source-code" id="profile-source">
|
600
|
-
<pre>static VALUE
|
601
|
-
prof_profile_object(VALUE self)
|
602
|
-
{
|
603
|
-
int result;
|
604
|
-
if (!rb_block_given_p())
|
605
|
-
{
|
606
|
-
rb_raise(rb_eArgError, "A block must be provided to the profile method.");
|
607
|
-
}
|
608
|
-
|
609
|
-
prof_start(self);
|
610
|
-
rb_protect(rb_yield, self, &result);
|
611
|
-
return prof_stop(self);
|
612
|
-
|
613
|
-
}</pre>
|
614
|
-
</div>
|
615
|
-
|
616
|
-
</div>
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
</div>
|
622
|
-
|
623
|
-
|
624
|
-
<div id="method-i-resume" class="method-detail ">
|
625
|
-
|
626
|
-
|
627
|
-
<div class="method-heading">
|
628
|
-
<span class="method-callseq">
|
629
|
-
resume → self
|
630
|
-
</span>
|
631
|
-
|
632
|
-
<span class="method-click-advice">click to toggle source</span>
|
633
|
-
|
634
|
-
</div>
|
635
|
-
|
636
|
-
<div class="method-heading">
|
637
|
-
<span class="method-callseq">
|
638
|
-
resume(&block) → self
|
639
|
-
</span>
|
640
|
-
|
641
|
-
</div>
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
<div class="method-description">
|
646
|
-
|
647
|
-
<p>Resumes recording profile data.</p>
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
<div class="method-source-code" id="resume-source">
|
653
|
-
<pre>static VALUE
|
654
|
-
prof_resume(VALUE self)
|
655
|
-
{
|
656
|
-
prof_profile_t* profile = prof_get_profile(self);
|
657
|
-
if (profile->running == Qfalse)
|
658
|
-
{
|
659
|
-
rb_raise(rb_eRuntimeError, "RubyProf is not running.");
|
660
|
-
}
|
661
|
-
|
662
|
-
if (profile->paused == Qtrue)
|
663
|
-
{
|
664
|
-
profile->paused = Qfalse;
|
665
|
-
profile->measurement_at_pause_resume = profile->measurer->measure();
|
666
|
-
st_foreach(profile->threads_tbl, unpause_thread, (st_data_t) profile);
|
667
|
-
}
|
668
|
-
|
669
|
-
return rb_block_given_p() ? rb_ensure(rb_yield, self, prof_pause, self) : self;
|
670
|
-
}</pre>
|
671
|
-
</div>
|
672
|
-
|
673
|
-
</div>
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
</div>
|
679
|
-
|
680
|
-
|
681
|
-
<div id="method-i-running-3F" class="method-detail ">
|
682
|
-
|
683
|
-
|
684
|
-
<div class="method-heading">
|
685
|
-
<span class="method-callseq">
|
686
|
-
running? → boolean
|
687
|
-
</span>
|
688
|
-
|
689
|
-
<span class="method-click-advice">click to toggle source</span>
|
690
|
-
|
691
|
-
</div>
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
<div class="method-description">
|
696
|
-
|
697
|
-
<p>Returns whether a profile is currently running.</p>
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
<div class="method-source-code" id="running-3F-source">
|
703
|
-
<pre>static VALUE
|
704
|
-
prof_running(VALUE self)
|
705
|
-
{
|
706
|
-
prof_profile_t* profile = prof_get_profile(self);
|
707
|
-
return profile->running;
|
708
|
-
}</pre>
|
709
|
-
</div>
|
710
|
-
|
711
|
-
</div>
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
</div>
|
717
|
-
|
718
|
-
|
719
|
-
<div id="method-i-start" class="method-detail ">
|
720
|
-
|
721
|
-
|
722
|
-
<div class="method-heading">
|
723
|
-
<span class="method-callseq">
|
724
|
-
start → self
|
725
|
-
</span>
|
726
|
-
|
727
|
-
<span class="method-click-advice">click to toggle source</span>
|
728
|
-
|
729
|
-
</div>
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
<div class="method-description">
|
734
|
-
|
735
|
-
<p>Starts recording profile data.</p>
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
<div class="method-source-code" id="start-source">
|
741
|
-
<pre>static VALUE
|
742
|
-
prof_start(VALUE self)
|
743
|
-
{
|
744
|
-
char* trace_file_name;
|
745
|
-
|
746
|
-
prof_profile_t* profile = prof_get_profile(self);
|
747
|
-
|
748
|
-
if (profile->running == Qtrue)
|
749
|
-
{
|
750
|
-
rb_raise(rb_eRuntimeError, "RubyProf.start was already called");
|
751
|
-
}
|
752
|
-
|
753
|
-
profile->running = Qtrue;
|
754
|
-
profile->paused = Qfalse;
|
755
|
-
profile->last_thread_data = NULL;
|
756
|
-
|
757
|
-
|
758
|
-
/* open trace file if environment wants it */
|
759
|
-
trace_file_name = getenv("RUBY_PROF_TRACE");
|
760
|
-
if (trace_file_name != NULL)
|
761
|
-
{
|
762
|
-
if (strcmp(trace_file_name, "stdout") == 0)
|
763
|
-
{
|
764
|
-
trace_file = stdout;
|
765
|
-
}
|
766
|
-
else if (strcmp(trace_file_name, "stderr") == 0)
|
767
|
-
{
|
768
|
-
trace_file = stderr;
|
769
|
-
}
|
770
|
-
else
|
771
|
-
{
|
772
|
-
trace_file = fopen(trace_file_name, "w");
|
773
|
-
}
|
774
|
-
}
|
775
|
-
|
776
|
-
prof_install_hook(self);
|
777
|
-
return self;
|
778
|
-
}</pre>
|
779
|
-
</div>
|
780
|
-
|
781
|
-
</div>
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
</div>
|
787
|
-
|
788
|
-
|
789
|
-
<div id="method-i-stop" class="method-detail ">
|
790
|
-
|
791
|
-
|
792
|
-
<div class="method-heading">
|
793
|
-
<span class="method-callseq">
|
794
|
-
stop → self
|
795
|
-
</span>
|
796
|
-
|
797
|
-
<span class="method-click-advice">click to toggle source</span>
|
798
|
-
|
799
|
-
</div>
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
<div class="method-description">
|
804
|
-
|
805
|
-
<p>Stops collecting profile data.</p>
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
<div class="method-source-code" id="stop-source">
|
811
|
-
<pre>static VALUE
|
812
|
-
prof_stop(VALUE self)
|
813
|
-
{
|
814
|
-
prof_profile_t* profile = prof_get_profile(self);
|
815
|
-
|
816
|
-
if (profile->running == Qfalse)
|
817
|
-
{
|
818
|
-
rb_raise(rb_eRuntimeError, "RubyProf.start was not yet called");
|
819
|
-
}
|
820
|
-
|
821
|
-
prof_remove_hook(self);
|
822
|
-
|
823
|
-
/* close trace file if open */
|
824
|
-
if (trace_file != NULL)
|
825
|
-
{
|
826
|
-
if (trace_file !=stderr && trace_file != stdout)
|
827
|
-
{
|
828
|
-
#ifdef _MSC_VER
|
829
|
-
_fcloseall();
|
830
|
-
#else
|
831
|
-
fclose(trace_file);
|
832
|
-
#endif
|
833
|
-
}
|
834
|
-
trace_file = NULL;
|
835
|
-
}
|
836
|
-
|
837
|
-
prof_pop_threads(profile);
|
838
|
-
|
839
|
-
/* Unset the last_thread_data (very important!)
|
840
|
-
and the threads table */
|
841
|
-
profile->running = profile->paused = Qfalse;
|
842
|
-
profile->last_thread_data = NULL;
|
843
|
-
|
844
|
-
return self;
|
845
|
-
}</pre>
|
846
|
-
</div>
|
847
|
-
|
848
|
-
</div>
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
</div>
|
854
|
-
|
855
|
-
|
856
|
-
<div id="method-i-threads" class="method-detail ">
|
857
|
-
|
858
|
-
|
859
|
-
<div class="method-heading">
|
860
|
-
<span class="method-callseq">
|
861
|
-
threads → Array of RubyProf::Thread
|
862
|
-
</span>
|
863
|
-
|
864
|
-
<span class="method-click-advice">click to toggle source</span>
|
865
|
-
|
866
|
-
</div>
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
<div class="method-description">
|
871
|
-
|
872
|
-
<p>Returns an array of <a href="Thread.html">RubyProf::Thread</a> instances
|
873
|
-
that were executed while the the program was being run.</p>
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
<div class="method-source-code" id="threads-source">
|
879
|
-
<pre>static VALUE
|
880
|
-
prof_threads(VALUE self)
|
881
|
-
{
|
882
|
-
VALUE result = rb_ary_new();
|
883
|
-
prof_profile_t* profile = prof_get_profile(self);
|
884
|
-
st_foreach(profile->threads_tbl, collect_threads, result);
|
885
|
-
return result;
|
886
|
-
}</pre>
|
887
|
-
</div>
|
888
|
-
|
889
|
-
</div>
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
</div>
|
895
|
-
|
896
|
-
|
897
|
-
</section>
|
898
|
-
|
899
|
-
</section>
|
900
|
-
</main>
|
901
|
-
|
902
|
-
|
903
|
-
<footer id="validator-badges" role="contentinfo">
|
904
|
-
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
905
|
-
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
906
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
907
|
-
</footer>
|
908
|
-
|