trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masa...@apache.org
Subject [trafficserver] branch quic-latest updated: Format debug logs of sending/receiving packets/frames
Date Mon, 19 Mar 2018 02:37:22 GMT
This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new 3e379b1  Format debug logs of sending/receiving packets/frames
3e379b1 is described below

commit 3e379b176101a87bbfb257cab47f837010937ebb
Author: Masaori Koshiba <masaori@apache.org>
AuthorDate: Mon Mar 19 11:37:08 2018 +0900

    Format debug logs of sending/receiving packets/frames
---
 iocore/net/QUICNetVConnection.cc       | 11 +++++++----
 iocore/net/quic/QUICFrameDispatcher.cc |  4 ++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 42d2197..5d6e6ae 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -48,6 +48,9 @@
 #define QUICConDebug(fmt, ...) \
   Debug("quic_net", "[%" PRIx64 "] " fmt, static_cast<uint64_t>(this->_quic_connection_id),
##__VA_ARGS__)
 
+#define QUICConVDebug(fmt, ...) \
+  Debug("v_quic_net", "[%" PRIx64 "] " fmt, static_cast<uint64_t>(this->_quic_connection_id),
##__VA_ARGS__)
+
 #define QUICError(fmt, ...)                                                             
                   \
   Debug("quic_net", "[%" PRIx64 "] " fmt, static_cast<uint64_t>(this->_quic_connection_id),
##__VA_ARGS__); \
   Error("quic_net [%" PRIx64 "] " fmt, static_cast<uint64_t>(this->_quic_connection_id),
##__VA_ARGS__)
@@ -339,7 +342,7 @@ QUICNetVConnection::_transmit_packet(QUICPacketUPtr packet)
   SCOPED_MUTEX_LOCK(packet_transmitter_lock, this->_packet_transmitter_mutex, this_ethread());
 
   if (packet) {
-    QUICConDebug("Packet Number=%" PRIu64 " Type=%s Size=%hu", packet->packet_number(),
QUICDebugNames::packet_type(packet->type()),
+    QUICConDebug("Enqueue %s pkt_num=%" PRIu64 " size=%hu", QUICDebugNames::packet_type(packet->type()),
packet->packet_number(),
                  packet->size());
     // TODO Remove const_cast
     this->_packet_send_queue.enqueue(const_cast<QUICPacket *>(packet.release()));
@@ -402,7 +405,7 @@ QUICNetVConnection::_transmit_frame(QUICFrameUPtr frame)
   SCOPED_MUTEX_LOCK(frame_transmitter_lock, this->_frame_transmitter_mutex, this_ethread());
 
   if (frame) {
-    QUICConDebug("Frame Type=%s Size=%zu", QUICDebugNames::frame_type(frame->type()),
frame->size());
+    QUICConVDebug("type=%s size=%zu", QUICDebugNames::frame_type(frame->type()), frame->size());
     if (frame->type() == QUICFrameType::STREAM) {
       QUICStreamFrame &stream_frame = static_cast<QUICStreamFrame &>(*frame);
       // XXX: Stream 0 is exempt from the connection-level flow control window.
@@ -1005,7 +1008,7 @@ QUICNetVConnection::_store_frame(ats_unique_buf &buf, size_t &len,
bool &retrans
   }
 
   size_t l = 0;
-  QUICConDebug("type=%s", QUICDebugNames::frame_type(frame->type()));
+  QUICConDebug("type=%s size=%zu", QUICDebugNames::frame_type(frame->type()), frame->size());
   frame->store(buf.get() + len, &l);
   len += l;
 
@@ -1265,7 +1268,7 @@ QUICNetVConnection::_dequeue_recv_packet(QUICPacketCreationResult &result)
     QUICConDebug("Unsupported version");
     break;
   case QUICPacketCreationResult::SUCCESS:
-    QUICConDebug("type=%s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
+    QUICConDebug("Dequeue %s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
                  quic_packet->packet_number(), quic_packet->size());
     break;
   default:
diff --git a/iocore/net/quic/QUICFrameDispatcher.cc b/iocore/net/quic/QUICFrameDispatcher.cc
index b4582b9..5b8b7a1 100644
--- a/iocore/net/quic/QUICFrameDispatcher.cc
+++ b/iocore/net/quic/QUICFrameDispatcher.cc
@@ -24,7 +24,7 @@
 #include "QUICFrameDispatcher.h"
 #include "QUICDebugNames.h"
 
-static constexpr char tag[] = "quic_frame_handler";
+static constexpr char tag[] = "quic_net";
 
 //
 // Frame Dispatcher
@@ -58,7 +58,7 @@ QUICFrameDispatcher::receive_frames(const uint8_t *payload, uint16_t size,
bool
 
     // TODO: check debug build
     if (type != QUICFrameType::PADDING) {
-      Debug(tag, "Received %s frame, size %zu", QUICDebugNames::frame_type(frame->type()),
frame->size());
+      Debug(tag, "type=%s, size=%zu", QUICDebugNames::frame_type(frame->type()), frame->size());
     }
 
     should_send_ack |= (type != QUICFrameType::PADDING && type != QUICFrameType::ACK);

-- 
To stop receiving notification emails like this one, please contact
masaori@apache.org.

Mime
View raw message