ruby-prof 1.6.3-x64-mingw-ucrt → 1.7.0-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +7 -0
  3. data/ext/ruby_prof/rp_allocation.c +342 -342
  4. data/ext/ruby_prof/rp_call_tree.c +1 -1
  5. data/ext/ruby_prof/rp_call_tree.h +1 -1
  6. data/ext/ruby_prof/rp_call_trees.c +2 -2
  7. data/ext/ruby_prof/rp_call_trees.h +2 -2
  8. data/ext/ruby_prof/rp_measure_allocations.c +1 -1
  9. data/ext/ruby_prof/rp_measure_memory.c +46 -46
  10. data/ext/ruby_prof/rp_measure_process_time.c +1 -1
  11. data/ext/ruby_prof/rp_measure_wall_time.c +1 -1
  12. data/ext/ruby_prof/rp_measurement.c +364 -364
  13. data/ext/ruby_prof/rp_method.c +24 -12
  14. data/ext/ruby_prof/rp_method.h +5 -2
  15. data/ext/ruby_prof/rp_profile.c +2 -2
  16. data/ext/ruby_prof/rp_profile.h +36 -36
  17. data/ext/ruby_prof/rp_stack.c +1 -1
  18. data/ext/ruby_prof/rp_thread.c +1 -1
  19. data/ext/ruby_prof/ruby_prof.c +1 -1
  20. data/ext/ruby_prof/ruby_prof.h +34 -34
  21. data/ext/ruby_prof/vc/ruby_prof.vcxproj +5 -7
  22. data/lib/3.2/ruby_prof.so +0 -0
  23. data/lib/3.3/ruby_prof.so +0 -0
  24. data/lib/ruby-prof/compatibility.rb +10 -10
  25. data/lib/ruby-prof/exclude_common_methods.rb +9 -3
  26. data/lib/ruby-prof/method_info.rb +87 -85
  27. data/lib/ruby-prof/version.rb +1 -1
  28. data/ruby-prof.gemspec +1 -1
  29. data/test/crash2.rb +144 -0
  30. data/test/enumerable_test.rb +5 -5
  31. data/test/exclude_methods_test.rb +197 -86
  32. data/test/line_number_test.rb +254 -99
  33. data/test/measure_allocations_test.rb +422 -1
  34. data/test/measure_memory_test.rb +433 -1
  35. data/test/measure_process_time_test.rb +882 -15
  36. data/test/measure_wall_time_test.rb +195 -47
  37. data/test/method_info_test.rb +1 -1
  38. data/test/recursive_test.rb +198 -1
  39. data/test/thread_test.rb +0 -4
  40. metadata +7 -6
  41. data/lib/3.1/ruby_prof.so +0 -0
@@ -321,7 +321,7 @@ class MeasureAllocationsTest < TestCase
321
321
  assert_equal(0, call_tree.children_time)
322
322
 
323
323
  assert_equal(0, method.call_trees.callees.length)
324
- else
324
+ elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.3')
325
325
  assert_equal(13, methods.length)
326
326
 
327
327
  # Method 0
@@ -654,6 +654,427 @@ class MeasureAllocationsTest < TestCase
654
654
  assert_equal(0, call_tree.self_time)
655
655
  assert_equal(0, call_tree.children_time)
656
656
 
657
+ assert_equal(0, method.call_trees.callees.length)
658
+ else
659
+ assert_equal(17, methods.length)
660
+
661
+ # Method 0
662
+ method = methods[0]
663
+ assert_equal('MeasureAllocationsTest#test_allocations', method.full_name)
664
+ assert_in_delta(20, method.total_time, 1)
665
+ assert_equal(0, method.wait_time)
666
+ assert_equal(0, method.self_time)
667
+ assert_in_delta(20, method.children_time, 1)
668
+
669
+ assert_equal(0, method.call_trees.callers.length)
670
+
671
+ assert_equal(2, method.call_trees.callees.length)
672
+ call_tree = method.call_trees.callees[0]
673
+ assert_equal('Class#new', call_tree.target.full_name)
674
+ assert_equal(1, call_tree.total_time)
675
+ assert_equal(0, call_tree.wait_time)
676
+ assert_equal(1, call_tree.self_time)
677
+ assert_equal(0, call_tree.children_time)
678
+
679
+ call_tree = method.call_trees.callees[1]
680
+ assert_equal('Allocator#run', call_tree.target.full_name)
681
+ assert_equal(19, call_tree.total_time)
682
+ assert_equal(0, call_tree.wait_time)
683
+ assert_equal(0, call_tree.self_time)
684
+ assert_equal(19, call_tree.children_time)
685
+
686
+ # Method 1
687
+ method = methods[1]
688
+ assert_equal('Allocator#run',method.full_name)
689
+ assert_equal(19, method.total_time)
690
+ assert_equal(0, method.wait_time)
691
+ assert_equal(0, method.self_time)
692
+ assert_equal(19, method.children_time)
693
+
694
+ assert_equal(1, method.call_trees.callers.length)
695
+ call_tree = method.call_trees.callers[0]
696
+ assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
697
+ assert_equal(19, call_tree.total_time)
698
+ assert_equal(0, call_tree.wait_time)
699
+ assert_equal(0, call_tree.self_time)
700
+ assert_equal(19, call_tree.children_time)
701
+
702
+ assert_equal(3, method.call_trees.callees.length)
703
+ call_tree = method.call_trees.callees[0]
704
+ assert_equal('Allocator#make_arrays', call_tree.target.full_name)
705
+ assert_equal(10, call_tree.total_time)
706
+ assert_equal(0, call_tree.wait_time)
707
+ assert_equal(0, call_tree.self_time)
708
+ assert_equal(10, call_tree.children_time)
709
+
710
+ call_tree = method.call_trees.callees[1]
711
+ assert_equal('Allocator#make_hashes', call_tree.target.full_name)
712
+ assert_equal(5, call_tree.total_time)
713
+ assert_equal(0, call_tree.wait_time)
714
+ assert_equal(0, call_tree.self_time)
715
+ assert_equal(5, call_tree.children_time)
716
+
717
+ call_tree = method.call_trees.callees[2]
718
+ assert_equal('Allocator#make_strings', call_tree.target.full_name)
719
+ assert_equal(4, call_tree.total_time)
720
+ assert_equal(0, call_tree.wait_time)
721
+ assert_equal(1, call_tree.self_time)
722
+ assert_equal(3, call_tree.children_time)
723
+
724
+ # Method 2
725
+ method = methods[2]
726
+ assert_equal('Allocator#make_arrays', method.full_name)
727
+ assert_equal(10, method.total_time)
728
+ assert_equal(0, method.wait_time)
729
+ assert_equal(0, method.self_time)
730
+ assert_equal(10, method.children_time)
731
+
732
+ assert_equal(1, method.call_trees.callers.length)
733
+ call_tree = method.call_trees.callers[0]
734
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
735
+ assert_equal(10, call_tree.total_time)
736
+ assert_equal(0, call_tree.wait_time)
737
+ assert_equal(0, call_tree.self_time)
738
+ assert_equal(10, call_tree.children_time)
739
+
740
+ assert_equal(1, method.call_trees.callees.length)
741
+ call_tree = method.call_trees.callees[0]
742
+ assert_equal('Integer#times', call_tree.target.full_name)
743
+ assert_equal(10, call_tree.total_time)
744
+ assert_equal(0, call_tree.wait_time)
745
+ assert_equal(0, call_tree.self_time)
746
+ assert_equal(10, call_tree.children_time)
747
+
748
+ # Method 3
749
+ method = methods[3]
750
+ assert_equal('Integer#times', method.full_name)
751
+ assert_equal(10, method.total_time)
752
+ assert_equal(0, method.wait_time)
753
+ assert_equal(0, method.self_time)
754
+ assert_equal(10, method.children_time)
755
+
756
+ assert_equal(1, method.call_trees.callers.length)
757
+ call_tree = method.call_trees.callers[0]
758
+ assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
759
+ assert_equal(10, call_tree.total_time)
760
+ assert_equal(0, call_tree.wait_time)
761
+ assert_equal(0, call_tree.self_time)
762
+ assert_equal(10, call_tree.children_time)
763
+
764
+ assert_equal(4, method.call_trees.callees.length)
765
+
766
+ call_tree = method.call_trees.callees[0]
767
+ assert_equal('Kernel#block_given?', call_tree.target.full_name)
768
+ assert_equal(0, call_tree.total_time)
769
+ assert_equal(0, call_tree.wait_time)
770
+ assert_equal(0, call_tree.self_time)
771
+ assert_equal(0, call_tree.children_time)
772
+
773
+ call_tree = method.call_trees.callees[1]
774
+ assert_equal('Integer#<', call_tree.target.full_name)
775
+ assert_equal(0, call_tree.total_time)
776
+ assert_equal(0, call_tree.wait_time)
777
+ assert_equal(0, call_tree.self_time)
778
+ assert_equal(0, call_tree.children_time)
779
+
780
+ call_tree = method.call_trees.callees[2]
781
+ assert_equal('<Class::Array>#new', call_tree.target.full_name)
782
+ assert_equal(10, call_tree.total_time)
783
+ assert_equal(0, call_tree.wait_time)
784
+ assert_equal(10, call_tree.self_time)
785
+ assert_equal(0, call_tree.children_time)
786
+
787
+ call_tree = method.call_trees.callees[3]
788
+ assert_equal('Integer#succ', call_tree.target.full_name)
789
+ assert_equal(0, call_tree.total_time)
790
+ assert_equal(0, call_tree.wait_time)
791
+ assert_equal(0, call_tree.self_time)
792
+ assert_equal(0, call_tree.children_time)
793
+
794
+ # Method 4
795
+ method = methods[4]
796
+ assert_equal('<Class::Array>#new', method.full_name)
797
+ assert_equal(10, method.total_time)
798
+ assert_equal(0, method.wait_time)
799
+ assert_equal(10, method.self_time)
800
+ assert_equal(0, method.children_time)
801
+
802
+ assert_equal(1, method.call_trees.callers.length)
803
+ call_tree = method.call_trees.callers[0]
804
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
805
+ assert_equal(10, call_tree.total_time)
806
+ assert_equal(0, call_tree.wait_time)
807
+ assert_equal(10, call_tree.self_time)
808
+ assert_equal(0, call_tree.children_time)
809
+
810
+ assert_equal(1, method.call_trees.callees.length)
811
+ call_tree = method.call_trees.callees[0]
812
+ assert_equal('Array#initialize', call_tree.target.full_name)
813
+ assert_equal(0, call_tree.total_time)
814
+ assert_equal(0, call_tree.wait_time)
815
+ assert_equal(0, call_tree.self_time)
816
+ assert_equal(0, call_tree.children_time)
817
+
818
+ # Method 5
819
+ method = methods[5]
820
+ assert_equal('Class#new', method.full_name)
821
+ assert_equal(6, method.total_time)
822
+ assert_equal(0, method.wait_time)
823
+ assert_equal(6, method.self_time)
824
+ assert_equal(0, method.children_time)
825
+
826
+ assert_equal(2, method.call_trees.callers.length)
827
+ call_tree = method.call_trees.callers[0]
828
+ assert_equal('MeasureAllocationsTest#test_allocations', call_tree.parent.target.full_name)
829
+ assert_equal(1, call_tree.total_time)
830
+ assert_equal(0, call_tree.wait_time)
831
+ assert_equal(1, call_tree.self_time)
832
+ assert_equal(0, call_tree.children_time)
833
+
834
+ call_tree = method.call_trees.callers[1]
835
+ assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
836
+ assert_equal(5, call_tree.total_time)
837
+ assert_equal(0, call_tree.wait_time)
838
+ assert_equal(5, call_tree.self_time)
839
+ assert_equal(0, call_tree.children_time)
840
+
841
+ assert_equal(2, method.call_trees.callees.length)
842
+ call_tree = method.call_trees.callees[0]
843
+ assert_equal('BasicObject#initialize', call_tree.target.full_name)
844
+ assert_equal(0, call_tree.total_time)
845
+ assert_equal(0, call_tree.wait_time)
846
+ assert_equal(0, call_tree.self_time)
847
+ assert_equal(0, call_tree.children_time)
848
+
849
+ call_tree = method.call_trees.callees[1]
850
+ assert_equal('Hash#initialize', call_tree.target.full_name)
851
+ assert_equal(0, call_tree.total_time)
852
+ assert_equal(0, call_tree.wait_time)
853
+ assert_equal(0, call_tree.self_time)
854
+ assert_equal(0, call_tree.children_time)
855
+
856
+ # Method 6
857
+ method = methods[6]
858
+ assert_equal('Allocator#make_hashes', method.full_name)
859
+ assert_equal(5, method.total_time)
860
+ assert_equal(0, method.wait_time)
861
+ assert_equal(0, method.self_time)
862
+ assert_equal(5, method.children_time)
863
+
864
+ assert_equal(1, method.call_trees.callers.length)
865
+ call_tree = method.call_trees.callers[0]
866
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
867
+ assert_equal(5, call_tree.total_time)
868
+ assert_equal(0, call_tree.wait_time)
869
+ assert_equal(0, call_tree.self_time)
870
+ assert_equal(5, call_tree.children_time)
871
+
872
+ assert_equal(1, method.call_trees.callees.length)
873
+ call_tree = method.call_trees.callees[0]
874
+ assert_equal('Class#new', call_tree.target.full_name)
875
+ assert_equal(5, call_tree.total_time)
876
+ assert_equal(0, call_tree.wait_time)
877
+ assert_equal(5, call_tree.self_time)
878
+ assert_equal(0, call_tree.children_time)
879
+
880
+ # Method 7
881
+ method = methods[7]
882
+ assert_equal('Allocator#make_strings', method.full_name)
883
+ assert_equal(4, method.total_time)
884
+ assert_equal(0, method.wait_time)
885
+ assert_equal(1, method.self_time)
886
+ assert_equal(3, method.children_time)
887
+
888
+ assert_equal(1, method.call_trees.callers.length)
889
+ call_tree = method.call_trees.callers[0]
890
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
891
+ assert_equal(4, call_tree.total_time)
892
+ assert_equal(0, call_tree.wait_time)
893
+ assert_equal(1, call_tree.self_time)
894
+ assert_equal(3, call_tree.children_time)
895
+
896
+ assert_equal(2, method.call_trees.callees.length)
897
+ call_tree = method.call_trees.callees[0]
898
+ assert_equal('String#*', call_tree.target.full_name)
899
+ assert_equal(1, call_tree.total_time)
900
+ assert_equal(0, call_tree.wait_time)
901
+ assert_equal(1, call_tree.self_time)
902
+ assert_equal(0, call_tree.children_time)
903
+
904
+ call_tree = method.call_trees.callees[1]
905
+ assert_equal('<Class::String>#new', call_tree.target.full_name)
906
+ assert_equal(2, call_tree.total_time)
907
+ assert_equal(0, call_tree.wait_time)
908
+ assert_equal(1, call_tree.self_time)
909
+ assert_equal(1, call_tree.children_time)
910
+
911
+ # Method 8
912
+ method = methods[8]
913
+ assert_equal('<Class::String>#new', method.full_name)
914
+ assert_equal(2, method.total_time)
915
+ assert_equal(0, method.wait_time)
916
+ assert_equal(1, method.self_time)
917
+ assert_equal(1, method.children_time)
918
+
919
+ assert_equal(1, method.call_trees.callers.length)
920
+ call_tree = method.call_trees.callers[0]
921
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
922
+ assert_equal(2, call_tree.total_time)
923
+ assert_equal(0, call_tree.wait_time)
924
+ assert_equal(1, call_tree.self_time)
925
+ assert_equal(1, call_tree.children_time)
926
+
927
+ assert_equal(1, method.call_trees.callees.length)
928
+
929
+ call_tree = method.call_trees.callees[0]
930
+ assert_equal('String#initialize', call_tree.target.full_name)
931
+ assert_equal(1, call_tree.total_time)
932
+ assert_equal(0, call_tree.wait_time)
933
+ assert_equal(1, call_tree.self_time)
934
+ assert_equal(0, call_tree.children_time)
935
+
936
+ # Method 9
937
+ method = methods[9]
938
+ assert_equal('String#*', method.full_name)
939
+ assert_equal(1, method.total_time)
940
+ assert_equal(0, method.wait_time)
941
+ assert_equal(1, method.self_time)
942
+ assert_equal(0, method.children_time)
943
+
944
+ assert_equal(1, method.call_trees.callers.length)
945
+ call_tree = method.call_trees.callers[0]
946
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
947
+ assert_equal(1, call_tree.total_time)
948
+ assert_equal(0, call_tree.wait_time)
949
+ assert_equal(1, call_tree.self_time)
950
+ assert_equal(0, call_tree.children_time)
951
+
952
+ assert_equal(0, method.call_trees.callees.length)
953
+
954
+ # Method 10
955
+ method = methods[10]
956
+ assert_equal('String#initialize', method.full_name)
957
+ assert_equal(1, method.total_time)
958
+ assert_equal(0, method.wait_time)
959
+ assert_equal(1, method.self_time)
960
+ assert_equal(0, method.children_time)
961
+
962
+ assert_equal(1, method.call_trees.callers.length)
963
+ call_tree = method.call_trees.callers[0]
964
+ assert_equal('<Class::String>#new', call_tree.parent.target.full_name)
965
+ assert_equal(1, call_tree.total_time)
966
+ assert_equal(0, call_tree.wait_time)
967
+ assert_equal(1, call_tree.self_time)
968
+ assert_equal(0, call_tree.children_time)
969
+
970
+ assert_equal(0, method.call_trees.callees.length)
971
+
972
+ # Method 11
973
+ method = methods[11]
974
+ assert_equal('BasicObject#initialize', method.full_name)
975
+ assert_equal(0, method.total_time)
976
+ assert_equal(0, method.wait_time)
977
+ assert_equal(0, method.self_time)
978
+ assert_equal(0, method.children_time)
979
+
980
+ assert_equal(1, method.call_trees.callers.length)
981
+ call_tree = method.call_trees.callers[0]
982
+ assert_equal('Class#new', call_tree.parent.target.full_name)
983
+ assert_equal(0, call_tree.total_time)
984
+ assert_equal(0, call_tree.wait_time)
985
+ assert_equal(0, call_tree.self_time)
986
+ assert_equal(0, call_tree.children_time)
987
+
988
+ assert_equal(0, method.call_trees.callees.length)
989
+
990
+ # Method 12
991
+ method = methods[12]
992
+ assert_equal('Kernel#block_given?', method.full_name)
993
+ assert_equal(0, method.total_time)
994
+ assert_equal(0, method.wait_time)
995
+ assert_equal(0, method.self_time)
996
+ assert_equal(0, method.children_time)
997
+
998
+ assert_equal(1, method.call_trees.callers.length)
999
+ call_tree = method.call_trees.callers[0]
1000
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
1001
+ assert_equal(0, call_tree.total_time)
1002
+ assert_equal(0, call_tree.wait_time)
1003
+ assert_equal(0, call_tree.self_time)
1004
+ assert_equal(0, call_tree.children_time)
1005
+
1006
+ assert_equal(0, method.call_trees.callees.length)
1007
+
1008
+ # Method 13
1009
+ method = methods[13]
1010
+ assert_equal('Integer#succ', method.full_name)
1011
+ assert_equal(0, method.total_time)
1012
+ assert_equal(0, method.wait_time)
1013
+ assert_equal(0, method.self_time)
1014
+ assert_equal(0, method.children_time)
1015
+
1016
+ assert_equal(1, method.call_trees.callers.length)
1017
+ call_tree = method.call_trees.callers[0]
1018
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
1019
+ assert_equal(0, call_tree.total_time)
1020
+ assert_equal(0, call_tree.wait_time)
1021
+ assert_equal(0, call_tree.self_time)
1022
+ assert_equal(0, call_tree.children_time)
1023
+
1024
+ assert_equal(0, method.call_trees.callees.length)
1025
+
1026
+ # Method 14
1027
+ method = methods[14]
1028
+ assert_equal('Integer#<', method.full_name)
1029
+ assert_equal(0, method.total_time)
1030
+ assert_equal(0, method.wait_time)
1031
+ assert_equal(0, method.self_time)
1032
+ assert_equal(0, method.children_time)
1033
+
1034
+ assert_equal(1, method.call_trees.callers.length)
1035
+ call_tree = method.call_trees.callers[0]
1036
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
1037
+ assert_equal(0, call_tree.total_time)
1038
+ assert_equal(0, call_tree.wait_time)
1039
+ assert_equal(0, call_tree.self_time)
1040
+ assert_equal(0, call_tree.children_time)
1041
+
1042
+ assert_equal(0, method.call_trees.callees.length)
1043
+
1044
+ # Method 15
1045
+ method = methods[15]
1046
+ assert_equal('Hash#initialize', method.full_name)
1047
+ assert_equal(0, method.total_time)
1048
+ assert_equal(0, method.wait_time)
1049
+ assert_equal(0, method.self_time)
1050
+ assert_equal(0, method.children_time)
1051
+
1052
+ assert_equal(1, method.call_trees.callers.length)
1053
+ call_tree = method.call_trees.callers[0]
1054
+ assert_equal('Class#new', call_tree.parent.target.full_name)
1055
+ assert_equal(0, call_tree.total_time)
1056
+ assert_equal(0, call_tree.wait_time)
1057
+ assert_equal(0, call_tree.self_time)
1058
+ assert_equal(0, call_tree.children_time)
1059
+
1060
+ assert_equal(0, method.call_trees.callees.length)
1061
+
1062
+ # Method 16
1063
+ method = methods[16]
1064
+ assert_equal('Array#initialize', method.full_name)
1065
+ assert_equal(0, method.total_time)
1066
+ assert_equal(0, method.wait_time)
1067
+ assert_equal(0, method.self_time)
1068
+ assert_equal(0, method.children_time)
1069
+
1070
+ assert_equal(1, method.call_trees.callers.length)
1071
+ call_tree = method.call_trees.callers[0]
1072
+ assert_equal('<Class::Array>#new', call_tree.parent.target.full_name)
1073
+ assert_equal(0, call_tree.total_time)
1074
+ assert_equal(0, call_tree.wait_time)
1075
+ assert_equal(0, call_tree.self_time)
1076
+ assert_equal(0, call_tree.children_time)
1077
+
657
1078
  assert_equal(0, method.call_trees.callees.length)
658
1079
  end
659
1080
  end