Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgrade to google-perftools 1.6

  • Loading branch information...
commit 3fc7f2d507045353ac4e926222c672f49adf0f80 1 parent 0f44f24
@tmm1 authored
View
6 ext/extconf.rb
@@ -3,7 +3,7 @@
def sys(cmd)
puts " -- #{cmd}"
unless ret = xsystem(cmd)
- raise "#{cmd} failed, please report to perftools@tmm1.net with pastie.org link to #{CWD}/mkmf.log and #{CWD}/src/google-perftools-1.4/config.log"
+ raise "#{cmd} failed, please report to perftools@tmm1.net with pastie.org link to #{CWD}/mkmf.log and #{CWD}/src/google-perftools-1.6/config.log"
end
ret
end
@@ -23,7 +23,7 @@ def sys(cmd)
end
end
-perftools = File.basename('google-perftools-1.4.tar.gz')
+perftools = File.basename('google-perftools-1.6.tar.gz')
dir = File.basename(perftools, '.tar.gz')
puts "(I'm about to compile google-perftools.. this will definitely take a while)"
@@ -45,9 +45,7 @@ def sys(cmd)
['perftools-pprof', true],
['perftools-gc', true],
['perftools-osx', RUBY_PLATFORM =~ /darwin/],
- ['perftools-osx-106', RUBY_PLATFORM =~ /darwin10/],
['perftools-debug', true],
- ['perftools-realtime', true],
['perftools-objects', true],
['perftools-frames', true]
].each do |patch, apply|
View
BIN  ext/src/google-perftools-1.4.tar.gz
Binary file not shown
View
BIN  ext/src/google-perftools-1.6.tar.gz
Binary file not shown
View
10 patches/perftools-notests.patch
@@ -1,14 +1,14 @@
diff --git a/Makefile.in b/Makefile.in
-index 0ddc27c..1869975 100644
+index b301f4d..969db5e 100644
--- a/Makefile.in
+++ b/Makefile.in
-@@ -53,9 +53,7 @@ host_triplet = @host@
- @ENABLE_FRAME_POINTERS_TRUE@@X86_64_TRUE@am__append_3 = -fno-omit-frame-pointer
- @ENABLE_FRAME_POINTERS_FALSE@@X86_64_TRUE@am__append_4 = -DNO_FRAME_POINTER
+@@ -65,9 +65,7 @@ host_triplet = @host@
+ @ENABLE_FRAME_POINTERS_TRUE@@X86_64_AND_NO_FP_BY_DEFAULT_TRUE@am__append_3 = -fno-omit-frame-pointer
+ @ENABLE_FRAME_POINTERS_FALSE@@X86_64_AND_NO_FP_BY_DEFAULT_TRUE@am__append_4 = -DNO_FRAME_POINTER
@MINGW_TRUE@am__append_5 = -Wl,-u__tcmalloc
-noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
- $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
-- $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_22)
+- $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_23)
+noinst_PROGRAMS =
bin_PROGRAMS =
@MINGW_TRUE@am__append_6 = libwindows.la libspinlock.la
View
28 patches/perftools-objects.patch
@@ -1,14 +1,8 @@
-commit 5ffd87871619a750ad19e247670a0887a6d38fbd
-Author: Aman Gupta <aman@tmm1.net>
-Date: Sun Aug 1 18:50:38 2010 -0700
-
- perftools-objects
-
diff --git a/src/profile-handler.cc b/src/profile-handler.cc
-index 619b980..2ecf2c0 100644
+index 5df5054..2335617 100644
--- a/src/profile-handler.cc
+++ b/src/profile-handler.cc
-@@ -402,6 +402,8 @@ void ProfileHandler::GetState(ProfileHandlerState* state) {
+@@ -395,6 +395,8 @@ void ProfileHandler::GetState(ProfileHandlerState* state) {
}
void ProfileHandler::StartTimer() {
@@ -17,7 +11,7 @@ index 619b980..2ecf2c0 100644
struct itimerval timer;
timer.it_interval.tv_sec = 0;
timer.it_interval.tv_usec = 1000000 / frequency_;
-@@ -410,12 +412,16 @@ void ProfileHandler::StartTimer() {
+@@ -403,12 +405,16 @@ void ProfileHandler::StartTimer() {
}
void ProfileHandler::StopTimer() {
@@ -25,16 +19,16 @@ index 619b980..2ecf2c0 100644
+
struct itimerval timer;
memset(&timer, 0, sizeof timer);
- setitimer(realtime_ ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
+ setitimer(timer_type_, &timer, 0);
}
bool ProfileHandler::IsTimerRunning() {
+ if (getenv("CPUPROFILE_OBJECTS") || getenv("CPUPROFILE_METHODS")) return false;
+
struct itimerval current_timer;
- RAW_CHECK(0 == getitimer(realtime_ ? ITIMER_REAL : ITIMER_PROF, &current_timer), "getitimer");
+ RAW_CHECK(0 == getitimer(timer_type_, &current_timer), "getitimer");
return (current_timer.it_value.tv_sec != 0 ||
-@@ -423,6 +429,8 @@ bool ProfileHandler::IsTimerRunning() {
+@@ -416,6 +422,8 @@ bool ProfileHandler::IsTimerRunning() {
}
void ProfileHandler::EnableHandler() {
@@ -43,7 +37,7 @@ index 619b980..2ecf2c0 100644
struct sigaction sa;
sa.sa_sigaction = SignalHandler;
sa.sa_flags = SA_RESTART | SA_SIGINFO;
-@@ -431,6 +439,8 @@ void ProfileHandler::EnableHandler() {
+@@ -425,6 +433,8 @@ void ProfileHandler::EnableHandler() {
}
void ProfileHandler::DisableHandler() {
@@ -53,10 +47,10 @@ index 619b980..2ecf2c0 100644
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_RESTART;
diff --git a/src/profiler.cc b/src/profiler.cc
-index 37234b2..905288f 100644
+index f408cf8..7645c45 100644
--- a/src/profiler.cc
+++ b/src/profiler.cc
-@@ -97,6 +97,10 @@ class CpuProfiler {
+@@ -102,6 +102,10 @@ class CpuProfiler {
static CpuProfiler instance_;
@@ -67,7 +61,7 @@ index 37234b2..905288f 100644
private:
// This lock implements the locking requirements described in the ProfileData
// documentation, specifically:
-@@ -125,10 +129,6 @@ class CpuProfiler {
+@@ -130,10 +134,6 @@ class CpuProfiler {
// Disables receiving SIGPROF interrupt.
void DisableHandler();
@@ -78,7 +72,7 @@ index 37234b2..905288f 100644
};
// Profile data structure singleton: Constructor will check to see if
-@@ -318,6 +318,10 @@ extern "C" PERFTOOLS_DLL_DECL void ProfilerFlush() {
+@@ -323,6 +323,10 @@ extern "C" PERFTOOLS_DLL_DECL void ProfilerFlush() {
extern "C" PERFTOOLS_DLL_DECL void ProfilerGcMark(void (*cb)(VALUE)) {
CpuProfiler::instance_.GcMark(cb);
}
View
96 patches/perftools-osx-106.patch
@@ -1,96 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
-index c613939..1a901d5 100644
---- a/Makefile.in
-diff --git a/src/base/sysinfo.cc b/src/base/sysinfo.cc
-index a2bc2a9..10b8886 100644
---- a/src/base/sysinfo.cc
-+++ b/src/base/sysinfo.cc
-@@ -728,26 +728,59 @@ bool ProcMapsIterator::NextExt(uint64 *start, uint64 *end, char **flags,
-
- // We start with the next load command (we've already looked at this one).
- for (current_load_cmd_--; current_load_cmd_ >= 0; current_load_cmd_--) {
-- const char* lc = ((const char *)hdr + sizeof(struct mach_header));
-+ const char* lc;
-+ uint32_t seg_marker;
-+ #if defined(MH_MAGIC_64)
-+ if (hdr->magic == MH_MAGIC_64) {
-+ lc = ((const char *)hdr + sizeof(struct mach_header_64));
-+ seg_marker = LC_SEGMENT_64;
-+ } else {
-+ #endif
-+ lc = ((const char *)hdr + sizeof(struct mach_header));
-+ seg_marker = LC_SEGMENT;
-+ #if defined(MH_MAGIC_64)
-+ }
-+ #endif
- // TODO(csilvers): make this not-quadradic (increment and hold state)
- for (int j = 0; j < current_load_cmd_; j++) // advance to *our* load_cmd
- lc += ((const load_command *)lc)->cmdsize;
-- if (((const load_command *)lc)->cmd == LC_SEGMENT) {
-+ if (((const load_command *)lc)->cmd == seg_marker) {
- const intptr_t dlloff = _dyld_get_image_vmaddr_slide(current_image_);
-- const segment_command* sc = (const segment_command *)lc;
-- if (start) *start = sc->vmaddr + dlloff;
-- if (end) *end = sc->vmaddr + sc->vmsize + dlloff;
-- if (flags) *flags = kDefaultPerms; // can we do better?
-- if (offset) *offset = sc->fileoff;
-- if (inode) *inode = 0;
-- if (filename)
-- *filename = const_cast<char*>(_dyld_get_image_name(current_image_));
-- if (file_mapping) *file_mapping = 0;
-- if (file_pages) *file_pages = 0; // could we use sc->filesize?
-- if (anon_mapping) *anon_mapping = 0;
-- if (anon_pages) *anon_pages = 0;
-- if (dev) *dev = 0;
-- return true;
-+ #if defined(MH_MAGIC_64)
-+ if (hdr->magic == MH_MAGIC_64) {
-+ const segment_command_64* sc = (const segment_command_64 *)lc;
-+ if (start) *start = sc->vmaddr + dlloff;
-+ if (end) *end = sc->vmaddr + sc->vmsize + dlloff;
-+ if (flags) *flags = kDefaultPerms; // can we do better?
-+ if (offset) *offset = sc->fileoff;
-+ if (inode) *inode = 0;
-+ if (filename)
-+ *filename = const_cast<char*>(_dyld_get_image_name(current_image_));
-+ if (file_mapping) *file_mapping = 0;
-+ if (file_pages) *file_pages = 0; // could we use sc->filesize?
-+ if (anon_mapping) *anon_mapping = 0;
-+ if (anon_pages) *anon_pages = 0;
-+ if (dev) *dev = 0;
-+ return true;
-+ } else {
-+ #endif
-+ const segment_command* sc = (const segment_command *)lc;
-+ if (start) *start = sc->vmaddr + dlloff;
-+ if (end) *end = sc->vmaddr + sc->vmsize + dlloff;
-+ if (flags) *flags = kDefaultPerms; // can we do better?
-+ if (offset) *offset = sc->fileoff;
-+ if (inode) *inode = 0;
-+ if (filename)
-+ *filename = const_cast<char*>(_dyld_get_image_name(current_image_));
-+ if (file_mapping) *file_mapping = 0;
-+ if (file_pages) *file_pages = 0; // could we use sc->filesize?
-+ if (anon_mapping) *anon_mapping = 0;
-+ if (anon_pages) *anon_pages = 0;
-+ if (dev) *dev = 0;
-+ return true;
-+ #if defined(MH_MAGIC_64)
-+ }
-+ #endif
- }
- }
- // If we get here, no more load_cmd's in this image talk about
-diff --git a/src/pprof b/src/pprof
-index 3531300..b256ed2 100755
---- a/src/pprof
-+++ b/src/pprof
-@@ -3193,7 +3193,7 @@ sub ParseTextSectionHeaderFromOtool {
- $sectname = $1;
- } elsif ($line =~ /segname (\w+)/) {
- $segname = $1;
-- } elsif (!($cmd eq "LC_SEGMENT" &&
-+ } elsif (!(($cmd eq "LC_SEGMENT" || $cmd eq "LC_SEGMENT_64") &&
- $sectname eq "__text" &&
- $segname eq "__TEXT")) {
- next;
View
30 patches/perftools-pprof.patch
@@ -1,8 +1,8 @@
diff --git a/src/pprof b/src/pprof
-index b5ef29a..25b956d 100755
+index e67e42e..ee9927c 100755
--- a/src/pprof
+++ b/src/pprof
-@@ -530,7 +530,8 @@ sub Main() {
+@@ -560,7 +560,8 @@ sub Main() {
my $symbol_map = {};
# Read one profile, pick the last item on the list
@@ -12,7 +12,7 @@ index b5ef29a..25b956d 100755
my $profile = $data->{profile};
my $pcs = $data->{pcs};
my $libs = $data->{libs}; # Info about main program and shared libraries
-@@ -567,6 +568,17 @@ sub Main() {
+@@ -601,6 +602,17 @@ sub Main() {
$symbols = ExtractSymbols($libs, $pcs);
}
@@ -30,18 +30,18 @@ index b5ef29a..25b956d 100755
# Remove uniniteresting stack items
$profile = RemoveUninterestingFrames($symbols, $profile);
-@@ -1927,6 +1927,10 @@ sub RemoveUninterestingFrames {
- 'ProfileData::prof_handler', # historical
- 'CpuProfiler::prof_handler',
+@@ -2425,6 +2437,10 @@ sub RemoveUninterestingFrames {
+ foreach my $name ('ProfileData::Add', # historical
+ 'ProfileData::prof_handler', # historical
+ 'CpuProfiler::prof_handler',
++ 'PerfTools::CpuProfiler.start',
++ 'Array#each',
++ 'Proc#call',
++ 'Class#new',
'__FRAME_END__',
-+ 'PerfTools::CpuProfiler.start',
-+ 'Array#each',
-+ 'Proc#call',
-+ 'Class#new',
- '__pthread_sighandler',
- '__restore') {
- $skip{$name} = 1;
-@@ -1935,6 +1936,7 @@ sub RemoveUninterestingFrames {
+ '__pthread_sighandler',
+ '__restore') {
+@@ -2434,6 +2450,7 @@ sub RemoveUninterestingFrames {
# Nothing skipped for unknown types
}
@@ -49,7 +49,7 @@ index b5ef29a..25b956d 100755
if ($main::profile_type eq 'cpu') {
# If all the second-youngest program counters are the same,
# this STRONGLY suggests that it is an artifact of measurement,
-@@ -1959,6 +1961,7 @@ sub RemoveUninterestingFrames {
+@@ -2458,6 +2475,7 @@ sub RemoveUninterestingFrames {
$profile = $result;
}
}
View
68 patches/perftools-realtime.patch
@@ -1,68 +0,0 @@
-diff --git a/src/profile-handler.cc b/src/profile-handler.cc
-index 370d012..619b980 100644
---- a/src/profile-handler.cc
-+++ b/src/profile-handler.cc
-@@ -133,6 +133,9 @@ class ProfileHandler {
- // SIGPROF interrupt frequency, read-only after construction.
- int32 frequency_;
-
-+ // use SIGALRM/ITIMER_REAL
-+ bool realtime_;
-+
- // Counts the number of callbacks registered.
- int32 callback_count_ GUARDED_BY(control_lock_);
-
-@@ -241,6 +244,13 @@ ProfileHandler::ProfileHandler()
- callback_count_(0),
- timer_sharing_(TIMERS_UNTOUCHED) {
- SpinLockHolder cl(&control_lock_);
-+
-+ const char* rt = getenv("CPUPROFILE_REALTIME");
-+ if (rt != NULL)
-+ realtime_ = true;
-+ else
-+ realtime_ = false;
-+
- // Get frequency of interrupts (if specified)
- char junk;
- const char* fr = getenv("CPUPROFILE_FREQUENCY");
-@@ -396,18 +406,18 @@ void ProfileHandler::StartTimer() {
- timer.it_interval.tv_sec = 0;
- timer.it_interval.tv_usec = 1000000 / frequency_;
- timer.it_value = timer.it_interval;
-- setitimer(ITIMER_PROF, &timer, 0);
-+ setitimer(realtime_ ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
- }
-
- void ProfileHandler::StopTimer() {
- struct itimerval timer;
- memset(&timer, 0, sizeof timer);
-- setitimer(ITIMER_PROF, &timer, 0);
-+ setitimer(realtime_ ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
- }
-
- bool ProfileHandler::IsTimerRunning() {
- struct itimerval current_timer;
-- RAW_CHECK(0 == getitimer(ITIMER_PROF, &current_timer), "getitimer");
-+ RAW_CHECK(0 == getitimer(realtime_ ? ITIMER_REAL : ITIMER_PROF, &current_timer), "getitimer");
- return (current_timer.it_value.tv_sec != 0 ||
- current_timer.it_value.tv_usec != 0);
- }
-@@ -417,7 +427,7 @@ void ProfileHandler::EnableHandler() {
- sa.sa_sigaction = SignalHandler;
- sa.sa_flags = SA_RESTART | SA_SIGINFO;
- sigemptyset(&sa.sa_mask);
-- RAW_CHECK(sigaction(SIGPROF, &sa, NULL) == 0, "sigprof (enable)");
-+ RAW_CHECK(sigaction(realtime_ ? SIGALRM : SIGPROF, &sa, NULL) == 0, "sigprof (enable)");
- }
-
- void ProfileHandler::DisableHandler() {
-@@ -425,7 +435,7 @@ void ProfileHandler::DisableHandler() {
- sa.sa_handler = SIG_IGN;
- sa.sa_flags = SA_RESTART;
- sigemptyset(&sa.sa_mask);
-- RAW_CHECK(sigaction(SIGPROF, &sa, NULL) == 0, "sigprof (disable)");
-+ RAW_CHECK(sigaction(realtime_ ? SIGALRM : SIGPROF, &sa, NULL) == 0, "sigprof (disable)");
- }
-
- void ProfileHandler::SignalHandler(int sig, siginfo_t* sinfo, void* ucontext) {
View
17 patches/perftools.patch
@@ -264,20 +264,3 @@ index d158eea..e8509fe 100644
# error Cannot calculate stack trace: will need to write for your environment
#endif
+#endif
-diff --git a/src/stacktrace_with_context.cc b/src/stacktrace_with_context.cc
-index ed7bfe3..a90c070 100644
---- a/src/stacktrace_with_context.cc
-+++ b/src/stacktrace_with_context.cc
-@@ -41,6 +41,7 @@
- // may inline this code anyway. Let's hope they respect
- // ATTRIBUTE_NOINLINE.
-
-+#ifndef BUILD_FOR_RUBY
- #include <config.h>
- #include <google/stacktrace.h>
- #include "stacktrace_config.h"
-@@ -59,3 +60,4 @@ int GetStackTraceWithContext(void** result, int max_depth,
- return GetStackTrace(result, max_depth, skip_count + 1);
- }
- #endif
-+#endif
Please sign in to comment.
Something went wrong with that request. Please try again.