ruby-prof 1.5.0 → 1.6.1
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 +4 -4
- data/CHANGES +13 -0
- data/ext/ruby_prof/rp_allocation.c +136 -81
- data/ext/ruby_prof/rp_allocation.h +8 -6
- data/ext/ruby_prof/rp_call_tree.c +8 -1
- data/ext/ruby_prof/rp_measurement.c +10 -3
- data/ext/ruby_prof/rp_method.c +51 -76
- data/ext/ruby_prof/rp_profile.c +62 -77
- data/ext/ruby_prof/rp_profile.h +1 -0
- data/ext/ruby_prof/rp_thread.c +14 -4
- data/ext/ruby_prof/vc/ruby_prof.vcxproj +1 -1
- data/lib/ruby-prof/compatibility.rb +14 -0
- data/lib/ruby-prof/printers/abstract_printer.rb +1 -1
- data/lib/ruby-prof/printers/call_tree_printer.rb +1 -1
- data/lib/ruby-prof/printers/multi_printer.rb +17 -17
- data/lib/ruby-prof/profile.rb +5 -5
- data/lib/ruby-prof/rack.rb +31 -21
- data/lib/ruby-prof/version.rb +1 -1
- data/test/abstract_printer_test.rb +1 -0
- data/test/alias_test.rb +6 -11
- data/test/call_tree_visitor_test.rb +1 -6
- data/test/call_trees_test.rb +2 -2
- data/test/{basic_test.rb → compatibility_test.rb} +8 -2
- data/test/duplicate_names_test.rb +1 -1
- data/test/dynamic_method_test.rb +1 -6
- data/test/enumerable_test.rb +1 -1
- data/test/exceptions_test.rb +2 -2
- data/test/exclude_methods_test.rb +3 -8
- data/test/exclude_threads_test.rb +4 -9
- data/test/fiber_test.rb +4 -9
- data/test/gc_test.rb +2 -1
- data/test/inverse_call_tree_test.rb +33 -34
- data/test/line_number_test.rb +1 -1
- data/test/marshal_test.rb +3 -3
- data/test/measure_allocations_test.rb +8 -17
- data/test/measure_memory_test.rb +3 -12
- data/test/measure_process_time_test.rb +29 -34
- data/test/measure_wall_time_test.rb +176 -181
- data/test/multi_printer_test.rb +0 -5
- data/test/no_method_class_test.rb +1 -1
- data/test/pause_resume_test.rb +12 -16
- data/test/printer_call_stack_test.rb +2 -2
- data/test/printer_call_tree_test.rb +2 -2
- data/test/printer_flat_test.rb +1 -1
- data/test/printer_graph_html_test.rb +2 -2
- data/test/printer_graph_test.rb +2 -2
- data/test/printers_test.rb +14 -20
- data/test/printing_recursive_graph_test.rb +2 -2
- data/test/recursive_test.rb +2 -7
- data/test/singleton_test.rb +1 -1
- data/test/stack_printer_test.rb +5 -8
- data/test/start_stop_test.rb +11 -14
- data/test/thread_test.rb +13 -15
- data/test/unique_call_path_test.rb +4 -4
- data/test/yarv_test.rb +3 -3
- metadata +4 -4
| @@ -6,20 +6,15 @@ require_relative './measure_times' | |
| 6 6 |  | 
| 7 7 | 
             
            class MeasureProcessTimeTest < TestCase
         | 
| 8 8 | 
             
              def setup
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                RubyProf::measure_mode = RubyProf::PROCESS_TIME
         | 
| 9 | 
            +
                super
         | 
| 11 10 | 
             
                GC.start
         | 
| 12 11 | 
             
              end
         | 
| 13 12 |  | 
| 14 | 
            -
              def test_mode
         | 
| 15 | 
            -
                assert_equal(RubyProf::PROCESS_TIME, RubyProf::measure_mode)
         | 
| 16 | 
            -
              end
         | 
| 17 | 
            -
             | 
| 18 13 | 
             
              # These tests run to fast for Windows to detect any used process time
         | 
| 19 14 | 
             
              if !windows?
         | 
| 20 15 | 
             
                if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1')
         | 
| 21 16 | 
             
                  def test_class_methods_sleep
         | 
| 22 | 
            -
                    result = RubyProf.profile do
         | 
| 17 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 23 18 | 
             
                      RubyProf::C1.sleep_wait
         | 
| 24 19 | 
             
                    end
         | 
| 25 20 |  | 
| @@ -53,7 +48,7 @@ class MeasureProcessTimeTest < TestCase | |
| 53 48 | 
             
                  end
         | 
| 54 49 |  | 
| 55 50 | 
             
                  def test_class_methods_sleep_threaded
         | 
| 56 | 
            -
                    result = RubyProf.profile do
         | 
| 51 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 57 52 | 
             
                      background_thread = Thread.new do
         | 
| 58 53 | 
             
                        RubyProf::C1.sleep_wait
         | 
| 59 54 | 
             
                      end
         | 
| @@ -130,7 +125,7 @@ class MeasureProcessTimeTest < TestCase | |
| 130 125 | 
             
                  end
         | 
| 131 126 |  | 
| 132 127 | 
             
                  def test_class_methods_busy
         | 
| 133 | 
            -
                    result = RubyProf.profile do
         | 
| 128 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 134 129 | 
             
                      RubyProf::C1.busy_wait
         | 
| 135 130 | 
             
                    end
         | 
| 136 131 |  | 
| @@ -164,7 +159,7 @@ class MeasureProcessTimeTest < TestCase | |
| 164 159 | 
             
                  end
         | 
| 165 160 |  | 
| 166 161 | 
             
                  def test_class_methods_busy_threaded
         | 
| 167 | 
            -
                    result = RubyProf.profile do
         | 
| 162 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 168 163 | 
             
                      background_thread = Thread.new do
         | 
| 169 164 | 
             
                        RubyProf::C1.busy_wait
         | 
| 170 165 | 
             
                      end
         | 
| @@ -241,7 +236,7 @@ class MeasureProcessTimeTest < TestCase | |
| 241 236 | 
             
                  end
         | 
| 242 237 |  | 
| 243 238 | 
             
                  def test_instance_methods_sleep
         | 
| 244 | 
            -
                    result = RubyProf.profile do
         | 
| 239 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 245 240 | 
             
                      RubyProf::C1.new.sleep_wait
         | 
| 246 241 | 
             
                    end
         | 
| 247 242 |  | 
| @@ -289,7 +284,7 @@ class MeasureProcessTimeTest < TestCase | |
| 289 284 | 
             
                  end
         | 
| 290 285 |  | 
| 291 286 | 
             
                  def test_instance_methods_sleep_block
         | 
| 292 | 
            -
                    result = RubyProf.profile do
         | 
| 287 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 293 288 | 
             
                      1.times { RubyProf::C1.new.sleep_wait }
         | 
| 294 289 | 
             
                    end
         | 
| 295 290 |  | 
| @@ -341,7 +336,7 @@ class MeasureProcessTimeTest < TestCase | |
| 341 336 | 
             
                  end
         | 
| 342 337 |  | 
| 343 338 | 
             
                  def test_instance_methods_sleep_threaded
         | 
| 344 | 
            -
                    result = RubyProf.profile do
         | 
| 339 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 345 340 | 
             
                      background_thread = Thread.new do
         | 
| 346 341 | 
             
                        RubyProf::C1.new.sleep_wait
         | 
| 347 342 | 
             
                      end
         | 
| @@ -432,7 +427,7 @@ class MeasureProcessTimeTest < TestCase | |
| 432 427 | 
             
                  end
         | 
| 433 428 |  | 
| 434 429 | 
             
                  def test_instance_methods_busy
         | 
| 435 | 
            -
                    result = RubyProf.profile do
         | 
| 430 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 436 431 | 
             
                      RubyProf::C1.new.busy_wait
         | 
| 437 432 | 
             
                    end
         | 
| 438 433 |  | 
| @@ -480,7 +475,7 @@ class MeasureProcessTimeTest < TestCase | |
| 480 475 | 
             
                  end
         | 
| 481 476 |  | 
| 482 477 | 
             
                  def test_instance_methods_busy_block
         | 
| 483 | 
            -
                    result = RubyProf.profile do
         | 
| 478 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 484 479 | 
             
                      1.times { RubyProf::C1.new.busy_wait }
         | 
| 485 480 | 
             
                    end
         | 
| 486 481 |  | 
| @@ -532,7 +527,7 @@ class MeasureProcessTimeTest < TestCase | |
| 532 527 | 
             
                  end
         | 
| 533 528 |  | 
| 534 529 | 
             
                  def test_instance_methods_busy_threaded
         | 
| 535 | 
            -
                    result = RubyProf.profile do
         | 
| 530 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 536 531 | 
             
                      background_thread = Thread.new do
         | 
| 537 532 | 
             
                        RubyProf::C1.new.busy_wait
         | 
| 538 533 | 
             
                      end
         | 
| @@ -623,7 +618,7 @@ class MeasureProcessTimeTest < TestCase | |
| 623 618 | 
             
                  end
         | 
| 624 619 |  | 
| 625 620 | 
             
                  def test_module_methods_sleep
         | 
| 626 | 
            -
                    result = RubyProf.profile do
         | 
| 621 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 627 622 | 
             
                      RubyProf::C2.sleep_wait
         | 
| 628 623 | 
             
                    end
         | 
| 629 624 |  | 
| @@ -657,7 +652,7 @@ class MeasureProcessTimeTest < TestCase | |
| 657 652 | 
             
                  end
         | 
| 658 653 |  | 
| 659 654 | 
             
                  def test_module_methods_busy
         | 
| 660 | 
            -
                    result = RubyProf.profile do
         | 
| 655 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 661 656 | 
             
                      RubyProf::C2.busy_wait
         | 
| 662 657 | 
             
                    end
         | 
| 663 658 |  | 
| @@ -691,7 +686,7 @@ class MeasureProcessTimeTest < TestCase | |
| 691 686 | 
             
                  end
         | 
| 692 687 |  | 
| 693 688 | 
             
                  def test_module_instance_methods_sleep
         | 
| 694 | 
            -
                    result = RubyProf.profile do
         | 
| 689 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 695 690 | 
             
                      RubyProf::C2.new.sleep_wait
         | 
| 696 691 | 
             
                    end
         | 
| 697 692 |  | 
| @@ -739,7 +734,7 @@ class MeasureProcessTimeTest < TestCase | |
| 739 734 | 
             
                  end
         | 
| 740 735 |  | 
| 741 736 | 
             
                  def test_module_instance_methods_busy
         | 
| 742 | 
            -
                    result = RubyProf.profile do
         | 
| 737 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 743 738 | 
             
                      RubyProf::C2.new.busy_wait
         | 
| 744 739 | 
             
                    end
         | 
| 745 740 |  | 
| @@ -787,7 +782,7 @@ class MeasureProcessTimeTest < TestCase | |
| 787 782 | 
             
                  end
         | 
| 788 783 | 
             
                else
         | 
| 789 784 | 
             
                  def test_class_methods_sleep
         | 
| 790 | 
            -
                    result = RubyProf.profile do
         | 
| 785 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 791 786 | 
             
                      RubyProf::C1.sleep_wait
         | 
| 792 787 | 
             
                    end
         | 
| 793 788 |  | 
| @@ -821,7 +816,7 @@ class MeasureProcessTimeTest < TestCase | |
| 821 816 | 
             
                  end
         | 
| 822 817 |  | 
| 823 818 | 
             
                  def test_class_methods_sleep_threaded
         | 
| 824 | 
            -
                    result = RubyProf.profile do
         | 
| 819 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 825 820 | 
             
                      background_thread = Thread.new do
         | 
| 826 821 | 
             
                        RubyProf::C1.sleep_wait
         | 
| 827 822 | 
             
                      end
         | 
| @@ -898,7 +893,7 @@ class MeasureProcessTimeTest < TestCase | |
| 898 893 | 
             
                  end
         | 
| 899 894 |  | 
| 900 895 | 
             
                  def test_class_methods_busy
         | 
| 901 | 
            -
                    result = RubyProf.profile do
         | 
| 896 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 902 897 | 
             
                      RubyProf::C1.busy_wait
         | 
| 903 898 | 
             
                    end
         | 
| 904 899 |  | 
| @@ -932,7 +927,7 @@ class MeasureProcessTimeTest < TestCase | |
| 932 927 | 
             
                  end
         | 
| 933 928 |  | 
| 934 929 | 
             
                  def test_class_methods_busy_threaded
         | 
| 935 | 
            -
                    result = RubyProf.profile do
         | 
| 930 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 936 931 | 
             
                      background_thread = Thread.new do
         | 
| 937 932 | 
             
                        RubyProf::C1.busy_wait
         | 
| 938 933 | 
             
                      end
         | 
| @@ -1009,7 +1004,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1009 1004 | 
             
                  end
         | 
| 1010 1005 |  | 
| 1011 1006 | 
             
                  def test_instance_methods_sleep
         | 
| 1012 | 
            -
                    result = RubyProf.profile do
         | 
| 1007 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1013 1008 | 
             
                      RubyProf::C1.new.sleep_wait
         | 
| 1014 1009 | 
             
                    end
         | 
| 1015 1010 |  | 
| @@ -1057,7 +1052,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1057 1052 | 
             
                  end
         | 
| 1058 1053 |  | 
| 1059 1054 | 
             
                  def test_instance_methods_sleep_block
         | 
| 1060 | 
            -
                    result = RubyProf.profile do
         | 
| 1055 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1061 1056 | 
             
                      1.times { RubyProf::C1.new.sleep_wait }
         | 
| 1062 1057 | 
             
                    end
         | 
| 1063 1058 |  | 
| @@ -1109,7 +1104,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1109 1104 | 
             
                  end
         | 
| 1110 1105 |  | 
| 1111 1106 | 
             
                  def test_instance_methods_sleep_threaded
         | 
| 1112 | 
            -
                    result = RubyProf.profile do
         | 
| 1107 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1113 1108 | 
             
                      background_thread = Thread.new do
         | 
| 1114 1109 | 
             
                        RubyProf::C1.new.sleep_wait
         | 
| 1115 1110 | 
             
                      end
         | 
| @@ -1200,7 +1195,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1200 1195 | 
             
                  end
         | 
| 1201 1196 |  | 
| 1202 1197 | 
             
                  def test_instance_methods_busy
         | 
| 1203 | 
            -
                    result = RubyProf.profile do
         | 
| 1198 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1204 1199 | 
             
                      RubyProf::C1.new.busy_wait
         | 
| 1205 1200 | 
             
                    end
         | 
| 1206 1201 |  | 
| @@ -1262,7 +1257,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1262 1257 | 
             
                  end
         | 
| 1263 1258 |  | 
| 1264 1259 | 
             
                  def test_instance_methods_busy_block
         | 
| 1265 | 
            -
                    result = RubyProf.profile do
         | 
| 1260 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1266 1261 | 
             
                      1.times { RubyProf::C1.new.busy_wait }
         | 
| 1267 1262 | 
             
                    end
         | 
| 1268 1263 |  | 
| @@ -1328,7 +1323,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1328 1323 | 
             
                  end
         | 
| 1329 1324 |  | 
| 1330 1325 | 
             
                  def test_instance_methods_busy_threaded
         | 
| 1331 | 
            -
                    result = RubyProf.profile do
         | 
| 1326 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1332 1327 | 
             
                      background_thread = Thread.new do
         | 
| 1333 1328 | 
             
                        RubyProf::C1.new.busy_wait
         | 
| 1334 1329 | 
             
                      end
         | 
| @@ -1433,7 +1428,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1433 1428 | 
             
                  end
         | 
| 1434 1429 |  | 
| 1435 1430 | 
             
                  def test_module_methods_sleep
         | 
| 1436 | 
            -
                    result = RubyProf.profile do
         | 
| 1431 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1437 1432 | 
             
                      RubyProf::C2.sleep_wait
         | 
| 1438 1433 | 
             
                    end
         | 
| 1439 1434 |  | 
| @@ -1467,7 +1462,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1467 1462 | 
             
                  end
         | 
| 1468 1463 |  | 
| 1469 1464 | 
             
                  def test_module_methods_busy
         | 
| 1470 | 
            -
                    result = RubyProf.profile do
         | 
| 1465 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1471 1466 | 
             
                      RubyProf::C2.busy_wait
         | 
| 1472 1467 | 
             
                    end
         | 
| 1473 1468 |  | 
| @@ -1501,7 +1496,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1501 1496 | 
             
                  end
         | 
| 1502 1497 |  | 
| 1503 1498 | 
             
                  def test_module_instance_methods_sleep
         | 
| 1504 | 
            -
                    result = RubyProf.profile do
         | 
| 1499 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1505 1500 | 
             
                      RubyProf::C2.new.sleep_wait
         | 
| 1506 1501 | 
             
                    end
         | 
| 1507 1502 |  | 
| @@ -1549,7 +1544,7 @@ class MeasureProcessTimeTest < TestCase | |
| 1549 1544 | 
             
                  end
         | 
| 1550 1545 |  | 
| 1551 1546 | 
             
                  def test_module_instance_methods_busy
         | 
| 1552 | 
            -
                    result = RubyProf.profile do
         | 
| 1547 | 
            +
                    result = RubyProf::Profile.profile(measure_mode: RubyProf::PROCESS_TIME) do
         | 
| 1553 1548 | 
             
                      RubyProf::C2.new.busy_wait
         | 
| 1554 1549 | 
             
                    end
         | 
| 1555 1550 |  |