]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: unify loggings for message exchange
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 11 Jul 2019 13:10:00 +0000 (21:10 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 16 Jul 2019 11:39:53 +0000 (19:39 +0800)
* remove duplicated information in message logs,
  because connection prefix already contains information about:
  "[my_name(my_logic_name) my_addr >> peer_name peer_addr]"
* unify message logs for both v1 and v2;
* continue to use familiar identifiers to highlight message logs:
  - received messages identified by "<== #seq === msg (type)";
  - sent messages identified by "--> #seq === msg (type)";

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV1.cc
src/crimson/net/ProtocolV2.cc

index 48b628684af363460869f9144fce8b5dddc17aa9..30aa86428653934ab2892e3362da2c55fa68e399 100644 (file)
@@ -699,6 +699,8 @@ ceph::bufferlist ProtocolV1::do_sweep_messages(
     if (session_security) {
       session_security->sign_message(msg.get());
     }
+    logger().debug("{} --> #{} === {} ({})",
+                   conn, msg->get_seq(), *msg, msg->get_type());
     bl.append(CEPH_MSGR_TAG_MSG);
     bl.append((const char*)&header, sizeof(header));
     bl.append(msg->get_payload());
@@ -819,8 +821,8 @@ seastar::future<> ProtocolV1::read_message()
 
       // start dispatch, ignoring exceptions from the application layer
       seastar::with_gate(pending_dispatch, [this, msg = std::move(msg_ref)] {
-          logger().debug("{} <= {}@{} === {}", messenger,
-                msg->get_source(), conn.peer_addr, *msg);
+          logger().debug("{} <== #{} === {} ({})",
+                         conn, msg->get_seq(), *msg, msg->get_type());
           return dispatcher.ms_dispatch(&conn, std::move(msg))
             .handle_exception([this] (std::exception_ptr eptr) {
               logger().error("{} ms_dispatch caught exception: {}", conn, eptr);
index e7b529ce49a7f6d2838ee59cb2a0292da0443b97..bf71adb755c8f97db4a90d7f9df4ba8fab2f54e8 100644 (file)
@@ -1480,9 +1480,8 @@ ceph::bufferlist ProtocolV2::do_sweep_messages(
 
     auto message = MessageFrame::Encode(header2,
         msg->get_payload(), msg->get_middle(), msg->get_data());
-    logger().debug("{} --> [{} {}] #{} === {} ({}) // {}",
-                  messenger, conn.get_peer_name(), conn.get_peer_addr(),
-                  msg->get_seq(), *msg, msg->get_type(), conn);
+    logger().debug("{} --> #{} === {} ({})",
+                  conn, msg->get_seq(), *msg, msg->get_type());
     bl.append(message.get_buffer(session_stream_handlers));
   });
 
@@ -1569,9 +1568,8 @@ seastar::future<> ProtocolV2::read_message(utime_t throttle_stamp)
 
     // note last received message.
     conn.in_seq = message->get_seq();
-    logger().debug("{} <== [{} {}] #{} === {} ({}) // {}",
-                  messenger, message->get_source(), conn.get_peer_addr(),
-                  message->get_seq(), *message, message->get_type(), conn);
+    logger().debug("{} <== #{} === {} ({})",
+                  conn, message->get_seq(), *message, message->get_type());
     if (!conn.policy.lossy) {
       // ++ack_left;
     }