lockdep create large data structures on .bss and on heap for tracking
the locks and their dependencies. but we don't need to pay for this
if lockdep is not enabled.
lockdep helps us to track the lock dependencies related issue on Debug
build. and Release build, this feature hurts the performance and more
importantly, lockdeps is a feature only kicks in when using the
mutex_debug and friends. they are not used in Release build at all.
so, after this change, lockdep is not built in Release build. and
the static variables defined in lockdep.cc are not allocated anymore
in Release build.
Signed-off-by: Kefu Chai <kchai@redhat.com>
hostname.cc
ipaddr.cc
iso_8601.cc
- lockdep.cc
mempool.cc
mime.c
numa.cc
if(WITH_CEPH_DEBUG_MUTEX)
list(APPEND common_srcs
+ lockdep.cc
mutex_debug.cc
shared_mutex_debug.cc)
endif()
${PROJECT_SOURCE_DIR}/src/common/Finisher.cc
${PROJECT_SOURCE_DIR}/src/common/HeartbeatMap.cc
${PROJECT_SOURCE_DIR}/src/common/PluginRegistry.cc
- ${PROJECT_SOURCE_DIR}/src/common/lockdep.cc
${PROJECT_SOURCE_DIR}/src/common/perf_counters.cc
${PROJECT_SOURCE_DIR}/src/common/perf_counters_collection.cc
${PROJECT_SOURCE_DIR}/src/common/RefCountedObj.cc
$<TARGET_OBJECTS:common_prioritycache_obj>)
if(WITH_CEPH_DEBUG_MUTEX)
list(APPEND crimson_alien_common_srcs
+ ${PROJECT_SOURCE_DIR}/src/common/lockdep.cc
${PROJECT_SOURCE_DIR}/src/common/mutex_debug.cc
${PROJECT_SOURCE_DIR}/src/common/shared_mutex_debug.cc)
endif()
endif()
# unittest_lockdep
-add_executable(unittest_lockdep
- test_lockdep.cc)
-add_ceph_unittest(unittest_lockdep)
-target_link_libraries(unittest_lockdep ceph-common)
+if(WITH_CEPH_DEBUG_MUTEX)
+ add_executable(unittest_lockdep
+ test_lockdep.cc)
+ add_ceph_unittest(unittest_lockdep)
+ target_link_libraries(unittest_lockdep ceph-common)
+endif()
# unittest_counter
add_executable(unittest_counter