tmm1-perftools.rb 0.1.9 → 0.2.0
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/README +4 -4
- data/ext/extconf.rb +6 -0
- data/ext/perftools.c +11 -1
- data/perftools.rb.gemspec +2 -2
- metadata +4 -3
data/README
CHANGED
@@ -114,11 +114,11 @@ google-perftools for ruby code
|
|
114
114
|
|
115
115
|
To profile C code, download and build an unpatched perftools (libunwind or ./configure --enable-frame-pointers required on x86_64):
|
116
116
|
|
117
|
-
wget http://google-perftools.googlecode.com/files/google-perftools-1.
|
118
|
-
tar zxvf google-perftools-1.
|
119
|
-
cd google-perftools-1.
|
117
|
+
wget http://google-perftools.googlecode.com/files/google-perftools-1.3.tar.gz
|
118
|
+
tar zxvf google-perftools-1.3.tar.gz
|
119
|
+
cd google-perftools-1.3
|
120
120
|
|
121
|
-
./configure --prefix=/opt
|
121
|
+
./configure --prefix=/opt
|
122
122
|
make
|
123
123
|
sudo make install
|
124
124
|
|
data/ext/extconf.rb
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
require 'mkmf'
|
2
|
+
|
3
|
+
if have_func('rb_thread_blocking_region')
|
4
|
+
raise 'Ruby 1.9 is not supported yet'
|
5
|
+
end
|
6
|
+
|
2
7
|
require 'fileutils'
|
3
8
|
require 'net/http'
|
4
9
|
|
@@ -31,6 +36,7 @@ Dir.chdir('src') do
|
|
31
36
|
xsystem("tar zxvf #{perftools}")
|
32
37
|
Dir.chdir(dir) do
|
33
38
|
xsystem("patch -p1 < ../../../patches/perftools.patch")
|
39
|
+
xsystem("patch -p1 < ../../../patches/perftools-gc.patch")
|
34
40
|
xsystem("patch -p1 < ../../../patches/perftools-osx.patch") if RUBY_PLATFORM =~ /darwin/
|
35
41
|
xsystem("patch -p1 < ../../../patches/perftools-debug.patch")# if ENV['DEBUG']
|
36
42
|
end
|
data/ext/perftools.c
CHANGED
@@ -70,6 +70,7 @@ rb_stack_trace(void** result, int max_depth)
|
|
70
70
|
static VALUE cPerfTools;
|
71
71
|
static VALUE cCpuProfiler;
|
72
72
|
static VALUE bProfilerRunning;
|
73
|
+
static VALUE gc_hook;
|
73
74
|
|
74
75
|
VALUE
|
75
76
|
cpuprofiler_running_p(VALUE self)
|
@@ -108,6 +109,12 @@ cpuprofiler_start(VALUE self, VALUE filename)
|
|
108
109
|
return Qtrue;
|
109
110
|
}
|
110
111
|
|
112
|
+
static void
|
113
|
+
cpuprofiler_gc_mark()
|
114
|
+
{
|
115
|
+
ProfilerGcMark(rb_gc_mark);
|
116
|
+
}
|
117
|
+
|
111
118
|
void
|
112
119
|
Init_perftools()
|
113
120
|
{
|
@@ -119,4 +126,7 @@ Init_perftools()
|
|
119
126
|
rb_define_singleton_method(cCpuProfiler, "running?", cpuprofiler_running_p, 0);
|
120
127
|
rb_define_singleton_method(cCpuProfiler, "start", cpuprofiler_start, 1);
|
121
128
|
rb_define_singleton_method(cCpuProfiler, "stop", cpuprofiler_stop, 0);
|
122
|
-
|
129
|
+
|
130
|
+
gc_hook = Data_Wrap_Struct(cCpuProfiler, cpuprofiler_gc_mark, NULL, NULL);
|
131
|
+
rb_global_variable(&gc_hook);
|
132
|
+
}
|
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.
|
4
|
-
s.date = '2009-06
|
3
|
+
s.version = '0.2.0'
|
4
|
+
s.date = '2009-09-06'
|
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: tmm1-perftools.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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-06
|
12
|
+
date: 2009-09-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- perftools.rb.gemspec
|
33
33
|
has_rdoc: false
|
34
34
|
homepage: http://github.com/tmm1/perftools.rb
|
35
|
+
licenses:
|
35
36
|
post_install_message:
|
36
37
|
rdoc_options: []
|
37
38
|
|
@@ -52,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
53
|
requirements: []
|
53
54
|
|
54
55
|
rubyforge_project: perftools-rb
|
55
|
-
rubygems_version: 1.
|
56
|
+
rubygems_version: 1.3.5
|
56
57
|
signing_key:
|
57
58
|
specification_version: 2
|
58
59
|
summary: google-perftools for ruby code
|