Fix a bug that was keeping lockdep from starting. Add a printout that
lets the user know that lockdep is enabled.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
#include "common/environment.h"
#include "Mutex.h"
-int g_lockdep = get_env_int("CEPH_LOCKDEP");
-
#ifdef LOCKDEP
#include "include/types.h"
<< TEXT_NORMAL << std::endl;
output_ceph_version();
}
+ if (g_lockdep) {
+ cout << TEXT_YELLOW << "*** lockdep is enabled (" << g_lockdep
+ << ") ***" << TEXT_NORMAL << std::endl;
+ }
}
static void pidfile_remove_void(void)
#define CEPH_COMMON_ENVIRONMENT_H
extern bool get_env_bool(const char *key);
+extern int get_env_int(const char *key);
#endif
-
-#include "lockdep.h"
-
-#include "include/types.h"
-#include "Clock.h"
#include "BackTrace.h"
+#include "Clock.h"
+#include "common/config.h"
+#include "common/environment.h"
+#include "include/types.h"
+#include "lockdep.h"
#include <ext/hash_map>
-#include "common/config.h"
-
#define DOUT_SUBSYS lockdep
// global
-int g_lockdep = 0;
+int g_lockdep = get_env_int("CEPH_LOCKDEP");
// disable lockdep when this module destructs.
struct lockdep_stopper_t {