]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: Updated allocator checking
authorAli Maredia <amaredia@redhat.com>
Thu, 31 Dec 2015 02:06:08 +0000 (21:06 -0500)
committerAli Maredia <amaredia@redhat.com>
Tue, 5 Jan 2016 20:42:06 +0000 (15:42 -0500)
Added a FindJeMalloc.cmake file, changed
allocator checking logic (tcmalloc is default),
replaced TCMALLOC_LIBS to ALLOC_LIBS, added
HAVE_LIB(ALLOCATOR) to config-h.in.cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
CMakeLists.txt
cmake/modules/FindJeMalloc.cmake [new file with mode: 0644]
src/CMakeLists.txt
src/include/config-h.in.cmake
src/test/CMakeLists.txt

index a696441127240eae668eba9720dfb22d5de9d6bb..dd74fc7ef2bd9275d0160c7428c53f1082258d82 100644 (file)
@@ -171,11 +171,23 @@ endif(${WITH_GPERFTOOLS})
 
 find_package(snappy REQUIRED)
 
-option(WITH_TCMALLOC "Use TCMalloc as Allocator" ON)
-if(${WITH_TCMALLOC})
-find_package(tcmalloc REQUIRED)
-set(HAVE_LIBTCMALLOC ${Tcmalloc_FOUND})
-endif(${WITH_TCMALLOC})
+#if allocator is set on command line make sure it matches below strings
+if(ALLOCATOR)
+  if(${ALLOCATOR} STREQUAL "tcmalloc")
+    find_package(tcmalloc REQUIRED)
+    set(HAVE_LIBTCMALLOC ${Tcmalloc_FOUND})
+  elseif(${ALLOCATOR} STREQUAL "jemalloc")
+    find_package(JeMalloc REQUIRED)
+  endif()
+else(ALLOCATOR)
+  find_package(tcmalloc)
+  set(HAVE_LIBTCMALLOC ${Tcmalloc_FOUND})
+  find_package(JeMalloc)
+  if(NOT Tcmalloc_FOUND AND NOT JEMALLOC_FOUND)
+    message(WARNING "tcmalloc and jemalloc not found, falling back to libc")
+    set(ALLOCATOR "libc")
+  endif(NOT Tcmalloc_FOUND AND NOT JEMALLOC_FOUND)
+endif(ALLOCATOR)
 
 find_package(keyutils REQUIRED)
 
diff --git a/cmake/modules/FindJeMalloc.cmake b/cmake/modules/FindJeMalloc.cmake
new file mode 100644 (file)
index 0000000..6926ae9
--- /dev/null
@@ -0,0 +1,72 @@
+# - Find JeMalloc library
+# Find the native JeMalloc includes and library
+# This module defines
+#  JEMALLOC_INCLUDE_DIRS, where to find jemalloc.h, Set when
+#                        JEMALLOC_INCLUDE_DIR is found.
+#  JEMALLOC_LIBRARIES, libraries to link against to use JeMalloc.
+#  JEMALLOC_ROOT_DIR, The base directory to search for JeMalloc.
+#                    This can also be an environment variable.
+#  JEMALLOC_FOUND, If false, do not try to use JeMalloc.
+#
+# also defined, but not for general use are
+#  JEMALLOC_LIBRARY, where to find the JeMalloc library.
+
+#=============================================================================
+# Copyright 2011 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# If JEMALLOC_ROOT_DIR was defined in the environment, use it.
+IF(NOT JEMALLOC_ROOT_DIR AND NOT $ENV{JEMALLOC_ROOT_DIR} STREQUAL "")
+  SET(JEMALLOC_ROOT_DIR $ENV{JEMALLOC_ROOT_DIR})
+ENDIF()
+
+SET(_jemalloc_SEARCH_DIRS
+  ${JEMALLOC_ROOT_DIR}
+  /usr/local
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+)
+
+FIND_PATH(JEMALLOC_INCLUDE_DIR
+  NAMES
+    jemalloc.h
+  HINTS
+    ${_jemalloc_SEARCH_DIRS}
+  PATH_SUFFIXES
+    include/jemalloc
+)
+
+FIND_LIBRARY(JEMALLOC_LIBRARY
+  NAMES
+  jemalloc
+  HINTS
+    ${_jemalloc_SEARCH_DIRS}
+  PATH_SUFFIXES
+    lib64 lib
+  )
+
+# handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JeMalloc DEFAULT_MSG
+    JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR)
+
+IF(JEMALLOC_FOUND)
+  SET(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY})
+  SET(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR})
+  message(STATUS "Found Jemalloc: ${JEMALLOC_LIBRARY}, ${JEMALLOC_INCLUDE_DIR}")
+else ()
+ENDIF(JEMALLOC_FOUND)
+
+MARK_AS_ADVANCED(
+  JEMALLOC_INCLUDE_DIR
+  JEMALLOC_LIBRARY
+)
index fdeb2e3eb0bd663677a585d851d4f7d88f0caeee..a8ff8b80de9678f9acf17048755e261ef1f35b5b 100644 (file)
@@ -121,13 +121,18 @@ if(HAVE_XIO)
   list(APPEND EXTRALIBS ${Xio_LIBRARY} ibverbs rdmacm pthread rt)
 endif(HAVE_XIO)
 
-if(${WITH_TCMALLOC} AND ${HAVE_GPERFTOOLS})
+# sort out which allocator to use
+if(Tcmalloc_FOUND)
+  set(ALLOC_LIBS tcmalloc)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
-  set(TCMALLOC_LIBS tcmalloc)
   set(TCMALLOC_srcs perfglue/heap_profiler.cc)
-else(${WITH_TCMALLOC} AND ${HAVE_GPERFTOOLS})
+elseif(NOT Tcmalloc_FOUND AND JEMALLOC_FOUND)
+  set(ALLOC_LIBS jemalloc)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
+  set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
+elseif(${ALLOCATOR} STREQUAL "libc")
   set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
-endif(${WITH_TCMALLOC} AND ${HAVE_GPERFTOOLS})
+endif()
 
 # tcmalloc heap profiler
 set(heap_profiler_files ${TCMALLOC_srcs})
@@ -395,7 +400,7 @@ add_library(librados ${CEPH_SHARED} ${librados_srcs}
 add_dependencies(librados osdc)
 target_link_libraries(librados PRIVATE osdc osd os global common cls_lock_client
   ${BLKID_LIBRARIES}
-  ${CRYPTO_LIBS} ${EXTRALIBS} ${TCMALLOC_LIBS})
+  ${CRYPTO_LIBS} ${EXTRALIBS} ${ALLOC_LIBS})
 if(${ENABLE_SHARED})
   set_target_properties(librados PROPERTIES OUTPUT_NAME rados VERSION 2.0.0
     SOVERSION 2)
@@ -425,7 +430,7 @@ set(rados_srcs
   tools/rados/PoolDump.cc
   common/obj_bencher.cc)
 add_executable(rados ${rados_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
-target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} libradosstriper)
+target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} libradosstriper)
 
 if (WITH_CEPHFS)
   set(cephfs_journal_tool_srcs
@@ -440,7 +445,7 @@ if (WITH_CEPHFS)
   add_executable(cephfs-journal-tool ${cephfs_journal_tool_srcs}
                  $<TARGET_OBJECTS:heap_profiler_objs>)
   target_link_libraries(cephfs-journal-tool librados mds osdc global
-                        ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+                        ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
   set(cephfs_table_tool_srcs
     tools/cephfs/cephfs-table-tool.cc
@@ -449,7 +454,7 @@ if (WITH_CEPHFS)
   add_executable(cephfs-table-tool ${cephfs_table_tool_srcs}
                  $<TARGET_OBJECTS:heap_profiler_objs>)
   target_link_libraries(cephfs-table-tool librados mds osdc global
-                        ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+                        ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
   set(cephfs_data_scan_srcs
     tools/cephfs/cephfs-data-scan.cc
@@ -460,7 +465,7 @@ if (WITH_CEPHFS)
 
   target_link_libraries(cephfs-data-scan librados mds osdc global
                         cls_cephfs_client
-                        ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+                        ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 endif (WITH_CEPHFS)
 
 set(librados_config_srcs
@@ -468,7 +473,7 @@ set(librados_config_srcs
 add_executable(librados-config ${librados_config_srcs}
   $<TARGET_OBJECTS:heap_profiler_objs>)
 target_link_libraries(librados-config librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS})
+  ${ALLOC_LIBS})
 
 install(TARGETS rados librados-config DESTINATION bin)
 
@@ -530,7 +535,7 @@ target_link_libraries(ceph-dencoder
   udev
   keyutils
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -567,7 +572,7 @@ set(ceph_mon_srcs
 add_executable(ceph-mon ${ceph_mon_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
 add_dependencies(ceph-mon erasure_code_plugins)
 target_link_libraries(ceph-mon mon boost_thread common os global ${EXTRALIBS}
-  ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 install(TARGETS ceph-mon DESTINATION bin)
 
 # OSD
@@ -674,7 +679,7 @@ add_executable(ceph-osd ${ceph_osd_srcs}
   $<TARGET_OBJECTS:heap_profiler_objs>
   $<TARGET_OBJECTS:common_util_obj>)
 add_dependencies(ceph-osd erasure_code_plugins)
-target_link_libraries(ceph-osd osd os global ${BLKID_LIBRARIES} ${TCMALLOC_LIBS})
+target_link_libraries(ceph-osd osd os global ${BLKID_LIBRARIES} ${ALLOC_LIBS})
 install(TARGETS ceph-osd DESTINATION bin)
 
 # MDS
@@ -722,7 +727,7 @@ if(${WITH_MDS})
     $<TARGET_OBJECTS:heap_profiler_objs>
     $<TARGET_OBJECTS:common_util_obj>)
   target_link_libraries(ceph-mds mds osdc ${CMAKE_DL_LIBS} global
-    ${TCMALLOC_LIBS} boost_thread)
+    ${ALLOC_LIBS} boost_thread)
   install(TARGETS ceph-mds DESTINATION bin)
 endif(${WITH_MDS})
 
@@ -994,7 +999,7 @@ if(${WITH_RBD})
   set_target_properties(rbd PROPERTIES OUTPUT_NAME rbd)
   target_link_libraries(rbd librbd librados global common keyutils udev
     boost_regex boost_program_options
-    ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+    ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
   install(TARGETS rbd DESTINATION bin)
   install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer DESTINATION bin)
   install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/rbdmap DESTINATION bin)
@@ -1116,7 +1121,7 @@ if(${WITH_RADOSGW})
     cls_rgw_client cls_lock_client cls_refcount_client
     cls_log_client cls_statelog_client cls_timeindex_client
     cls_version_client cls_replica_log_client cls_user_client
-    curl expat global fcgi resolv ${BLKID_LIBRARIES} ${TCMALLOC_LIBS})
+    curl expat global fcgi resolv ${BLKID_LIBRARIES} ${ALLOC_LIBS})
   install(TARGETS radosgw DESTINATION bin)
 
   add_executable(radosgw-admin ${radosgw_admin_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
@@ -1124,7 +1129,7 @@ if(${WITH_RADOSGW})
     cls_rgw_client cls_lock_client cls_refcount_client
     cls_log_client cls_statelog_client cls_timeindex_client
     cls_version_client cls_replica_log_client cls_user_client
-    curl expat global fcgi resolv ${BLKID_LIBRARIES} ${TCMALLOC_LIBS})
+    curl expat global fcgi resolv ${BLKID_LIBRARIES} ${ALLOC_LIBS})
   install(TARGETS radosgw-admin DESTINATION bin)
 
   add_executable(radosgw-object-expirer ${radosgw_object_expirer_srcs} $<TARGET_OBJECTS:heap_profiler_objs>)
@@ -1132,7 +1137,7 @@ if(${WITH_RADOSGW})
     cls_rgw_client cls_lock_client cls_refcount_client
     cls_log_client cls_statelog_client cls_timeindex_client
     cls_version_client cls_replica_log_client cls_user_client
-    curl expat global fcgi resolv ${TCMALLOC_LIBS})
+    curl expat global fcgi resolv ${ALLOC_LIBS})
   install(TARGETS radosgw-object-expirer DESTINATION bin)
 endif(${WITH_RADOSGW})
 
index 6cf521b7ba4b0262fa73605ca0ddf79c76a990f9..7e5efc9dadb42fc59b20346210feed855c69cbcc 100644 (file)
 /* Define to 1 if you have the `snappy' library (-lsnappy). */
 #cmakedefine HAVE_LIBSNAPPY 1
 
+/* Define if you have jemalloc */
+#cmakedefine HAVE_LIBJEMALLOC
+
 /* Define if you have tcmalloc */
 #cmakedefine HAVE_LIBTCMALLOC
 
+/* Define if you have tcmalloc */
+#cmakedefine HAVE_LIBTCMALLOC_MINIMAL
+
 /* Define to 1 if you have the <memory.h> header file. */
 #cmakedefine HAVE_MEMORY_H 1
 
index 4a63093675b08f7c7eb26d5e6d93bec1c5303ca3..bcf1bd6fc3a03e70982cb7f4a342b65fe60400a1 100644 (file)
@@ -3,7 +3,7 @@ add_executable(test_timers
   TestTimers.cc
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
-target_link_libraries(test_timers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+target_link_libraries(test_timers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # test_signal_handlers
 add_executable(test_signal_handlers
@@ -11,14 +11,14 @@ add_executable(test_signal_handlers
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(test_signal_handlers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS})
+  ${ALLOC_LIBS})
 
 # test_msgr
 add_executable(test_msgr
   testmsgr.cc
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
-target_link_libraries(test_msgr global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+target_link_libraries(test_msgr global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # test_crypt
 add_executable(test_crypt
@@ -32,7 +32,7 @@ target_link_libraries(test_crypt
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   )
 
 # test_rados
@@ -48,9 +48,9 @@ target_link_libraries(test_rados
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   )
 
 # test_mutate
@@ -59,7 +59,7 @@ add_executable(test_mutate
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(test_mutate global librados ${BLKID_LIBRARIES}
-  ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # test_rewrite_latency
 add_executable(test_rewrite_latency
@@ -68,7 +68,7 @@ add_executable(test_rewrite_latency
   )
 target_link_libraries(test_rewrite_latency common
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_THREAD_LIBS_INIT} ${CRYPTO_LIBS} m ${EXTRALIBS})
 
 # test_trans
@@ -76,14 +76,14 @@ add_executable(test_trans
   test_trans.cc
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
-target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # test_keys
 add_executable(test_keys
   testkeys.cc
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
-target_link_libraries(test_keys mon global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+target_link_libraries(test_keys mon global ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # get_command_descriptions
 add_executable(get_command_descriptions
@@ -97,7 +97,7 @@ target_link_libraries(get_command_descriptions
   leveldb
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -115,7 +115,7 @@ add_executable(smalliobench
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(smalliobench librados boost_program_options global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # smalliobenchfs
 set(smalliobenchfs_srcs
@@ -129,7 +129,7 @@ add_executable(smalliobenchfs
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(smalliobenchfs librados boost_program_options os global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # smalliobenchdumb
 set(smalliobenchdumb_srcs
@@ -143,7 +143,7 @@ add_executable(smalliobenchdumb
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(smalliobenchdumb librados boost_program_options os global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # smalliobenchrbd
 if (${WITH_RBD})
@@ -169,7 +169,7 @@ if (${WITH_RBD})
     udev
     ${BLKID_LIBRARIES}
     ${CMAKE_DL_LIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     keyutils
     )
 endif (${WITH_RBD})
@@ -183,7 +183,7 @@ add_executable(tpbench
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(tpbench librados boost_program_options os global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # omapbench
 set(omapbench_srcs
@@ -200,7 +200,7 @@ target_link_libraries(omapbench
   global
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   )
 
 # kvstorebench
@@ -213,12 +213,12 @@ add_executable(kvstorebench
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(kvstorebench librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS})
+  ${ALLOC_LIBS})
 
 # ceph_objectstore_bench
 add_executable(ceph_objectstore_bench objectstore_bench.cc
   $<TARGET_OBJECTS:heap_profiler_objs>)
-target_link_libraries(ceph_objectstore_bench global os ${TCMALLOC_LIBS})
+target_link_libraries(ceph_objectstore_bench global os ${ALLOC_LIBS})
 
 ## System tests
 
@@ -239,7 +239,7 @@ add_executable(test_rados_list_parallel
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(test_rados_list_parallel librados systest global pthread
-  rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # test_rados_open_pools_parallel
 set(test_rados_open_pools_parallel_srcs system/rados_open_pools_parallel.cc)
@@ -248,7 +248,7 @@ add_executable(test_rados_open_pools_parallel
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(test_rados_open_pools_parallel librados systest global
-  pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # test_rados_delete_pools_parallel
 set(test_rados_delete_pools_parallel_srcs
@@ -263,7 +263,7 @@ add_executable(test_rados_delete_pools_parallel
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(test_rados_delete_pools_parallel librados systest global
-  pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # test_rados_watch_notify
 set(test_rados_watch_notify_srcs
@@ -279,7 +279,7 @@ add_executable(test_rados_watch_notify
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(test_rados_watch_notify librados systest global
-  pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # bench_log
 set(bench_log_srcs
@@ -289,7 +289,7 @@ add_executable(bench_log
   ${bench_log_srcs}
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
-target_link_libraries(bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+target_link_libraries(bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 ## Unit tests
 #make check starts here
@@ -415,7 +415,7 @@ add_executable(unittest_encoding EXCLUDE_FROM_ALL
 add_test(unittest_encoding unittest_encoding)
 add_dependencies(check unittest_encoding)
 #target_link_libraries(unittest_encoding librados global boost_filesystem
-target_link_libraries(unittest_encoding cephfs librados pthread rt m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+target_link_libraries(unittest_encoding cephfs librados pthread rt m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_encoding
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -427,7 +427,7 @@ add_executable(unittest_addrs EXCLUDE_FROM_ALL
 add_test(unittest_addrs unittest_addrs)
 add_dependencies(check unittest_addrs)
 target_link_libraries(unittest_addrs cephfs librados pthread rt m
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_addrs
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -442,7 +442,7 @@ target_link_libraries(unittest_blkdev
   global
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_blkdev PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -455,7 +455,7 @@ add_executable(unittest_bloom_filter EXCLUDE_FROM_ALL
 add_test(unittest_bloom_filter unittest_bloom_filter)
 add_dependencies(check unittest_bloom_filter)
 target_link_libraries(unittest_bloom_filter global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_bloom_filter
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -467,7 +467,7 @@ add_executable(unittest_histogram EXCLUDE_FROM_ALL
 add_test(unittest_histogram unittest_histogram)
 add_dependencies(check unittest_histogram)
 target_link_libraries(unittest_histogram global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_histogram
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -479,7 +479,7 @@ add_executable(unittest_prioritized_queue EXCLUDE_FROM_ALL
 add_test(unittest_prioritized_queue unittest_prioritized_queue)
 add_dependencies(check unittest_prioritized_queue)
 target_link_libraries(unittest_prioritized_queue global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_prioritized_queue
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -491,7 +491,7 @@ add_executable(unittest_str_map EXCLUDE_FROM_ALL
 add_test(unittest_str_map unittest_str_map)
 add_dependencies(check unittest_str_map)
 target_link_libraries(unittest_str_map common global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS} common)
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS} common)
 set_target_properties(unittest_str_map
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -503,7 +503,7 @@ add_executable(unittest_sharedptr_registry EXCLUDE_FROM_ALL
 add_test(unittest_sharedptr_registry unittest_sharedptr_registry)
 add_dependencies(check unittest_sharedptr_registry)
 target_link_libraries(unittest_sharedptr_registry global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_sharedptr_registry
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -515,7 +515,7 @@ add_executable(unittest_shared_cache EXCLUDE_FROM_ALL
 add_test(unittest_shared_cache unittest_shared_cache)
 add_dependencies(check unittest_shared_cache)
 target_link_libraries(unittest_shared_cache global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_shared_cache
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -527,7 +527,7 @@ add_executable(unittest_sloppy_crc_map EXCLUDE_FROM_ALL
 add_test(unittest_sloppy_crc_map unittest_sloppy_crc_map)
 add_dependencies(check unittest_sloppy_crc_map)
 target_link_libraries(unittest_sloppy_crc_map global
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_sloppy_crc_map
   PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
@@ -544,7 +544,7 @@ target_link_libraries(unittest_time
   global
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS}
   )
 set_target_properties(unittest_time
@@ -562,7 +562,7 @@ target_link_libraries(unittest_util
   global
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS}
   )
 set_target_properties(unittest_util
@@ -575,7 +575,7 @@ add_executable(unittest_crush_wrapper EXCLUDE_FROM_ALL
   )
 add_test(unittest_crush_wrapper unittest_crush_wrapper)
 add_dependencies(check unittest_crush_wrapper)
-target_link_libraries(unittest_crush_wrapper global crush ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_crush_wrapper global crush ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_crush_wrapper PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -587,7 +587,7 @@ add_executable(unittest_crush EXCLUDE_FROM_ALL
   )
 add_test(unittest_crush unittest_crush)
 add_dependencies(check unittest_crush)
-target_link_libraries(unittest_crush global m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_crush global m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS} ${EXTRALIBS})
 set_target_properties(unittest_crush PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -599,7 +599,7 @@ add_executable(unittest_osdmap EXCLUDE_FROM_ALL
   )
 add_test(unittest_osdmap unittest_osdmap)
 add_dependencies(check unittest_osdmap)
-target_link_libraries(unittest_osdmap global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_osdmap global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_osdmap PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -612,7 +612,7 @@ add_executable(unittest_workqueue EXCLUDE_FROM_ALL
 add_test(unittest_workqueue unittest_workqueue)
 add_dependencies(check unittest_workqueue)
 target_link_libraries(unittest_workqueue global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_workqueue PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -624,7 +624,7 @@ add_executable(unittest_striper EXCLUDE_FROM_ALL
   )
 add_test(unittest_striper unittest_striper)
 add_dependencies(check unittest_striper)
-target_link_libraries(unittest_striper global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} 
+target_link_libraries(unittest_striper global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS} 
   ${UNITTEST_LIBS})
 set_target_properties(unittest_striper PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -637,7 +637,7 @@ add_executable(unittest_prebufferedstreambuf EXCLUDE_FROM_ALL
 add_test(unittest_prebufferedstreambuf unittest_prebufferedstreambuf)
 add_dependencies(check unittest_prebufferedstreambuf)
 target_link_libraries(unittest_prebufferedstreambuf global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_prebufferedstreambuf PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -649,7 +649,7 @@ add_executable(unittest_str_list EXCLUDE_FROM_ALL
 add_test(unittest_str_list unittest_str_list)
 add_dependencies(check unittest_str_list)
 target_link_libraries(unittest_str_list global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_str_list PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -660,7 +660,7 @@ add_executable(unittest_log EXCLUDE_FROM_ALL
   )
 add_test(unittest_log unittest_log)
 add_dependencies(check unittest_log)
-target_link_libraries(unittest_log global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_log global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_log PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -673,7 +673,7 @@ add_executable(unittest_throttle EXCLUDE_FROM_ALL
 add_test(unittest_throttle unittest_throttle)
 add_dependencies(check unittest_throttle)
 target_link_libraries(unittest_throttle global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_throttle PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -684,7 +684,7 @@ add_executable(unittest_base64 EXCLUDE_FROM_ALL
   )
 add_test(unittest_base64 unittest_base64)
 add_dependencies(check unittest_base64)
-target_link_libraries(unittest_base64 global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+target_link_libraries(unittest_base64 global ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_base64 PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
 # unittest_ceph_argparse
@@ -695,7 +695,7 @@ add_executable(unittest_ceph_argparse EXCLUDE_FROM_ALL
 add_test(unittest_ceph_argparse unittest_ceph_argparse)
 add_dependencies(check unittest_ceph_argparse)
 target_link_libraries(unittest_ceph_argparse global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_ceph_argparse PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -707,7 +707,7 @@ add_executable(unittest_ceph_compatset EXCLUDE_FROM_ALL
 add_test(unittest_ceph_compatset unittest_ceph_compatset)
 add_dependencies(check unittest_ceph_compatset)
 target_link_libraries(unittest_ceph_compatset global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_ceph_compatset PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -719,7 +719,7 @@ add_executable(unittest_mds_types EXCLUDE_FROM_ALL
 add_test(unittest_mds_types unittest_mds_types)
 add_dependencies(check unittest_mds_types)
 target_link_libraries(unittest_mds_types global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_mds_types PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
 # unittest_osd_types
@@ -730,7 +730,7 @@ add_executable(unittest_osd_types EXCLUDE_FROM_ALL
 add_test(unittest_osd_types unittest_osd_types)
 add_dependencies(check unittest_osd_types)
 target_link_libraries(unittest_osd_types global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_osd_types PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -742,7 +742,7 @@ add_executable(unittest_lru EXCLUDE_FROM_ALL
 add_test(unittest_lru unittest_lru)
 add_dependencies(check unittest_lru)
 target_link_libraries(unittest_lru global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_lru PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -754,7 +754,7 @@ add_executable(unittest_io_priority EXCLUDE_FROM_ALL
 add_test(unittest_io_priority unittest_io_priority)
 add_dependencies(check unittest_io_priority)
 target_link_libraries(unittest_io_priority global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_io_priority PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -765,7 +765,7 @@ add_executable(unittest_gather EXCLUDE_FROM_ALL
   )
 add_test(unittest_gather unittest_gather)
 add_dependencies(check unittest_gather)
-target_link_libraries(unittest_gather global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_gather global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_gather PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -777,7 +777,7 @@ add_executable(unittest_run_cmd EXCLUDE_FROM_ALL
   )
 add_test(unittest_run_cmd unittest_run_cmd)
 add_dependencies(check unittest_run_cmd)
-target_link_libraries(unittest_run_cmd global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} 
+target_link_libraries(unittest_run_cmd global ${CMAKE_DL_LIBS} ${ALLOC_LIBS} 
   ${UNITTEST_LIBS})
 set_target_properties(unittest_run_cmd PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -789,7 +789,7 @@ add_executable(unittest_signals EXCLUDE_FROM_ALL
   )
 add_test(unittest_signals unittest_signals)
 add_dependencies(check unittest_signals)
-target_link_libraries(unittest_signals global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} 
+target_link_libraries(unittest_signals global ${CMAKE_DL_LIBS} ${ALLOC_LIBS} 
   ${UNITTEST_LIBS})
 set_target_properties(unittest_signals PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -802,7 +802,7 @@ add_executable(unittest_simple_spin EXCLUDE_FROM_ALL
 add_test(unittest_simple_spin unittest_simple_spin)
 add_dependencies(check unittest_simple_spin)
 target_link_libraries(unittest_simple_spin global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_simple_spin PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -814,7 +814,7 @@ add_executable(unittest_bufferlist EXCLUDE_FROM_ALL
 add_test(unittest_bufferlist unittest_bufferlist)
 add_dependencies(check unittest_bufferlist)
 target_link_libraries(unittest_bufferlist global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_bufferlist PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -826,7 +826,7 @@ add_executable(unittest_xlist EXCLUDE_FROM_ALL
 add_test(unittest_xlist unittest_xlist)
 add_dependencies(check unittest_xlist)
 target_link_libraries(unittest_xlist common ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_xlist PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -842,7 +842,7 @@ target_link_libraries(unittest_librados
   global
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS}
   )
 set_target_properties(unittest_librados PROPERTIES COMPILE_FLAGS
@@ -855,7 +855,7 @@ add_executable(unittest_crc32c EXCLUDE_FROM_ALL
   )
 add_test(unittest_crc32c unittest_crc32c)
 add_dependencies(check unittest_crc32c)
-target_link_libraries(unittest_crc32c global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_crc32c global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_crc32c PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -867,7 +867,7 @@ add_executable(unittest_arch EXCLUDE_FROM_ALL
   )
 add_test(unittest_arch unittest_arch)
 add_dependencies(check unittest_arch)
-target_link_libraries(unittest_arch global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_arch global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_arch PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -880,7 +880,7 @@ add_executable(unittest_crypto
 add_test(unittest_crypto unittest_crypto)
 add_dependencies(check unittest_crypto)
 target_link_libraries(unittest_crypto global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_crypto PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -892,7 +892,7 @@ add_executable(unittest_crypto_init EXCLUDE_FROM_ALL
 add_test(unittest_crypto_init unittest_crypto_init)
 add_dependencies(check unittest_crypto_init)
 target_link_libraries(unittest_crypto_init global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_crypto_init PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -904,7 +904,7 @@ add_executable(unittest_perf_counters EXCLUDE_FROM_ALL
 add_test(unittest_perf_counters unittest_perf_counters)
 add_dependencies(check unittest_perf_counters)
 target_link_libraries(unittest_perf_counters global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_perf_counters PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -916,7 +916,7 @@ add_executable(unittest_admin_socket EXCLUDE_FROM_ALL
 add_test(unittest_admin_socket unittest_admin_socket)
 add_dependencies(check unittest_admin_socket)
 target_link_libraries(unittest_admin_socket global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_admin_socket PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -928,7 +928,7 @@ add_executable(unittest_ceph_crypto EXCLUDE_FROM_ALL
 add_test(unittest_ceph_crypto unittest_ceph_crypto)
 add_dependencies(check unittest_ceph_crypto)
 target_link_libraries(unittest_ceph_crypto global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_ceph_crypto PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -939,7 +939,7 @@ add_executable(unittest_utf8 EXCLUDE_FROM_ALL
   )
 add_test(unittest_utf8 unittest_utf8)
 add_dependencies(check unittest_utf8)
-target_link_libraries(unittest_utf8 global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_utf8 global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_utf8 PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -951,7 +951,7 @@ add_executable(unittest_mime EXCLUDE_FROM_ALL
   )
 add_test(unittest_mime unittest_mime)
 add_dependencies(check unittest_mime)
-target_link_libraries(unittest_mime global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_mime global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_mime PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -963,7 +963,7 @@ add_executable(unittest_escape EXCLUDE_FROM_ALL
   )
 add_test(unittest_escape unittest_escape)
 add_dependencies(check unittest_escape)
-target_link_libraries(unittest_escape global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_escape global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_escape PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -975,7 +975,7 @@ add_executable(unittest_strtol EXCLUDE_FROM_ALL
   )
 add_test(unittest_strtol unittest_strtol)
 add_dependencies(check unittest_strtol)
-target_link_libraries(unittest_strtol global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_strtol global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_strtol PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -988,7 +988,7 @@ add_executable(unittest_confutils EXCLUDE_FROM_ALL
 add_test(unittest_confutils unittest_confutils)
 add_dependencies(check unittest_confutils)
 target_link_libraries(unittest_confutils global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_confutils PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -999,7 +999,7 @@ add_executable(unittest_config EXCLUDE_FROM_ALL
   )
 add_test(unittest_config unittest_config)
 add_dependencies(check unittest_config)
-target_link_libraries(unittest_config global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}
+target_link_libraries(unittest_config global ${CMAKE_DL_LIBS} ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_config PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -1012,7 +1012,7 @@ add_executable(unittest_context EXCLUDE_FROM_ALL
 add_test(unittest_context unittest_context)
 add_dependencies(check unittest_context)
 target_link_libraries(unittest_context global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_context PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1029,7 +1029,7 @@ target_link_libraries(unittest_chain_xattr
   os
   global
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS}
   )
 set_target_properties(unittest_chain_xattr PROPERTIES COMPILE_FLAGS
@@ -1043,7 +1043,7 @@ add_executable(unittest_safe_io EXCLUDE_FROM_ALL
 add_test(unittest_safe_io unittest_safe_io)
 add_dependencies(check unittest_safe_io)
 target_link_libraries(unittest_safe_io global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_safe_io PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1055,7 +1055,7 @@ add_executable(unittest_heartbeatmap EXCLUDE_FROM_ALL
 add_test(unittest_heartbeatmap unittest_heartbeatmap)
 add_dependencies(check unittest_heartbeatmap)
 target_link_libraries(unittest_heartbeatmap global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_heartbeatmap PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1069,7 +1069,7 @@ if(${WITH_RADOSGW})
   add_test(unittest_formatter unittest_formatter)
   add_dependencies(check unittest_formatter)
   target_link_libraries(unittest_formatter global ${CMAKE_DL_LIBS}
-    ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+    ${ALLOC_LIBS} ${UNITTEST_LIBS})
   set_target_properties(unittest_formatter PROPERTIES COMPILE_FLAGS
     ${UNITTEST_CXX_FLAGS})
 endif(${WITH_RADOSGW})
@@ -1087,7 +1087,7 @@ target_link_libraries(unittest_daemon_config
   ${UNITTEST_LIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${EXTRALIBS}
   )
 set_target_properties(unittest_daemon_config PROPERTIES COMPILE_FLAGS
@@ -1101,7 +1101,7 @@ add_executable(unittest_libcephfs_config EXCLUDE_FROM_ALL
 add_test(unittest_libcephfs_config unittest_libcephfs_config)
 add_dependencies(check unittest_libcephfs_config)
 target_link_libraries(unittest_libcephfs_config cephfs ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_libcephfs_config PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1113,7 +1113,7 @@ add_executable(unittest_lfnindex EXCLUDE_FROM_ALL
 add_test(unittest_lfnindex unittest_lfnindex)
 add_dependencies(check unittest_lfnindex)
 target_link_libraries(unittest_lfnindex os global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_lfnindex PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1130,7 +1130,7 @@ target_link_libraries(unittest_librados_config
   global
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS}
   )
 set_target_properties(unittest_librados_config PROPERTIES COMPILE_FLAGS
@@ -1153,7 +1153,7 @@ target_link_libraries(unittest_rbd_replay
   keyutils
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS}
 )
 set_target_properties(unittest_rbd_replay PROPERTIES COMPILE_FLAGS
@@ -1168,7 +1168,7 @@ add_executable(unittest_mon_moncap EXCLUDE_FROM_ALL
 add_test(unittest_mon_moncap unittest_mon_moncap)
 add_dependencies(check unittest_mon_moncap)
 target_link_libraries(unittest_mon_moncap mon global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_mon_moncap PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1181,7 +1181,7 @@ add_executable(unittest_mon_pgmap EXCLUDE_FROM_ALL
 add_test(unittest_mon_pgmap unittest_mon_pgmap)
 add_dependencies(check unittest_mon_pgmap)
 target_link_libraries(unittest_mon_pgmap mon global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_mon_pgmap PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1193,7 +1193,7 @@ add_executable(unittest_ecbackend EXCLUDE_FROM_ALL
 add_test(unittest_ecbackend unittest_ecbackend)
 add_dependencies(check unittest_ecbackend)
 target_link_libraries(unittest_ecbackend osd global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_ecbackend PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1205,7 +1205,7 @@ add_executable(unittest_osdscrub EXCLUDE_FROM_ALL
 add_test(unittest_osdscrub unittest_osdscrub)
 add_dependencies(check unittest_osdscrub)
 target_link_libraries(unittest_osdscrub osd global dl os mon ${CMAKE_DL_LIBS}
-  ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_osdscrub PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1217,7 +1217,7 @@ add_executable(unittest_pglog EXCLUDE_FROM_ALL
 add_test(unittest_pglog unittest_pglog)
 add_dependencies(check unittest_pglog)
 target_link_libraries(unittest_pglog osd global dl ${CMAKE_DL_LIBS}
-  ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_pglog PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1229,7 +1229,7 @@ add_executable(unittest_hitset EXCLUDE_FROM_ALL
 add_test(unittest_hitset unittest_hitset)
 add_dependencies(check unittest_hitset)
 target_link_libraries(unittest_hitset osd global ${CMAKE_DL_LIBS}
-  ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_hitset PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1241,7 +1241,7 @@ add_executable(unittest_osd_osdcap EXCLUDE_FROM_ALL
 add_test(unittest_osd_osdcap unittest_osd_osdcap)
 add_dependencies(check unittest_osd_osdcap)
 target_link_libraries(unittest_osd_osdcap osd global ${CMAKE_DL_LIBS}
-${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_osd_osdcap PROPERTIES COMPILE_FLAGS
 ${UNITTEST_CXX_FLAGS})
 
@@ -1253,7 +1253,7 @@ add_executable(unittest_snap_mapper EXCLUDE_FROM_ALL
 add_test(unittest_snap_mapper unittest_snap_mapper)
 add_dependencies(check unittest_snap_mapper)
 target_link_libraries(unittest_snap_mapper osd global ${CMAKE_DL_LIBS}
-  ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_snap_mapper PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1265,7 +1265,7 @@ add_executable(unittest_mds_authcap EXCLUDE_FROM_ALL
 add_test(unittest_mds_authcap unittest_mds_authcap)
 add_dependencies(check unittest_mds_authcap)
 target_link_libraries(unittest_mds_authcap mds global ${CMAKE_DL_LIBS}
-  ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_mds_authcap PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1278,7 +1278,7 @@ add_executable(unittest_mds_sessionfilter EXCLUDE_FROM_ALL
 add_test(unittest_mds_sessionfilter unittest_mds_sessionfilter)
 add_dependencies(check unittest_mds_sessionfilter)
 target_link_libraries(unittest_mds_sessionfilter mds osdc common global
-  ${CMAKE_DL_LIBS} ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${CMAKE_DL_LIBS} ${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_mds_sessionfilter PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1288,7 +1288,7 @@ add_executable(unittest_ipaddr EXCLUDE_FROM_ALL
 add_test(unittest_ipaddr unittest_ipaddr)
 add_dependencies(check unittest_ipaddr)
 target_link_libraries(unittest_ipaddr mon global ${CMAKE_DL_LIBS} 
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_ipaddr PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1301,7 +1301,7 @@ add_executable(unittest_texttable EXCLUDE_FROM_ALL
 add_test(unittest_texttable unittest_texttable)
 add_dependencies(check unittest_texttable)
 target_link_libraries(unittest_texttable mon global ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${ALLOC_LIBS} ${UNITTEST_LIBS})
 set_target_properties(unittest_texttable PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 
@@ -1315,7 +1315,7 @@ add_dependencies(check unittest_on_exit)
 target_link_libraries(unittest_on_exit
   global
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 add_test(unittest_on_exit unittest_on_exit)
 add_dependencies(check unittest_on_exit)
@@ -1332,7 +1332,7 @@ add_dependencies(check unittest_readahead)
 target_link_libraries(unittest_readahead
   global
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 add_test(unittest_readahead unittest_readahead)
 add_dependencies(check unittest_readahead)
@@ -1349,7 +1349,7 @@ add_dependencies(check unittest_tableformatter)
 target_link_libraries(unittest_tableformatter
   global
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 add_test(unittest_tableformatter unittest_tableformatter)
 add_dependencies(check unittest_tableformatter)
@@ -1366,7 +1366,7 @@ add_dependencies(check unittest_bit_vector)
 target_link_libraries(unittest_bit_vector
   global
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 add_test(unittest_bit_vector unittest_bit_vector)
 add_dependencies(check unittest_bit_vector)
@@ -1382,7 +1382,7 @@ add_dependencies(check unittest_subprocess)
 target_link_libraries(unittest_subprocess
   global
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_subprocess PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -1405,7 +1405,7 @@ target_link_libraries(unittest_async_compressor
   global
   compressor
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${UNITTEST_LIBS})
 set_target_properties(unittest_async_compressor PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
@@ -1418,7 +1418,8 @@ add_executable(unittest_rocksdb_option EXCLUDE_FROM_ALL
 add_test(unittest_rocksdb_option unittest_rocksdb_option)
 add_dependencies(check unittest_rocksdb_option)
 target_link_libraries(unittest_rocksdb_option global os rocksdb ${CMAKE_DL_LIBS}
-  ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+  ${BLKID_LIBRARIES} ${ALLOC_LIBS} ${UNITTEST_LIBS})
+target_include_directories(unittest_rocksdb_option PUBLIC ${CMAKE_SOURCE_DIR}/src/rocksdb/include)
 set_target_properties(unittest_rocksdb_option PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
 # unittest_bluefs
@@ -1454,7 +1455,7 @@ if(${WITH_RADOSGW})
     curl
     expat
     ${BLKID_LIBRARIES}
-    ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
+    ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS})
   set_target_properties(test_cors PROPERTIES COMPILE_FLAGS
     ${UNITTEST_CXX_FLAGS})
 
@@ -1482,7 +1483,7 @@ if(${WITH_RADOSGW})
     expat
     ${BLKID_LIBRARIES}
     ${CMAKE_DL_LIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${UNITTEST_LIBS}
     ${CRYPTO_LIBS}
     )
@@ -1512,7 +1513,7 @@ if(${WITH_RADOSGW})
     uuid
     expat
     ${CMAKE_DL_LIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${UNITTEST_LIBS}
     ${CRYPTO_LIBS}
     )
@@ -1540,7 +1541,7 @@ if(${WITH_RADOSGW})
     cls_lock_client
     boost_regex
     ${BLKID_LIBRARIES}
-    ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS} ${CRYPTO_LIBS})
+    ${CMAKE_DL_LIBS} ${ALLOC_LIBS} ${UNITTEST_LIBS} ${CRYPTO_LIBS})
   set_target_properties(test_cls_rgw_meta PROPERTIES COMPILE_FLAGS
     ${UNITTEST_CXX_FLAGS})
 
@@ -1568,7 +1569,7 @@ if(${WITH_RADOSGW})
     boost_regex
     ${BLKID_LIBRARIES}
     ${CMAKE_DL_LIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${UNITTEST_LIBS}
     ${EXTRALIBS}
     ${CRYPTO_LIBS}
@@ -1598,7 +1599,7 @@ if(${WITH_RADOSGW})
     expat
     ${BLKID_LIBRARIES}
     ${CMAKE_DL_LIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${UNITTEST_LIBS}
     ${CRYPTO_LIBS}
     ${EXTRALIBS}
@@ -1618,7 +1619,7 @@ add_executable(multi_stress_watch
   $<TARGET_OBJECTS:heap_profiler_objs>
   )
 target_link_libraries(multi_stress_watch librados global radostest
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS})
+  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
 
 # unittest_librbd
 add_executable(unittest_librbd EXCLUDE_FROM_ALL
@@ -1641,7 +1642,7 @@ target_link_libraries(unittest_librbd
   ${UNITTEST_LIBS}
   global
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   blkid
@@ -1662,7 +1663,7 @@ target_link_libraries(test_librbd_fsx
   global
   m
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   blkid
@@ -1686,7 +1687,7 @@ target_link_libraries(test_cls_rbd
   global
   ${UNITTEST_LIBS}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   radostest
@@ -1708,7 +1709,7 @@ target_link_libraries(test_cls_refcount
   ${UNITTEST_LIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   radostest
@@ -1727,7 +1728,7 @@ target_link_libraries(test_cls_version
   ${UNITTEST_LIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   radostest
@@ -1747,7 +1748,7 @@ target_link_libraries(test_cls_log
   ${UNITTEST_LIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   )
@@ -1765,7 +1766,7 @@ target_link_libraries(test_cls_statelog
   ${UNITTEST_LIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   radostest
@@ -1784,7 +1785,7 @@ target_link_libraries(test_cls_replica_log
   ${UNITTEST_LIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   radostest
@@ -1803,7 +1804,7 @@ target_link_libraries(test_cls_lock
   ${UNITTEST_LIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CRYPTO_LIBS}
   ${EXTRALIBS}
   radostest
@@ -1820,7 +1821,7 @@ target_link_libraries(test_cls_hello
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   radostest
   ${UNITTEST_LIBS}
@@ -1840,7 +1841,7 @@ if(${WITH_RADOSGW})
     ${UNITTEST_LIBS}
     ${EXTRALIBS}
     ${BLKID_LIBRARIES}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${CMAKE_DL_LIBS}
     radostest)
 endif(${WITH_RADOSGW})
@@ -1854,7 +1855,7 @@ target_link_libraries(test_mon_workloadgen
   osdc
   global
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -1865,7 +1866,7 @@ add_executable(test_rados_api_cmd
 set_target_properties(test_rados_api_cmd PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_cmd
-  librados global ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados global ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_io
   librados/io.cc
@@ -1874,7 +1875,7 @@ add_executable(test_rados_api_io
 set_target_properties(test_rados_api_io PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_io
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_c_write_operations
   librados/c_write_operations.cc
@@ -1883,7 +1884,7 @@ add_executable(test_rados_api_c_write_operations
 set_target_properties(test_rados_api_c_write_operations PROPERTIES
   COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_c_write_operations
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_c_read_operations
   librados/c_read_operations.cc
@@ -1892,7 +1893,7 @@ add_executable(test_rados_api_c_read_operations
 set_target_properties(test_rados_api_c_read_operations PROPERTIES COMPILE_FLAGS 
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_c_read_operations
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_aio
   librados/aio.cc
@@ -1901,7 +1902,7 @@ add_executable(test_rados_api_aio
 set_target_properties(test_rados_api_aio PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_aio
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_list
   librados/list.cc
@@ -1910,7 +1911,7 @@ add_executable(test_rados_api_list
 set_target_properties(test_rados_api_list PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_list
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_nlist
   librados/nlist.cc
@@ -1919,7 +1920,7 @@ add_executable(test_rados_api_nlist
 set_target_properties(test_rados_api_nlist PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_nlist
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_pool
   librados/pool.cc
@@ -1929,7 +1930,7 @@ set_target_properties(test_rados_api_pool PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS}
   )
 target_link_libraries(test_rados_api_pool
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_stat
   librados/stat.cc
@@ -1938,7 +1939,7 @@ add_executable(test_rados_api_stat
 set_target_properties(test_rados_api_stat PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_stat
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_watch_notify
   librados/watch_notify.cc
@@ -1947,7 +1948,7 @@ add_executable(test_rados_api_watch_notify
 set_target_properties(test_rados_api_watch_notify PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_watch_notify
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_cls
   librados/cls.cc
@@ -1956,7 +1957,7 @@ add_executable(test_rados_api_cls
 set_target_properties(test_rados_api_cls PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_cls
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_misc
   librados/misc.cc
@@ -1965,7 +1966,7 @@ add_executable(test_rados_api_misc
 set_target_properties(test_rados_api_misc PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_misc
-  librados global ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados global ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 add_executable(test_rados_api_lock
   librados/lock.cc
@@ -1974,7 +1975,7 @@ add_executable(test_rados_api_lock
 set_target_properties(test_rados_api_lock PROPERTIES COMPILE_FLAGS
   ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rados_api_lock
-  librados ${UNITTEST_LIBS} ${TCMALLOC_LIBS} radostest)
+  librados ${UNITTEST_LIBS} ${ALLOC_LIBS} radostest)
 
 if(${WITH_CEPHFS})
   add_executable(test_libcephfs
@@ -1991,7 +1992,7 @@ if(${WITH_CEPHFS})
     cephfs
     ${UNITTEST_LIBS}
     ${EXTRALIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${CMAKE_DL_LIBS}
     )
 endif(${WITH_CEPHFS})  
@@ -2009,7 +2010,7 @@ target_link_libraries(test_objectstore
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2026,7 +2027,7 @@ target_link_libraries(test_keyvaluedb
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2040,7 +2041,7 @@ target_link_libraries(test_objectstore_workloadgen
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2055,7 +2056,7 @@ target_link_libraries(test_filestore_idempotent
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2071,7 +2072,7 @@ target_link_libraries(test_filestore_idempotent_sequence
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2088,7 +2089,7 @@ target_link_libraries(test_xattr_bench
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2105,7 +2106,7 @@ target_link_libraries(test_filejournal
   global
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   ${EXTRALIBS}
   )
@@ -2123,7 +2124,7 @@ target_link_libraries(test_stress_watch
   radostest
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2136,7 +2137,7 @@ target_link_libraries(test_objectcacher_stress
   osdc
   global
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2153,7 +2154,7 @@ target_link_libraries(test_object_map
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2169,7 +2170,7 @@ target_link_libraries(test_keyvaluedb_atomicity
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2186,7 +2187,7 @@ target_link_libraries(test_keyvaluedb_iterators
   ${UNITTEST_LIBS}
   global
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2198,7 +2199,7 @@ if(${HAVE_FUSE})
     global
     os
     ${EXTRALIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${CMAKE_DL_LIBS}
     )
 endif(${HAVE_FUSE})
@@ -2213,7 +2214,7 @@ if(${WITH_CEPHFS})
     cephfs
     ${EXTRALIBS}
     ${BLKID_LIBRARIES}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${CMAKE_DL_LIBS}
     )
 endif(${WITH_CEPHFS})
@@ -2227,7 +2228,7 @@ target_link_libraries(test_get_blkdev_size
   pthread
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2239,7 +2240,7 @@ add_executable(simple_server
 target_link_libraries(simple_server
   os global common boost_regex
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2251,7 +2252,7 @@ add_executable(simple_client
 target_link_libraries(simple_client
   os global common boost_regex
   ${EXTRALIBS}
-  ${TCMALLOC_LIBS}
+  ${ALLOC_LIBS}
   ${CMAKE_DL_LIBS}
   )
 
@@ -2265,7 +2266,7 @@ if(HAVE_XIO)
     os global common boost_regex
     ${Xio_LIBRARY} ibverbs rdmacm pthread rt
     ${EXTRALIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${CMAKE_DL_LIBS}
     )
 
@@ -2278,7 +2279,7 @@ if(HAVE_XIO)
     os global common boost_regex
     ${Xio_LIBRARY} ibverbs rdmacm pthread rt
     ${EXTRALIBS}
-    ${TCMALLOC_LIBS}
+    ${ALLOC_LIBS}
     ${CMAKE_DL_LIBS}
     )
 endif(HAVE_XIO)