From: Jianpeng Ma Date: Tue, 19 Feb 2019 07:10:24 +0000 (+0800) Subject: msg/async: only call OID_EVENT when WTIH_EVENTRACE define. X-Git-Tag: v15.0.0~113^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb54be4b8bbf3da0ed7ef73ffd7758b8ad85ef9c;p=ceph.git msg/async: only call OID_EVENT when WTIH_EVENTRACE define. Signed-off-by: Jianpeng Ma --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 91ea1f6c8278..c73b14e21713 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -511,10 +511,12 @@ int AsyncConnection::send_message(Message *m) m->get_header().src = async_msgr->get_myname(); m->set_connection(this); +#if defined(WITH_LTTNG) && defined(WITH_EVENTTRACE) if (m->get_type() == CEPH_MSG_OSD_OP) OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OP_BEGIN", true); else if (m->get_type() == CEPH_MSG_OSD_OPREPLY) OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OPREPLY_BEGIN", true); +#endif if (async_msgr->get_myaddrs() == get_peer_addrs()) { //loopback connection ldout(async_msgr->cct, 20) << __func__ << " " << *m << " local" << dendl; diff --git a/src/msg/async/AsyncMessenger.cc b/src/msg/async/AsyncMessenger.cc index f6bcaa9b794e..8ca54d10aa84 100644 --- a/src/msg/async/AsyncMessenger.cc +++ b/src/msg/async/AsyncMessenger.cc @@ -644,10 +644,12 @@ int AsyncMessenger::send_to(Message *m, int type, const entity_addrvec_t& addrs) FUNCTRACE(cct); ceph_assert(m); +#if defined(WITH_LTTNG) && defined(WITH_EVENTTRACE) if (m->get_type() == CEPH_MSG_OSD_OP) OID_EVENT_TRACE(((MOSDOp *)m)->get_oid().name.c_str(), "SEND_MSG_OSD_OP"); else if (m->get_type() == CEPH_MSG_OSD_OPREPLY) OID_EVENT_TRACE(((MOSDOpReply *)m)->get_oid().name.c_str(), "SEND_MSG_OSD_OP_REPLY"); +#endif ldout(cct, 1) << __func__ << "--> " << ceph_entity_type_name(type) << " " << addrs << " -- " << *m << " -- ?+" diff --git a/src/msg/async/ProtocolV1.cc b/src/msg/async/ProtocolV1.cc index 5bc5084c035a..d41329bd9fdd 100644 --- a/src/msg/async/ProtocolV1.cc +++ b/src/msg/async/ProtocolV1.cc @@ -1167,10 +1167,13 @@ ssize_t ProtocolV1::write_message(Message *m, bufferlist &bl, bool more) { ldout(cct, 10) << __func__ << " sending " << m << (rc ? " continuely." : " done.") << dendl; } + +#if defined(WITH_LTTNG) && defined(WITH_EVENTTRACE) if (m->get_type() == CEPH_MSG_OSD_OP) OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OP_END", false); else if (m->get_type() == CEPH_MSG_OSD_OPREPLY) OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OPREPLY_END", false); +#endif m->put(); return rc; diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 46503495084b..9fe753c2269e 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -533,10 +533,13 @@ ssize_t ProtocolV2::write_message(Message *m, bool more) { ldout(cct, 10) << __func__ << " sending " << m << (rc ? " continuely." : " done.") << dendl; } + +#if defined(WITH_LTTNG) && defined(WITH_EVENTTRACE) if (m->get_type() == CEPH_MSG_OSD_OP) OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OP_END", false); else if (m->get_type() == CEPH_MSG_OSD_OPREPLY) OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OPREPLY_END", false); +#endif m->put(); return rc;