Enable enqueue/dequeue tracing for point-to-point links
authorTom Henderson <tomh@tomh.org>
Fri, 14 Sep 2007 14:42:31 -0700
changeset 1508 081930e88b34
parent 1507 11a370eecc52
child 1509 30b8037ff1ea
Enable enqueue/dequeue tracing for point-to-point links
examples/csma-multicast.cc
examples/simple-point-to-point.cc
src/devices/point-to-point/point-to-point-net-device.cc
--- a/examples/csma-multicast.cc	Fri Sep 14 09:57:53 2007 -0700
+++ b/examples/csma-multicast.cc	Fri Sep 14 14:42:31 2007 -0700
@@ -63,6 +63,9 @@
 // Users may find it convenient to turn on explicit debugging
 // for selected modules; the below lines suggest how to do this
 //
+
+NS_LOG_ALL("");
+
 #if 0
   LogComponentEnable ("CsmaMulticastExample", LOG_LEVEL_INFO);
 
--- a/examples/simple-point-to-point.cc	Fri Sep 14 09:57:53 2007 -0700
+++ b/examples/simple-point-to-point.cc	Fri Sep 14 14:42:31 2007 -0700
@@ -214,8 +214,8 @@
   // Trace output will be sent to the simple-point-to-point.tr file
   NS_LOG_INFO ("Configure Tracing.");
   AsciiTrace asciitrace ("simple-point-to-point.tr");
+  asciitrace.TraceAllNetDeviceRx ();
   asciitrace.TraceAllQueues ();
-  asciitrace.TraceAllNetDeviceRx ();
 
   // Also configure some tcpdump traces; each interface will be traced
   // The output files will be named 
--- a/src/devices/point-to-point/point-to-point-net-device.cc	Fri Sep 14 09:57:53 2007 -0700
+++ b/src/devices/point-to-point/point-to-point-net-device.cc	Fri Sep 14 14:42:31 2007 -0700
@@ -156,9 +156,12 @@
 //
 //
 // If there's a transmission in progress, we enque the packet for later
-// trnsmission; otherwise we send it now.
+// transmission; otherwise we send it now.
   if (m_txMachineState == READY) 
     {
+// We still enqueue and dequeue it to hit the tracing hooks
+      m_queue->Enqueue (p);
+      m_queue->Dequeue (p);
       return TransmitStart (p);
     }
   else