From fd2359263ce24572a77f39e7b6f84b1a577490ac Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 12 May 2017 19:50:51 -0400 Subject: [PATCH] blkin: improved objecter trace events Signed-off-by: Jason Dillaman --- src/osdc/Objecter.cc | 12 +++++++++--- src/osdc/Objecter.h | 5 ++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 050c762c7cd..0364be92de7 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 85b947afef9..883ef5bbb1d 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"); } }; -- 2.39.5