cpu: warn if TrafficGen is suppressing a large numer of packets
authorAndreas Hansson <andreas.hansson@arm.com>
Sun, 20 Mar 2016 10:38:34 +0000 (06:38 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Sun, 20 Mar 2016 10:38:34 +0000 (06:38 -0400)
Add a basic warning for every 10000 packet that is suppressed to alert
the user.

src/cpu/testers/traffic_gen/traffic_gen.cc
src/cpu/testers/traffic_gen/traffic_gen.hh

index f8eb38d315e6c882a3b68286907e949ba79566d8..a405351edabbb9124b85872a9ed3997b4e4c5cef 100644 (file)
@@ -63,7 +63,8 @@ TrafficGen::TrafficGen(const TrafficGenParams* p)
       port(name() + ".port", *this),
       retryPkt(NULL),
       retryPktTick(0),
-      updateEvent(this)
+      updateEvent(this),
+      numSuppressed(0)
 {
 }
 
@@ -198,6 +199,12 @@ TrafficGen::update()
         } else {
             DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
                     pkt->cmdString(), pkt->getAddr());
+
+            ++numSuppressed;
+            if (numSuppressed % 10000)
+                warn("%s suppressed %d packets with non-memory addresses\n",
+                     name(), numSuppressed);
+
             delete pkt->req;
             delete pkt;
             pkt = nullptr;
index d57b613f345ca72d6c7c3d3e396bf70c5f07b490..914b4ac09fabeb0aaed4cc07de880ad01d638902 100644 (file)
@@ -177,6 +177,8 @@ class TrafficGen : public MemObject
     /** Event for scheduling updates */
     EventWrapper<TrafficGen, &TrafficGen::update> updateEvent;
 
+    uint64_t numSuppressed;
+
     /** Count the number of generated packets. */
     Stats::Scalar numPackets;