ruby-prof 1.4.3 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +30 -9
- data/{README.rdoc → README.md} +2 -2
- data/Rakefile +3 -3
- data/ext/ruby_prof/rp_call_tree.c +0 -2
- data/ext/ruby_prof/rp_call_tree.h +1 -1
- data/ext/ruby_prof/rp_measure_allocations.c +10 -13
- data/ext/ruby_prof/rp_measure_memory.c +8 -4
- data/ext/ruby_prof/rp_measure_process_time.c +7 -6
- data/ext/ruby_prof/rp_measurement.c +1 -1
- data/ext/ruby_prof/rp_measurement.h +1 -1
- data/ext/ruby_prof/rp_profile.c +18 -3
- data/ext/ruby_prof/vc/ruby_prof.vcxproj +8 -6
- data/lib/ruby-prof/assets/call_stack_printer.html.erb +2 -1
- data/lib/ruby-prof/printers/call_tree_printer.rb +3 -7
- data/lib/ruby-prof/printers/graph_html_printer.rb +1 -1
- data/lib/ruby-prof/version.rb +1 -1
- data/lib/ruby-prof.rb +1 -1
- data/ruby-prof.gemspec +2 -3
- data/test/alias_test.rb +97 -101
- data/test/duplicate_names_test.rb +4 -4
- data/test/dynamic_method_test.rb +23 -9
- data/test/marshal_test.rb +15 -2
- data/test/measure_allocations.rb +1 -5
- data/test/measure_allocations_test.rb +643 -349
- data/test/{measure_memory_trace_test.rb → measure_memory_test.rb} +178 -605
- data/test/measure_process_time_test.rb +1564 -735
- data/test/measure_wall_time_test.rb +6 -15
- data/test/printer_call_tree_test.rb +2 -2
- data/test/recursive_test.rb +372 -148
- data/test/test_helper.rb +4 -8
- data/test/unique_call_path_test.rb +24 -8
- data/test/yarv_test.rb +8 -4
- metadata +10 -26
- data/test/measure_allocations_trace_test.rb +0 -375
- data/test/temp.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb77381e6fdb509ca6b243a57dd21e4f7eceaeaeb658cbfa13c5660d94320657
|
4
|
+
data.tar.gz: d9de35cbf400aad32c6f451af75e4e8e549712f55e89b35e4036ec2eaecd3ce8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdd4b10b506be935b8ae272722b95745646c6ad2a1d1997a2869c7c9a8425c5d498dec449246c7cb3c1fc728ea2c2be92cfffa4e806a3ff8363fe075f71e385b
|
7
|
+
data.tar.gz: ff9453f7f7a7cd37e36303d92ccff7697f167776a578351efe8d778e9f92c0f6d4cd144d6792ea18afe93cae8b47a6099264304ec39759334d0b3e61c9ee688f
|
data/CHANGES
CHANGED
@@ -1,15 +1,36 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.5 (2022-12-27)
|
2
|
+
=====================
|
3
|
+
* Look for ruby_prof extension built on install in the lib directory (Charlie Savage)
|
4
|
+
* Added Ruby 3.2.0 build for mingw-urct
|
5
|
+
|
6
|
+
1.4.4 (2022-12-11)
|
7
|
+
=====================
|
8
|
+
* Update tests for Ruby 3.1 (Charlie Savage)
|
9
|
+
* When tracing allocations always use the RUBY_INTERNAL_EVENT_NEWOBJ trace event. Previously GC stats could also be used, but that includes the creation of internal T_IMEMO objects makes reviewing results confusing (Charlie Savage)
|
10
|
+
* Remove :profile option that lets a user set the prefix on callgrind output files since KCacheGrind will not automatically show these files in its open dialog. Fixes #313. (Charlie Savage)
|
11
|
+
* Don't expose threads to Ruby that don't have a call tree. This can happen when a user is profiling memory usage and then sends a signint to the profiled process. New objects will be created in a new thread, but no method enter/exit trace events are generated by Ruby. Thus the thread has no call tree. Fixes #312 (Charlie Savage)
|
12
|
+
* Update github Actions - change 3.0 to '3.0', add Windows mswin (MSP-Greg)
|
13
|
+
* Add Ruby 3.1 to test matrix (Charlie Savage)
|
14
|
+
* Use normal weight text instead of bold in call strack printer output. Fixes #297 (Charlie Savage)
|
15
|
+
* Update VC project to Ruby 3.1 and Visual Studio 2022 (Charlie Savage)
|
16
|
+
* Fix marshaling of profile measure. Fixes #315 (Charlie Savage)
|
17
|
+
* CI: Omit duplicate 'bundle install'. PR #309 (Olle Jonsson)
|
18
|
+
* Fix typo. s/perecent/percent/ (Paarth Madan)
|
19
|
+
* Remove support for Ruby 2.5 and 2.6 which are now end of life (Charlie Savage)
|
20
|
+
|
21
|
+
1.4.3 (2021-02-16)
|
2
22
|
=====================
|
3
23
|
* Remove trailing spaces (sergioro)
|
4
|
-
*
|
5
|
-
*
|
24
|
+
* Load "ruby-prof.so" with require_relative (sergioro)
|
25
|
+
* Use same file permissions for all test files (sergioro)
|
26
|
+
* Create tmp directory for test output (sergioro)
|
27
|
+
* Update git-ignore to add mkmf log (sergioro)
|
6
28
|
* Fix minitest warning about using MT_CPU instead of N (sergioro)
|
7
|
-
* Fix minitest warning "Use assert_nil if expecting nil
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
* Greatly slim down library size by removing symbols on GCC (Charlie Savage)
|
29
|
+
* Fix minitest warning "Use assert_nil if expecting nil (sergioro)
|
30
|
+
* Add xcode project (Charlie Savage)
|
31
|
+
* Update test for Ruby 3.0 (Charlie Savage)
|
32
|
+
* Remove Ruby 2.4 support since it is no longer maintained (Charlie Savage)
|
33
|
+
* Replace travis status badge with github status badge (Charlie Savage)
|
13
34
|
|
14
35
|
1.4.2 (2020-11-3)
|
15
36
|
=====================
|
data/{README.rdoc → README.md}
RENAMED
data/Rakefile
CHANGED
@@ -42,7 +42,7 @@ end
|
|
42
42
|
Rake::Task[:package].enhance [:rdoc]
|
43
43
|
|
44
44
|
# Setup Windows Gem
|
45
|
-
if RUBY_PLATFORM.match(/
|
45
|
+
if RUBY_PLATFORM.match(/mswin|mingw/)
|
46
46
|
# Windows specification
|
47
47
|
win_spec = default_spec.clone
|
48
48
|
win_spec.platform = Gem::Platform::CURRENT
|
@@ -65,13 +65,13 @@ RDoc::Task.new("rdoc") do |rdoc|
|
|
65
65
|
# Show source inline with line numbers
|
66
66
|
rdoc.options << "--line-numbers"
|
67
67
|
# Make the readme file the start page for the generated html
|
68
|
-
rdoc.options << '--main' << 'README.
|
68
|
+
rdoc.options << '--main' << 'README.md'
|
69
69
|
rdoc.rdoc_files.include('bin/*',
|
70
70
|
'doc/*.rdoc',
|
71
71
|
'lib/**/*.rb',
|
72
72
|
'ext/ruby_prof/*.c',
|
73
73
|
'ext/ruby_prof/*.h',
|
74
|
-
'README.
|
74
|
+
'README.md',
|
75
75
|
'LICENSE')
|
76
76
|
end
|
77
77
|
|
@@ -38,6 +38,6 @@ uint32_t prof_call_figure_depth(prof_call_tree_t* call_tree_data);
|
|
38
38
|
prof_call_tree_t* prof_get_call_tree(VALUE self);
|
39
39
|
VALUE prof_call_tree_wrap(prof_call_tree_t* call_tree);
|
40
40
|
void prof_call_tree_free(prof_call_tree_t* call_tree);
|
41
|
-
void rp_init_call_tree(
|
41
|
+
void rp_init_call_tree();
|
42
42
|
|
43
43
|
#endif //__RP_CALL_TREE_H__
|
@@ -8,20 +8,20 @@
|
|
8
8
|
static VALUE cMeasureAllocations;
|
9
9
|
VALUE total_allocated_objects_key;
|
10
10
|
|
11
|
-
static double
|
12
|
-
{
|
13
|
-
return (double)rb_gc_stat(total_allocated_objects_key);
|
14
|
-
}
|
15
|
-
|
16
|
-
static double measure_allocations_via_tracing(rb_trace_arg_t* trace_arg)
|
11
|
+
static double measure_allocations(rb_trace_arg_t* trace_arg)
|
17
12
|
{
|
18
13
|
static double result = 0;
|
19
14
|
|
20
15
|
if (trace_arg)
|
21
16
|
{
|
17
|
+
// Only process creation of new objects
|
22
18
|
rb_event_flag_t event = rb_tracearg_event_flag(trace_arg);
|
23
|
-
if (event == RUBY_INTERNAL_EVENT_NEWOBJ)
|
24
|
-
|
19
|
+
if (event == RUBY_INTERNAL_EVENT_NEWOBJ) {
|
20
|
+
// Don't count allocations of internal IMemo objects
|
21
|
+
VALUE object = rb_tracearg_object(trace_arg);
|
22
|
+
if (BUILTIN_TYPE(object) != T_IMEMO)
|
23
|
+
result++;
|
24
|
+
}
|
25
25
|
}
|
26
26
|
return result;
|
27
27
|
}
|
@@ -30,14 +30,11 @@ prof_measurer_t* prof_measurer_allocations(bool track_allocations)
|
|
30
30
|
{
|
31
31
|
prof_measurer_t* measure = ALLOC(prof_measurer_t);
|
32
32
|
measure->mode = MEASURE_ALLOCATIONS;
|
33
|
+
measure->measure = measure_allocations;
|
33
34
|
measure->multiplier = 1;
|
35
|
+
// Need to track allocations to get RUBY_INTERNAL_EVENT_NEWOBJ event
|
34
36
|
measure->track_allocations = track_allocations;
|
35
37
|
|
36
|
-
if (track_allocations)
|
37
|
-
measure->measure = measure_allocations_via_tracing;
|
38
|
-
else
|
39
|
-
measure->measure = measure_allocations_via_gc_stats;
|
40
|
-
|
41
38
|
return measure;
|
42
39
|
}
|
43
40
|
|
@@ -7,20 +7,23 @@
|
|
7
7
|
|
8
8
|
static VALUE cMeasureMemory;
|
9
9
|
|
10
|
-
static double
|
11
|
-
measure_memory_via_tracing(rb_trace_arg_t* trace_arg)
|
10
|
+
static double measure_memory(rb_trace_arg_t* trace_arg)
|
12
11
|
{
|
13
12
|
static double result = 0;
|
14
13
|
|
15
14
|
if (trace_arg)
|
16
15
|
{
|
16
|
+
// Only process creation of new objects
|
17
17
|
rb_event_flag_t event = rb_tracearg_event_flag(trace_arg);
|
18
18
|
if (event == RUBY_INTERNAL_EVENT_NEWOBJ)
|
19
19
|
{
|
20
|
+
// Don't count allocations of internal IMemo objects
|
20
21
|
VALUE object = rb_tracearg_object(trace_arg);
|
21
|
-
|
22
|
+
if (BUILTIN_TYPE(object) != T_IMEMO)
|
23
|
+
result += rb_obj_memsize_of(object);
|
22
24
|
}
|
23
25
|
}
|
26
|
+
|
24
27
|
return result;
|
25
28
|
}
|
26
29
|
|
@@ -28,8 +31,9 @@ prof_measurer_t* prof_measurer_memory(bool track_allocations)
|
|
28
31
|
{
|
29
32
|
prof_measurer_t* measure = ALLOC(prof_measurer_t);
|
30
33
|
measure->mode = MEASURE_MEMORY;
|
31
|
-
measure->measure =
|
34
|
+
measure->measure = measure_memory;
|
32
35
|
measure->multiplier = 1;
|
36
|
+
// Need to track allocations to get RUBY_INTERNAL_EVENT_NEWOBJ event
|
33
37
|
measure->track_allocations = true;
|
34
38
|
return measure;
|
35
39
|
}
|
@@ -11,21 +11,22 @@ static double measure_process_time(rb_trace_arg_t* trace_arg)
|
|
11
11
|
#if defined(_WIN32)
|
12
12
|
FILETIME createTime;
|
13
13
|
FILETIME exitTime;
|
14
|
-
FILETIME
|
14
|
+
FILETIME kernelTime;
|
15
15
|
FILETIME userTime;
|
16
16
|
|
17
|
-
ULARGE_INTEGER
|
17
|
+
ULARGE_INTEGER kernelTimeInt;
|
18
18
|
ULARGE_INTEGER userTimeInt;
|
19
19
|
|
20
|
-
GetProcessTimes(GetCurrentProcess(), &createTime, &exitTime, &
|
20
|
+
GetProcessTimes(GetCurrentProcess(), &createTime, &exitTime, &kernelTime, &userTime);
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
kernelTimeInt.LowPart = kernelTime.dwLowDateTime;
|
23
|
+
kernelTimeInt.HighPart = kernelTime.dwHighDateTime;
|
24
24
|
userTimeInt.LowPart = userTime.dwLowDateTime;
|
25
25
|
userTimeInt.HighPart = userTime.dwHighDateTime;
|
26
26
|
|
27
|
-
return (double)(
|
27
|
+
return (double)(kernelTimeInt.QuadPart + userTimeInt.QuadPart);
|
28
28
|
#elif !defined(CLOCK_PROCESS_CPUTIME_ID)
|
29
|
+
#include <sys/resource.h>
|
29
30
|
struct rusage usage;
|
30
31
|
getrusage(RUSAGE_SELF, &usage);
|
31
32
|
return usage.ru_stime.tv_sec + usage.ru_utime.tv_sec + ((usage.ru_stime.tv_usec + usage.ru_utime.tv_usec) / 1000000.0);
|
@@ -16,7 +16,7 @@ void rp_init_measure_memory(void);
|
|
16
16
|
void rp_init_measure_process_time(void);
|
17
17
|
void rp_init_measure_wall_time(void);
|
18
18
|
|
19
|
-
prof_measurer_t*
|
19
|
+
prof_measurer_t* prof_measurer_create(prof_measure_mode_t measure, bool track_allocations)
|
20
20
|
{
|
21
21
|
switch (measure)
|
22
22
|
{
|
@@ -36,7 +36,7 @@ typedef struct prof_measurement_t
|
|
36
36
|
VALUE object;
|
37
37
|
} prof_measurement_t;
|
38
38
|
|
39
|
-
prof_measurer_t*
|
39
|
+
prof_measurer_t* prof_measurer_create(prof_measure_mode_t measure, bool track_allocations);
|
40
40
|
double prof_measure(prof_measurer_t* measurer, rb_trace_arg_t* trace_arg);
|
41
41
|
|
42
42
|
prof_measurement_t* prof_measurement_create(void);
|
data/ext/ruby_prof/rp_profile.c
CHANGED
@@ -211,7 +211,7 @@ static void prof_event_hook(VALUE trace_point, void* data)
|
|
211
211
|
}
|
212
212
|
|
213
213
|
/* Special case - skip any methods from the mProf
|
214
|
-
module since they clutter the results but aren't important
|
214
|
+
module since they clutter the results but aren't important. */
|
215
215
|
if (self == mProf)
|
216
216
|
return;
|
217
217
|
|
@@ -226,6 +226,8 @@ static void prof_event_hook(VALUE trace_point, void* data)
|
|
226
226
|
{
|
227
227
|
prof_frame_t* frame = prof_frame_current(thread_data->stack);
|
228
228
|
|
229
|
+
/* If there is no frame then this is either the first method being profiled or we have climbed the
|
230
|
+
call stack higher than where we started. */
|
229
231
|
if (!frame)
|
230
232
|
{
|
231
233
|
prof_method_t* method = check_method(profile, trace_arg, event, thread_data);
|
@@ -236,11 +238,13 @@ static void prof_event_hook(VALUE trace_point, void* data)
|
|
236
238
|
prof_call_tree_t* call_tree = prof_call_tree_create(method, NULL, method->source_file, method->source_line);
|
237
239
|
prof_add_call_tree(method->call_trees, call_tree);
|
238
240
|
|
241
|
+
// We have climbed higher in the stack then where we started
|
239
242
|
if (thread_data->call_tree)
|
240
243
|
{
|
241
244
|
prof_call_tree_add_parent(thread_data->call_tree, call_tree);
|
242
245
|
frame = prof_frame_unshift(thread_data->stack, call_tree, thread_data->call_tree, measurement);
|
243
246
|
}
|
247
|
+
// This is the first method to be profiled
|
244
248
|
else
|
245
249
|
{
|
246
250
|
frame = prof_frame_push(thread_data->stack, call_tree, measurement, RTEST(profile_t->paused));
|
@@ -374,7 +378,7 @@ prof_profile_t* prof_get_profile(VALUE self)
|
|
374
378
|
static int collect_threads(st_data_t key, st_data_t value, st_data_t result)
|
375
379
|
{
|
376
380
|
thread_data_t* thread_data = (thread_data_t*)value;
|
377
|
-
if (thread_data->trace)
|
381
|
+
if (thread_data->trace && thread_data->call_tree)
|
378
382
|
{
|
379
383
|
VALUE threads_array = (VALUE)result;
|
380
384
|
rb_ary_push(threads_array, prof_thread_wrap(thread_data));
|
@@ -565,7 +569,7 @@ static VALUE prof_initialize(int argc, VALUE* argv, VALUE self)
|
|
565
569
|
{
|
566
570
|
Check_Type(mode, T_FIXNUM);
|
567
571
|
}
|
568
|
-
profile->measurer =
|
572
|
+
profile->measurer = prof_measurer_create(NUM2INT(mode), track_allocations == Qtrue);
|
569
573
|
profile->allow_exceptions = (allow_exceptions == Qtrue);
|
570
574
|
|
571
575
|
if (exclude_threads != Qnil)
|
@@ -854,8 +858,14 @@ static VALUE prof_exclude_method(VALUE self, VALUE klass, VALUE msym)
|
|
854
858
|
/* :nodoc: */
|
855
859
|
VALUE prof_profile_dump(VALUE self)
|
856
860
|
{
|
861
|
+
prof_profile_t* profile = prof_get_profile(self);
|
862
|
+
|
857
863
|
VALUE result = rb_hash_new();
|
858
864
|
rb_hash_aset(result, ID2SYM(rb_intern("threads")), prof_threads(self));
|
865
|
+
rb_hash_aset(result, ID2SYM(rb_intern("measurer_mode")), INT2NUM(profile->measurer->mode));
|
866
|
+
rb_hash_aset(result, ID2SYM(rb_intern("measurer_track_allocations")),
|
867
|
+
profile->measurer->track_allocations ? Qtrue : Qfalse);
|
868
|
+
|
859
869
|
return result;
|
860
870
|
}
|
861
871
|
|
@@ -864,6 +874,11 @@ VALUE prof_profile_load(VALUE self, VALUE data)
|
|
864
874
|
{
|
865
875
|
prof_profile_t* profile = prof_get_profile(self);
|
866
876
|
|
877
|
+
VALUE measurer_mode = rb_hash_aref(data, ID2SYM(rb_intern("measurer_mode")));
|
878
|
+
VALUE measurer_track_allocations = rb_hash_aref(data, ID2SYM(rb_intern("measurer_track_allocations")));
|
879
|
+
profile->measurer = prof_measurer_create((prof_measure_mode_t)(NUM2INT(measurer_mode)),
|
880
|
+
measurer_track_allocations == Qtrue ? true : false);
|
881
|
+
|
867
882
|
VALUE threads = rb_hash_aref(data, ID2SYM(rb_intern("threads")));
|
868
883
|
for (int i = 0; i < rb_array_len(threads); i++)
|
869
884
|
{
|
@@ -29,19 +29,21 @@
|
|
29
29
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
30
30
|
<UseDebugLibraries>true</UseDebugLibraries>
|
31
31
|
<CharacterSet>Unicode</CharacterSet>
|
32
|
+
<PlatformToolset>v143</PlatformToolset>
|
32
33
|
</PropertyGroup>
|
33
34
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
34
35
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
35
36
|
<UseDebugLibraries>false</UseDebugLibraries>
|
36
37
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
37
38
|
<CharacterSet>Unicode</CharacterSet>
|
39
|
+
<PlatformToolset>v143</PlatformToolset>
|
38
40
|
</PropertyGroup>
|
39
41
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
40
|
-
<PlatformToolset>
|
42
|
+
<PlatformToolset>v143</PlatformToolset>
|
41
43
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
42
44
|
</PropertyGroup>
|
43
45
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
44
|
-
<PlatformToolset>
|
46
|
+
<PlatformToolset>v143</PlatformToolset>
|
45
47
|
</PropertyGroup>
|
46
48
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
47
49
|
<ImportGroup Label="ExtensionSettings">
|
@@ -64,7 +66,7 @@
|
|
64
66
|
</PropertyGroup>
|
65
67
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
66
68
|
<TargetExt>.so</TargetExt>
|
67
|
-
<OutDir
|
69
|
+
<OutDir>$(SolutionDir)\..</OutDir>
|
68
70
|
</PropertyGroup>
|
69
71
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
70
72
|
<ClCompile>
|
@@ -102,14 +104,14 @@
|
|
102
104
|
</ItemDefinitionGroup>
|
103
105
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
104
106
|
<ClCompile>
|
105
|
-
<AdditionalIncludeDirectories>C:\msys64\usr\local\ruby-
|
107
|
+
<AdditionalIncludeDirectories>C:\msys64\usr\local\ruby-3.1.2-vc\include\ruby-3.1.0\x64-mswin64_140;C:\msys64\usr\local\ruby-3.1.2-vc\include\ruby-3.1.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
106
108
|
<Optimization>Disabled</Optimization>
|
107
109
|
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
108
110
|
<WarningLevel>Level3</WarningLevel>
|
109
111
|
</ClCompile>
|
110
112
|
<Link>
|
111
|
-
<AdditionalLibraryDirectories>C:\msys64\usr\local\ruby-
|
112
|
-
<AdditionalDependencies>x64-vcruntime140-
|
113
|
+
<AdditionalLibraryDirectories>C:\msys64\usr\local\ruby-3.1.2-vc\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
114
|
+
<AdditionalDependencies>x64-vcruntime140-ruby310.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
113
115
|
<ModuleDefinitionFile>ruby_prof.def</ModuleDefinitionFile>
|
114
116
|
<SubSystem>Console</SubSystem>
|
115
117
|
</Link>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
5
5
|
<title>ruby-prof call tree</title>
|
6
|
-
<style
|
6
|
+
<style>
|
7
7
|
body {
|
8
8
|
font-size: 70%;
|
9
9
|
padding: 0;
|
@@ -19,6 +19,7 @@
|
|
19
19
|
margin-bottom: 0px;
|
20
20
|
padding-left: 0px;
|
21
21
|
list-style-type: none;
|
22
|
+
font-weight: normal;
|
22
23
|
}
|
23
24
|
|
24
25
|
li {
|
@@ -100,21 +100,17 @@ module RubyProf
|
|
100
100
|
true
|
101
101
|
end
|
102
102
|
|
103
|
-
def base_name
|
104
|
-
@options[:profile] || "profile"
|
105
|
-
end
|
106
|
-
|
107
103
|
def remove_subsidiary_files_from_previous_profile_runs
|
108
|
-
pattern = [
|
104
|
+
pattern = ["callgrind.out", $$, "*"].join(".")
|
109
105
|
files = Dir.glob(File.join(path, pattern))
|
110
106
|
FileUtils.rm_f(files)
|
111
107
|
end
|
112
108
|
|
113
109
|
def file_name_for_thread(thread)
|
114
110
|
if thread.fiber_id == Fiber.current.object_id
|
115
|
-
[
|
111
|
+
["callgrind.out", $$].join(".")
|
116
112
|
else
|
117
|
-
[
|
113
|
+
["callgrind.out", $$, thread.fiber_id].join(".")
|
118
114
|
end
|
119
115
|
end
|
120
116
|
|
@@ -29,7 +29,7 @@ module RubyProf
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# Creates a link to a method. Note that we do not create
|
32
|
-
# links to methods which are under the
|
32
|
+
# links to methods which are under the min_percent
|
33
33
|
# specified by the user, since they will not be
|
34
34
|
# printed out.
|
35
35
|
def create_link(thread, overall_time, method)
|
data/lib/ruby-prof/version.rb
CHANGED
data/lib/ruby-prof.rb
CHANGED
data/ruby-prof.gemspec
CHANGED
@@ -36,7 +36,7 @@ EOF
|
|
36
36
|
spec.files = Dir['CHANGES',
|
37
37
|
'LICENSE',
|
38
38
|
'Rakefile',
|
39
|
-
'README.
|
39
|
+
'README.md',
|
40
40
|
'ruby-prof.gemspec',
|
41
41
|
'bin/ruby-prof',
|
42
42
|
'bin/ruby-prof-check-trace',
|
@@ -56,10 +56,9 @@ EOF
|
|
56
56
|
'test/*.rb']
|
57
57
|
|
58
58
|
spec.test_files = Dir["test/test_*.rb"]
|
59
|
-
spec.required_ruby_version = '>= 2.
|
59
|
+
spec.required_ruby_version = '>= 2.7.0'
|
60
60
|
spec.date = Time.now.strftime('%Y-%m-%d')
|
61
61
|
spec.homepage = 'https://github.com/ruby-prof/ruby-prof'
|
62
62
|
spec.add_development_dependency('minitest')
|
63
63
|
spec.add_development_dependency('rake-compiler')
|
64
|
-
spec.add_development_dependency('rdoc')
|
65
64
|
end
|