Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add perftools 1.7.

  • Loading branch information...
commit 4c368ae7747e69968d655bcf205dc57c273f76cc 1 parent 7065007
Evan Weaver authored
Showing with 79,467 additions and 0 deletions.
  1. +2 −0  distro/google-perftools-1.7/AUTHORS
  2. +28 −0 distro/google-perftools-1.7/COPYING
  3. +499 −0 distro/google-perftools-1.7/ChangeLog
  4. +500 −0 distro/google-perftools-1.7/INSTALL
  5. +1,279 −0 distro/google-perftools-1.7/Makefile.am
  6. +4,920 −0 distro/google-perftools-1.7/Makefile.in
  7. +170 −0 distro/google-perftools-1.7/NEWS
  8. +279 −0 distro/google-perftools-1.7/README
  9. +104 −0 distro/google-perftools-1.7/README_windows.txt
  10. +47 −0 distro/google-perftools-1.7/TODO
  11. +904 −0 distro/google-perftools-1.7/aclocal.m4
  12. +142 −0 distro/google-perftools-1.7/compile
  13. +1,516 −0 distro/google-perftools-1.7/config.guess
  14. +1,626 −0 distro/google-perftools-1.7/config.sub
  15. +19,617 −0 distro/google-perftools-1.7/configure
  16. +363 −0 distro/google-perftools-1.7/configure.ac
  17. +530 −0 distro/google-perftools-1.7/depcomp
  18. +264 −0 distro/google-perftools-1.7/doc/cpuprofile-fileformat.html
  19. +520 −0 distro/google-perftools-1.7/doc/cpuprofile.html
  20. +115 −0 distro/google-perftools-1.7/doc/designstyle.css
  21. BIN  distro/google-perftools-1.7/doc/heap-example1.png
  22. +534 −0 distro/google-perftools-1.7/doc/heap_checker.html
  23. +376 −0 distro/google-perftools-1.7/doc/heapprofile.html
  24. +21 −0 distro/google-perftools-1.7/doc/index.html
  25. +15 −0 distro/google-perftools-1.7/doc/overview.dot
  26. BIN  distro/google-perftools-1.7/doc/overview.gif
  27. +29 −0 distro/google-perftools-1.7/doc/pageheap.dot
  28. BIN  distro/google-perftools-1.7/doc/pageheap.gif
  29. BIN  distro/google-perftools-1.7/doc/pprof-test-big.gif
  30. BIN  distro/google-perftools-1.7/doc/pprof-test.gif
  31. BIN  distro/google-perftools-1.7/doc/pprof-vsnprintf-big.gif
  32. BIN  distro/google-perftools-1.7/doc/pprof-vsnprintf.gif
  33. +131 −0 distro/google-perftools-1.7/doc/pprof.1
  34. +260 −0 distro/google-perftools-1.7/doc/pprof_remote_servers.html
  35. +22 −0 distro/google-perftools-1.7/doc/spanmap.dot
  36. BIN  distro/google-perftools-1.7/doc/spanmap.gif
  37. +480 −0 distro/google-perftools-1.7/doc/t-test1.times.txt
  38. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.1024.bytes.png
  39. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.128.bytes.png
  40. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.131072.bytes.png
  41. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.16384.bytes.png
  42. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.2048.bytes.png
  43. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.256.bytes.png
  44. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.32768.bytes.png
  45. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.4096.bytes.png
  46. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.512.bytes.png
  47. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.64.bytes.png
  48. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.65536.bytes.png
  49. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspercpusec.vs.threads.8192.bytes.png
  50. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.1.threads.png
  51. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.12.threads.png
  52. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.16.threads.png
  53. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.2.threads.png
  54. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.20.threads.png
  55. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.3.threads.png
  56. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.4.threads.png
  57. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.5.threads.png
  58. BIN  distro/google-perftools-1.7/doc/tcmalloc-opspersec.vs.size.8.threads.png
  59. +758 −0 distro/google-perftools-1.7/doc/tcmalloc.html
  60. +21 −0 distro/google-perftools-1.7/doc/threadheap.dot
  61. BIN  distro/google-perftools-1.7/doc/threadheap.gif
  62. +173 −0 distro/google-perftools-1.7/google-perftools.sln
  63. +323 −0 distro/google-perftools-1.7/install-sh
  64. +9,063 −0 distro/google-perftools-1.7/libtool
  65. +8,413 −0 distro/google-perftools-1.7/ltmain.sh
  66. +16 −0 distro/google-perftools-1.7/m4/ac_have_attribute.m4
  67. +35 −0 distro/google-perftools-1.7/m4/acx_nanosleep.m4
  68. +397 −0 distro/google-perftools-1.7/m4/acx_pthread.m4
  69. +24 −0 distro/google-perftools-1.7/m4/compiler_characteristics.m4
  70. +8 −0 distro/google-perftools-1.7/m4/install_prefix.m4
  71. +7,377 −0 distro/google-perftools-1.7/m4/libtool.m4
  72. +368 −0 distro/google-perftools-1.7/m4/ltoptions.m4
  73. +123 −0 distro/google-perftools-1.7/m4/ltsugar.m4
  74. +23 −0 distro/google-perftools-1.7/m4/ltversion.m4
  75. +92 −0 distro/google-perftools-1.7/m4/lt~obsolete.m4
  76. +15 −0 distro/google-perftools-1.7/m4/namespaces.m4
  77. +96 −0 distro/google-perftools-1.7/m4/pc_from_ucontext.m4
  78. +19 −0 distro/google-perftools-1.7/m4/program_invocation_name.m4
  79. +25 −0 distro/google-perftools-1.7/m4/stl_namespace.m4
  80. +360 −0 distro/google-perftools-1.7/missing
  81. +158 −0 distro/google-perftools-1.7/mkinstalldirs
  82. +74 −0 distro/google-perftools-1.7/packages/deb.sh
  83. +7 −0 distro/google-perftools-1.7/packages/deb/README
  84. +171 −0 distro/google-perftools-1.7/packages/deb/changelog
  85. +1 −0  distro/google-perftools-1.7/packages/deb/compat
  86. +25 −0 distro/google-perftools-1.7/packages/deb/control
  87. +35 −0 distro/google-perftools-1.7/packages/deb/copyright
  88. +47 −0 distro/google-perftools-1.7/packages/deb/docs
  89. +4 −0 distro/google-perftools-1.7/packages/deb/libgoogle-perftools-dev.dirs
  90. +10 −0 distro/google-perftools-1.7/packages/deb/libgoogle-perftools-dev.install
  91. +2 −0  distro/google-perftools-1.7/packages/deb/libgoogle-perftools0.dirs
  92. +4 −0 distro/google-perftools-1.7/packages/deb/libgoogle-perftools0.install
  93. +1 −0  distro/google-perftools-1.7/packages/deb/libgoogle-perftools0.manpages
  94. +117 −0 distro/google-perftools-1.7/packages/deb/rules
  95. +86 −0 distro/google-perftools-1.7/packages/rpm.sh
  96. +76 −0 distro/google-perftools-1.7/packages/rpm/rpm.spec
  97. +421 −0 distro/google-perftools-1.7/src/addressmap-inl.h
  98. +234 −0 distro/google-perftools-1.7/src/base/atomicops-internals-arm-gcc.h
  99. +416 −0 distro/google-perftools-1.7/src/base/atomicops-internals-linuxppc.h
  100. +359 −0 distro/google-perftools-1.7/src/base/atomicops-internals-macosx.h
  101. +414 −0 distro/google-perftools-1.7/src/base/atomicops-internals-x86-msvc.h
  102. +125 −0 distro/google-perftools-1.7/src/base/atomicops-internals-x86.cc
  103. +428 −0 distro/google-perftools-1.7/src/base/atomicops-internals-x86.h
  104. +389 −0 distro/google-perftools-1.7/src/base/atomicops.h
  105. +335 −0 distro/google-perftools-1.7/src/base/basictypes.h
  106. +131 −0 distro/google-perftools-1.7/src/base/commandlineflags.h
  107. +122 −0 distro/google-perftools-1.7/src/base/cycleclock.h
  108. +176 −0 distro/google-perftools-1.7/src/base/dynamic_annotations.c
  109. +621 −0 distro/google-perftools-1.7/src/base/dynamic_annotations.h
  110. +385 −0 distro/google-perftools-1.7/src/base/elfcore.h
  111. +51 −0 distro/google-perftools-1.7/src/base/googleinit.h
  112. +3,020 −0 distro/google-perftools-1.7/src/base/linux_syscall_support.h
  113. +665 −0 distro/google-perftools-1.7/src/base/linuxthreads.cc
  114. +53 −0 distro/google-perftools-1.7/src/base/linuxthreads.h
  115. +107 −0 distro/google-perftools-1.7/src/base/logging.cc
  116. +249 −0 distro/google-perftools-1.7/src/base/logging.h
  117. +522 −0 distro/google-perftools-1.7/src/base/low_level_alloc.cc
  118. +106 −0 distro/google-perftools-1.7/src/base/low_level_alloc.h
  119. +331 −0 distro/google-perftools-1.7/src/base/simple_mutex.h
  120. +182 −0 distro/google-perftools-1.7/src/base/spinlock.cc
  121. +151 −0 distro/google-perftools-1.7/src/base/spinlock.h
  122. +77 −0 distro/google-perftools-1.7/src/base/spinlock_internal.cc
  123. +64 −0 distro/google-perftools-1.7/src/base/spinlock_internal.h
  124. +97 −0 distro/google-perftools-1.7/src/base/spinlock_linux-inl.h
  125. +62 −0 distro/google-perftools-1.7/src/base/spinlock_posix-inl.h
  126. +53 −0 distro/google-perftools-1.7/src/base/spinlock_win32-inl.h
  127. +97 −0 distro/google-perftools-1.7/src/base/stl_allocator.h
  128. +50 −0 distro/google-perftools-1.7/src/base/synchronization_profiling.h
  129. +963 −0 distro/google-perftools-1.7/src/base/sysinfo.cc
  130. +233 −0 distro/google-perftools-1.7/src/base/sysinfo.h
  131. +134 −0 distro/google-perftools-1.7/src/base/thread_annotations.h
  132. +77 −0 distro/google-perftools-1.7/src/base/thread_lister.c
  133. +82 −0 distro/google-perftools-1.7/src/base/thread_lister.h
  134. +563 −0 distro/google-perftools-1.7/src/base/vdso_support.cc
  135. +186 −0 distro/google-perftools-1.7/src/base/vdso_support.h
  136. +326 −0 distro/google-perftools-1.7/src/central_freelist.cc
  137. +175 −0 distro/google-perftools-1.7/src/central_freelist.h
  138. +214 −0 distro/google-perftools-1.7/src/common.cc
  139. +246 −0 distro/google-perftools-1.7/src/common.h
  140. +256 −0 distro/google-perftools-1.7/src/config.h.in
  141. +64 −0 distro/google-perftools-1.7/src/config_for_unittests.h
  142. +1,429 −0 distro/google-perftools-1.7/src/debugallocation.cc
  143. +186 −0 distro/google-perftools-1.7/src/getpc.h
Sorry, we could not display the entire diff because it was too big.
View
2  distro/google-perftools-1.7/AUTHORS
@@ -0,0 +1,2 @@
+opensource@google.com
+
View
28 distro/google-perftools-1.7/COPYING
@@ -0,0 +1,28 @@
+Copyright (c) 2005, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
499 distro/google-perftools-1.7/ChangeLog
@@ -0,0 +1,499 @@
+Fri Feb 04 15:54:31 2011 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.7 release
+ * Reduce page map key size under x86_64 by 4.4MB (rus)
+ * Remove a flaky malloc-extension test (fdabek)
+ * Improve the performance of PageHeap::New (ond..., csilvers)
+ * Improve sampling_test with no-inline additions/etc (fdabek)
+ * 16-byte align debug allocs (jyasskin)
+ * Change FillProcSelfMaps to detect out-of-buffer-space (csilvers)
+ * Document the need for sampling to use GetHeapSample (csilvers)
+ * Try to read TSC frequency from tsc_freq_khs (adurbin)
+ * Do better at figuring out if tests are running under gdb (ppluzhnikov)
+ * Improve spinlock contention performance (ruemmler)
+ * Better internal-function list for pprof's /contention (ruemmler)
+ * Speed up GoogleOnce (m3b)
+ * Limit number of incoming/outgoing edges in pprof (sanjay)
+ * Add pprof --evince to go along with --gv (csilvers)
+ * Document the various ways to get heap-profiling information (csilvers)
+ * Separate out synchronization profiling routines (ruemmler)
+ * Improve malloc-stats output to be more understandable (csilvers)
+ * Add support for census profiler in pporf (nabeelmian)
+ * Document how pprof's /symbol must support GET requests (csilvers)
+ * Improve acx_pthread.m4 (ssuomi, liujisi)
+ * Speed up pprof's ExtractSymbols (csilvers)
+ * Ignore some known-leaky (java) libraries in the heap checker (davidyu)
+ * Make kHideMask use all 64 bits in tests (ppluzhnikov)
+ * Clean up pprof input-file handling (csilvers)
+ * BUGFIX: Don't crash if __environ is NULL (csilvers)
+ * BUGFIX: Fix totally broken debugallocation tests (csilvers)
+ * BUGFIX: Fix up fake_VDSO handling for unittest (ppluzhnikov)
+ * BUGFIX: Suppress all large allocs when report threshold is 0 (lexie)
+ * BUGFIX: mmap2 on i386 takes an off_t, not off64_t (csilvers)
+ * PORTING: Add missing PERFTOOLS_DLL_DECL (csilvers)
+ * PORTING: Add stddef.h to make newer gcc's happy (csilvers)
+ * PORTING: Document some tricks for working under OS X (csilvers)
+ * PORTING: Don't try to check valgrind for windows (csilvers)
+ * PORTING: Make array-size a var to compile under clang (chandlerc)
+ * PORTING: No longer hook _aligned_malloc and _aligned_free (csilvers)
+ * PORTING: Quiet some gcc warnings (csilvers)
+ * PORTING: Replace %PRIxPTR with %p to be more portable (csilvers)
+ * PORTING: Support systems that capitalize /proc weirdly (sanek)
+ * PORTING: Treat arm3 the same as arm5t in cycletimer (csilvers)
+ * PORTING: Update windows logging to not allocate memory (csilvers)
+ * PORTING: avoid double-patching newer windows DLLs (roger.orr)
+ * PORTING: get dynamic_annotations.c to work on windows (csilvers)
+ * Add pkg-config .pc files for the 5 libraries we produce (csilvers)
+ * Added proper libtool versioning, so this lib will be 0.1.0 (csilvers)
+ * Moved from autoconf 2.64 to 2.65
+
+Thu Aug 5 12:48:03 PDT 2010 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.6 release
+ * Add tc_malloc_usable_size for compatibility with glibc (csilvers)
+ * Override malloc_usable_size with tc_malloc_usable_size (csilvers)
+ * Default to no automatic heap sampling in tcmalloc (csilvers)
+ * Add -DTCMALLOC_LARGE_PAGES, a possibly faster tcmalloc (rus)
+ * Make some functions extern "C" to avoid false ODR warnings (jyasskin)
+ * pprof: Add SVG-based output (rsc)
+ * pprof: Extend pprof --tools to allow per-tool configs (csilvers)
+ * pprof: Improve support of 64-bit and big-endian profiles (csilvers)
+ * pprof: Add interactive callgrind suport (weidenri...)
+ * pprof: Improve address->function mapping a bit (dpeng)
+ * Better detection of when we're running under valgrind (csilvers)
+ * Better CPU-speed detection under valgrind (saito)
+ * Use, and recommend, -fno-builtin-malloc when compiling (csilvers)
+ * Avoid false-sharing of memory between caches (bmaurer)
+ * BUGFIX: Fix heap sampling to use correct alloc size (bmauer)
+ * BUGFIX: Avoid gcc 4.0.x bug by making hook-clearing atomic (csilvers)
+ * BUGFIX: Avoid gcc 4.5.x optimization bug (csilvers)
+ * BUGFIX: Work around deps-determining bug in libtool 1.5.26 (csilvers)
+ * BUGFIX: Fixed test to use HAVE_PTHREAD, not HAVE_PTHREADS (csilvers)
+ * BUGFIX: Fix tls callback behavior on windows when using wpo (wtc)
+ * BUGFIX: properly align allocation sizes on Windows (antonm)
+ * BUGFIX: Fix prototypes for tcmalloc/debugalloc wrt throw() (csilvers)
+ * DOC: Updated heap-checker doc to match reality better (fischman)
+ * DOC: Document ProfilerFlush, ProfilerStartWithOptions (csilvers)
+ * DOC: Update docs for heap-profiler functions (csilvers)
+ * DOC: Clean up documentation around tcmalloc.slack_bytes (fikes)
+ * DOC: Renamed README.windows to README_windows.txt (csilvers)
+ * DOC: Update the NEWS file to be non-empty (csilvers)
+ * PORTING: Fix windows addr2line and nm with proper rc code (csilvers)
+ * PORTING: Add CycleClock and atomicops support for arm 5 (sanek)
+ * PORTING: Improve PC finding on cygwin and redhat 7 (csilvers)
+ * PORTING: speed up function-patching under windows (csilvers)
+
+Tue Jan 19 14:46:12 2010 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.5 release
+ * Add tc_set_new_mode (willchan)
+ * Make memalign functions + realloc respect tc_set_new_mode (willchan)
+ * Add ReleaseToSystem(num_bytes) (kash)
+ * Handle zero-length symbols a bit better in pprof (csilvers)
+ * Prefer __environ to /proc/self/environ in cpu profiler (csilvers)
+ * Add HEAP_CHECK_MAX_LEAKS flag to control #leaks to report (glider)
+ * Add two new numeric pageheap properties to MallocExtension (fikes)
+ * Print alloc size when mmap fails (hakon)
+ * Add ITIMER_REAL support to cpu profiler (csilvers, nabeelmian)
+ * Speed up symbolizer in heap-checker reporting (glider)
+ * Speed up futexes with FUTEX_PRIVATE_FLAG (m3b)
+ * Speed up tcmalloc but doing better span coalescing (sanjay)
+ * Better support for different wget's and addr2maps in pprof (csilvres)
+ * Implement a nothrow version of delete and delete[] (csilvers)
+ * BUGFIX: fix a race on module_libcs[i] in windows patching (csilvers)
+ * BUGFIX: Fix debugallocation to call cpp_alloc for new (willchan)
+ * BUGFIX: A simple bugfix for --raw mode (mrabkin)
+ * BUGFIX: Fix C shims to actually be valid C (csilvers)
+ * BUGFIX: Fix recursively-unmapped-region accounting (ppluzhnikov)
+ * BUGFIX: better distinguish real and fake vdso (ppluzhnikov)
+ * WINDOWS: replace debugmodule with more reliable psai (andrey)
+ * PORTING: Add .bundle as another shared library extension (csilvers)
+ * PORTING: Fixed a typo bug in the ocnfigure PRIxx m4 macro (csilvers)
+ * PORTING: Augment sysinfo to work on 64-bit OS X (csilvers)
+ * PORTING: Use sys/ucontext.h to fix compiing on OS X 10.6 (csilvers)
+ * PORTING: Fix sysinfo libname reporting for solaris x86 (jeffrey)
+ * PORTING: Use libunwind for i386 when using --omitfp (ppluzhnikov)
+
+Thu Sep 10 13:51:15 2009 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.4 release
+ * Add debugallocation library, to catch memory leaks, stomping, etc
+ * Add --raw mode to allow for delayed processing of pprof files
+ * Use less memory when reading CPU profiles
+ * New environment variables to control kernel-allocs (sbrk, memfs, etc)
+ * Add MarkThreadBusy(): performance improvement
+ * Remove static thread-cache-size code; all is dynamic now
+ * Add new HiddenPointer class to heap checker
+ * BUGFIX: pvalloc(0) allocates now (found by new debugalloc library)
+ * BUGFIX: valloc test (not implementation) no longer overruns memory
+ * BUGFIX: GetHeapProfile no longer deadlocks
+ * BUGFIX: Support unmapping memory regions before main
+ * BUGFIX: Fix some malloc-stats formatting
+ * BUGFIX: Don't crash as often when freeing libc-allocated memory
+ * BUGFIX: Deal better with incorrect PPROF_PATH when symbolizing
+ * BUGFIX: weaken new/delete/etc in addition to malloc/free/etc
+ * BUGFIX: Fix return value of GetAllocatedSize
+ * PORTING: Fix mmap-#define problem on some 64-bit systems
+ * PORTING: Call ranlib again (some OS X versions need it)
+ * PORTING: Fix a leak when building with LLVM
+ * PORTING: Remove some unneeded bash-ishs from testing scripts
+ * WINDOWS: Support library unloading as well as loading
+ * WINDOWS/BUGFIX: Set page to 'xrw' instead of 'rw' when patching
+
+Tue Jun 9 18:19:06 2009 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.3 release
+ * Provide our own name for memory functions: tc_malloc, etc (csilvers)
+ * Weaken memory-alloc functions so user can override them (csilvers)
+ * Remove meaningless delete(nothrow) and delete[](nothrow) (csilvers)
+ * BUILD: replace clever libtcmalloc/profiler.a with a new .a (csilvers)
+ * PORTING: improve windows port by using google spinlocks (csilvers)
+ * PORTING: Fix RedHat 9 memory allocation in heapchecker (csilvers)
+ * PORTING: Rename OS_WINDOWS macro to PLATFORM_WINDOWS (mbelshe)
+ * PORTING/BUGFIX: Make sure we don't clobber GetLastError (mbelshe)
+ * BUGFIX: get rid of useless data for callgrind (weidenrinde)
+ * BUGFIX: Modify windows patching to deadlock sometimes (csilvers)
+ * BUGFIX: an improved fix for hook handling during fork (csilvers)
+ * BUGFIX: revamp profiler_unittest.sh, which was very broken (csilvers)
+
+Fri Apr 17 16:40:48 2009 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.2 release
+ * Allow large_alloc_threshold=0 to turn it off entirely (csilvers)
+ * Die more helpfully when out of memory for internal data (csilvers)
+ * Refactor profile-data gathering, add a new unittest (cgd, nabeelmian)
+ * BUGFIX: fix rounding errors with static thread-size caches (addi)
+ * BUGFIX: disable hooks better when forking in leak-checker (csilvers)
+ * BUGFIX: fix realloc of crt pointers on windows (csilvers)
+ * BUGFIX: do a better job of finding binaries in .sh tests (csilvers)
+ * WINDOWS: allow overriding malloc/etc instead of patching (mbelshe)
+ * PORTING: fix compilation error in a ppc-specific file (csilvers)
+ * PORTING: deal with quirks in cygwin's /proc/self/maps (csilvers)
+ * PORTING: use 'A' version of functions for ascii input (mbelshe)
+ * PORTING: generate .so's on cygwin and mingw (ajenjo)
+ * PORTING: disable profiler methods on cygwin (jperkins)
+ * Updated autoconf version to 2.61 and libtool version to 1.5.26
+
+Wed Mar 11 11:25:34 2009 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.1 release
+ * Dynamically resize thread caches -- nice perf. improvement (kash)
+ * Add VDSO support to give better stacktraces in linux (ppluzhnikov)
+ * Improve heap-profiling sampling algorithm (ford)
+ * Rewrite leak-checking code: should be faster and more robust (sanjay)
+ * Use ps2 instead of ps for dot: better page cropping for gv (csilvers)
+ * Disable malloc-failure warning messages by default (csilvers)
+ * Update config/Makefile to disable tests on a per-OS basis (csilvers)
+ * PORTING: Get perftools compiling under MSVC 7.1 again (csilvers)
+ * PORTING: Get perftools compiling under cygwin again (csilvers)
+ * PORTING: automatically set library flags for solaris x86 (csilvers)
+ * Add TCMALLOC_SKIP_SBRK to mirror TCMALLOC_SKIP_MMAP (csilvers)
+ * Add --enable flags to allow selective building (csilvers)
+ * Put addr2line-pdb and nm-pdb in proper output directory (csilvers)
+ * Remove deprecated DisableChecksIn (sanjay)
+ * DOCUMENTATION: Document most MallocExtension routines (csilvers)
+
+Tue Jan 6 13:58:56 2009 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.0 release
+ * Exactly the same as 1.0rc2
+
+Sun Dec 14 17:10:35 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.0rc2 release
+ * Fix compile error on 64-bit systems (casting ptr to int) (csilvers)
+
+Thu Dec 11 16:01:32 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 1.0rc1 release
+ * Replace API for selectively disabling heap-checker in code (sanjay)
+ * Add a pre-mmap hook (daven, adlr)
+ * Add MallocExtension interface to set memory-releasing rate (fikes)
+ * Augment pprof to allow any string ending in /pprof/profile (csilvers)
+ * PORTING: Rewrite -- and fix -- malloc patching for windows (dvitek)
+ * PORTING: Add nm-pdb and addr2line-pdb for use by pprof (dvitek)
+ * PORTING: Improve cygwin and mingw support (jperkins, csilvers)
+ * PORTING: Fix pprof for mac os x, other pprof improvements (csilvers)
+ * PORTING: Fix some PPC bugs in our locking code (anton.blanchard)
+ * A new unittest, smapling_test, to verify tcmalloc-profiles (csilvers)
+ * Turn off TLS for gcc < 4.1.2, due to a TLS + -fPIC bug (csilvers)
+ * Prefer __builtin_frame_address to assembly for stacktraces (nlewycky)
+ * Separate tcmalloc.cc out into multiple files -- finally! (kash)
+ * Make our locking code work with -fPIC on 32-bit x86 (aruns)
+ * Fix an initialization-ordering bug for tcmalloc/profiling (csilvers)
+ * Use "initial exec" model of TLS to speed up tcmalloc (csilvers)
+ * Enforce 16-byte alignment for tcmalloc, for SSE (sanjay)
+
+Tue Sep 23 08:56:31 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.99.2 release
+ * COMPILE FIX: add #include needed for FreeBSD and OS X (csilvers)
+
+Sat Sep 20 09:37:18 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.99.1 release
+ * BUG FIX: look for nm, etc in /usr/bin, not /usr/crosstool (csilvers)
+
+Thu Sep 18 16:00:27 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.99 release
+ * Add IsHeapProfileRunning (csilvers)
+ * Add C shims for some of the C++ header files (csilvers)
+ * Fix heap profile file clean-up logic (maxim)
+ * Rename linuxthreads.c to .cc for better compiler support (csilvers)
+ * Add source info to disassembly in pprof (sanjay)
+ * Use open instead of fopen to avoid memory alloc (csilvers)
+ * Disable malloc extensions when running under valgrind (kcc)
+ * BUG FIX: Fix out-of-bound error by reordering a check (larryz)
+ * Add Options struct to ProfileData (cgd)
+ * Correct PC-handling of --base in pprof (csilvers)
+ * Handle 1 function occurring twice in an image (sanjay)
+ * Improve stack-data cleaning (maxim)
+ * Use 'struct Foo' to make header C compatible (csilvers)
+ * Add 'total' line to pprof --text (csilvers)
+ * Pre-allocate buffer for heap-profiler to avoid OOM errors (csilvers)
+ * Allow a few more env-settings to control tcmalloc (csilvers)
+ * Document some of the issues involving thread-local storage (csilvers)
+ * BUG FIX: Define strtoll and friends for windows (csilvers)
+
+Mon Jun 9 16:47:03 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.98 release
+ * Add ProfilerStartWithOptions() (cgd)
+ * Change tcmalloc_minimal to not do any stack-tracing at all (csilvers)
+ * Prefer mmap to sbrk for 64-buit debug mode (sanjay)
+ * Fix accounting for some tcmalloc stats (sanjay)
+ * Use setrlimit() to keep unittests from killing the machine (odo)
+ * Fix a bug when sbrk-ing near address 4G (csilvers)
+ * Make MallocHook thread-safe (jyasskin)
+ * Fix windows build for MemoryBarrier (jyasskin)
+ * Fix CPU-profiler docs to mention correct libs (csilvers)
+ * Fix for GetHeapProfile() when heap-profiling is off (maxim)
+ * Avoid realloc resizing ping-pongs using hysteresis (csilvers)
+ * Add --callgrind output support to pprof (klimek)
+ * Fix profiler.h and heap-profiler.h to be C-compatible (csilvers)
+ * Break malloc_hook.h into two parts to reduce dependencies (csilvers)
+ * Better handle systems that don't implement mmap (csilvers)
+ * PORTING: disable system_alloc_unittest for msvc (csilvers)
+ * PORTING: Makefile tweaks to build better on cygwin (csilvers)
+
+Mon Apr 21 15:20:52 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.97 release
+ * Refactor GetHeapProfile to avoid using malloc (maxim)
+ * Fix heap-checker and heap-profiler hook interactions (maxim)
+ * Fix a data race in MemoryRegionMap::Lock (jyasskin)
+ * Improve thread-safety of leak checker (maxim)
+ * Fix mmap profile to no longer deadlock (maxim)
+ * Fix rpm to have devel package depend on non-devel (csilvers)
+ * PORTING: Fix clock-speed detection for Mac OS X (csilvers)
+
+Tue Mar 18 14:30:44 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.96 release
+ * major atomicops rewrite; fixed atomic ops code for linux/ppc (vchen)
+ * nix the stacktrace library; now build structure is simpler (csilvers)
+ * Speed up heap-checker, and reduce extraneous logging (maxim)
+ * Improve itimer code for NPTL case (cgd)
+ * Add source code annotations for use by valgrind, etc (kcc)
+ * PORTING: Fix high resolution timers for Mac OS X (adlr)
+
+Tue Feb 19 12:01:31 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.95.1 release (bugfix release)
+ * x86_64 compile-fix: nix pread64 and pwrite64 (csilvers)
+ * more heap-checker debug logging (maxim)
+ * minor improvement to x86_64 CycleClock (gpike)
+
+Tue Feb 12 12:28:32 2008 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.95 release
+ * Better -- not perfect -- support for linux-ppc (csilvers)
+ * Fix race condition in libunwind stacktrace (aruns)
+ * Speed up x86 spinlock locking (m3b)
+ * Improve heap-checker performance (maxim)
+ * Heap checker traverses more ptrs inside heap-alloced objects (maxim)
+ * Remove deprecated ProfilerThreadState function (cgd)
+ * Update libunwind documentation for statically linked binaries (aruns)
+
+Mon Dec 3 23:51:54 2007 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.94.1 release (bugfix release)
+ * Fix missing #includes for x86_64 compile using libunwind (csilvers)
+
+Thu Nov 29 07:59:43 2007 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.94 release
+ * PORTING: MinGW/Msys support -- runs same code as MSVC does (csilvers)
+ * PORTING: Add NumCPUs support for Mac OS X (csilvers)
+ * Work around a sscanf bug in glibc(?) (waldemar)
+ * Fix Windows MSVC bug triggered by thread deletion (csilvers)
+ * Fix bug that triggers in MSVC /O2: missing volatile (gpike)
+ * March-of-time support: quiet warnings/errors for gcc 4.2, OS X 10.5
+ * Modify pprof so it works without nm: useful for windows (csilvers)
+ * pprof: Support filtering for CPU profiles (cgd)
+ * Bugfix: have realloc report to hooks in all situations (maxim)
+ * Speed improvement: replace slow memcpy with std::copy (soren)
+ * Speed: better iterator efficiency in RecordRegionRemoval (soren)
+ * Speed: minor speed improvements via better bitfield alignment (gpike)
+ * Documentation: add documentation of binary profile output (cgd)
+
+Fri Aug 17 12:32:56 2007 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.93 release
+ * PORTING: everything compiles on Solaris, OS X, FreeBSD (see INSTALL)
+ * PORTING: cpu-profiler works on most platforms (much better GetPC())
+ * PORTING: heap-profiler works on most platforms
+ * PORTING: improved windows support, including release builds
+ * No longer build or run ptmalloc tests by default
+ * Add support for using memfs filesystem to allocate memory in linux
+ * WINDOWS: give debug library and release library different names
+
+Tue Jul 17 22:26:27 2007 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.92 release
+ * PERFORMANCE: use a packed cache to speed up tcmalloc
+ * PORTING: preliminary windows support! (see README.windows)
+ * PORTING: better support for solaris, OS X, FreeBSD (see INSTALL)
+ * Envvar support for running the heap-checker under gdb
+ * Add weak declarations to maybe_threads to fix no-pthreads compile bugs
+ * Some 64bit fixes, especially with pprof
+ * Better heap-checker support for some low-level allocations
+ * Fix bug where heap-profiles would sometimes get truncated
+ * New documentation about how to handle common heap leak situations
+ * Use computed includes for hash_map/set: easier config
+ * Added all used .m4 templates to the distribution
+
+Wed Apr 18 16:43:55 2007 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.91 release
+ * Brown-paper-bag bugfix: compilation error on some x86-64 machines
+
+Fri Apr 13 14:50:51 2007 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.90 release
+ * (As the version-number jump hints, this is a major new release:
+ almost every piece of functionality was rewritten. I can't do
+ justice to all the changes, but will concentrate on highlights.)
+ *** USER-VISIBLE CHANGES:
+ * Ability to "release" unused memory added to tcmalloc
+ * Exposed more tweaking knobs via environment variables (see docs)
+ * pprof tries harder to map addresses to functions
+ * tcmalloc_minimal compiles and runs on FreeBSD 6.0 and Solaris 10
+ *** INTERNAL CHANGES:
+ * Much better 64-bit support
+ * Better multiple-processor support (e.g. multicore contention tweaks)
+ * Support for recent kernel ABI changes (e.g. new arg to mremap)
+ * Addition of spinlocks to tcmalloc to reduce contention cost
+ * Speed up tcmalloc by using __thread on systems that support TLS
+ * Total redesign of heap-checker to improve liveness checking
+ * More portable stack-frame analysis -- no more hard-coded constants!
+ * Disentangled heap-profiler code and heap-checker code
+ * Several new unittests to test, e.g., thread-contention costs
+ * Lots of small (but important!) bug fixes: e.g., fixing GetPC on amd64
+ *** KNOWN PROBLEMS:
+ * CPU-profiling may crash on x86_64 (64-bit) systems. See the README
+ * Profiling/heap-checking may deadlock on x86_64 systems. See README
+
+Wed Jun 14 15:11:14 2006 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.8 release
+ * Experimental support for remote profiling added to pprof (many)
+ * Fixed race condition in ProfileData::FlushTable (etune)
+ * Better support for weird /proc maps (maxim, mec)
+ * Fix heap-checker interaction with gdb (markus)
+ * Better 64-bit support in pprof (aruns)
+ * Reduce scavenging cost in tcmalloc by capping NumMoveSize (sanjay)
+ * Cast syscall(SYS_mmap); works on more 64-bit systems now (menage)
+ * Document the text output of pprof! (csilvers)
+ * Better compiler support for no-THREADS and for old compilers (csilvers)
+ * Make libunwind the default stack unwinder for x86-64 (aruns)
+ * Somehow the COPYING file got erased. Regenerate it (csilvers)
+
+Thu Apr 13 20:59:09 2006 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.7 release
+ * Major rewrite of thread introspection for new kernels (markus)
+ * Major rewrite of heap-checker to use new thread tools (maxim)
+ * Add proper support for following data in thread registers (maxim)
+ * Syscall support for older kernels, including _syscall6 (markus)
+ * Support PIC mode (markus, mbland, iant)
+ * Better support for running in non-threaded contexts (csilvers)
+
+Fri Jan 27 14:04:27 2006 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.6 release
+ * More sophisticated stacktrace usage, possibly using libunwind (aruns)
+ * Update pprof to handle 64-bit profiles (dehnert)
+ * Fix GetStackTrace to correctly return top stackframe (sanjay)
+ * Add ANSI compliance for new and new[], including new_handler (jkearney)
+ * More accuracy by reading ELF files directly rather than objdump (mec)
+ * Add readline support for pprof (addi)
+ * Add #includes for PPC (csilvers)
+ * New PC-detection routine for ibook powerpc (asbestoshead)
+ * Vastly improved tcmalloc unittest (csilvers)
+ * Move documentation from /usr/doc to /usr/share/doc
+
+Mon Nov 14 17:28:59 2005 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.5 release
+ * Add va_start/va_end calls around vsnprintf() (csilvers)
+ * Write our own __syscall_return(), since it's not defined
+ consistently on all 64-bit linux distros (markus)
+
+Wed Oct 26 15:19:16 2005 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.4 release
+ * Decrease fragmentation in tcmalloc (lefevere)
+ * Support for ARM in some of the thread-specific code (markus)
+ * Turn off heap-checker for statically-linked binaries, which
+ cause error leak reports now (etune)
+ * Many pprof improvements, including a command-line interface (jeff)
+ * CPU profiling now automatically affects all threads in linux 2.6.
+ (Kernel bugs break CPU profiling and threads in linux 2.4 a bit.)
+ ProfilerEnable() and ProfilerDisable() are deprecated. (sanjay)
+ * tcmalloc now correctly intercepts memalign (m3b, maxim)
+ * Syntax fix: added missing va_end()s. Helps non-gcc compiling (etune)
+ * Fixed a few coredumper bugs: race condition after PTRACE_DETACH,
+ ignore non-aligned stackframe pointers (markus, menage)
+ * 64-bit cleanup, especially for spinlock code (etune) and mmap (sanjay)
+ * Better support for finding threads in linux (markus)
+ * tcmalloc now tracks those stack traces that allocate memory (sanjay)
+ * Work around a weird setspecific problem (sanjay)
+ * Fix tcmalloc overflow problems when an alloc is close to 2G/4G (sanjay)
+
+Fri Jun 24 18:02:26 2005 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.3 release
+ * Add missing errno include for one of the unittests (csilvers)
+ * Reduce tcmalloc startup memory from 5M to 256K (sanjay)
+ * Add support for mallopt() and mallinfo (sanjay)
+ * Improve stacktrace's performance on some 64-bit systems (etune)
+ * Improve the stacktrace unittest (etune)
+
+Tue May 31 08:14:38 2005 Google Inc. <opensource@google.com>
+
+ * google-perftools: version 0.2 release
+ * Use mmap2() instead of mmap(), to map more memory (menage)
+ * Do correct pthread-local checking in heap-checker! (maxim)
+ * Avoid overflow on 64-bit machines in pprof (sanjay)
+ * Add a few more GetPC() functions, including for AMD (csilvers)
+ * Better method for overriding pthread functions (menage)
+ * (Hacky) fix to avoid overwriting profile files after fork() (csilvers)
+ * Crashing bugfix involving dumping heaps on small-stack threads (tudor)
+ * Allow library versions with letters at the end (csilvers)
+ * Config fixes for systems that don't define PATH_MAX (csilvers)
+ * Confix fixes so we no longer need config.h after install (csilvers)
+ * Fix to pprof to correctly read very big cpu profiles (csilvers)
+ * Fix to pprof to deal with new commandline flags in modern gv's
+ * Better error reporting when we can't access /proc/maps (etune)
+ * Get rid of the libc-preallocate code (which could crash on some
+ systems); no longer needed with local-threads fix (csilvers)
+
+Tue Feb 8 09:57:17 2005 Google Inc. <opensource@google.com>
+
+ * google-perftools: initial release:
+ The google-perftools package contains some utilities to improve
+ and analyze the performance of C++ programs. This includes an
+ optimized thread-caching malloc() and cpu and heap profiling
+ utilities.
View
500 distro/google-perftools-1.7/INSTALL
@@ -0,0 +1,500 @@
+Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+
+Perftools-Specific Install Notes
+================================
+
+*** NOTE FOR 64-BIT LINUX SYSTEMS
+
+The glibc built-in stack-unwinder on 64-bit systems has some problems
+with the perftools libraries. (In particular, the cpu/heap profiler
+may be in the middle of malloc, holding some malloc-related locks when
+they invoke the stack unwinder. The built-in stack unwinder may call
+malloc recursively, which may require the thread to acquire a lock it
+already holds: deadlock.)
+
+For that reason, if you use a 64-bit system, we strongly recommend you
+install libunwind before trying to configure or install google
+perftools. libunwind can be found at
+
+ http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99-beta.tar.gz
+
+Even if you already have libunwind installed, you should check the
+version. Versions older than this will not work properly; too-new
+versions introduce new code that does not work well with perftools
+(because libunwind can call malloc, which will lead to deadlock).
+
+CAUTION: if you install libunwind from the url above, be aware that
+you may have trouble if you try to statically link your binary with
+perftools: that is, if you link with 'gcc -static -lgcc_eh ...'. This
+is because both libunwind and libgcc implement the same C++ exception
+handling APIs, but they implement them differently on some platforms.
+This is not likely to be a problem on ia64, but may be on x86-64.
+
+Also, if you link binaries statically, make sure that you add
+-Wl,--eh-frame-hdr to your linker options. This is required so that
+libunwind can find the information generated by the compiler required
+for stack unwinding.
+
+Using -static is rare, though, so unless you know this will affect you
+it probably won't.
+
+If you cannot or do not wish to install libunwind, you can still try
+to use the built-in stack unwinder. The built-in stack unwinder
+requires that your application, the tcmalloc library, and system
+libraries like libc, all be compiled with a frame pointer. This is
+*not* the default for x86-64.
+
+If you are on x86-64 system, know that you have a set of system
+libraries with frame-pointers enabled, and compile all your
+applications with -fno-omit-frame-pointer, then you can enable the
+built-in perftools stack unwinder by passing the
+--enable-frame-pointers flag to configure.
+
+Even with the use of libunwind, there are still known problems with
+stack unwinding on 64-bit systems, particularly x86-64. See the
+"64-BIT ISSUES" section in README.
+
+If you encounter problems, try compiling perftools with './configure
+--enable-frame-pointers'. Note you will need to compile your
+application with frame pointers (via 'gcc -fno-omit-frame-pointer
+...') in this case.
+
+
+*** TCMALLOC LARGE PAGES: TRADING TIME FOR SPACE
+
+Internally, tcmalloc divides its memory into "pages." The default
+page size is chosen to minimize memory use by reducing fragmentation.
+The cost is that keeping track of these pages can cost tcmalloc time.
+We've added a new, experimental flag to tcmalloc that enables a larger
+page size. In general, this will increase the memory needs of
+applications using tcmalloc. However, in many cases it will speed up
+the applications as well, particularly if they allocate and free a lot
+of memory. We've seen average speedups of 3-5% on Google
+applications.
+
+This feature is still very experimental; it's not even a configure
+flag yet. To build libtcmalloc with large pages, run
+
+ ./configure <normal flags> CXXFLAGS=-DTCMALLOC_LARGE_PAGES
+
+(or add -DTCMALLOC_LARGE_PAGES to your existing CXXFLAGS argument).
+
+
+*** NOTE FOR ___tls_get_addr ERROR
+
+When compiling perftools on some old systems, like RedHat 8, you may
+get an error like this:
+ ___tls_get_addr: symbol not found
+
+This means that you have a system where some parts are updated enough
+to support Thread Local Storage, but others are not. The perftools
+configure script can't always detect this kind of case, leading to
+that error. To fix it, just comment out the line
+ #define HAVE_TLS 1
+in your config.h file before building.
+
+
+*** TCMALLOC AND DLOPEN
+
+To improve performance, we use the "initial exec" model of Thread
+Local Storage in tcmalloc. The price for this is the library will not
+work correctly if it is loaded via dlopen(). This should not be a
+problem, since loading a malloc-replacement library via dlopen is
+asking for trouble in any case: some data will be allocated with one
+malloc, some with another. If, for some reason, you *do* need to use
+dlopen on tcmalloc, the easiest way is to use a version of tcmalloc
+with TLS turned off; see the ___tls_get_addr note above.
+
+
+*** COMPILING ON NON-LINUX SYSTEMS
+
+Perftools has been tested on the following systems:
+ FreeBSD 6.0 (x86)
+ Linux Fedora Core 3 (x86)
+ Linux Fedora Core 4 (x86)
+ Linux Fedora Core 5 (x86)
+ Linux Fedora Core 6 (x86)
+ Linux Ubuntu 6.06.1 (x86)
+ Linux Ubuntu 6.06.1 (x86_64)
+ Linux RedHat 9 (x86)
+ Linux Debian 4.0 (PPC)
+ Mac OS X 10.3.9 (Panther) (PowerPC)
+ Mac OS X 10.4.8 (Tiger) (PowerPC)
+ Mac OS X 10.4.8 (Tiger) (x86)
+ Mac OS X 10.5 (Leopard) (x86)
+ Solaris 10 (x86)
+ Windows XP, Visual Studio 2003 (VC++ 7) (x86)
+ Windows XP, Visual Studio 2005 (VC++ 8) (x86)
+ Windows XP, MinGW 5.1.3 (x86)
+ Windows XP, Cygwin 5.1 (x86)
+
+It works in its full generality on the Linux systems
+tested (though see 64-bit notes above). Portions of perftools work on
+the other systems. The basic memory-allocation library,
+tcmalloc_minimal, works on all systems. The cpu-profiler also works
+fairly widely. However, the heap-profiler and heap-checker are not
+yet as widely supported. In general, the 'configure' script will
+detect what OS you are building for, and only build the components
+that work on that OS.
+
+Note that tcmalloc_minimal is perfectly usable as a malloc/new
+replacement, so it is possible to use tcmalloc on all the systems
+above, by linking in libtcmalloc_minimal.
+
+** FreeBSD:
+
+ The following binaries build and run successfully (creating
+ libtcmalloc_minimal.so and libprofile.so in the process):
+ % ./configure
+ % make tcmalloc_minimal_unittest tcmalloc_minimal_large_unittest \
+ addressmap_unittest atomicops_unittest frag_unittest \
+ low_level_alloc_unittest markidle_unittest memalign_unittest \
+ packed_cache_test stacktrace_unittest system_alloc_unittest \
+ thread_dealloc_unittest profiler_unittest.sh
+ % ./tcmalloc_minimal_unittest # to run this test
+ % [etc] # to run other tests
+
+ Three caveats: first, frag_unittest tries to allocate 400M of memory,
+ and if you have less virtual memory on your system, the test may
+ fail with a bad_alloc exception.
+
+ Second, profiler_unittest.sh sometimes fails in the "fork" test.
+ This is because stray SIGPROF signals from the parent process are
+ making their way into the child process. (This may be a kernel
+ bug that only exists in older kernels.) The profiling code itself
+ is working fine. This only affects programs that call fork(); for
+ most programs, the cpu profiler is entirely safe to use.
+
+ Third, perftools depends on /proc to get shared library
+ information. If you are running a FreeBSD system without proc,
+ perftools will not be able to map addresses to functions. Some
+ unittests will fail as a result.
+
+ Finally, the new test introduced in perftools-1.2,
+ profile_handler_unittest, fails on FreeBSD. It has something to do
+ with how the itimer works. The cpu profiler test passes, so I
+ believe the functionality is correct and the issue is with the test
+ somehow. If anybody is an expert on itimers and SIGPROF in
+ FreeBSD, and would like to debug this, I'd be glad to hear the
+ results!
+
+ libtcmalloc.so successfully builds, and the "advanced" tcmalloc
+ functionality all works except for the leak-checker, which has
+ Linux-specific code:
+ % make heap-profiler_unittest.sh maybe_threads_unittest.sh \
+ tcmalloc_unittest tcmalloc_both_unittest \
+ tcmalloc_large_unittest # THESE WORK
+ % make -k heap-checker_unittest.sh \
+ heap-checker-death_unittest.sh # THESE DO NOT
+
+ Note that unless you specify --enable-heap-checker explicitly,
+ 'make' will not build the heap-checker unittests on a FreeBSD
+ system.
+
+ I have not tested other *BSD systems, but they are probably similar.
+
+** Mac OS X:
+
+ I've tested OS X 10.5 [Leopard], OS X 10.4 [Tiger] and OS X 10.3
+ [Panther] on both intel (x86) and PowerPC systems. For Panther
+ systems, perftools does not work at all: it depends on a header
+ file, OSAtomic.h, which is new in 10.4. (It's possible to get the
+ code working for Panther/i386 without too much work; if you're
+ interested in exploring this, drop an e-mail.)
+
+ For the other seven systems, the binaries and libraries that
+ successfully build are exactly the same as for FreeBSD. See that
+ section for a list of binaries and instructions on building them.
+
+ In addition, it appears OS X regularly fails profiler_unittest.sh
+ in the "thread" test (in addition to occassionally failing in the
+ "fork" test). It looks like OS X often delivers the profiling
+ signal to the main thread, even when it's sleeping, rather than
+ spawned threads that are doing actual work. If anyone knows
+ details of how OS X handles SIGPROF (via setitimer()) events with
+ threads, and has insight into this problem, please send mail to
+ google-perftools@googlegroups.com.
+
+** Solaris 10 x86:
+
+ I've only tested using the GNU C++ compiler, not the Sun C++
+ compiler. Using g++ requires setting the PATH appropriately when
+ configuring.
+
+ % PATH=${PATH}:/usr/sfw/bin/:/usr/ccs/bin ./configure
+ % PATH=${PATH}:/usr/sfw/bin/:/usr/ccs/bin make [...]
+
+ Again, the binaries and libraries that successfully build are
+ exactly the same as for FreeBSD. (However, while libprofiler.so can
+ be used to generate profiles, pprof is not very successful at
+ reading them -- necessary helper programs like nm don't seem
+ to be installed by default on Solaris, or perhaps are only
+ installed as part of the Sun C++ compiler package.) See that
+ section for a list of binaries, and instructions on building them.
+
+** Windows:
+
+ Work on Windows is rather preliminary: we haven't found a good way
+ to get stack traces in release mode on windows (that is, when FPO
+ is enabled), so the heap profiling may not be reliable in that
+ case. Also, heap-checking and CPU profiling do not yet work at
+ all. But as in other ports, the basic tcmalloc library
+ functionality, overriding malloc and new and such (and even
+ windows-specific functions like _aligned_malloc!), is working fine,
+ at least with VC++ 7.1 (Visual Studio 2003) and VC++ 8.0
+ (Visual Studio 2005), in both debug and release modes. See
+ README.windows for instructions on how to install on Windows using
+ Visual Studio.
+
+ Cygwin can compile some but not all of perftools. Furthermore,
+ there is a problem with exception-unwinding in cygwin (it can call
+ malloc, which can call the exception-unwinding-setup code, which
+ can lead to an infinite loop). I've comitted a workaround to the
+ exception unwinding problem, but it only works in debug mode and
+ when statically linking in tcmalloc. I hope to have a more proper
+ fix in a later release. To configure under cygwin, run
+
+ ./configure --disable-shared CXXFLAGS=-g && make
+
+ Most of cygwin will compile (cygwin doesn't allow weak symbols, so
+ the heap-checker and a few other pieces of functionality will not
+ compile). 'make' will compile those libraries and tests that can
+ be compiled. You can run 'make check' to make sure the basic
+ functionality is working. I've heard reports that some versions of
+ cygwin fail calls to pthread_join() with EINVAL, causing several
+ tests to fail. If you have any insight into this, please mail
+ google-perftools@googlegroups.com.
+
+ This Windows functionality is also available using MinGW and Msys,
+ In this case, you can use the regular './configure && make'
+ process. 'make install' should also work. The Makefile will limit
+ itself to those libraries and binaries that work on windows.
+
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
View
1,279 distro/google-perftools-1.7/Makefile.am
@@ -0,0 +1,1279 @@
+## Process this file with automake to produce Makefile.in
+
+# Note: for every library we create, we're explicit about what symbols
+# we export. In order to avoid complications with C++ mangling, we always
+# use the regexp for of specifying symbols.
+
+# Make sure that when we re-make ./configure, we get the macros we need
+ACLOCAL_AMFLAGS = -I m4
+
+# This is so we can #include <google/foo>
+AM_CPPFLAGS = -I$(top_srcdir)/src
+
+if !WITH_STACK_TRACE
+AM_CPPFLAGS += -DNO_TCMALLOC_SAMPLES
+endif !WITH_STACK_TRACE
+
+# This is mostly based on configure options
+AM_CXXFLAGS =
+
+# These are good warnings to turn on by default. We also tell gcc
+# that malloc, free, realloc, mmap, etc. are not builtins (these flags
+# are supported since gcc 3.1.1). gcc doesn't think most of them are
+# builtins now in any case, but it's best to be explicit in case that
+# changes one day. gcc ignores functions it doesn't understand.
+if GCC
+AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare \
+ -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc \
+ -fno-builtin-calloc -fno-builtin-cfree \
+ -fno-builtin-memalign -fno-builtin-posix_memalign \
+ -fno-builtin-valloc -fno-builtin-pvalloc
+endif GCC
+
+# The -no-undefined flag allows libtool to generate shared libraries for
+# Cygwin and MinGW. LIBSTDCXX_LA_LINKER_FLAG is used to fix a Solaris bug.
+AM_LDFLAGS = -no-undefined $(LIBSTDCXX_LA_LINKER_FLAG)
+
+# We know our low-level code cannot trigger an exception. On some
+# systems, such as cygwin, it would be disastrous if they did, because
+# the exception handler might call malloc! If our low-level routines
+# raised an exception within the malloc, they'd deadlock. Luckily,
+# we control all this code, and do not need exceptions for it.
+if GCC
+NO_EXCEPTIONS = -fno-exceptions
+else !GCC
+NO_EXCEPTIONS =
+endif !GCC
+
+# These are x86-specific, having to do with frame-pointers. In
+# particular, some x86_64 systems do not insert frame pointers by
+# default (all i386 systems that I know of, do. I don't know about
+# non-x86 chips). We need to tell perftools what to do about that.
+if X86_64_AND_NO_FP_BY_DEFAULT
+if ENABLE_FRAME_POINTERS
+AM_CXXFLAGS += -fno-omit-frame-pointer
+else
+ # TODO(csilvers): check if -fomit-frame-pointer might be in $(CXXFLAGS),
+ # before setting this.
+AM_CXXFLAGS += -DNO_FRAME_POINTER
+endif !ENABLE_FRAME_POINTERS
+endif X86_64_AND_NO_FP_BY_DEFAULT
+
+# For windows systems (at least, mingw), we need to tell all our
+# tests to link in libtcmalloc using -u. This is because libtcmalloc
+# accomplishes its tasks via patching, leaving no work for the linker
+# to identify, so the linker will ignore libtcmalloc by default unless
+# we explicitly create a dependency via -u.
+TCMALLOC_FLAGS =
+if MINGW
+TCMALLOC_FLAGS += -Wl,-u__tcmalloc
+endif MINGW
+
+# If we have objcopy, make malloc/free/etc weak symbols. That way folks
+# can override our malloc if they want to (they can still use tc_malloc).
+# Note: the weird-looking symbols are the c++ memory functions:
+# (in order) new, new(nothrow), new[], new[](nothrow), delete, delete[]
+# In theory this will break if mangling changes, but that seems pretty
+# unlikely at this point. Just in case, I throw in versions with an
+# extra underscore as well, which may help on OS X.
+if HAVE_OBJCOPY_WEAKEN
+WEAKEN = $(OBJCOPY) -W malloc -W free -W realloc -W calloc -W cfree \
+ -W memalign -W posix_memalign -W valloc -W pvalloc \
+ -W malloc_stats -W mallopt -W mallinfo \
+ -W _Znwm -W _ZnwmRKSt9nothrow_t -W _Znam -W _ZnamRKSt9nothrow_t \
+ -W _ZdlPv -W _ZdaPv \
+ -W __Znwm -W __ZnwmRKSt9nothrow_t -W __Znam -W __ZnamRKSt9nothrow_t \
+ -W __ZdlPv -W __ZdaPv
+else
+WEAKEN = :
+endif !HAVE_OBJCOPY_WEAKEN
+
+LIBS_TO_WEAKEN =
+
+googleincludedir = $(includedir)/google
+# The .h files you want to install (that is, .h files that people
+# who install this package can include in their own applications.)
+# We'll add to this later, on a library-by-library basis
+googleinclude_HEADERS =
+# tcmalloc.h is a special case, because it's a .h.in file
+nodist_googleinclude_HEADERS = src/google/tcmalloc.h
+noinst_HEADERS = src/google/tcmalloc.h.in
+
+docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
+# This is for HTML and other documentation you want to install.
+# Add your documentation files (in doc/) in addition to these
+# top-level boilerplate files. Also add a TODO file if you have one.
+# We'll add to this later, on a library-by-library basis
+dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README README_windows.txt \
+ TODO
+
+# The libraries (.so's) you want to install
+# We'll add to this later, on a library-by-library basis
+lib_LTLIBRARIES =
+# This is for 'convenience libraries' -- basically just a container for sources
+noinst_LTLIBRARIES =
+## The location of the windows project file for each binary we make
+WINDOWS_PROJECTS = google-perftools.sln
+
+# unittests you want to run when people type 'make check'.
+# Note: tests cannot take any arguments!
+# In theory, unittests that are scripts should be added to check_SCRIPTS
+# instead. But check_SCRIPTS is definitely a second-class testing mechanims:
+# it don't get TESTS_ENVIRONMENT, and it doesn't get success/failure counting
+# (in fact, a script failure aborts all the rest of the tests, even with -k).
+# So, for scripts, we add the script to tests, and also put in an empty
+# rule so automake doesn't try to build the script as a C binary.
+TESTS =
+# TESTS_ENVIRONMENT sets environment variables for when you run unittest.
+# We always get "srcdir" set for free.
+# We'll add to this later, on a library-by-library basis.
+TESTS_ENVIRONMENT =
+# All script tests should be added here
+noinst_SCRIPTS =
+# If your test calls another program that, like the test itself, shouldn't
+# be installed, add it here. (Stuff in TESTS is automatically added later).
+noinst_PROGRAMS =
+
+# Binaries we might build that should be installed
+bin_PROGRAMS =
+
+# This is my own var, used for extra libraries I make that I need installed
+EXTRA_INSTALL =
+
+## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
+
+dist_doc_DATA += doc/index.html doc/designstyle.css
+
+
+### ------- library routines, in src/base
+
+# This is a 'convenience library' -- it's not actually installed or anything
+LOGGING_INCLUDES = src/base/logging.h \
+ src/base/commandlineflags.h \
+ src/base/basictypes.h \
+ src/base/dynamic_annotations.h \
+ src/third_party/valgrind.h
+noinst_LTLIBRARIES += liblogging.la
+liblogging_la_SOURCES = src/base/logging.cc \
+ src/base/dynamic_annotations.c \
+ $(LOGGING_INCLUDES)
+
+SYSINFO_INCLUDES = src/base/sysinfo.h \
+ src/base/logging.h \
+ src/base/commandlineflags.h \
+ src/base/cycleclock.h \
+ src/base/basictypes.h
+noinst_LTLIBRARIES += libsysinfo.la
+libsysinfo_la_SOURCES = src/base/sysinfo.cc \
+ $(SYSINFO_INCLUDES)
+libsysinfo_la_LIBADD = $(NANOSLEEP_LIBS)
+
+# For MinGW, we use also have to use libwindows Luckily, we need the
+# windows.a library in exactly the same place we need spinlock.a
+# (pretty much everywhere), so we can use the same variable name for
+# each. We can also optimize the MinGW rule a bit by leaving out
+# files we know aren't used on windows, such as
+# atomicops-internals-x86.cc. libwindows also obsoletes the need for
+# other files like system_alloc.cc.
+if MINGW
+WINDOWS_INCLUDES = src/windows/port.h \
+ src/windows/mingw.h \
+ src/windows/mini_disassembler.h \
+ src/windows/mini_disassembler_types.h \
+ src/windows/preamble_patcher.h
+noinst_LTLIBRARIES += libwindows.la
+libwindows_la_SOURCES = $(WINDOWS_INCLUDES) \
+ src/windows/port.cc \
+ src/windows/ia32_modrm_map.cc \
+ src/windows/ia32_opcode_map.cc \
+ src/windows/mini_disassembler.cc \
+ src/windows/patch_functions.cc \
+ src/windows/preamble_patcher.cc \
+ src/windows/preamble_patcher_with_stub.cc
+# patch_functions.cc uses Psapi.lib. MSVC has a #pragma for that, but not us.
+libwindows_la_LIBADD = -lPsapi
+
+SPINLOCK_INCLUDES = src/base/spinlock.h \
+ src/base/spinlock_internal.h \
+ src/base/spinlock_win32-inl.h \
+ src/base/spinlock_linux-inl.h \
+ src/base/spinlock_posix-inl.h \
+ src/base/synchronization_profiling.h \
+ src/base/atomicops-internals-macosx.h \
+ src/base/atomicops-internals-linuxppc.h \
+ src/base/atomicops-internals-arm-gcc.h \
+ src/base/atomicops-internals-x86-msvc.h \
+ src/base/atomicops-internals-x86.h
+noinst_LTLIBRARIES += libspinlock.la
+libspinlock_la_SOURCES = src/base/spinlock.cc \
+ src/base/spinlock_internal.cc \
+ $(SPINLOCK_INCLUDES)
+
+LIBSPINLOCK = libwindows.la libspinlock.la libsysinfo.la liblogging.la
+
+# We also need to tell mingw that sysinfo.cc needs shlwapi.lib.
+# (We do this via a #pragma for msvc, but need to do it here for mingw).
+libsysinfo_la_LIBADD += -lshlwapi
+
+# patch_functions.cc #includes tcmalloc.cc, so no need to link it in.
+TCMALLOC_CC =
+# windows has its own system for threads and system memory allocation.
+MAYBE_THREADS_CC =
+SYSTEM_ALLOC_CC =
+else !MINGW
+# spinlock is the only code that uses atomicops.
+SPINLOCK_INCLUDES = src/base/spinlock.h \
+ src/base/spinlock_internal.h \
+ src/base/atomicops.h \
+ src/base/atomicops-internals-macosx.h \
+ src/base/atomicops-internals-linuxppc.h \
+ src/base/atomicops-internals-x86-msvc.h \
+ src/base/atomicops-internals-x86.h
+
+noinst_LTLIBRARIES += libspinlock.la
+libspinlock_la_SOURCES = src/base/spinlock.cc \
+ src/base/spinlock_internal.cc \
+ src/base/atomicops-internals-x86.cc \
+ $(SPINLOCK_INCLUDES)
+libspinlock_la_LIBADD = $(NANOSLEEP_LIBS)
+# spinlock also needs NumCPUs, from libsysinfo, which in turn needs liblogging
+LIBSPINLOCK = libspinlock.la libsysinfo.la liblogging.la
+
+TCMALLOC_CC = src/tcmalloc.cc
+MAYBE_THREADS_CC = src/maybe_threads.cc
+SYSTEM_ALLOC_CC = src/system-alloc.cc
+endif !MINGW
+
+### Unittests
+TESTS += low_level_alloc_unittest
+WINDOWS_PROJECTS += vsprojects/low_level_alloc_unittest/low_level_alloc_unittest.vcproj
+LOW_LEVEL_ALLOC_UNITTEST_INCLUDES = src/base/low_level_alloc.h \
+ src/base/basictypes.h \
+ src/google/malloc_hook.h \
+ src/google/malloc_hook_c.h \
+ src/malloc_hook-inl.h \
+ $(SPINLOCK_INCLUDES) \
+ $(LOGGING_INCLUDES)
+low_level_alloc_unittest_SOURCES = src/base/low_level_alloc.cc \
+ src/malloc_hook.cc \
+ src/tests/low_level_alloc_unittest.cc \
+ $(LOW_LEVEL_ALLOC_UNITTEST_INCLUDES)
+# By default, MallocHook takes stack traces for use by the heap-checker.
+# We don't need that functionality here, so we turn it off to reduce deps.
+low_level_alloc_unittest_CXXFLAGS = -DNO_TCMALLOC_SAMPLES
+low_level_alloc_unittest_LDADD = $(LIBSPINLOCK)
+
+TESTS += atomicops_unittest
+ATOMICOPS_UNITTEST_INCLUDES = src/base/atomicops.h \
+ src/base/atomicops-internals-macosx.h \
+ src/base/atomicops-internals-x86-msvc.h \
+ src/base/atomicops-internals-x86.h \
+ $(LOGGING_INCLUDES)
+atomicops_unittest_SOURCES = src/tests/atomicops_unittest.cc \
+ $(ATOMICOPS_UNITTEST_INCLUDES)
+atomicops_unittest_LDADD = $(LIBSPINLOCK)
+
+
+### ------- stack trace
+
+if WITH_STACK_TRACE
+
+### The header files we use. We divide into categories based on directory
+S_STACKTRACE_INCLUDES = src/stacktrace_config.h \
+ src/stacktrace_generic-inl.h \
+ src/stacktrace_libunwind-inl.h \
+ src/stacktrace_powerpc-inl.h \
+ src/stacktrace_x86_64-inl.h \
+ src/stacktrace_x86-inl.h \
+ src/stacktrace_win32-inl.h \
+ src/base/vdso_support.h
+SG_STACKTRACE_INCLUDES = src/google/stacktrace.h
+STACKTRACE_INCLUDES = $(S_STACKTRACE_INCLUDES) $(SG_STACKTRACE_INCLUDES)
+googleinclude_HEADERS += $(SG_STACKTRACE_INCLUDES)
+
+### Making the library
+noinst_LTLIBRARIES += libstacktrace.la
+libstacktrace_la_SOURCES = src/stacktrace.cc \
+ src/base/vdso_support.cc \
+ $(STACKTRACE_INCLUDES)
+libstacktrace_la_LIBADD = $(UNWIND_LIBS) $(LIBSPINLOCK)
+STACKTRACE_SYMBOLS = '(GetStackTrace|GetStackFrames|GetStackTraceWithContext|GetStackFramesWithContext)'
+libstacktrace_la_LDFLAGS = -export-symbols-regex $(STACKTRACE_SYMBOLS)
+
+### Unittests
+TESTS += stacktrace_unittest
+STACKTRACE_UNITTEST_INLCUDES = src/config_for_unittests.h \
+ src/base/commandlineflags.h \
+ $(STACKTRACE_INCLUDES) \
+ $(LOGGING_INCLUDES)
+stacktrace_unittest_SOURCES = src/tests/stacktrace_unittest.cc \
+ $(STACKTRACE_UNITTEST_INLCUDES)
+stacktrace_unittest_LDADD = libstacktrace.la liblogging.la
+
+### Documentation
+dist_doc_DATA +=
+
+endif WITH_STACK_TRACE
+
+### ------- pprof
+
+# If we are not compiling with stacktrace support, pprof is worthless
+if WITH_STACK_TRACE
+
+bin_SCRIPTS = src/pprof
+
+### Unittests
+
+check_SCRIPTS = pprof_unittest
+pprof_unittest: $(top_srcdir)/src/pprof
+ $(top_srcdir)/src/pprof -test
+
+# Let unittests find pprof if they need to run it
+TESTS_ENVIRONMENT += PPROF_PATH=$(top_srcdir)/src/pprof
+
+### Documentation
+dist_man_MANS = doc/pprof.1
+dist_doc_DATA += doc/pprof_remote_servers.html
+
+# On MSVC, we need our own versions of addr2line and nm to work with pprof.
+WINDOWS_PROJECTS += vsprojects/nm-pdb/nm-pdb.vcproj
+WINDOWS_PROJECTS += vsprojects/addr2line-pdb/addr2line-pdb.vcproj
+# This is a slight abuse of WINDOWS_PROJECTS, but not much
+WINDOWS_PROJECTS += src/windows/nm-pdb.c \
+ src/windows/addr2line-pdb.c
+
+endif WITH_STACK_TRACE
+
+### ------- tcmalloc_minimal (thread-caching malloc)
+
+### The header files we use. We divide into categories based on directory
+S_TCMALLOC_MINIMAL_INCLUDES = src/common.h \
+ src/internal_logging.h \
+ src/system-alloc.h \
+ src/packed-cache-inl.h \
+ $(SPINLOCK_INCLUDES) \
+ src/tcmalloc_guard.h \
+ src/base/commandlineflags.h \
+ src/base/basictypes.h \
+ src/pagemap.h \
+ src/sampler.h \
+ src/central_freelist.h \
+ src/linked_list.h \
+ src/page_heap.h \
+ src/page_heap_allocator.h \
+ src/span.h \
+ src/static_vars.h \
+ src/symbolize.h \
+ src/thread_cache.h \
+ src/stack_trace_table.h \
+ src/base/thread_annotations.h \
+ src/malloc_hook-inl.h \
+ src/maybe_threads.h
+SG_TCMALLOC_MINIMAL_INCLUDES = src/google/malloc_hook.h \
+ src/google/malloc_hook_c.h \
+ src/google/malloc_extension.h \
+ src/google/malloc_extension_c.h \
+ src/google/stacktrace.h
+TCMALLOC_MINIMAL_INCLUDES = $(S_TCMALLOC_MINIMAL_INCLUDES) $(SG_TCMALLOC_MINIMAL_INCLUDES)
+googleinclude_HEADERS += $(SG_TCMALLOC_MINIMAL_INCLUDES)
+
+### Making the library
+
+# As we describe at the top of this file, we want to turn off exceptions
+# for all files in this library -- except tcmalloc.cc which needs them
+# to fulfill its API. Automake doesn't allow per-file CXXFLAGS, so we need
+# to separate into two libraries.
+noinst_LTLIBRARIES += libtcmalloc_minimal_internal.la
+libtcmalloc_minimal_internal_la_SOURCES = src/common.cc \
+ src/internal_logging.cc \
+ $(SYSTEM_ALLOC_CC) \
+ src/memfs_malloc.cc \
+ src/central_freelist.cc \
+ src/page_heap.cc \
+ src/sampler.cc \
+ src/span.cc \
+ src/stack_trace_table.cc \
+ src/static_vars.cc \
+ src/symbolize.cc \
+ src/thread_cache.cc \
+ src/malloc_hook.cc \
+ src/malloc_extension.cc \
+ $(MAYBE_THREADS_CC) \
+ $(TCMALLOC_MINIMAL_INCLUDES)
+# We #define NO_TCMALLOC_SAMPLES, since sampling is turned off for _minimal.
+libtcmalloc_minimal_internal_la_CXXFLAGS = -DNO_TCMALLOC_SAMPLES \
+ -DNO_HEAP_CHECK \
+ $(PTHREAD_CFLAGS) -DNDEBUG \
+ $(AM_CXXFLAGS) $(NO_EXCEPTIONS)
+libtcmalloc_minimal_internal_la_LDFLAGS = $(PTHREAD_CFLAGS)
+libtcmalloc_minimal_internal_la_LIBADD = $(PTHREAD_LIBS) $(LIBSPINLOCK)
+
+lib_LTLIBRARIES += libtcmalloc_minimal.la
+WINDOWS_PROJECTS += vsprojects/libtcmalloc_minimal/libtcmalloc_minimal.vcproj
+libtcmalloc_minimal_la_SOURCES = $(TCMALLOC_CC) $(TCMALLOC_MINIMAL_INCLUDES)
+libtcmalloc_minimal_la_CXXFLAGS = -DNO_TCMALLOC_SAMPLES \
+ $(PTHREAD_CFLAGS) -DNDEBUG $(AM_CXXFLAGS)
+# -version-info gets passed to libtool
+libtcmalloc_minimal_la_LDFLAGS = $(PTHREAD_CFLAGS) -version-info @TCMALLOC_SO_VERSION@
+libtcmalloc_minimal_la_LIBADD = libtcmalloc_minimal_internal.la $(PTHREAD_LIBS)
+
+# For windows, we're playing around with trying to do some stacktrace
+# support even with libtcmalloc_minimal. For everyone else, though,
+# we turn off all stack-trace activity for libtcmalloc_minimal.
+# TODO(csilvers): when we're done experimenting, do something principled here
+if MINGW
+LIBTCMALLOC_MINIMAL = libtcmalloc_minimal.la libstacktrace.la
+else !MINGW
+LIBTCMALLOC_MINIMAL = libtcmalloc_minimal.la
+endif !MINGW
+
+LIBS_TO_WEAKEN += libtcmalloc_minimal.la
+
+### Unittests
+
+# Commented out for the moment because malloc(very_big_num) is broken in
+# standard libc! At least, in some situations, some of the time.
+## TESTS += malloc_unittest
+## MALLOC_UNITEST_INCLUDES = src/google/malloc_extension.h \
+## src/google/malloc_hook.h \
+## src/google/malloc_hook_c.h \
+## src/malloc_hook-inl.h \
+## src/base/basictypes.h \
+## src/maybe_threads.h
+## malloc_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
+## src/malloc_hook.cc \
+## src/malloc_extension.cc \
+## $(MAYBE_THREADS_CC) \
+## $(MALLOC_UNITTEST_INCLUDES)
+## malloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+## malloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
+## malloc_unittest_LDADD = $(PTHREAD_LIBS)
+
+TESTS += tcmalloc_minimal_unittest
+WINDOWS_PROJECTS += vsprojects/tcmalloc_minimal_unittest/tcmalloc_minimal_unittest.vcproj
+WINDOWS_PROJECTS += vsprojects/tmu-static/tmu-static.vcproj
+tcmalloc_minimal_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
+ src/tests/testutil.h src/tests/testutil.cc \
+ $(TCMALLOC_UNITTEST_INCLUDES)
+tcmalloc_minimal_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+tcmalloc_minimal_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+# We want libtcmalloc last on the link line, but due to a bug in
+# libtool involving convenience libs, they need to come last on the
+# link line in order to get dependency ordering right. This is ok:
+# convenience libraries are .a's, so tcmalloc is still the last .so.
+# We also put pthreads after tcmalloc, because some pthread
+# implementations define their own malloc, and we need to go on the
+# first linkline to make sure our malloc 'wins'.
+tcmalloc_minimal_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) \
+ liblogging.la $(PTHREAD_LIBS)
+
+TESTS += tcmalloc_minimal_large_unittest
+WINDOWS_PROJECTS += vsprojects/tcmalloc_minimal_large/tcmalloc_minimal_large_unittest.vcproj
+tcmalloc_minimal_large_unittest_SOURCES = src/tests/tcmalloc_large_unittest.cc
+tcmalloc_minimal_large_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+tcmalloc_minimal_large_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+tcmalloc_minimal_large_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+# This tests it works to LD_PRELOAD libtcmalloc (tests maybe_threads.cc)
+# In theory this should work under mingw, but mingw has trouble running
+# shell scripts that end in .exe. And it doesn't seem to build shared
+# libraries anyway (so can't be LD_PRELOADed) -- in fact, anybody who
+# chooses not to build shared libraries won't be able to run this test.
+# TODO(csilvers): figure out how to nix ".exe" or otherwise work under mingw
+if !MINGW
+if !ENABLE_STATIC
+TESTS += maybe_threads_unittest.sh$(EXEEXT)
+maybe_threads_unittest_sh_SOURCES = src/tests/maybe_threads_unittest.sh
+noinst_SCRIPTS += $(maybe_threads_unittest_sh_SOURCES)
+# This script preloads libtcmalloc, and calls two other binaries as well
+# TODO(csilvers): replace by 'if ! cmp $^ $@ >/dev/null 2>&; then ...; fi'
+maybe_threads_unittest.sh$(EXEEXT): $(top_srcdir)/$(maybe_threads_unittest_sh_SOURCES) \
+ $(LIBTCMALLOC_MINIMAL) \
+ low_level_alloc_unittest
+ rm -f $@
+ cp -p $(top_srcdir)/$(maybe_threads_unittest_sh_SOURCES) $@
+endif !ENABLE_STATIC
+endif !MINGW
+
+# These all tests components of tcmalloc_minimal
+
+TESTS += addressmap_unittest
+WINDOWS_PROJECTS += vsprojects/addressmap_unittest/addressmap_unittest.vcproj
+ADDRESSMAP_UNITTEST_INCLUDES = src/addressmap-inl.h \
+ src/base/commandlineflags.h \
+ $(LOGGING_INCLUDES)
+addressmap_unittest_SOURCES = src/tests/addressmap_unittest.cc \
+ $(ADDRESSMAP_UNITTEST_INCLUDES)
+if MINGW
+addressmap_unittest_SOURCES += src/windows/port.h src/windows/port.cc
+endif MINGW
+addressmap_unittest_CXXFLAGS = -g $(AM_CXXFLAGS)
+addressmap_unittest_LDADD = liblogging.la
+
+if !MINGW
+TESTS += system_alloc_unittest
+system_alloc_unittest_SOURCES = src/config_for_unittests.h \
+ src/tests/system-alloc_unittest.cc
+system_alloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+system_alloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+system_alloc_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+endif !MINGW
+
+TESTS += packed_cache_test
+WINDOWS_PROJECTS += vsprojects/packed-cache_test/packed-cache_test.vcproj
+packed_cache_test_SOURCES = src/tests/packed-cache_test.cc
+packed_cache_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+packed_cache_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+packed_cache_test_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+TESTS += frag_unittest
+WINDOWS_PROJECTS += vsprojects/frag_unittest/frag_unittest.vcproj
+frag_unittest_SOURCES = src/tests/frag_unittest.cc src/config_for_unittests.h
+frag_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+frag_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+frag_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+TESTS += markidle_unittest
+WINDOWS_PROJECTS += vsprojects/markidle_unittest/markidle_unittest.vcproj
+markidle_unittest_SOURCES = src/tests/markidle_unittest.cc \
+ src/config_for_unittests.h \
+ src/tests/testutil.h src/tests/testutil.cc
+markidle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+markidle_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+markidle_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+TESTS += malloc_extension_test
+WINDOWS_PROJECTS += vsprojects/malloc_extension_test/malloc_extension_test.vcproj
+malloc_extension_test_SOURCES = src/tests/malloc_extension_test.cc \
+ src/config_for_unittests.h \
+ src/base/logging.h \
+ src/google/malloc_extension.h \
+ src/google/malloc_extension_c.h
+malloc_extension_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+malloc_extension_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+malloc_extension_test_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+# This doesn't work with static linkage, because libtcmalloc.a isn't
+# happy with C linkage (it misses the stdc++ library). Likewise with
+# mingw, which links foo.a even though it doesn't set ENABLE_STATIC.
+# TODO(csilvers): set enable_static=true in configure.ac:36?
+if !MINGW
+if !ENABLE_STATIC
+TESTS += malloc_extension_c_test
+malloc_extension_c_test_SOURCES = src/tests/malloc_extension_c_test.c \
+ src/google/malloc_extension.h \
+ src/google/malloc_extension_c.h
+malloc_extension_c_test_CFLAGS = $(PTHREAD_CFLAGS) $(AM_CFLAGS)
+# -ansi here is just to help ensure the code is bog-standard C.
+if GCC
+malloc_extension_c_test_CFLAGS += -ansi
+endif GCC
+malloc_extension_c_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+malloc_extension_c_test_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+endif !ENABLE_STATIC
+endif !MINGW
+
+if !MINGW
+TESTS += memalign_unittest
+memalign_unittest_SOURCES = src/tests/memalign_unittest.cc \
+ src/tcmalloc.h \
+ src/config_for_unittests.h \
+ src/tests/testutil.h src/tests/testutil.cc
+memalign_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+memalign_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+memalign_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+endif !MINGW
+
+TESTS += page_heap_test
+WINDOWS_PROJECTS += vsprojects/page_heap_test/page_heap_test.vcproj
+page_heap_test_SOURCES = src/tests/page_heap_test.cc \
+ src/config_for_unittests.h \
+ src/base/logging.h \
+ src/common.h \
+ src/page_heap.h
+page_heap_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+page_heap_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+page_heap_test_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+TESTS += pagemap_unittest
+WINDOWS_PROJECTS += vsprojects/pagemap_unittest/pagemap_unittest.vcproj
+pagemap_unittest_SOURCES = src/tests/pagemap_unittest.cc \
+ src/config_for_unittests.h \
+ src/base/logging.h \
+ src/pagemap.h
+pagemap_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+pagemap_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+pagemap_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+TESTS += realloc_unittest
+WINDOWS_PROJECTS += vsprojects/realloc_unittest/realloc_unittest.vcproj
+realloc_unittest_SOURCES = src/tests/realloc_unittest.cc \
+ src/config_for_unittests.h \
+ src/base/logging.h
+realloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+realloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+realloc_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+TESTS += stack_trace_table_test
+WINDOWS_PROJECTS += vsprojects/stack_trace_table_test/stack_trace_table_test.vcproj
+stack_trace_table_test_SOURCES = src/tests/stack_trace_table_test.cc \
+ src/config_for_unittests.h
+stack_trace_table_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+stack_trace_table_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+stack_trace_table_test_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+TESTS += thread_dealloc_unittest
+WINDOWS_PROJECTS += vsprojects/thread_dealloc_unittest/thread_dealloc_unittest.vcproj
+thread_dealloc_unittest_SOURCES = src/tests/thread_dealloc_unittest.cc \
+ src/config_for_unittests.h \
+ src/tests/testutil.h src/tests/testutil.cc
+thread_dealloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+thread_dealloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+thread_dealloc_unittest_LDADD = $(LIBTCMALLOC_MINIMAL) $(PTHREAD_LIBS)
+
+### Documentation
+dist_doc_DATA += doc/tcmalloc.html \
+ doc/overview.gif \
+ doc/pageheap.gif \
+ doc/spanmap.gif \
+ doc/threadheap.gif \
+ doc/t-test1.times.txt \
+ doc/tcmalloc-opspercpusec.vs.threads.1024.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.128.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.131072.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.16384.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.2048.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.256.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.32768.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.4096.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.512.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.64.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.65536.bytes.png \
+ doc/tcmalloc-opspercpusec.vs.threads.8192.bytes.png \
+ doc/tcmalloc-opspersec.vs.size.1.threads.png \
+ doc/tcmalloc-opspersec.vs.size.12.threads.png \
+ doc/tcmalloc-opspersec.vs.size.16.threads.png \
+ doc/tcmalloc-opspersec.vs.size.2.threads.png \
+ doc/tcmalloc-opspersec.vs.size.20.threads.png \
+ doc/tcmalloc-opspersec.vs.size.3.threads.png \
+ doc/tcmalloc-opspersec.vs.size.4.threads.png \
+ doc/tcmalloc-opspersec.vs.size.5.threads.png \
+ doc/tcmalloc-opspersec.vs.size.8.threads.png
+
+# I don't know how to say "distribute the .dot files but don't install them";
+# noinst doesn't seem to work with data. I separate them out anyway, in case
+# one day we figure it out. Regardless, installing the dot files isn't the
+# end of the world.
+dist_doc_DATA += doc/overview.dot \
+ doc/pageheap.dot \
+ doc/spanmap.dot \
+ doc/threadheap.dot
+
+
+### ------- tcmalloc_minimal_debug (thread-caching malloc with debugallocation)
+
+# Like tcmalloc.cc, debugallocation.cc needs exceptions to fulfill its
+# API. Luckily, we can reuse everything else from tcmalloc_minimal.
+
+if WITH_DEBUGALLOC
+
+lib_LTLIBRARIES += libtcmalloc_minimal_debug.la
+libtcmalloc_minimal_debug_la_SOURCES = src/debugallocation.cc \
+ $(TCMALLOC_MINIMAL_INCLUDES)
+libtcmalloc_minimal_debug_la_CXXFLAGS = $(libtcmalloc_minimal_la_CXXFLAGS) \
+ -DTCMALLOC_FOR_DEBUGALLOCATION
+# version_info gets passed to libtool
+libtcmalloc_minimal_debug_la_LDFLAGS = $(libtcmalloc_minimal_la_LDFLAGS) \
+ -version-info @TCMALLOC_SO_VERSION@
+libtcmalloc_minimal_debug_la_LIBADD = $(libtcmalloc_minimal_la_LIBADD)
+
+LIBS_TO_WEAKEN += libtcmalloc_minimal_debug.la
+
+### Unittests
+
+TESTS += tcmalloc_minimal_debug_unittest
+tcmalloc_minimal_debug_unittest_SOURCES = $(tcmalloc_minimal_unittest_SOURCES)
+tcmalloc_minimal_debug_unittest_CXXFLAGS = $(tcmalloc_minimal_unittest_CXXFLAGS) \
+ -DDEBUGALLOCATION
+tcmalloc_minimal_debug_unittest_LDFLAGS = $(tcmalloc_minimal_unittest_LDFLAGS)
+tcmalloc_minimal_debug_unittest_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
+
+TESTS += malloc_extension_debug_test
+malloc_extension_debug_test_SOURCES = $(malloc_extension_test_SOURCES)
+malloc_extension_debug_test_CXXFLAGS = $(malloc_extension_test_CXXFLAGS)
+malloc_extension_debug_test_LDFLAGS = $(malloc_extension_test_LDFLAGS)
+malloc_extension_debug_test_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
+
+TESTS += memalign_debug_unittest
+memalign_debug_unittest_SOURCES = $(memalign_unittest_SOURCES)
+memalign_debug_unittest_CXXFLAGS = $(memalign_unittest_CXXFLAGS)
+memalign_debug_unittest_LDFLAGS = $(memalign_unittest_LDFLAGS)
+memalign_debug_unittest_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
+
+TESTS += realloc_debug_unittest
+realloc_debug_unittest_SOURCES = $(realloc_unittest_SOURCES)
+realloc_debug_unittest_CXXFLAGS = $(realloc_unittest_CXXFLAGS)
+realloc_debug_unittest_LDFLAGS = $(realloc_unittest_LDFLAGS)
+realloc_debug_unittest_LDADD = libtcmalloc_minimal_debug.la $(PTHREAD_LIBS)
+
+TESTS += debugallocation_test.sh$(EXEEXT)
+debugallocation_test_sh_SOURCES = src/tests/debugallocation_test.sh
+noinst_SCRIPTS += $(debugallocation_test_sh_SOURCES)
+debugallocation_test.sh$(EXEEXT): $(top_srcdir)/$(debugallocation_test_sh_SOURCES) \
+ debugallocation_test
+ rm -f $@
+ cp -p $(top_srcdir)/$(debugallocation_test_sh_SOURCES) $@
+
+# This is the sub-program used by debugallocation_test.sh
+noinst_PROGRAMS += debugallocation_test
+debugallocation_test_SOURCES = src/tests/debugallocation_test.cc
+debugallocation_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+debugallocation_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+debugallocation_test_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
+
+endif WITH_DEBUGALLOC
+
+
+### ------- tcmalloc (thread-caching malloc + heap profiler + heap checker)
+
+if WITH_HEAP_PROFILER_OR_CHECKER
+
+### The header files we use. We divide into categories based on directory
+S_TCMALLOC_INCLUDES = $(S_TCMALLOC_MINIMAL_INCLUDES) \
+ $(LOGGING_INCLUDES) \
+ src/addressmap-inl.h \
+ src/raw_printer.h \
+ src/base/elfcore.h \
+ src/base/googleinit.h \
+ src/base/linux_syscall_support.h \
+ src/base/linuxthreads.h \
+ src/base/stl_allocator.h \
+ src/base/sysinfo.h \
+ src/base/thread_lister.h \
+ src/heap-profile-table.h
+SG_TCMALLOC_INCLUDES = $(SG_TCMALLOC_MINIMAL_INCLUDES) \
+ src/google/heap-profiler.h \
+ src/google/heap-checker.h
+TCMALLOC_INCLUDES = $(S_TCMALLOC_INCLUDES) $(SG_TCMALLOC_INCLUDES)
+googleinclude_HEADERS += $(SG_TCMALLOC_INCLUDES)
+
+### Making the library
+
+# As we describe at the top of this file, we want to turn off exceptions
+# for all files in this library -- except tcmalloc.cc which needs them
+# to fulfill its API. Automake doesn't allow per-file CXXFLAGS, so we need
+# to separate into two libraries.
+noinst_LTLIBRARIES += libtcmalloc_internal.la
+libtcmalloc_internal_la_SOURCES = $(libtcmalloc_minimal_internal_la_SOURCES) \
+ $(TCMALLOC_INCLUDES) \
+ src/base/low_level_alloc.cc \
+ src/heap-profile-table.cc \
+ src/heap-profiler.cc \
+ src/raw_printer.cc \
+ src/memory_region_map.cc
+libtcmalloc_internal_la_CXXFLAGS = $(PTHREAD_CFLAGS) -DNDEBUG \
+ $(AM_CXXFLAGS) $(NO_EXCEPTIONS)
+libtcmalloc_internal_la_LDFLAGS = $(PTHREAD_CFLAGS)
+libtcmalloc_internal_la_LIBADD = libstacktrace.la $(PTHREAD_LIBS)
+
+lib_LTLIBRARIES += libtcmalloc.la
+libtcmalloc_la_SOURCES = $(TCMALLOC_CC) $(TCMALLOC_INCLUDES)
+libtcmalloc_la_CXXFLAGS = $(PTHREAD_CFLAGS) -DNDEBUG $(AM_CXXFLAGS)
+libtcmalloc_la_LDFLAGS = $(PTHREAD_CFLAGS) -version-info @TCMALLOC_SO_VERSION@
+libtcmalloc_la_LIBADD = libtcmalloc_internal.la $(PTHREAD_LIBS)
+
+if WITH_HEAP_CHECKER
+# heap-checker-bcad is last, in hopes its global ctor will run first.
+# (Note this is added to libtcmalloc.la, not libtcmalloc_internal.la,
+# but that's ok; the internal/external distinction is only useful for
+# cygwin, and cygwin doesn't use HEAP_CHECKER anyway.)
+HEAP_CHECKER_SOURCES = src/base/thread_lister.c \
+ src/base/linuxthreads.cc \
+ src/heap-checker.cc \
+ src/heap-checker-bcad.cc
+libtcmalloc_la_SOURCES += $(HEAP_CHECKER_SOURCES)
+else !WITH_HEAP_CHECKER
+HEAP_CHECKER_SOURCES =
+libtcmalloc_internal_la_CXXFLAGS += -DNO_HEAP_CHECK
+libtcmalloc_la_CXXFLAGS += -DNO_HEAP_CHECK
+endif !WITH_HEAP_CHECKER
+
+LIBTCMALLOC = libtcmalloc.la
+
+LIBS_TO_WEAKEN += libtcmalloc.la
+
+### Unittests
+
+TESTS += tcmalloc_unittest
+TCMALLOC_UNITTEST_INCLUDES = src/config_for_unittests.h \
+ src/google/malloc_extension.h
+tcmalloc_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
+ src/tcmalloc.h \
+ src/tests/testutil.h src/tests/testutil.cc \
+ $(TCMALLOC_UNITTEST_INCLUDES)
+tcmalloc_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+tcmalloc_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+# We want libtcmalloc last on the link line, but due to a bug in
+# libtool involving convenience libs, they need to come last on the
+# link line in order to get dependency ordering right. This is ok:
+# convenience libraries are .a's, so tcmalloc is still the last .so.
+# We also put pthreads after tcmalloc, because some pthread
+# implementations define their own malloc, and we need to go on the
+# first linkline to make sure our malloc 'wins'.
+tcmalloc_unittest_LDADD = $(LIBTCMALLOC) liblogging.la $(PTHREAD_LIBS)
+
+# This makes sure it's safe to link in both tcmalloc and
+# tcmalloc_minimal. (One would never do this on purpose, but perhaps
+# by accident...) When we can compile libprofiler, we also link it in
+# to make sure that works too.
+
+TESTS += tcmalloc_both_unittest
+tcmalloc_both_unittest_SOURCES = src/tests/tcmalloc_unittest.cc \
+ src/tests/testutil.h src/tests/testutil.cc \
+ $(TCMALLOC_UNITTEST_INCLUDES)
+tcmalloc_both_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+tcmalloc_both_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+if WITH_CPU_PROFILER
+# We want libtcmalloc last on the link line, but due to a bug in
+# libtool involving convenience libs, they need to come last on the
+# link line in order to get dependency ordering right. This is ok:
+# convenience libraries are .a's, so tcmalloc is still the last .so.
+# We also put pthreads after tcmalloc, because some pthread
+# implementations define their own malloc, and we need to go on the
+# first linkline to make sure our malloc 'wins'.
+tcmalloc_both_unittest_LDADD = $(LIBTCMALLOC) $(LIBTCMALLOC_MINIMAL) \
+ libprofiler.la liblogging.la $(PTHREAD_LIBS)
+else
+tcmalloc_both_unittest_LDADD = $(LIBTCMALLOC) $(LIBTCMALLOC_MINIMAL) \
+ liblogging.la $(PTHREAD_LIBS)
+endif !WITH_CPU_PROFILER
+
+TESTS += tcmalloc_large_unittest
+tcmalloc_large_unittest_SOURCES = src/tests/tcmalloc_large_unittest.cc
+tcmalloc_large_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+tcmalloc_large_unittest_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+tcmalloc_large_unittest_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
+
+TESTS += raw_printer_test
+raw_printer_test_SOURCES = src/tests/raw_printer_test.cc
+raw_printer_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+raw_printer_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+raw_printer_test_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
+
+# sampler_test and sampling_test both require sampling to be turned
+# on, which it's not by default. Use the "standard" value of 2^19.
+TESTS_ENVIRONMENT += TCMALLOC_SAMPLE_PARAMETER=524288
+
+TESTS += sampler_test
+WINDOWS_PROJECTS += vsprojects/sampler_test/sampler_test.vcproj
+sampler_test_SOURCES = src/tests/sampler_test.cc \
+ src/config_for_unittests.h
+sampler_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+sampler_test_LDFLAGS = $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+sampler_test_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS) -lm
+
+
+# These unittests often need to run binaries. They're in the current dir
+TESTS_ENVIRONMENT += BINDIR=.
+TESTS_ENVIRONMENT += TMPDIR=/tmp/perftools
+
+TESTS += sampling_test.sh$(EXEEXT)
+sampling_test_sh_SOURCES = src/tests/sampling_test.sh
+noinst_SCRIPTS += $(sampling_test_sh_SOURCES)
+sampling_test.sh$(EXEEXT): $(top_srcdir)/$(sampling_test_sh_SOURCES) \
+ sampling_test
+ rm -f $@
+ cp -p $(top_srcdir)/$(sampling_test_sh_SOURCES) $@
+
+# This is the sub-program used by sampling_test.sh
+# The -g is so pprof can get symbol information.
+noinst_PROGRAMS += sampling_test
+SAMPLING_TEST_INCLUDES = src/config_for_unittests.h \
+ src/base/logging.h \
+ src/google/malloc_extension.h
+sampling_test_SOURCES = src/tests/sampling_test.cc \
+ $(SAMPLING_TEST_INCLUDES)
+sampling_test_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+sampling_test_LDFLAGS = -g $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+sampling_test_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
+
+endif WITH_HEAP_PROFILER_OR_CHECKER
+
+if WITH_HEAP_PROFILER
+
+TESTS += heap-profiler_unittest.sh$(EXEEXT)
+heap_profiler_unittest_sh_SOURCES = src/tests/heap-profiler_unittest.sh
+noinst_SCRIPTS += $(heap_profiler_unittest_sh_SOURCES)
+heap-profiler_unittest.sh$(EXEEXT): $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) \
+ heap-profiler_unittest
+ rm -f $@
+ cp -p $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) $@
+
+# These are sub-programs used by heap-profiler_unittest.sh
+noinst_PROGRAMS += heap-profiler_unittest
+HEAP_PROFILER_UNITTEST_INCLUDES = src/config_for_unittests.h \
+ src/google/heap-profiler.h
+heap_profiler_unittest_SOURCES = src/tests/heap-profiler_unittest.cc \
+ $(HEAP_PROFILER_UNITTEST_INCLUDES)
+heap_profiler_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+heap_profiler_unittest_LDFLAGS = -g $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+heap_profiler_unittest_LDADD = $(LIBTCMALLOC) $(PTHREAD_LIBS)
+
+endif WITH_HEAP_PROFILER
+
+if WITH_HEAP_CHECKER
+
+TESTS += heap-checker_unittest.sh$(EXEEXT)
+heap_checker_unittest_sh_SOURCES = src/tests/heap-checker_unittest.sh
+noinst_SCRIPTS += $(heap_checker_unittest_sh_SOURCES)
+heap-checker_unittest.sh$(EXEEXT): $(top_srcdir)/$(heap_checker_unittest_sh_SOURCES) \
+ heap-checker_unittest
+ rm -f $@
+ cp -p $(top_srcdir)/$(heap_checker_unittest_sh_SOURCES) $@
+
+TESTS += heap-checker-death_unittest.sh$(EXEEXT)
+heap_checker_death_unittest_sh_SOURCES = src/tests/heap-checker-death_unittest.sh
+noinst_SCRIPTS += $(top_srcdir)/$(heap_checker_death_unittest_sh_SOURCES)
+heap-checker-death_unittest.sh$(EXEEXT): $(heap_checker_death_unittest_sh_SOURCES) \
+ heap-checker_unittest
+ rm -f $@
+ cp -p $(top_srcdir)/$(heap_checker_death_unittest_sh_SOURCES) $@
+
+# These are sub-programs used by heap-checker_unittest.sh
+noinst_PROGRAMS += heap-checker_unittest
+HEAP_CHECKER_UNITTEST_INCLUDES = src/config_for_unittests.h \
+ src/memory_region_map.h \
+ src/base/commandlineflags.h \
+ src/base/googleinit.h \
+ src/google/heap-checker.h \
+ $(LOGGING_INCLUDES)
+heap_checker_unittest_SOURCES = src/tests/heap-checker_unittest.cc \
+ $(HEAP_CHECKER_UNITTEST_INCLUDES)
+heap_checker_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+heap_checker_unittest_LDFLAGS = -g $(PTHREAD_CFLAGS) $(TCMALLOC_FLAGS)
+# We want libtcmalloc last on the link line, but due to a bug in
+# libtool involving convenience libs, they need to come last on the
+# link line in order to get dependency ordering right. This is ok:
+# convenience libraries are .a's, so tcmalloc is still the last .so.
+# We also put pthreads after tcmalloc, because some pthread
+# implementations define their own malloc, and we need to go on the
+# first linkline to make sure our malloc 'wins'.
+heap_checker_unittest_LDADD = $(LIBTCMALLOC) liblogging.la $(PTHREAD_LIBS)
+
+endif WITH_HEAP_CHECKER
+
+### Documentation (above and beyond tcmalloc_minimal documentation)
+if WITH_HEAP_PROFILER
+dist_doc_DATA += doc/heapprofile.html doc/heap-example1.png
+endif WITH_HEAP_PROFILER
+
+if WITH_HEAP_CHECKER
+dist_doc_DATA += doc/heap_checker.html
+endif WITH_HEAP_CHECKER
+
+
+### ------- tcmalloc with debugallocation
+
+if WITH_DEBUGALLOC
+if WITH_HEAP_PROFILER_OR_CHECKER
+
+lib_LTLIBRARIES += libtcmalloc_debug.la
+libtcmalloc_debug_la_SOURCES = src/debugallocation.cc $(HEAP_CHECKER_SOURCES) \
+ $(TCMALLOC_INCLUDES)
+libtcmalloc_debug_la_CXXFLAGS = $(libtcmalloc_la_CXXFLAGS) \
+ -DTCMALLOC_FOR_DEBUGALLOCATION
+libtcmalloc_debug_la_LDFLAGS = $(libtcmalloc_la_LDFLAGS) \
+ -version-info @TCMALLOC_SO_VERSION@
+libtcmalloc_debug_la_LIBADD = $(libtcmalloc_la_LIBADD)
+
+LIBS_TO_WEAKEN += libtcmalloc_debug.la
+
+### Unittests
+
+TESTS += tcmalloc_debug_unittest
+tcmalloc_debug_unittest_SOURCES = $(tcmalloc_unittest_SOURCES)
+tcmalloc_debug_unittest_CXXFLAGS = $(tcmalloc_unittest_CXXFLAGS) \
+ -DDEBUGALLOCATION
+tcmalloc_debug_unittest_LDFLAGS = $(tcmalloc_unittest_LDFLAGS)
+tcmalloc_debug_unittest_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
+
+TESTS += sampler_debug_test
+sampler_debug_test_SOURCES = $(sampler_test_SOURCES)
+sampler_debug_test_CXXFLAGS = $(samples_test_CXXFLAGS)
+sampler_debug_test_LDFLAGS = $(sampler_test_LDFLAGS)
+sampler_debug_test_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS) -lm
+
+TESTS += sampling_debug_test.sh$(EXEEXT)
+sampling_debug_test_sh_SOURCES = src/tests/sampling_test.sh
+sampling_debug_test.sh$(EXEEXT): $(top_srcdir)/$(sampling_test_sh_SOURCES) \
+ sampling_debug_test
+ rm -f $@
+ cp -p $(top_srcdir)/$(sampling_test_sh_SOURCES) $@
+
+# This is the sub-program using by sampling_debug_test.sh
+# The -g is so pprof can get symbol information.
+noinst_PROGRAMS += sampling_debug_test
+sampling_debug_test_SOURCES = $(sampling_test_SOURCES)
+sampling_debug_test_CXXFLAGS = $(sampling_test_CXXFLAGS)
+sampling_debug_test_LDFLAGS = $(sampling_test_LDFLAGS)
+sampling_debug_test_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
+
+endif WITH_HEAP_PROFILER_OR_CHECKER
+
+if WITH_HEAP_PROFILER
+
+TESTS += heap-profiler_debug_unittest.sh$(EXEEXT)
+heap_profiler_debug_unittest_sh_SOURCES = src/tests/heap-profiler_unittest.sh
+heap-profiler_debug_unittest.sh$(EXEEXT): $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) \
+ heap-profiler_debug_unittest
+ rm -f $@
+ cp -p $(top_srcdir)/$(heap_profiler_unittest_sh_SOURCES) $@
+
+# These are sub-programs used by heap-profiler_debug_unittest.sh
+noinst_PROGRAMS += heap-profiler_debug_unittest
+heap_profiler_debug_unittest_SOURCES = $(heap_profiler_unittest_SOURCES)
+heap_profiler_debug_unittest_CXXFLAGS = $(heap_profiler_unittest_CXXFLAGS)
+heap_profiler_debug_unittest_LDFLAGS = $(heap_profiler_unittest_LDFLAGS)
+heap_profiler_debug_unittest_LDADD = libtcmalloc_debug.la $(PTHREAD_LIBS)
+
+endif WITH_HEAP_PROFILER
+
+if WITH_HEAP_CHECKER
+
+TESTS += heap-checker_debug_unittest.sh$(EXEEXT)
+heap_checker_debug_unittest_sh_SOURCES = src/tests/heap-checker_unittest.sh
+heap-checker_debug_unittest.sh$(EXEEXT): $(top_srcdir)/$(heap_checker_unittest_sh_SOURCES) \
+ heap-checker_debug_unittest
+ rm -f $@
+ cp -p $(top_srcdir)/$(heap_checker_unittest_sh_SOURCES) $@
+
+# These are sub-programs used by heap-checker_debug_unittest.sh
+noinst_PROGRAMS += heap-checker_debug_unittest
+heap_checker_debug_unittest_SOURCES = $(heap_checker_unittest_SOURCES)
+heap_checker_debug_unittest_CXXFLAGS = $(heap_checker_unittest_CXXFLAGS)
+heap_checker_debug_unittest_LDFLAGS = $(heap_checker_unittest_LDFLAGS)
+# We want libtcmalloc last on the link line, but due to a bug in
+# libtool involving convenience libs, they need to come last on the
+# link line in order to get dependency ordering right. This is ok:
+# convenience libraries are .a's, so tcmalloc is still the last .so.
+heap_checker_debug_unittest_LDADD = libtcmalloc_debug.la liblogging.la \
+ $(PTHREAD_LIBS)
+
+endif WITH_HEAP_CHECKER
+endif WITH_DEBUGALLOC
+
+
+### ------- CPU profiler
+
+if WITH_CPU_PROFILER
+
+### The header files we use. We divide into categories based on directory
+S_CPU_PROFILER_INCLUDES = src/profiledata.h \
+ src/profile-handler.h \
+ src/getpc.h \
+ src/base/basictypes.h \
+ src/base/commandlineflags.h \
+ src/base/googleinit.h \
+ src/base/logging.h \
+ src/base/simple_mutex.h \
+ src/base/sysinfo.h \
+ $(SPINLOCK_INCLUDES) \
+ $(LOGGING_INCLUDES)
+SG_CPU_PROFILER_INCLUDES = src/google/profiler.h \
+ src/google/stacktrace.h
+CPU_PROFILER_INCLUDES = $(S_CPU_PROFILER_INCLUDES) $(SG_CPU_PROFILER_INCLUDES)
+googleinclude_HEADERS += $(SG_CPU_PROFILER_INCLUDES)
+
+### Making the library
+lib_LTLIBRARIES += libprofiler.la
+libprofiler_la_SOURCES = src/profiler.cc \
+ src/profile-handler.cc \
+ src/profiledata.cc \
+ $(CPU_PROFILER_INCLUDES)
+libprofiler_la_LIBADD = libstacktrace.la
+# We have to include ProfileData for profiledata_unittest
+CPU_PROFILER_SYMBOLS = '(ProfilerStart|ProfilerStartWithOptions|ProfilerStop|ProfilerFlush|ProfilerEnable|ProfilerDisable|ProfilingIsEnabledForAllThreads|ProfilerRegisterThread|ProfilerGetCurrentState|ProfilerState|ProfileData|ProfileHandler)'
+libprofiler_la_LDFLAGS = -export-symbols-regex $(CPU_PROFILER_SYMBOLS) \
+ -version-info @PROFILER_SO_VERSION@
+
+# See discussion above (under LIBTCMALLOC_MINIMAL) for why we do this.
+# Basically it's to work around systems where --rpath doesn't work right.
+LIBPROFILER = libstacktrace.la libprofiler.la
+
+### Unittests
+TESTS += getpc_test
+#WINDOWS_PROJECTS += vsprojects/getpc_test/getpc_test.vcproj
+getpc_test_SOURCES = src/tests/getpc_test.cc src/getpc.h
+
+TESTS += profiledata_unittest
+#WINDOWS_PROJECTS += vsprojects/profiledata_unittest/profiledata_unittest.vcproj
+profiledata_unittest_SOURCES = src/tests/profiledata_unittest.cc \
+ src/profiledata.h \
+ src/base/commandlineflags.h \
+ src/base/logging.h \
+ src/base/basictypes.h
+profiledata_unittest_LDADD = $(LIBPROFILER)
+
+TESTS += profile_handler_unittest
+profile_handler_unittest_SOURCES = src/tests/profile-handler_unittest.cc \
+ src/profile-handler.h
+profile_handler_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
+profile_handler_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
+profile_handler_unittest_LDADD = $(LIBPROFILER) $(PTHREAD_LIBS)
+
+TESTS += profiler_unittest.sh$(EXEEXT)
+profiler_unittest_sh_SOURCES = src/tests/profiler_unittest.sh
+noinst_SCRIPTS += $(profiler_unittest_sh_SOURCES)
+profiler_unittest.sh$(EXEEXT): $(top_srcdir)/$(profiler_unittest_sh_SOURCES) \
+ profiler1_unittest profiler2_unittest \
+ profiler3_unittest profiler4_unittest
+ rm -f $@
+ cp -p $(top_srcdir)/$(profiler_unittest_sh_SOURCES) $@
+
+# These are sub-programs used by profiler_unittest.sh
+noinst_PROGRAMS += profiler1_unittest profiler2_unittest profiler3_unittest \
+ profiler4_unittest
+PROFILER_UNITTEST_INCLUDES = src/config_for_unittests.h \
+ src/google/profiler.h
+PROFILER_UNITTEST_SRCS = src/tests/profiler_unittest.cc \
+ src/tests/testutil.h src/tests/testutil.cc \
+ $(PROFILER_UNITTEST_INCLUDES)
+profiler1_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
+profiler1_unittest_CXXFLAGS = -g -DNO_THREADS $(AM_CXXFLAGS)
+profiler1_unittest_LDADD = $(LIBPROFILER)
+profiler2_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
+profiler2_unittest_CXXFLAGS = -g -DNO_THREADS $(AM_CXXFLAGS)
+profiler2_unittest_LDADD = -lstacktrace -lprofiler
+# We depend on -lprofiler but haven't yet said how to build it. Do so now.
+profiler2_unittest_DEPENDENCIES = $(LIBPROFILER)
+profiler3_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
+profiler3_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+profiler3_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
+profiler3_unittest_LDADD = $(LIBPROFILER) $(PTHREAD_LIBS)
+profiler4_unittest_SOURCES = $(PROFILER_UNITTEST_SRCS)
+profiler4_unittest_CXXFLAGS = -g $(PTHREAD_CFLAGS) $(AM_CXXFLAGS)
+profiler4_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
+profiler4_unittest_LDADD = -lstacktrace -lprofiler $(PTHREAD_LIBS)
+# We depend on -lprofiler but haven't yet said how to build it. Do so now.
+profiler4_unittest_DEPENDENCIES = $(LIBPROFILER)
+
+
+### Documentation
+dist_doc_DATA += doc/cpuprofile.html \
+ doc/cpuprofile-fileformat.html \
+ doc/pprof-test-big.gif \
+ doc/pprof-test.gif \
+ doc/pprof-vsnprintf-big.gif \
+ doc/pprof-vsnprintf.gif
+
+endif WITH_CPU_PROFILER
+
+
+### ------- CPU profiler and heap checker, in one!
+
+# Ideally, folks who wanted to use both tcmalloc and libprofiler,
+# could just link them both into their application. But while this
+# works fine for .so files, it does not for .a files. The easiest way
+# around this -- and I've tried a bunch of the hard ways -- is to just
+# to create another set of libraries that has both functionality in it.
+
+if WITH_HEAP_PROFILER_OR_CHECKER
+if WITH_CPU_PROFILER
+
+lib_LTLIBRARIES += libtcmalloc_and_profiler.la
+libtcmalloc_and_profiler_la_SOURCES = $(libtcmalloc_la_SOURCES) $(libprofiler_la_SOURCES)
+libtcmalloc_and_profiler_la_CXXFLAGS = $(libtcmalloc_la_CXXFLAGS) $(libprofiler_la_CXXFLAGS)
+# Since this library is meant to be used as a .a, I don't worry as much
+# about .so versioning. I just give the libtcmalloc version number.
+# TODO(csilvers): use -export-symbols-regex?
+libtcmalloc_and_profiler_la_LDFLAGS = $(PTHREAD_CFLAGS) \
+ -version-info @TCMALLOC_SO_VERSION@
+# We don't include libprofiler_la_LIBADD here because all it adds is
+# libstacktrace.la, which we already get via libtcmalloc. Trying to
+# specify it twice causes link-time duplicate-definition errors. :-(
+libtcmalloc_and_profiler_la_LIBADD = $(libtcmalloc_la_LIBADD)
+
+TESTS += tcmalloc_and_profiler_unittest
+tcmalloc_and_profiler_unittest_SOURCES = $(tcmalloc_both_unittest_SOURCES)
+tcmalloc_and_profiler_unittest_CXXFLAGS = $(tcmalloc_both_unittest_CXXFLAGS)
+tcmalloc_and_profiler_unittest_LDFLAGS = $(tcmalloc_both_unittest_LDFLAGS)
+tcmalloc_and_profiler_unittest_LDADD = libtcmalloc_and_profiler.la
+
+LIBS_TO_WEAKEN += libtcmalloc_and_profiler.la
+
+endif WITH_CPU_PROFILER
+endif WITH_HEAP_PROFILER_OR_CHECKER
+
+## ^^^^ END OF RULES TO MAKE YOUR LIBRARIES, BINARIES, AND UNITTESTS
+
+
+# Do the weakening on some exported libtcmalloc symbols.
+install-exec-local: all-local
+all-local: $(LIBS_TO_WEAKEN)
+ for la in $(LIBS_TO_WEAKEN); do lib=".libs/`basename $$la .la`.a"; [ ! -f "$$lib" ] || $(WEAKEN) "$$lib"; done
+
+
+# This should always include $(TESTS), but may also include other
+# binaries that you compile but don't want automatically installed.
+# We'll add to this later, on a library-by-library basis
+noinst_PROGRAMS += $(TESTS)
+
+rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
+ @cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
+
+deb: dist-gzip packages/deb.sh packages/deb/*
+ @cd packages && ./deb.sh ${PACKAGE} ${VERSION}
+
+# http://linux.die.net/man/1/pkg-config, http://pkg-config.freedesktop.org/wiki
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libtcmalloc.pc libtcmalloc_minimal.pc \
+ libtcmalloc_debug.pc libtcmalloc_minimal_debug.pc \
+ libprofiler.pc
+CLEANFILES = $(pkgconfig_DATA)
+
+# I get the description and URL lines from the rpm spec. I use sed to
+# try to rewrite exec_prefix, libdir, and includedir in terms of
+# prefix, if possible.
+libtcmalloc.pc: Makefile packages/rpm/rpm.spec
+ echo 'prefix=$(prefix)' > "$@".tmp
+ echo 'exec_prefix='`echo '$(exec_prefix)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
+ echo 'libdir='`echo '$(libdir)' | sed 's@^$(exec_prefix)@$${exec_prefix}@'` >> "$@".tmp
+ echo 'includedir='`echo '$(includedir)' | sed 's@^$(prefix)@$${prefix}@'` >> "$@".tmp
+ echo '' >> "$@".tmp
+ echo 'Name: $(PACKAGE)' >> "$@".tmp
+ echo 'Version: $(VERSION)' >> "$@".tmp
+ -grep '^Summary:' packages/rpm/rpm.spec | sed s/^Summary:/Description:/ | head -n1 >> "$@".tmp
+ -grep '^URL: ' packages/rpm/rpm.spec >> "$@".tmp
+ echo 'Requires:' >> "$@".tmp
+ echo 'Libs: -L$${libdir} -ltcmalloc' >> "$@".tmp
+ echo 'Libs.private: $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)' >> "$@".tmp
+ echo 'Cflags: -I$${includedir}' >> "$@".tmp
+ mv -f "$@".tmp "$@"
+
+# The other versions are mostly the same.
+libtcmalloc_minimal.pc: libtcmalloc.pc
+ cat libtcmalloc.pc | sed s/-ltcmalloc/-ltcmalloc_minimal/ > "$@"
+
+libtcmalloc_debug.pc: libtcmalloc.pc
+ cat libtcmalloc.pc | sed s/-ltcmalloc/-ltcmalloc_debug/ > "$@"
+
+libtcmalloc_minimal_debug.pc: libtcmalloc.pc
+ cat libtcmalloc.pc | sed s/-ltcmalloc/-ltcmalloc_minimal_debug/ > "$@"
+
+libprofiler.pc: libtcmalloc.pc
+ cat libtcmalloc.pc | sed s/-ltcmalloc/-lprofiler/ > "$@"
+
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
+
+# Windows wants write permission to .vcproj files and maybe even sln files.
+dist-hook:
+ test -e "$(distdir)/vsprojects" \
+ && chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/
+
+EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \
+ $(SCRIPTS) libtool \
+ src/windows/get_mangled_names.cc src/windows/override_functions.cc \
+ src/windows/config.h src/windows/google/tcmalloc.h \
+ $(WINDOWS_PROJECTS) \
+ src/solaris/libstdc++.la
View
4,920 distro/google-perftools-1.7/Makefile.in
4,920 additions, 0 deletions not shown
View
170 distro/google-perftools-1.7/NEWS
@@ -0,0 +1,170 @@
+== 04 February 2011 ==
+
+I've just released perftools 1.7
+
+I apologize for the delay since the last release; so many great new
+patches and bugfixes kept coming in (and are still coming in; I also
+apologize to those folks who have to slip until the next release). I
+picked this arbitrary time to make a cut.
+
+Among the many new features in this release is a multi-megabyte
+reduction in the amount of tcmalloc overhead uder x86_64, improved
+performance in the case of contention, and many many bugfixes,
+especially architecture-specific bugfixes. See the
+[http://google-perftools.googlecode.com/svn/tags/perftools-1.7/ChangeLog ChangeLog]
+for full details.
+
+One architecture-specific change of note is added comments in the
+[http://google-perftools.googlecode.com/svn/tags/perftools-1.7/README README]
+for using tcmalloc under OS X. I'm trying to get my head around the
+exact behavior of the OS X linker, and hope to have more improvements
+for the next release, but I hope these notes help folks who have been
+having trouble with tcmalloc on OS X.
+
+*Windows users*: I've heard reports that some unittests fail on
+Windows when compiled with MSVC 10 in Release mode. All tests pass in
+Debug mode. I've not heard of any problems with earlier versions of
+MSVC. I don't know if this is a problem with the runtime patching (so
+the static patching discussed in README_windows.txt will still work),
+a problem with perftools more generally, or a bug in MSVC 10. Anyone
+with windows expertise that can debug this, I'd be glad to hear from!
+
+
+=== 5 August 2010 ===
+
+I've just released perftools 1.6
+
+This version also has a large number of minor changes, including
+support for `malloc_usable_size()` as a glibc-compatible alias to
+`malloc_size()`, the addition of SVG-based output to `pprof`, and
+experimental support for tcmalloc large pages, which may speed up
+tcmalloc at the cost of greater memory use. To use tcmalloc large
+pages, see the
+[http://google-perftools.googlecode.com/svn/tags/perftools-1.6/INSTALL
+INSTALL file]; for all changes, see the
+[http://google-perftools.googlecode.com/svn/tags/perftools-1.6/ChangeLog
+ChangeLog].
+
+OS X NOTE: improvements in the profiler unittest have turned up an OS
+X issue: in multithreaded programs, it seems that OS X often delivers
+the profiling signal (from sigitimer()) to the main thread, even when
+it's sleeping, rather than spawned threads that are doing actual work.
+If anyone knows details of how OS X handles SIGPROF events (from
+setitimer) in threaded programs, and has insight into this problem,
+please send mail to google-perftools@googlegroups.com.
+
+To see if you're affected by this, look for profiling time that pprof
+attributes to `___semwait_signal`. This is work being done in other
+threads, that is being attributed to sleeping-time in the main thread.
+
+
+=== 20 January 2010 ===
+
+I've just released perftools 1.5
+
+This version has a slew of changes, leading to somewhat faster
+performance and improvements in portability. It adds features like
+`ITIMER_REAL` support to the cpu profiler, and `tc_set_new_mode` to
+mimic the windows function of the same name. Full details are in the
+[http://google-perftools.googlecode.com/svn/tags/perftools-1.5/ChangeLog
+ChangeLog].
+
+
+=== 11 September 2009 ===
+
+I've just released perftools 1.4
+
+The major change this release is the addition of a debugging malloc
+library! If you link with `libtcmalloc_debug.so` instead of
+`libtcmalloc.so` (and likewise for the `minimal` variants) you'll get
+a debugging malloc, which will catch double-frees, writes to freed
+data, `free`/`delete` and `delete`/`delete[]` mismatches, and even
+(optionally) writes past the end of an allocated block.
+
+We plan to do more with this library in the future, including
+supporting it on Windows, and adding the ability to use the debugging
+library with your default malloc in addition to using it with
+tcmalloc.
+
+There are also the usual complement of bug fixes, documented in the
+ChangeLog, and a few minor user-tunable knobs added to components like
+the system allocator.
+
+
+=== 9 June 2009 ===
+
+I've just released perftools 1.3
+