rbtrace 0.3.11 → 0.3.12

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.
data/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbtrace (0.3.11)
5
- ffi (>= 1.0.5)
4
+ rbtrace (0.3.12)
5
+ ffi (>= 1.0.6)
6
6
  msgpack (>= 0.4.3)
7
7
  trollop (>= 1.16.2)
8
8
 
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- ffi (1.0.5)
12
+ ffi (1.0.6)
13
13
  rake (>= 0.8.7)
14
14
  msgpack (0.4.4)
15
15
  rake (0.8.7)
data/bin/rbtrace CHANGED
@@ -585,6 +585,7 @@ class RBTracer
585
585
  print name
586
586
  end
587
587
  print ' <%f>' % (diff/1_000_000.0) if @show_duration
588
+ newline
588
589
 
589
590
  if @nesting == 0 and @max_nesting > 1
590
591
  # unless tracer == @last_tracer and @last_tracer[:last] == name
@@ -653,7 +654,7 @@ class RBTracer
653
654
  parser = Trollop::Parser.new do
654
655
  version <<-EOS
655
656
  rbtrace: like strace, but for ruby code
656
- version 0.3.11
657
+ version 0.3.12
657
658
  (c) 2011 Aman Gupta (tmm1)
658
659
  http://github.com/tmm1/rbtrace
659
660
  EOS
data/ext/extconf.rb CHANGED
@@ -29,6 +29,9 @@ unless File.exists?("#{CWD}/dst/lib/libmsgpackc.a")
29
29
 
30
30
  sys("tar zxvf #{msgpack}")
31
31
  Dir.chdir(dir) do
32
+ if RUBY_PLATFORM =~ /i686/ and gcc = `gcc -v 2>&1` and gcc =~ /gcc version 4\.1/
33
+ ENV['CFLAGS'] += " -march=i686 "
34
+ end
32
35
  sys("./configure --disable-dependency-tracking --disable-shared --disable-cxx --with-pic --prefix=#{CWD}/dst/")
33
36
  sys("make install")
34
37
  end
data/ext/rbtrace.c CHANGED
@@ -13,6 +13,7 @@
13
13
  #include <sys/msg.h>
14
14
  #include <sys/time.h>
15
15
  #include <sys/types.h>
16
+ #include <sys/wait.h>
16
17
  #include <time.h>
17
18
  #include <unistd.h>
18
19
 
@@ -191,7 +192,7 @@ rbtrace__send_event(int nargs, const char *name, ...)
191
192
  msgpack_pack_unsigned_long(pk, ulong);
192
193
  break;
193
194
 
194
- case 't': // unsigned long long (timestamps)
195
+ case 't': // uint64 (timestamps)
195
196
  uint64 = va_arg(ap, uint64_t);
196
197
  msgpack_pack_uint64(pk, uint64);
197
198
  break;
@@ -210,7 +211,7 @@ rbtrace__send_event(int nargs, const char *name, ...)
210
211
  break;
211
212
 
212
213
  default:
213
- fprintf(stderr, "unknown type (%c) passed to rbtrace__send_event\n", (char)type);
214
+ fprintf(stderr, "unknown type (%d) passed to rbtrace__send_event for %s\n", (int)type, name);
214
215
  }
215
216
  }
216
217
 
@@ -221,7 +222,7 @@ rbtrace__send_event(int nargs, const char *name, ...)
221
222
  msg.mtype = 1;
222
223
 
223
224
  if (rbtracer.sbuf->size > sizeof(msg.buf)) {
224
- fprintf(stderr, "rbtrace__send_event(): message is too large (%zd > %lu)\n", rbtracer.sbuf->size, sizeof(msg.buf));
225
+ fprintf(stderr, "rbtrace__send_event(): message is too large (%zd > %zu)\n", rbtracer.sbuf->size, sizeof(msg.buf));
225
226
  return;
226
227
  }
227
228
 
@@ -403,7 +404,7 @@ event_hook(rb_event_t event, NODE *node, VALUE self, ID mid, VALUE klass)
403
404
  rbtrace__send_event(6,
404
405
  event == RUBY_EVENT_RETURN ? "slow" : "cslow",
405
406
  't', rbtracer.call_times[ rbtracer.num_calls ],
406
- 'u', diff,
407
+ 't', diff,
407
408
  'u', rbtracer.num_calls,
408
409
  'l', mid,
409
410
  'b', singleton,
@@ -448,7 +449,7 @@ event_hook(rb_event_t event, NODE *node, VALUE self, ID mid, VALUE klass)
448
449
  val = rb_inspect(rb_ivar_get(self, rb_intern(expr)));
449
450
 
450
451
  } else {
451
- snprintf(buffer, len+150, "(begin; ObjectSpace._id2ref(%p >> 1).instance_eval{ %s }; rescue Exception => e; e; end).inspect", (void*)self, expr);
452
+ snprintf(buffer, len+150, "(begin; ObjectSpace._id2ref(%ld).instance_eval{ %s }; rescue Exception => e; e; end).inspect", NUM2LONG(rb_obj_id(self)), expr);
452
453
  val = rb_eval_string_protect(buffer, 0);
453
454
  }
454
455
 
data/rbtrace.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rbtrace'
3
- s.version = '0.3.11'
3
+ s.version = '0.3.12'
4
4
  s.homepage = 'http://github.com/tmm1/rbtrace'
5
5
 
6
6
  s.authors = 'Aman Gupta'
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.bindir = 'bin'
13
13
  s.executables << 'rbtrace'
14
14
 
15
- s.add_dependency 'ffi', '>= 1.0.5'
15
+ s.add_dependency 'ffi', '>= 1.0.6'
16
16
  s.add_dependency 'trollop', '>= 1.16.2'
17
17
  s.add_dependency 'msgpack', '>= 0.4.3'
18
18
 
data/test.sh CHANGED
@@ -13,7 +13,7 @@ export RUBYOPT="-I."
13
13
  ruby server.rb &
14
14
  export PID=$!
15
15
 
16
- trap cleanup SIGINT SIGTERM
16
+ trap cleanup INT TERM
17
17
  cleanup() {
18
18
  kill $PID
19
19
  wait $PID || true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbtrace
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 11
10
- version: 0.3.11
9
+ - 12
10
+ version: 0.3.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aman Gupta
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-01 00:00:00 -08:00
18
+ date: 2011-03-05 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 29
29
+ hash: 27
30
30
  segments:
31
31
  - 1
32
32
  - 0
33
- - 5
34
- version: 1.0.5
33
+ - 6
34
+ version: 1.0.6
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency