]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: a bit better coroutine related logging
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 21 Oct 2015 23:17:07 +0000 (16:17 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:19 +0000 (16:13 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_coroutine.cc
src/rgw/rgw_coroutine.h

index 923ad5f50e6bab026923c1feacb978ee882220f2..5194fb15c90a78ce727212b5333da02990340e1f 100644 (file)
@@ -119,6 +119,7 @@ int RGWCoroutinesStack::operate(RGWCoroutinesEnv *_env)
 {
   env = _env;
   RGWCoroutine *op = *pos;
+  ldout(cct, 20) << *op << ": operate()" << dendl;
   op->stack = this;
   int r = op->operate();
   if (r < 0) {
@@ -480,6 +481,17 @@ void RGWCoroutine::wait_for_child()
   stack->set_wait_for_child(true);
 }
 
+string RGWCoroutine::to_str()
+{
+  return typeid(*this).name();
+}
+
+ostream& operator<<(ostream& out, const RGWCoroutine& cr)
+{
+  out << "cr:s=" << (void *)cr.get_stack() << ":op=" << (void *)&cr << ":" << typeid(cr).name();
+  return out;
+}
+
 bool RGWCoroutine::drain_children()
 {
   bool done = false;
index 1a18fc6dc14911095f41a6a7ff7abbbd0daaaa8e..a0aae9b09f02d5bb765e2475ff3b533f9bacfae5 100644 (file)
@@ -186,8 +186,16 @@ public:
   }
 
   void wait_for_child();
+
+  virtual string to_str();
+
+  RGWCoroutinesStack *get_stack() const {
+    return stack;
+  }
 };
 
+ostream& operator<<(ostream& out, const RGWCoroutine& cr);
+
 #define yield_until_true(x)     \
 do {                            \
   do {                          \