From 29b4c795d30c3ea9cdc0a0ea3a10f7230c27c577 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 15 Dec 2022 17:38:07 +0800 Subject: [PATCH] test/crimson: print conn instead of its address now that crimson::net::Connection can be formatted using fmt::format(), instead of printing the pointer, let's print its value. Signed-off-by: Kefu Chai --- src/test/crimson/test_messenger.cc | 4 ++-- src/test/crimson/test_messenger_thrash.cc | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/crimson/test_messenger.cc b/src/test/crimson/test_messenger.cc index b8cde621689..a0b982645e8 100644 --- a/src/test/crimson/test_messenger.cc +++ b/src/test/crimson/test_messenger.cc @@ -985,7 +985,7 @@ class FailoverSuite : public Dispatcher { throw std::runtime_error(fmt::format( "The connected connection [{}] {} doesn't" " match the tracked connection [{}] {}", - result.index, *result.conn, tracked_index, tracked_conn)); + result.index, *result.conn, tracked_index, *tracked_conn)); } if (pending_send == 0 && pending_peer_receive == 0 && pending_receive == 0) { result.state = conn_state_t::established; @@ -1574,7 +1574,7 @@ class FailoverTestPeer : public Dispatcher { break; } default: - logger().error("{} got unexpected msg from cmd client: {}", *c, m); + logger().error("{} got unexpected msg from cmd client: {}", *c, *m); ceph_abort(); } return {seastar::now()}; diff --git a/src/test/crimson/test_messenger_thrash.cc b/src/test/crimson/test_messenger_thrash.cc index 2806cc630e2..d56da0a86e8 100644 --- a/src/test/crimson/test_messenger_thrash.cc +++ b/src/test/crimson/test_messenger_thrash.cc @@ -107,7 +107,7 @@ class SyntheticDispatcher final std::optional> ms_dispatch(crimson::net::ConnectionRef con, MessageRef m) { if (verbose) { - logger().warn("{}: con = {}", __func__, con); + logger().warn("{}: con = {}", __func__, *con); } // MSG_COMMAND is used to disorganize regular message flow if (m->get_type() == MSG_COMMAND) { @@ -119,7 +119,7 @@ class SyntheticDispatcher final decode(pl, p); if (pl.who == Payload::PING) { logger().info(" {} conn= {} {}", __func__, - m->get_connection(), pl); + *m->get_connection(), pl); return reply_message(m, pl); } else { ceph_assert(pl.who == Payload::PONG); @@ -137,11 +137,11 @@ class SyntheticDispatcher final } void ms_handle_accept(crimson::net::ConnectionRef conn) { - logger().info("{} - Connection:{}", __func__, conn); + logger().info("{} - Connection:{}", __func__, *conn); } void ms_handle_connect(crimson::net::ConnectionRef conn) { - logger().info("{} - Connection:{}", __func__, conn); + logger().info("{} - Connection:{}", __func__, *conn); } void ms_handle_reset(crimson::net::ConnectionRef con, bool is_replace); @@ -173,7 +173,7 @@ class SyntheticDispatcher final sent[pl.seq] = pl.data; conn_sent[&*con].push_back(pl.seq); logger().info("{} conn= {} send i= {}", - __func__, con, pl.seq); + __func__, *con, pl.seq); return con->send(std::move(m)); } -- 2.39.5