]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
blkin: improved objecter trace events
authorJason Dillaman <dillaman@redhat.com>
Fri, 12 May 2017 23:50:51 +0000 (19:50 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 18 May 2017 22:13:27 +0000 (18:13 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 050c762c7cd3b7236f31636db6cb98cf517a82cd..0364be92de799e4418212edb0e5cae1a67b5fc4c 100644 (file)
@@ -2195,6 +2195,7 @@ void Objecter::op_submit(Op *op, ceph_tid_t *ptid, int *ctx_budget)
   ceph_tid_t tid = 0;
   if (!ptid)
     ptid = &tid;
+  op->trace.event("op submit");
   _op_submit_with_budget(op, rl, ptid, ctx_budget);
 }
 
@@ -3090,9 +3091,10 @@ MOSDOp *Objecter::_prepare_osd_op(Op *op)
   m->ops = op->ops;
   m->set_mtime(op->mtime);
   m->set_retry_attempt(op->attempts++);
-  m->trace = op->trace;
-  if (!m->trace && cct->_conf->osdc_blkin_trace_all)
-    m->trace.init("objecter op", &trace_endpoint);
+
+  if (!op->trace.valid() && cct->_conf->osdc_blkin_trace_all) {
+    op->trace.init("op", &trace_endpoint);
+  }
 
   if (op->priority)
     m->set_priority(op->priority);
@@ -3177,6 +3179,9 @@ void Objecter::_send_op(Op *op, MOSDOp *m)
 
   m->set_tid(op->tid);
 
+  if (op->trace.valid()) {
+    m->trace.init("op msg", nullptr, &op->trace);
+  }
   op->session->con->send_message(m);
 }
 
@@ -3285,6 +3290,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
                << " attempt " << m->get_retry_attempt()
                << dendl;
   Op *op = iter->second;
+  op->trace.event("osd op reply");
 
   if (retry_writes_after_first_reply && op->attempts == 1 &&
       (op->target.flags & CEPH_OSD_FLAG_WRITE)) {
index 85b947afef9de7e24d72cabf51868d607e12de32..883ef5bbb1d94090d5ba1872df4af1b575d1ade5 100644 (file)
@@ -1384,8 +1384,10 @@ public:
       if (target.base_oloc.key == o)
        target.base_oloc.key.clear();
 
-      if (parent_trace && parent_trace->valid())
+      if (parent_trace && parent_trace->valid()) {
         trace.init("op", nullptr, parent_trace);
+        trace.event("start");
+      }
     }
 
     bool operator<(const Op& other) const {
@@ -1404,6 +1406,7 @@ public:
        delete out_handler.back();
        out_handler.pop_back();
       }
+      trace.event("finish");
     }
   };