From: Kefu Chai Date: Fri, 12 Mar 2021 13:12:08 +0000 (+0800) Subject: common/lockdep: disable lockdep if !CEPH_DEBUG_MUTEX X-Git-Tag: v17.1.0~2626^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8102981e17d3bb27ca0f40e8f37a496fdb50bb58;p=ceph.git common/lockdep: disable lockdep if !CEPH_DEBUG_MUTEX make lockdep a feature which can only be enabled at compile time. we don't need to have lockdep when CEPH_DEBUG_MUTEX is OFF, so just comment it out in Release builds. Signed-off-by: Kefu Chai --- diff --git a/src/common/lockdep.h b/src/common/lockdep.h index 240347d02e3b2..f2376d0b12226 100644 --- a/src/common/lockdep.h +++ b/src/common/lockdep.h @@ -16,6 +16,9 @@ #define CEPH_LOCKDEP_H #include "include/common_fwd.h" + +#ifdef CEPH_DEBUG_MUTEX + extern bool g_lockdep; extern void lockdep_register_ceph_context(CephContext *cct); @@ -30,4 +33,17 @@ extern int lockdep_will_lock(const char *n, int id, bool force_backtrace=false, extern int lockdep_locked(const char *n, int id, bool force_backtrace=false); extern int lockdep_will_unlock(const char *n, int id); extern int lockdep_dump_locks(); + +#else + +static constexpr bool g_lockdep = false; +#define lockdep_register(...) 0 +#define lockdep_unregister(...) +#define lockdep_will_lock(...) 0 +#define lockdep_locked(...) 0 +#define lockdep_will_unlock(...) 0 + +#endif // CEPH_DEBUG_MUTEX + + #endif