From 4d88978913c57e0cd10751d31d7f5b95c1e00170 Mon Sep 17 00:00:00 2001 From: Curtis Dunham Date: Tue, 23 Dec 2014 09:31:18 -0500 Subject: arm: Add stats to table walker This patch adds table walker stats for: - Walk events - Instruction vs Data - Page size histogram - Wait time and service time histograms - Pending requests histogram (per cycle) - measures dist. of L (p(1..) = how often busy, p(0) = how often idle) - Squashes, before starting and after completion --- src/dev/dma_device.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/dev/dma_device.cc') diff --git a/src/dev/dma_device.cc b/src/dev/dma_device.cc index 5033c3617..d53ea2546 100644 --- a/src/dev/dma_device.cc +++ b/src/dev/dma_device.cc @@ -152,7 +152,7 @@ DmaPort::recvRetry() trySendTimingReq(); } -void +RequestPtr DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag) { @@ -161,11 +161,17 @@ DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, // i.e. cache line size DmaReqState *reqState = new DmaReqState(event, size, delay); + // (functionality added for Table Walker statistics) + // We're only interested in this when there will only be one request. + // For simplicity, we return the last request, which would also be + // the only request in that case. + RequestPtr req = NULL; + DPRINTF(DMA, "Starting DMA for addr: %#x size: %d sched: %d\n", addr, size, event ? event->scheduled() : -1); for (ChunkGenerator gen(addr, size, sys->cacheLineSize()); !gen.done(); gen.next()) { - Request *req = new Request(gen.addr(), gen.size(), flag, masterId); + req = new Request(gen.addr(), gen.size(), flag, masterId); req->taskId(ContextSwitchTaskId::DMA); PacketPtr pkt = new Packet(req, cmd); @@ -184,6 +190,8 @@ DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, // just created, for atomic this involves actually completing all // the requests sendDma(); + + return req; } void -- cgit v1.2.3