From ee5502d2aeb29bcffa2fc0eb5066753c2e410fa0 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Fri, 10 Jun 2011 11:02:27 -0700 Subject: [PATCH] Remove cdout cdout just duplicates the functionality of dout. Signed-off-by: Colin McCabe --- src/common/debug.h | 5 ----- src/include/Context.h | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/common/debug.h b/src/common/debug.h index 264a6850fd196..7aaa7665ddf19 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -87,11 +87,6 @@ inline std::ostream& operator<<(std::ostream& out, _bad_endl_use_dendl_t) { dout_impl(v) \ dout_prefix -#define cdout(sys, v) \ - do { if (v <= XDOUT_CONDVAR(sys)) { \ - dout_impl(v) \ - dout_prefix - #define pdout(v, p) \ do { if ((v) <= (p)) {\ dout_impl(v) \ diff --git a/src/include/Context.h b/src/include/Context.h index 091867997703f..f4c795ab540d8 100644 --- a/src/include/Context.h +++ b/src/include/Context.h @@ -24,6 +24,7 @@ #include +#define DOUT_SUBSYS context /* * Context - abstract callback class @@ -47,12 +48,12 @@ inline void finish_contexts(std::list& finished, list ls; ls.swap(finished); // swap out of place to avoid weird loops - cdout(context, 10) << ls.size() << " contexts to finish with " << result << dendl; + dout(10) << ls.size() << " contexts to finish with " << result << dendl; for (std::list::iterator it = ls.begin(); it != ls.end(); it++) { Context *c = *it; - cdout(context, 10) << "---- " << c << dendl; + dout(10) << "---- " << c << dendl; c->finish(result); delete c; } @@ -67,12 +68,12 @@ inline void finish_contexts(std::vector& finished, vector ls; ls.swap(finished); // swap out of place to avoid weird loops - cdout(context, 10) << ls.size() << " contexts to finish with " << result << dendl; + dout(10) << ls.size() << " contexts to finish with " << result << dendl; for (std::vector::iterator it = ls.begin(); it != ls.end(); it++) { Context *c = *it; - cdout(context, 10) << "---- " << c << dendl; + dout(10) << "---- " << c << dendl; c->finish(result); delete c; } @@ -131,7 +132,7 @@ private: #endif --sub_existing_count; - cdout(context, 10) << "C_Gather " << this << ".sub_finish(r=" << r << ") " << sub + dout(10) << "C_Gather " << this << ".sub_finish(r=" << r << ") " << sub #ifdef DEBUG_GATHER << " (remaining " << waitfor << ")" #endif @@ -186,10 +187,10 @@ public: lock("C_Gather::lock", true, false), //disable lockdep any(an), activated(onfinish ? true : false) { - cdout(context, 10) << "C_Gather " << this << ".new" << dendl; + dout(10) << "C_Gather " << this << ".new" << dendl; } ~C_Gather() { - cdout(context, 10) << "C_Gather " << this << ".delete" << dendl; + dout(10) << "C_Gather " << this << ".delete" << dendl; assert(sub_existing_count == 0); #ifdef DEBUG_GATHER assert(waitfor.empty()); @@ -211,7 +212,7 @@ public: #ifdef DEBUG_GATHER waitfor.insert(s); #endif - cdout(context, 10) << "C_Gather " << this << ".new_sub is " << sub_created_count << " " << s << dendl; + dout(10) << "C_Gather " << this << ".new_sub is " << sub_created_count << " " << s << dendl; return s; } void rm_sub(Context *s) { @@ -233,4 +234,6 @@ public: }; +#undef DOUT_SUBSYS + #endif -- 2.39.5