mem-cache: Added stats filtering both useful and spanPage prefetch.

Change-Id: I2570ee47f064ac999f2dcc813c9e39174a2ad8af
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54163
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Jiasen Huang
2021-12-14 20:42:15 +08:00
committed by Huang Jiasen
parent 110e22439f
commit 735f768cc8
2 changed files with 8 additions and 1 deletions

View File

@@ -210,6 +210,10 @@ Queued::notify(const PacketPtr &pkt, const PrefetchInfo &pfi)
if (!samePage(addr_prio.first, pfi.getAddr())) {
statsQueued.pfSpanPage += 1;
if (hasBeenPrefetched(pkt->getAddr(), pkt->isSecure())) {
statsQueued.pfUsefulSpanPage += 1;
}
}
bool can_cross_page = (tlb != nullptr);
@@ -272,7 +276,9 @@ Queued::QueuedStats::QueuedStats(statistics::Group *parent)
ADD_STAT(pfRemovedFull, statistics::units::Count::get(),
"number of prefetches dropped due to prefetch queue size"),
ADD_STAT(pfSpanPage, statistics::units::Count::get(),
"number of prefetches that crossed the page")
"number of prefetches that crossed the page"),
ADD_STAT(pfUsefulSpanPage, statistics::units::Count::get(),
"number of prefetches that is useful and crossed the page")
{
}

View File

@@ -185,6 +185,7 @@ class Queued : public Base
statistics::Scalar pfRemovedDemand;
statistics::Scalar pfRemovedFull;
statistics::Scalar pfSpanPage;
statistics::Scalar pfUsefulSpanPage;
} statsQueued;
public:
using AddrPriority = std::pair<Addr, int32_t>;