summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiuwen Lu <[email protected]>2020-10-15 15:51:45 +0800
committerQiuwen Lu <[email protected]>2020-10-15 16:02:47 +0800
commit24f79a5a2050f6ee538e844b957bf79ac866b783 (patch)
tree7fd7ea48ed1bce3e036f3be21d6f65ea5660ebd4
parent90ac86a10c1c82c231d8dd1f44f544e9ee9d498a (diff)
调整gperftools中Heap Profiler输出字符串缓冲区大小到1<<22,并升级gperftools.
* heap profiler工具中定义的Heap文件输出缓冲区过小(1<<20),当使用内存较多时无法正确输出Heap文件。通过Patch的方式调整。 * 升级gperftools到最新稳定版本2.8。
-rw-r--r--vendor/CMakeLists.txt7
-rw-r--r--vendor/gperftools-2.7.tar.gzbin1523562 -> 0 bytes
-rw-r--r--vendor/gperftools-2.8.tar.gzbin0 -> 1595567 bytes
-rw-r--r--vendor/patch/gperftools-fix_too_small_heap_profile_buffer_size.patch13
4 files changed, 17 insertions, 3 deletions
diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt
index 5cbf316..9afbb55 100644
--- a/vendor/CMakeLists.txt
+++ b/vendor/CMakeLists.txt
@@ -101,7 +101,7 @@ ExternalProject_Add(ratelimiter PREFIX ratelimiter
CONFIGURE_COMMAND ""
BUILD_COMMAND make
BUILD_IN_SOURCE 1)
-
+
ExternalProject_Get_Property(ratelimiter INSTALL_DIR)
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
@@ -334,8 +334,9 @@ target_link_libraries(brotlienc-static INTERFACE brotlicommon-static)
### gperftools
ExternalProject_Add(gperftools
PREFIX gperftools
- URL ${CMAKE_CURRENT_SOURCE_DIR}/gperftools-2.7.tar.gz
- URL_MD5 c6a852a817e9160c79bdb2d3101b4601
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/gperftools-2.8.tar.gz
+ URL_MD5 ea61ad1e886f53e4069873ce52cae7df
+ PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/patch/gperftools-fix_too_small_heap_profile_buffer_size.patch
CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> --disable-shared
BUILD_IN_SOURCE 1)
diff --git a/vendor/gperftools-2.7.tar.gz b/vendor/gperftools-2.7.tar.gz
deleted file mode 100644
index e0a82a2..0000000
--- a/vendor/gperftools-2.7.tar.gz
+++ /dev/null
Binary files differ
diff --git a/vendor/gperftools-2.8.tar.gz b/vendor/gperftools-2.8.tar.gz
new file mode 100644
index 0000000..edda2b0
--- /dev/null
+++ b/vendor/gperftools-2.8.tar.gz
Binary files differ
diff --git a/vendor/patch/gperftools-fix_too_small_heap_profile_buffer_size.patch b/vendor/patch/gperftools-fix_too_small_heap_profile_buffer_size.patch
new file mode 100644
index 0000000..356e557
--- /dev/null
+++ b/vendor/patch/gperftools-fix_too_small_heap_profile_buffer_size.patch
@@ -0,0 +1,13 @@
+diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc
+index 33a25ac..4d750bb 100644
+--- a/src/heap-profiler.cc
++++ b/src/heap-profiler.cc
+@@ -151,7 +151,7 @@ static void ProfilerFree(void* p) {
+ }
+
+ // We use buffers of this size in DoGetHeapProfile.
+-static const int kProfileBufferSize = 1 << 20;
++static const int kProfileBufferSize = 1 << 22;
+
+ // This is a last-ditch buffer we use in DumpProfileLocked in case we
+ // can't allocate more memory from ProfilerMalloc. We expect this