From: Jason Dillaman Date: Fri, 12 May 2017 23:50:51 +0000 (-0400) Subject: blkin: improved objecter trace events X-Git-Tag: v12.1.0~10^2~67^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fd2359263ce24572a77f39e7b6f84b1a577490ac;p=ceph.git blkin: improved objecter trace events Signed-off-by: Jason Dillaman --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 050c762c7cd3..0364be92de79 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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)) { diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 85b947afef9d..883ef5bbb1d9 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -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"); } };