From bdf1a7a943e66f027437c2de98169a742be394e0 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 24 Apr 2017 18:06:16 -0400 Subject: [PATCH] mds: use debug_mds for most subsys DOUT_COND was obsoleted by f41887e38d70970f4d0181fb73e835ece68cee6c. Balancer and Mantle use a dout hack to continue working since we will probably specifically want very verbose balancer output in the future. Fixes: http://tracker.ceph.com/issues/19734 Signed-off-by: Patrick Donnelly --- doc/rados/troubleshooting/log-and-debug.rst | 4 +--- src/common/dout.h | 4 +++- src/mds/Locker.cc | 2 -- src/mds/MDBalancer.cc | 17 +++++++++++++---- src/mds/MDLog.cc | 2 -- src/mds/Migrator.cc | 2 -- src/mds/journal.cc | 6 ------ 7 files changed, 17 insertions(+), 20 deletions(-) diff --git a/doc/rados/troubleshooting/log-and-debug.rst b/doc/rados/troubleshooting/log-and-debug.rst index dabe8412a849..757dfb178e92 100644 --- a/doc/rados/troubleshooting/log-and-debug.rst +++ b/doc/rados/troubleshooting/log-and-debug.rst @@ -88,8 +88,6 @@ particular daemons are set under the daemon section in your configuration file [mds] debug mds = 1 debug mds balancer = 1 - debug mds log = 1 - debug mds migrator = 1 See `Subsystem, Log and Debug Settings`_ for details. @@ -171,7 +169,7 @@ as ``debug ms = 1/5``. For example: debug {subsystem} = {log-level}/{memory-level} #for example - debug mds log = 1/20 + debug mds balancer = 1/20 The following table provides a list of Ceph subsystems and their default log and diff --git a/src/common/dout.h b/src/common/dout.h index 9f715bf501b3..d2340c9364cc 100644 --- a/src/common/dout.h +++ b/src/common/dout.h @@ -77,9 +77,11 @@ public: // NOTE: depend on magic value in _ASSERT_H so that we detect when // /usr/include/assert.h clobbers our fancier version. -#define dendl std::flush; \ +#define dendl_impl std::flush; \ _ASSERT_H->_log->submit_entry(_dout_e); \ } \ } while (0) +#define dendl dendl_impl + #endif diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index cd6ed93bcd71..d50650b63840 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -47,8 +47,6 @@ #define dout_subsys ceph_subsys_mds #undef dout_prefix -#undef DOUT_COND -#define DOUT_COND(cct, l) l<=cct->_conf->debug_mds || l <= cct->_conf->debug_mds_locker #define dout_context g_ceph_context #define dout_prefix _prefix(_dout, mds) static ostream& _prefix(std::ostream *_dout, MDSRank *mds) { diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index cb9c1f32f606..192dc9d02ec0 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -41,10 +41,19 @@ using std::vector; #define dout_context g_ceph_context #define dout_subsys ceph_subsys_mds -#undef DOUT_COND -#define DOUT_COND(cct, l) l<=cct->_conf->debug_mds || l <= cct->_conf->debug_mds_balancer #undef dout_prefix #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".bal " +#undef dout +#define dout(lvl) \ + do {\ + auto subsys = ceph_subsys_mds;\ + if ((dout_context)->_conf->subsys.should_gather(ceph_subsys_mds_balancer, lvl)) {\ + subsys = ceph_subsys_mds_balancer;\ + }\ + dout_impl(dout_context, subsys, lvl) dout_prefix +#undef dendl +#define dendl dendl_impl; } while (0) + #define MIN_LOAD 50 // ?? #define MIN_REEXPORT 5 // will automatically reexport @@ -61,7 +70,7 @@ int MDBalancer::proc_message(Message *m) break; default: - derr << " balancer unknown message " << m->get_type() << dendl; + dout(0) << " balancer unknown message " << m->get_type() << dendl; assert(0 == "balancer unknown message"); } @@ -205,7 +214,7 @@ mds_load_t MDBalancer::get_load(utime_t now) if (cpu.is_open()) cpu >> load.cpu_load_avg; else - derr << "input file " PROCPREFIX "'/proc/loadavg' not found" << dendl; + dout(0) << "input file " PROCPREFIX "'/proc/loadavg' not found" << dendl; dout(15) << "get_load " << load << dendl; return load; diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 7b2826e97007..f02489fd176c 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -33,8 +33,6 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_mds -#undef DOUT_COND -#define DOUT_COND(cct, l) l<=cct->_conf->debug_mds || l <= cct->_conf->debug_mds_log #undef dout_prefix #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".log " diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 140a61592545..67796cf5a214 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -78,8 +78,6 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_mds -#undef DOUT_COND -#define DOUT_COND(cct, l) (l <= cct->_conf->debug_mds || l <= cct->_conf->debug_mds_migrator) #undef dout_prefix #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".migrator " diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 53dd3f466f13..a28491547217 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -54,9 +54,6 @@ #define dout_context g_ceph_context #define dout_subsys ceph_subsys_mds -#undef DOUT_COND -#define DOUT_COND(cct, l) (l<=cct->_conf->debug_mds || l <= cct->_conf->debug_mds_log \ - || l <= cct->_conf->debug_mds_log_expire) #undef dout_prefix #define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".journal " @@ -298,9 +295,6 @@ void LogSegment::try_to_expire(MDSRank *mds, MDSGatherBuilder &gather_bld, int o } } -#undef DOUT_COND -#define DOUT_COND(cct, l) (l<=cct->_conf->debug_mds || l <= cct->_conf->debug_mds_log) - // ----------------------- // EMetaBlob -- 2.47.3