ruby-prof 1.1.0-x64-mingw32 → 1.3.0-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +19 -1
  3. data/bin/ruby-prof +100 -152
  4. data/ext/ruby_prof/rp_aggregate_call_tree.c +59 -0
  5. data/ext/ruby_prof/rp_aggregate_call_tree.h +13 -0
  6. data/ext/ruby_prof/rp_allocation.c +67 -59
  7. data/ext/ruby_prof/rp_allocation.h +3 -3
  8. data/ext/ruby_prof/rp_call_tree.c +369 -0
  9. data/ext/ruby_prof/rp_call_tree.h +43 -0
  10. data/ext/ruby_prof/rp_call_trees.c +288 -0
  11. data/ext/ruby_prof/rp_call_trees.h +28 -0
  12. data/ext/ruby_prof/rp_measure_allocations.c +11 -13
  13. data/ext/ruby_prof/rp_measure_process_time.c +11 -13
  14. data/ext/ruby_prof/rp_measure_wall_time.c +17 -15
  15. data/ext/ruby_prof/rp_measurement.c +47 -40
  16. data/ext/ruby_prof/rp_measurement.h +7 -7
  17. data/ext/ruby_prof/rp_method.c +116 -255
  18. data/ext/ruby_prof/rp_method.h +31 -39
  19. data/ext/ruby_prof/rp_profile.c +311 -281
  20. data/ext/ruby_prof/rp_profile.h +1 -2
  21. data/ext/ruby_prof/rp_stack.c +113 -105
  22. data/ext/ruby_prof/rp_stack.h +17 -20
  23. data/ext/ruby_prof/rp_thread.c +136 -111
  24. data/ext/ruby_prof/rp_thread.h +12 -9
  25. data/ext/ruby_prof/ruby_prof.c +27 -23
  26. data/ext/ruby_prof/ruby_prof.h +9 -0
  27. data/ext/ruby_prof/vc/ruby_prof.vcxproj +11 -7
  28. data/lib/ruby-prof.rb +2 -3
  29. data/lib/ruby-prof/assets/call_stack_printer.html.erb +4 -7
  30. data/lib/ruby-prof/assets/graph_printer.html.erb +5 -6
  31. data/lib/ruby-prof/{call_info.rb → call_tree.rb} +6 -6
  32. data/lib/ruby-prof/call_tree_visitor.rb +36 -0
  33. data/lib/ruby-prof/measurement.rb +5 -2
  34. data/lib/ruby-prof/method_info.rb +3 -15
  35. data/lib/ruby-prof/printers/call_info_printer.rb +12 -10
  36. data/lib/ruby-prof/printers/call_stack_printer.rb +19 -22
  37. data/lib/ruby-prof/printers/call_tree_printer.rb +1 -1
  38. data/lib/ruby-prof/printers/dot_printer.rb +3 -3
  39. data/lib/ruby-prof/printers/graph_printer.rb +3 -4
  40. data/lib/ruby-prof/printers/multi_printer.rb +2 -2
  41. data/lib/ruby-prof/rack.rb +3 -0
  42. data/lib/ruby-prof/thread.rb +3 -18
  43. data/lib/ruby-prof/version.rb +1 -1
  44. data/ruby-prof.gemspec +7 -0
  45. data/test/alias_test.rb +42 -45
  46. data/test/basic_test.rb +0 -86
  47. data/test/{call_info_visitor_test.rb → call_tree_visitor_test.rb} +6 -5
  48. data/test/call_trees_test.rb +66 -0
  49. data/test/exclude_methods_test.rb +17 -12
  50. data/test/fiber_test.rb +197 -9
  51. data/test/gc_test.rb +36 -42
  52. data/test/inverse_call_tree_test.rb +175 -0
  53. data/test/line_number_test.rb +67 -70
  54. data/test/marshal_test.rb +7 -11
  55. data/test/measure_allocations_test.rb +224 -234
  56. data/test/measure_allocations_trace_test.rb +224 -234
  57. data/test/measure_memory_trace_test.rb +814 -469
  58. data/test/measure_process_time_test.rb +0 -64
  59. data/test/measure_times.rb +2 -0
  60. data/test/measure_wall_time_test.rb +34 -58
  61. data/test/pause_resume_test.rb +19 -10
  62. data/test/prime.rb +1 -3
  63. data/test/prime_script.rb +6 -0
  64. data/test/printers_test.rb +1 -1
  65. data/test/recursive_test.rb +50 -54
  66. data/test/start_stop_test.rb +19 -19
  67. data/test/test_helper.rb +3 -15
  68. data/test/thread_test.rb +11 -11
  69. data/test/unique_call_path_test.rb +25 -95
  70. metadata +19 -10
  71. data/ext/ruby_prof/rp_call_info.c +0 -271
  72. data/ext/ruby_prof/rp_call_info.h +0 -35
  73. data/lib/2.6.5/ruby_prof.so +0 -0
  74. data/lib/ruby-prof/call_info_visitor.rb +0 -38
  75. data/test/parser_timings.rb +0 -24
@@ -1,35 +0,0 @@
1
- /* Copyright (C) 2005-2019 Shugo Maeda <shugo@ruby-lang.org> and Charlie Savage <cfis@savagexi.com>
2
- Please see the LICENSE file for copyright and distribution information */
3
-
4
- #ifndef __RP_CALL_INFO_H__
5
- #define __RP_CALL_INFO_H__
6
-
7
- #include "ruby_prof.h"
8
- #include "rp_measurement.h"
9
- #include "rp_method.h"
10
-
11
- /* Callers and callee information for a method. */
12
- typedef struct prof_call_info_t
13
- {
14
- prof_method_t *method;
15
- prof_method_t *parent;
16
- prof_measurement_t *measurement;
17
- VALUE object;
18
-
19
- int visits; /* Current visits on the stack */
20
-
21
- unsigned int depth;
22
- unsigned int source_line;
23
- VALUE source_file;
24
- } prof_call_info_t;
25
-
26
- prof_call_info_t *prof_call_info_create(prof_method_t *method, prof_method_t *parent, VALUE source_file, int source_line);
27
- void prof_call_info_mark(void *data);
28
- prof_call_info_t *call_info_table_lookup(st_table* table, st_data_t key);
29
- size_t call_info_table_insert(st_table *table, st_data_t key, prof_call_info_t *val);
30
- prof_call_info_t *prof_get_call_info(VALUE self);
31
- VALUE prof_call_info_wrap(prof_call_info_t* call_info);
32
- void prof_call_info_free(prof_call_info_t* call_info);
33
- void rp_init_call_info(void);
34
-
35
- #endif //__RP_CALL_INFO_H__
Binary file
@@ -1,38 +0,0 @@
1
- module RubyProf
2
- # The call info visitor class does a depth-first traversal across a
3
- # list of method infos. At each call_info node, the visitor executes
4
- # the block provided in the #visit method. The block is passed two
5
- # parameters, the event and the call_info instance. Event will be
6
- # either :enter or :exit.
7
- #
8
- # visitor = RubyProf::CallInfoVisitor.new(result.threads.first.root_methods)
9
- #
10
- # method_names = Array.new
11
- #
12
- # visitor.visit do |call_info, event|
13
- # method_names << call_info.target.full_name if event == :enter
14
- # end
15
- #
16
- # puts method_names
17
- class CallInfoVisitor
18
- def initialize(root_methods)
19
- @call_infos = root_methods.map(&:callers).flatten
20
- end
21
-
22
- def visit(&block)
23
- @call_infos.each do |call_info|
24
- visit_call_info(call_info, &block)
25
- end
26
- end
27
-
28
- private
29
-
30
- def visit_call_info(call_info, &block)
31
- yield call_info, :enter
32
- call_info.target.callees.each do |child|
33
- visit_call_info(child, &block)
34
- end
35
- yield call_info, :exit
36
- end
37
- end
38
- end
@@ -1,24 +0,0 @@
1
- require File.expand_path('../test_helper', __FILE__)
2
-
3
- require 'ruby-prof'
4
-
5
- require 'parser/current'
6
- Parser::Builders::Default.emit_lambda = true
7
- Parser::Builders::Default.emit_procarg0 = true
8
- Parser::Builders::Default.emit_encoding = true
9
- Parser::Builders::Default.emit_index = true
10
-
11
- start = Time.now
12
- result = RubyProf.profile(:measure_mode => RubyProf::ALLOCATIONS, :track_allocations => true) do
13
- code = File.read('C:/msys64/usr/local/src/ruby-2.6.3/lib/rdoc/markdown.rb')
14
- parse = Parser::CurrentRuby.parse(code)
15
- end
16
-
17
- finish = Time.now
18
-
19
- puts "#{finish - start} seconds"
20
-
21
- printer = RubyProf::GraphHtmlPrinter.new(result)
22
- File.open('c:/temp/graph.html', 'wb') do |file|
23
- printer.print(file)
24
- end