perftools.rb 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ commit 4ba520684b8171488971ba2039730122a0bc7faf
2
+ Author: Aman Gupta <aman@tmm1.net>
3
+ Date: Mon Oct 26 16:10:31 2009 -0700
4
+
5
+ perftools
6
+
1
7
  diff --git a/Makefile.in b/Makefile.in
2
8
  index 232d2ec..566d77c 100644
3
9
  --- a/Makefile.in
@@ -43,7 +49,7 @@ index e658d30..370d012 100644
43
49
 
44
50
  ProfileHandlerToken* ProfileHandler::RegisterCallback(
45
51
  diff --git a/src/profiledata.cc b/src/profiledata.cc
46
- index 5f2531b..e6240d9 100644
52
+ index 5f2531b..ea95493 100644
47
53
  --- a/src/profiledata.cc
48
54
  +++ b/src/profiledata.cc
49
55
  @@ -56,6 +56,19 @@ const int ProfileData::kAssociativity;
@@ -122,14 +128,23 @@ index 5f2531b..e6240d9 100644
122
128
  start_time_ = time(NULL);
123
129
  fname_ = strdup(fname);
124
130
 
125
- @@ -166,16 +203,52 @@ void ProfileData::Stop() {
131
+ @@ -166,16 +203,61 @@ void ProfileData::Stop() {
126
132
  return;
127
133
  }
128
134
 
129
135
  +#ifdef BUILD_FOR_RUBY
130
136
  + FILE *symbols;
137
+ + int precision;
138
+ +
131
139
  + symbols = fopen(sym_fname_, "w");
132
- + fprintf(symbols, "%0*lx: garbage_collector\n", sizeof(unsigned long)*2, (ID)rb_gc);
140
+ + if (!symbols) {
141
+ + fprintf(stderr, "PROFILER ERROR: Unable to open %s (%s)\n", sym_fname_, strerror(errno));
142
+ + Reset();
143
+ + return;
144
+ + }
145
+ +
146
+ + precision = sizeof(unsigned long)*2;
147
+ + fprintf(symbols, "%0*lx: garbage_collector\n", precision, (ID)rb_gc);
133
148
  +
134
149
  + std::set<ID> known_symbols;
135
150
  +#endif
@@ -152,7 +167,7 @@ index 5f2531b..e6240d9 100644
152
167
  + ID sym = self + klass + method; // unique identifer
153
168
  +
154
169
  + if (known_symbols.find(sym) == known_symbols.end()) {
155
- + fprintf(symbols, "%0*lx: ", sizeof(unsigned long)*2, sym);
170
+ + fprintf(symbols, "%0*lx: ", precision, sym);
156
171
  +
157
172
  + if (self) { // class method
158
173
  + fprintf(symbols, "%s.%s\n", rb_class2name(self), rb_id2name(method));
@@ -176,7 +191,7 @@ index 5f2531b..e6240d9 100644
176
191
  if (num_evicted_ + 3 > kBufferLength) {
177
192
  // Ensure there is enough room for end of data marker
178
193
  FlushEvicted();
179
- @@ -211,6 +279,10 @@ void ProfileData::Reset() {
194
+ @@ -211,6 +293,10 @@ void ProfileData::Reset() {
180
195
  num_evicted_ = 0;
181
196
  free(fname_);
182
197
  fname_ = 0;
data/perftools.rb.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'perftools.rb'
3
- s.version = '0.3.5'
4
- s.date = '2009-10-13'
3
+ s.version = '0.3.6'
4
+ s.date = '2009-10-26'
5
5
  s.rubyforge_project = 'perftools-rb'
6
6
  s.summary = 'google-perftools for ruby code'
7
7
  s.description = 'A sampling profiler for ruby code based on patches to google-perftools'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perftools.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aman Gupta
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-13 00:00:00 -07:00
12
+ date: 2009-10-26 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements: []
60
60
 
61
61
  rubyforge_project: perftools-rb
62
- rubygems_version: 1.3.5
62
+ rubygems_version: 1.3.4
63
63
  signing_key:
64
64
  specification_version: 3
65
65
  summary: google-perftools for ruby code