diff --git a/src/mem/coherent_xbar.hh b/src/mem/coherent_xbar.hh --- a/src/mem/coherent_xbar.hh +++ b/src/mem/coherent_xbar.hh @@ -394,6 +394,7 @@ bool sinkPacket(const PacketPtr pkt) const; Stats::Scalar snoops; + Stats::Scalar snoopTraffic; Stats::Distribution snoopFanout; public: # Node ID 6fc8f1dda721ea430eea2f29fbfe594c37e7c4e5 # Parent e273e86a873d4c9542186f9268883f3249a33621 diff --git a/src/mem/coherent_xbar.cc b/src/mem/coherent_xbar.cc --- a/src/mem/coherent_xbar.cc +++ b/src/mem/coherent_xbar.cc @@ -316,8 +316,10 @@ pktSize[slave_port_id][master_port_id] += pkt_size; transDist[pkt_cmd]++; - if (is_express_snoop) + if (is_express_snoop) { snoops++; + snoopTraffic += pkt_size; + } } if (sink_packet) @@ -414,8 +416,10 @@ pkt->getAddr()); // update stats here as we know the forwarding will succeed + unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; transDist[pkt->cmdToIndex()]++; snoops++; + snoopTraffic += pkt_size; // we should only see express snoops from caches assert(pkt->isExpressSnoop()); @@ -587,6 +591,7 @@ // stats updates transDist[pkt_cmd]++; snoops++; + snoopTraffic += pkt_size; return true; } @@ -738,7 +743,9 @@ pkt->cmdString()); // add the request snoop data + unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; snoops++; + snoopTraffic += pkt_size; // forward to all snoopers std::pair snoop_result; @@ -964,6 +971,11 @@ .desc("Total snoops (count)") ; + snoopTraffic + .name(name() + ".snoopTraffic") + .desc("Total snoop traffic (bytes)") + ; + snoopFanout .init(0, snoopPorts.size(), 1) .name(name() + ".snoop_fanout")