ruby-prof 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,10 @@
1
+ 0.7.2 (2008-12-08)
2
+ ========================
3
+ * Fixed major bug in printing child methods in graph reports.
4
+
5
+ * Fixes for supporting x86_64 machines (Diego Pettenò)
6
+
7
+
1
8
  0.7.1 (2008-11-28)
2
9
  ========================
3
10
  * Added new AggregateCallInfo class for printers to
@@ -37,9 +37,9 @@ static prof_measure_t
37
37
  measure_cpu_time()
38
38
  {
39
39
  #if defined(__i386__) || defined(__x86_64__)
40
- unsigned long long x;
41
- __asm__ __volatile__ ("rdtsc" : "=A" (x));
42
- return x;
40
+ uint32_t a, d;
41
+ __asm__ volatile("rdtsc" : "=a" (a), "=d" (d));
42
+ return ((uint64_t)d << 32) + a;
43
43
  #elif defined(__powerpc__) || defined(__ppc__)
44
44
  unsigned long long x, y;
45
45
 
data/ext/version.h CHANGED
@@ -1,4 +1,4 @@
1
- #define RUBY_PROF_VERSION "0.7.1"
1
+ #define RUBY_PROF_VERSION "0.7.2"
2
2
  #define RUBY_PROF_VERSION_MAJ 0
3
3
  #define RUBY_PROF_VERSION_MIN 7
4
- #define RUBY_PROF_VERSION_MIC 1
4
+ #define RUBY_PROF_VERSION_MIC 2
@@ -55,8 +55,8 @@ module RubyProf
55
55
  def aggregate(method_name)
56
56
  self.call_infos.inject(0) do |sum, call_info|
57
57
  sum += call_info.send(method_name)
58
+ sum
58
59
  end
59
60
  end
60
-
61
61
  end
62
62
  end
@@ -79,22 +79,22 @@ module RubyProf
79
79
  end
80
80
 
81
81
  def aggregate_parents
82
- aggregate_call_infos(self.call_infos)
83
- end
84
-
85
- def aggregate_children
86
- aggregate_call_infos(self.children)
87
- end
82
+ # Group call info's based on their parents
83
+ groups = self.call_infos.inject(Hash.new) do |hash, call_info|
84
+ key = call_info.parent ? call_info.parent.target : self
85
+ (hash[key] ||= []) << call_info
86
+ hash
87
+ end
88
88
 
89
- def to_s
90
- full_name
89
+ groups.map do |key, value|
90
+ AggregateCallInfo.new(value)
91
+ end
91
92
  end
92
93
 
93
- private
94
-
95
- def aggregate_call_infos(call_infos)
96
- groups = call_infos.inject(Hash.new) do |hash, call_info|
97
- key = call_info.parent ? call_info.parent.target : self
94
+ def aggregate_children
95
+ # Group call info's based on their targets
96
+ groups = self.children.inject(Hash.new) do |hash, call_info|
97
+ key = call_info.target
98
98
  (hash[key] ||= []) << call_info
99
99
  hash
100
100
  end
@@ -103,5 +103,9 @@ module RubyProf
103
103
  AggregateCallInfo.new(value)
104
104
  end
105
105
  end
106
+
107
+ def to_s
108
+ full_name
109
+ end
106
110
  end
107
111
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda and Charlie Savage
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-30 00:00:00 -07:00
12
+ date: 2008-12-08 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -55,7 +55,6 @@ files:
55
55
  - lib/ruby-prof/flat_printer.rb
56
56
  - lib/ruby-prof/graph_html_printer.rb
57
57
  - lib/ruby-prof/graph_printer.rb
58
- - lib/ruby-prof/group_by.rb
59
58
  - lib/ruby-prof/method_info.rb
60
59
  - lib/ruby-prof/task.rb
61
60
  - lib/ruby-prof/test.rb
@@ -1,10 +0,0 @@
1
- unless Enumerable.method_defined?(:group_by)
2
- module Enumerable
3
- def group_by
4
- inject(Hash.new) do |result, element|
5
- (result[yield(element)] ||= []) << element
6
- result
7
- end
8
- end
9
- end
10
- end