Skip to content

Commit

Permalink
xio: provide dout_prefix for XioConnection with: from>>to, peer-type,…
Browse files Browse the repository at this point in the history
… and conn/sess

1. this prefix will be added for any log message from XioConnection
(2. hence, remove info that is now redundeant in few existing log messages)

Signed-off-by: Avner BenHanoch <avnerb@mellanox.com>
  • Loading branch information
avnerbh authored and Adir Lev committed Jun 2, 2016
1 parent e4f55f4 commit 3fbc268
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/msg/xio/XioConnection.cc
Expand Up @@ -77,6 +77,14 @@ void print_ceph_msg(CephContext *cct, const char *tag, Message *m)
}
}

#undef dout_prefix
#define dout_prefix _conn_prefix(_dout)
ostream& XioConnection::_conn_prefix(std::ostream *_dout) {
return *_dout << "-- " << get_messenger()->get_myinst().addr << " >> " << peer_addr
<< " peer=" << peer.name.type_str()
<< " conn=" << conn << " sess=" << session << " ";
}

XioConnection::XioConnection(XioMessenger *m, XioConnection::type _type,
const entity_inst_t& _peer) :
Connection(m->cct, m),
Expand Down Expand Up @@ -136,8 +144,7 @@ XioConnection::XioConnection(XioMessenger *m, XioConnection::type _type,
xio_set_opt(NULL, XIO_OPTLEVEL_ACCELIO, XIO_OPTNAME_RCV_QUEUE_DEPTH_BYTES,
&bytes_opt, sizeof(bytes_opt));

ldout(m->cct,4) << "Peer type: " << peer.name.type_str() <<
" throttle_msgs: " << xopt << " throttle_bytes: " << bytes_opt << dendl;
ldout(m->cct,4) << "throttle_msgs: " << xopt << " throttle_bytes: " << bytes_opt << dendl;

/* XXXX fake features, aieee! */
set_features(XIO_ALL_FEATURES);
Expand Down Expand Up @@ -281,7 +288,6 @@ int XioConnection::handle_data_msg(struct xio_session *session,
<< " iov_base " << tmsg->in.header.iov_base
<< " iov_len " << (int) tmsg->in.header.iov_len
<< " nents " << tmsg->in.pdata_iov.nents
<< " conn " << conn << " sess " << session
<< " sn " << tmsg->sn << dendl;
assert(session == this->session);
in_seq.set_count(msg_cnt.msg_cnt);
Expand Down Expand Up @@ -561,7 +567,7 @@ int XioConnection::on_ow_msg_send_complete(struct xio_session *session,
} /* trace ctr */

ldout(msgr->cct,11) << "on_msg_delivered xcon: " << xsend->xcon <<
" session: " << session << " msg: " << req << " sn: " << req->sn << dendl;
" msg: " << req << " sn: " << req->sn << dendl;

XioMsg *xmsg = dynamic_cast<XioMsg*>(xsend);
if (xmsg) {
Expand All @@ -578,8 +584,8 @@ int XioConnection::on_ow_msg_send_complete(struct xio_session *session,
if ((send_ctr <= uint32_t(xio_qdepth_low_mark())) &&
(1 /* XXX memory <= memory low-water mark */)) {
cstate.state_up_ready(XioConnection::CState::OP_FLAG_NONE);
ldout(msgr->cct,2) << "on_msg_delivered xcon: " << xsend->xcon <<
" session: " << session << " up_ready from flow_controlled" << dendl;
ldout(msgr->cct,2) << "on_msg_delivered xcon: " << xsend->xcon
<< " up_ready from flow_controlled" << dendl;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/msg/xio/XioConnection.h
Expand Up @@ -272,6 +272,7 @@ class XioConnection : public Connection
if (conn)
xio_connection_destroy(conn);
}
ostream& _conn_prefix(std::ostream *_dout);

bool is_connected() override { return connected.read(); }

Expand Down

0 comments on commit 3fbc268

Please sign in to comment.