tmm1-perftools.rb 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. data/ext/perftools.c +8 -0
  2. data/perftools.rb.gemspec +1 -1
  3. metadata +1 -1
data/ext/perftools.c CHANGED
@@ -3,6 +3,7 @@
3
3
  #include <env.h>
4
4
 
5
5
  static VALUE Iallocate;
6
+ static VALUE I__send__;
6
7
 
7
8
  static inline void
8
9
  save_frame(struct FRAME *frame, void** result, int *depth)
@@ -12,6 +13,9 @@ save_frame(struct FRAME *frame, void** result, int *depth)
12
13
  // if (BUILTIN_TYPE(klass) == T_ICLASS)
13
14
  // klass = RBASIC(klass)->klass;
14
15
 
16
+ if (frame->last_func == I__send__)
17
+ return;
18
+
15
19
  if (FL_TEST(klass, FL_SINGLETON) &&
16
20
  (BUILTIN_TYPE(frame->self) == T_CLASS || BUILTIN_TYPE(frame->self) == T_MODULE))
17
21
  result[(*depth)++] = (void*) frame->self;
@@ -42,6 +46,8 @@ rb_stack_trace(void** result, int max_depth)
42
46
  }
43
47
  #endif
44
48
 
49
+ // XXX SIGPROF can come in while ruby_frame is in an inconsistent state (rb_call0), so we ignore the top-most frame
50
+ /*
45
51
  // XXX does it make sense to track allocations or not?
46
52
  if (frame->last_func == ID_ALLOCATOR) {
47
53
  frame = frame->prev;
@@ -50,6 +56,7 @@ rb_stack_trace(void** result, int max_depth)
50
56
  if (frame->last_func) {
51
57
  save_frame(frame, result, &depth);
52
58
  }
59
+ */
53
60
 
54
61
  for (; frame && (n = frame->node); frame = frame->prev) {
55
62
  if (frame->prev && frame->prev->last_func) {
@@ -122,6 +129,7 @@ Init_perftools()
122
129
  cCpuProfiler = rb_define_class_under(cPerfTools, "CpuProfiler", rb_cObject);
123
130
  bProfilerRunning = Qfalse;
124
131
  Iallocate = rb_intern("allocate");
132
+ I__send__ = rb_intern("__send__");
125
133
 
126
134
  rb_define_singleton_method(cCpuProfiler, "running?", cpuprofiler_running_p, 0);
127
135
  rb_define_singleton_method(cCpuProfiler, "start", cpuprofiler_start, 1);
data/perftools.rb.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'perftools.rb'
3
- s.version = '0.2.0'
3
+ s.version = '0.2.1'
4
4
  s.date = '2009-09-06'
5
5
  s.rubyforge_project = 'perftools-rb'
6
6
  s.summary = 'google-perftools for ruby code'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmm1-perftools.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aman Gupta