Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update patches for perftools-1.4, bundle perftools source in gem

  • Loading branch information...
commit b70caba7f37e4e59dd3a610f4178d88978abdb61 1 parent e369d24
@tmm1 authored
View
24 ext/extconf.rb
@@ -5,33 +5,13 @@
end
require 'fileutils'
-require 'net/http'
-url = 'http://google-perftools.googlecode.com/files/google-perftools-1.3.tar.gz'
-perftools = File.basename(url)
+perftools = File.basename('google-perftools-1.4.tar.gz')
dir = File.basename(perftools, '.tar.gz')
-Logging.message "(I'm about to download and compile google-perftools.. this will definitely take a while)"
-
-FileUtils.mkdir_p('src')
-
-if proxy = URI(ENV['http_proxy'] || ENV['HTTP_PROXY']) rescue nil
- proxy_host = proxy.host
- proxy_port = proxy.port
- proxy_user, proxy_pass = proxy.userinfo.split(/:/) if proxy.userinfo
-end
+puts "(I'm about to compile google-perftools.. this will definitely take a while)"
Dir.chdir('src') do
- unless File.exists?(perftools)
- Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass).get_response(URI(url)) do |res|
- File.open(perftools, 'wb') do |out|
- res.read_body do |chunk|
- out.write(chunk)
- end
- end
- end
- end
-
unless File.exists?(dir)
xsystem("tar zxvf #{perftools}")
Dir.chdir(dir) do
View
BIN  ext/src/google-perftools-1.4.tar.gz
Binary file not shown
View
4 patches/perftools-debug.patch
@@ -1,8 +1,8 @@
diff --git a/Makefile.in b/Makefile.in
-index a7a4fb5..bfa0347 100644
+index c3bf409..c613939 100644
--- a/Makefile.in
+++ b/Makefile.in
-@@ -1067,13 +1067,13 @@ AUTOMAKE = @AUTOMAKE@
+@@ -1367,13 +1367,13 @@ AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
View
22 patches/perftools-gc.patch
@@ -33,7 +33,7 @@ index e6240d9..b901ee8 100644
if (!enabled()) {
return;
diff --git a/src/profiledata.h b/src/profiledata.h
-index 67c463d..1df79c2 100644
+index 67c463d..a68e12f 100644
--- a/src/profiledata.h
+++ b/src/profiledata.h
@@ -40,6 +40,12 @@
@@ -54,14 +54,14 @@ index 67c463d..1df79c2 100644
void GetCurrentState(State* state) const;
+#ifdef BUILD_FOR_RUBY
-+ void GcMark(void (*cb)(VALUE));
++ void GcMark(void (*cb)(VALUE));
+#endif
+
private:
static const int kAssociativity = 4; // For hashtable
static const int kBuckets = 1 << 10; // For hashtable
diff --git a/src/profiler.cc b/src/profiler.cc
-index 21c7669..b7277c7 100644
+index d89a53a..37234b2 100644
--- a/src/profiler.cc
+++ b/src/profiler.cc
@@ -87,6 +87,10 @@ class CpuProfiler {
@@ -69,7 +69,7 @@ index 21c7669..b7277c7 100644
void FlushTable();
+#ifdef BUILD_FOR_RUBY
-+ void GcMark(void (*cb)(VALUE));
++ void GcMark(void (*cb)(VALUE));
+#endif
+
bool Enabled();
@@ -81,27 +81,27 @@ index 21c7669..b7277c7 100644
+#ifdef BUILD_FOR_RUBY
+void CpuProfiler::GcMark(void (*cb)(VALUE)) {
-+ if (!collector_.enabled()) {
-+ return;
-+ }
++ if (!collector_.enabled()) {
++ return;
++ }
+
-+ collector_.GcMark(cb);
++ collector_.GcMark(cb);
+}
+#endif
+
bool CpuProfiler::Enabled() {
SpinLockHolder cl(&lock_);
return collector_.enabled();
-@@ -300,6 +314,12 @@ extern "C" void ProfilerFlush() {
+@@ -300,6 +314,12 @@ extern "C" PERFTOOLS_DLL_DECL void ProfilerFlush() {
CpuProfiler::instance_.FlushTable();
}
+#ifdef BUILD_FOR_RUBY
-+extern "C" void ProfilerGcMark(void (*cb)(VALUE)) {
++extern "C" PERFTOOLS_DLL_DECL void ProfilerGcMark(void (*cb)(VALUE)) {
+ CpuProfiler::instance_.GcMark(cb);
+}
+#endif
+
- extern "C" int ProfilingIsEnabledForAllThreads() {
+ extern "C" PERFTOOLS_DLL_DECL int ProfilingIsEnabledForAllThreads() {
return CpuProfiler::instance_.Enabled();
}
View
4 patches/perftools-osx.patch
@@ -1,8 +1,8 @@
diff --git a/Makefile.in b/Makefile.in
-index e3690b2..a7a4fb5 100644
+index 566d77c..c3bf409 100644
--- a/Makefile.in
+++ b/Makefile.in
-@@ -1097,7 +1097,7 @@ INSTALL_DATA = @INSTALL_DATA@
+@@ -1397,7 +1397,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
View
18 patches/perftools.patch
@@ -1,8 +1,8 @@
diff --git a/Makefile.in b/Makefile.in
-index 8ba85fb..e3690b2 100644
+index 232d2ec..566d77c 100644
--- a/Makefile.in
+++ b/Makefile.in
-@@ -1067,13 +1067,13 @@ AUTOMAKE = @AUTOMAKE@
+@@ -1367,13 +1367,13 @@ AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
@@ -19,12 +19,12 @@ index 8ba85fb..e3690b2 100644
DEFS = @DEFS@
DEPDIR = @DEPDIR@
diff --git a/src/pprof b/src/pprof
-index 9d4d0e8..a41fcb1 100755
+index 973f69d..3531300 100755
--- a/src/pprof
+++ b/src/pprof
-@@ -504,7 +504,8 @@ sub Main() {
- FetchDynamicProfiles();
-
+@@ -530,7 +530,8 @@ sub Main() {
+ my $symbol_map = {};
+
# Read one profile, pick the last item on the list
- my $data = ReadProfile($main::prog, pop(@main::profile_files));
+ my $fname = pop(@main::profile_files);
@@ -32,7 +32,7 @@ index 9d4d0e8..a41fcb1 100755
my $profile = $data->{profile};
my $pcs = $data->{pcs};
my $libs = $data->{libs}; # Info about main program and shared libraries
-@@ -549,6 +550,17 @@ sub Main() {
+@@ -580,6 +581,17 @@ sub Main() {
$profile = IgnoreProfile($symbols, $profile, $main::opt_ignore);
}
@@ -227,7 +227,7 @@ index da7ea9e..67c463d 100644
// Move 'entry' to the eviction buffer.
diff --git a/src/profiler.cc b/src/profiler.cc
-index c51c7b2..21c7669 100644
+index 183a7c7..d89a53a 100644
--- a/src/profiler.cc
+++ b/src/profiler.cc
@@ -63,6 +63,12 @@ typedef int ucontext_t; // just to quiet the compiler, mostly
@@ -283,7 +283,7 @@ index d158eea..e8509fe 100644
#endif
+#endif
diff --git a/src/stacktrace_with_context.cc b/src/stacktrace_with_context.cc
-index 02f837d..ca5da92 100644
+index ed7bfe3..a90c070 100644
--- a/src/stacktrace_with_context.cc
+++ b/src/stacktrace_with_context.cc
@@ -41,6 +41,7 @@
View
1  perftools.rb.gemspec
@@ -22,6 +22,7 @@ spec = Gem::Specification.new do |s|
"bin/pprof.rb",
"ext/extconf.rb",
"ext/perftools.c",
+ "ext/src/google-perftools-1.4.tar.gz",
"patches/perftools-debug.patch",
"patches/perftools-gc.patch",
"patches/perftools-osx.patch",
Please sign in to comment.
Something went wrong with that request. Please try again.