perftools.rb 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e5354c9f6adafa6a03a40aa9f642a48e869b26e0
4
+ data.tar.gz: c928c2375eb6f16a1b7d0889ef5bdb8544004904
5
+ SHA512:
6
+ metadata.gz: 8fbc618563d5dad63f74c8b84f31e37009d0e7c5ea7343de5e961efb1a13d9980fa842c30dea7685be321b85e7f4af76240b3dabf8d2b5764a2092658222d33c
7
+ data.tar.gz: f9f92e6dd03853f7c9a328385e9035c5b857b5bec80b0bca68641340b89b9da69a92064498b88e86310c14c755dbad6042ce0e87703fe78099c553fd98e1b4b7
data/README.md CHANGED
@@ -96,15 +96,15 @@ The sampling interval of the profiler can be adjusted to collect more
96
96
 
97
97
  #### pprof.rb --gif
98
98
 
99
- * Simple [require 'rubygems'](http://perftools-rb.rubyforge.org/examples/rubygems.gif) profile
99
+ * Simple [require 'rubygems'](https://raw.github.com/tmm1/perftools.rb/master/examples/rubygems.gif) profile
100
100
 
101
- * Comparing redis-rb [with](http://perftools-rb.rubyforge.org/examples/redis-rb.gif) and [without](http://perftools-rb.rubyforge.org/examples/redis-rb-notimeout.gif) SystemTimer based socket timeouts
101
+ * Comparing redis-rb [with](https://raw.github.com/tmm1/perftools.rb/master/examples/redis-rb.gif) and [without](https://raw.github.com/tmm1/perftools.rb/master/examples/redis-rb-notimeout.gif) SystemTimer based socket timeouts
102
102
 
103
- * [Sinatra](http://perftools-rb.rubyforge.org/examples/sinatra.gif) vs. [Merb](http://perftools-rb.rubyforge.org/examples/merb.gif) vs. [Rails](http://perftools-rb.rubyforge.org/examples/rails.gif)
103
+ * [Sinatra](https://raw.github.com/tmm1/perftools.rb/master/examples/sinatra.gif) vs. [Merb](https://raw.github.com/tmm1/perftools.rb/master/examples/merb.gif) vs. [Rails](https://raw.github.com/tmm1/perftools.rb/master/examples/rails.gif)
104
104
 
105
- * C-level profile of EventMachine + epoll + Ruby threads [before](http://perftools-rb.rubyforge.org/examples/eventmachine-epoll+nothreads.gif) and [after](http://perftools-rb.rubyforge.org/examples/eventmachine-epoll+threads.gif) a [6 line EM bugfix](http://timetobleed.com/6-line-eventmachine-bugfix-2x-faster-gc-1300-requestssec/)
105
+ * C-level profile of EventMachine + epoll + Ruby threads [before](https://raw.github.com/tmm1/perftools.rb/master/examples/eventmachine-epoll+nothreads.gif) and [after](https://raw.github.com/tmm1/perftools.rb/master/examples/eventmachine-epoll+threads.gif) a [6 line EM bugfix](http://timetobleed.com/6-line-eventmachine-bugfix-2x-faster-gc-1300-requestssec/)
106
106
 
107
- * C-level profile of a [ruby/rails vm](http://perftools-rb.rubyforge.org/examples/ruby_interpreter.gif)
107
+ * C-level profile of a [ruby/rails vm](https://raw.github.com/tmm1/perftools.rb/master/examples/ruby_interpreter.gif)
108
108
  * 12% time spent in re_match_exec because of excessive calls to rb_str_sub_bang by Date.parse
109
109
 
110
110
 
@@ -10,8 +10,19 @@ end
10
10
 
11
11
  require 'mkmf'
12
12
  require 'fileutils'
13
+ if RUBY_VERSION > "2.1"
14
+ begin
15
+ require 'debase/ruby_core_source'
16
+ rescue LoadError
17
+ require 'rubygems/dependency_installer'
18
+ installer = Gem::DependencyInstaller.new
19
+ installer.install 'debase-ruby_core_source'
13
20
 
14
- if RUBY_VERSION >= "1.9"
21
+ Gem.refresh
22
+ Gem::Specification.find_by_name('debase-ruby_core_source').activate
23
+ require 'debase/ruby_core_source'
24
+ end
25
+ elsif RUBY_VERSION >= "1.9"
15
26
  begin
16
27
  require "debugger/ruby_core_source"
17
28
  rescue LoadError
@@ -98,6 +109,10 @@ end
98
109
  if RUBY_VERSION >= "1.9"
99
110
  add_define 'RUBY19'
100
111
 
112
+ if RUBY_VERSION >= "2.0"
113
+ add_define 'HAVE_RB_NEWOBJ_OF'
114
+ end
115
+
101
116
  hdrs = proc {
102
117
  have_header("method.h") # exists on 1.9.2
103
118
  have_header("vm_core.h") and
@@ -106,7 +121,9 @@ if RUBY_VERSION >= "1.9"
106
121
  have_header("insns_info.inc")
107
122
  }
108
123
 
109
- unless Debugger::RubyCoreSource::create_makefile_with_core(hdrs, "perftools")
124
+ core_source = Debugger rescue Debase
125
+
126
+ unless core_source::RubyCoreSource::create_makefile_with_core(hdrs, "perftools")
110
127
  STDERR.puts "\n\n"
111
128
  STDERR.puts "***************************************************************************************"
112
129
  STDERR.puts "****************** Debugger::RubyCoreSource::create_makefile FAILED *******************"
@@ -38,6 +38,12 @@ static VALUE Isend;
38
38
  result[depth++] = (void*) (method == ID_ALLOCATOR ? Iallocate : method); \
39
39
  }
40
40
 
41
+ #ifdef HAVE_RB_NEWOBJ_OF
42
+ #define NEWOBJ_FUNC rb_newobj_of
43
+ #else
44
+ #define NEWOBJ_FUNC rb_newobj
45
+ #endif
46
+
41
47
  #ifdef RUBY18
42
48
  #include <env.h>
43
49
  #include <node.h>
@@ -492,11 +498,11 @@ objprofiler_setup()
492
498
  sigemptyset(&sig.sa_mask);
493
499
  sigaction(SIGTRAP, &sig, NULL);
494
500
 
495
- unprotect_page((char*)rb_newobj);
501
+ unprotect_page((char*)NEWOBJ_FUNC);
496
502
 
497
503
  for (i=0; i<NUM_ORIG_BYTES; i++) {
498
- orig_bytes[i].location = (char *)rb_newobj + i;
499
- orig_bytes[i].value = ((unsigned char*)rb_newobj)[i];
504
+ orig_bytes[i].location = (char *)NEWOBJ_FUNC + i;
505
+ orig_bytes[i].value = ((unsigned char*)NEWOBJ_FUNC)[i];
500
506
  orig_bytes[i].location[0] = '\xCC';
501
507
  }
502
508
 
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'perftools.rb'
3
- s.version = '2.0.1'
3
+ s.version = '2.0.2'
4
4
  s.rubyforge_project = 'perftools-rb'
5
5
  s.summary = 'gperftools for ruby code'
6
6
  s.description = 'A sampling profiler for ruby code based on patches to gperftools'
metadata CHANGED
@@ -1,32 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: perftools.rb
3
- version: !ruby/object:Gem::Version
4
- hash: 13
5
- prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 1
10
- version: 2.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.2
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Aman Gupta
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-05-23 00:00:00 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
19
12
  dependencies: []
20
-
21
13
  description: A sampling profiler for ruby code based on patches to gperftools
22
14
  email: perftools@tmm1.net
23
- executables:
15
+ executables:
24
16
  - pprof.rb
25
- extensions:
17
+ extensions:
26
18
  - ext/extconf.rb
27
19
  extra_rdoc_files: []
28
-
29
- files:
20
+ files:
30
21
  - README.md
31
22
  - bin/pprof.rb
32
23
  - ext/extconf.rb
@@ -45,37 +36,25 @@ files:
45
36
  - perftools.rb.gemspec
46
37
  homepage: http://github.com/tmm1/perftools.rb
47
38
  licenses: []
48
-
39
+ metadata: {}
49
40
  post_install_message:
50
41
  rdoc_options: []
51
-
52
- require_paths:
42
+ require_paths:
53
43
  - lib
54
- required_ruby_version: !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
57
46
  - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
63
- required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
- requirements:
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
66
51
  - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
70
- - 0
71
- version: "0"
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
72
54
  requirements: []
73
-
74
55
  rubyforge_project: perftools-rb
75
- rubygems_version: 1.8.24
56
+ rubygems_version: 2.2.3
76
57
  signing_key:
77
- specification_version: 3
58
+ specification_version: 4
78
59
  summary: gperftools for ruby code
79
60
  test_files: []
80
-
81
- has_rdoc: false