dev,dev-arm: Add units to stats in /src/dev
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 20 Jan 2021 09:55:39 +0000 (01:55 -0800)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 10 Feb 2021 09:03:09 +0000 (09:03 +0000)
Change-Id: I9d2449ef173f2f467717a9d233aef8d9a2f43f26
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39415
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

src/dev/arm/flash_device.cc
src/dev/arm/hdlcd.cc
src/dev/arm/smmu_v3.cc
src/dev/arm/smmu_v3_caches.cc
src/dev/arm/ufs_device.cc
src/dev/net/etherdevice.cc
src/dev/net/sinic.cc
src/dev/pci/copy_engine.cc
src/dev/storage/ide_disk.cc

index 533b3ed955cb14c23ad714abda1a66a3549587c3..a45ade0e035b604dcbbdddc37785f31623af4c2d 100644 (file)
@@ -458,12 +458,14 @@ FlashDevice::getUnknownPages(uint32_t index)
 FlashDevice::
 FlashDeviceStats::FlashDeviceStats(Stats::Group *parent)
     : Stats::Group(parent, "FlashDevice"),
-    ADD_STAT(totalGCActivations, "Number of Garbage collector activations"),
-    ADD_STAT(writeAccess, "Histogram of write addresses"),
-    ADD_STAT(readAccess, "Histogram of read addresses"),
-    ADD_STAT(fileSystemAccess, "Histogram of file system accesses"),
-    ADD_STAT(writeLatency, "Histogram of write latency"),
-    ADD_STAT(readLatency, "Histogram of read latency")
+    ADD_STAT(totalGCActivations, UNIT_COUNT,
+             "Number of Garbage collector activations"),
+    ADD_STAT(writeAccess, UNIT_COUNT, "Histogram of write addresses"),
+    ADD_STAT(readAccess, UNIT_COUNT, "Histogram of read addresses"),
+    ADD_STAT(fileSystemAccess, UNIT_COUNT,
+             "Histogram of file system accesses"),
+    ADD_STAT(writeLatency, UNIT_TICK, "Histogram of write latency"),
+    ADD_STAT(readLatency, UNIT_TICK, "Histogram of read latency")
 {
     using namespace Stats;
 
index c6ff6db29aa05889ceeab59594268af1842267d0..85230be7a370f78cde8f845985c42cd0cef92098 100644 (file)
@@ -81,7 +81,7 @@ HDLcd::HDLcd(const HDLcdParams &p)
 HDLcd::
 HDLcdStats::HDLcdStats(Stats::Group *parent)
     : Stats::Group(parent, "HDLcd"),
-      ADD_STAT(underruns, "Number of buffer underruns")
+      ADD_STAT(underruns, UNIT_COUNT, "Number of buffer underruns")
 {
     using namespace Stats;
 
index 3076f5e590aa6ed50b7817725222f6da4a98825c..95712ed67296959ba81c92aab82da8fb94a0ab76 100644 (file)
@@ -746,12 +746,12 @@ SMMUv3::init()
 
 SMMUv3::SMMUv3Stats::SMMUv3Stats(Stats::Group *parent)
     : Stats::Group(parent),
-      ADD_STAT(steL1Fetches, "STE L1 fetches"),
-      ADD_STAT(steFetches, "STE fetches"),
-      ADD_STAT(cdL1Fetches, "CD L1 fetches"),
-      ADD_STAT(cdFetches, "CD fetches"),
-      ADD_STAT(translationTimeDist, "Time to translate address"),
-      ADD_STAT(ptwTimeDist, "Time to walk page tables")
+      ADD_STAT(steL1Fetches, UNIT_COUNT, "STE L1 fetches"),
+      ADD_STAT(steFetches, UNIT_COUNT, "STE fetches"),
+      ADD_STAT(cdL1Fetches, UNIT_COUNT, "CD L1 fetches"),
+      ADD_STAT(cdFetches, UNIT_COUNT, "CD fetches"),
+      ADD_STAT(translationTimeDist, UNIT_TICK, "Time to translate address"),
+      ADD_STAT(ptwTimeDist, UNIT_TICK, "Time to walk page tables")
 {
     using namespace Stats;
 
index b8f284d82288069fd0e1d180e80040cc9e58070f..8bea3eacbae76cac3e49341d4a2b1cbd6664eb4e 100644 (file)
@@ -84,14 +84,21 @@ SMMUv3BaseCache::decodePolicyName(const std::string &policy_name)
 SMMUv3BaseCache::
 SMMUv3BaseCacheStats::SMMUv3BaseCacheStats(Stats::Group *parent)
     : Stats::Group(parent),
-      ADD_STAT(averageLookups, "Average number lookups per second"),
-      ADD_STAT(totalLookups, "Total number of lookups"),
-      ADD_STAT(averageMisses, "Average number misses per second"),
-      ADD_STAT(totalMisses, "Total number of misses"),
-      ADD_STAT(averageUpdates, "Average number updates per second"),
-      ADD_STAT(totalUpdates, "Total number of updates"),
-      ADD_STAT(averageHitRate, "Average hit rate"),
-      ADD_STAT(insertions, "Number of insertions (not replacements)")
+      ADD_STAT(averageLookups,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Second),
+               "Average number lookups per second"),
+      ADD_STAT(totalLookups, UNIT_COUNT, "Total number of lookups"),
+      ADD_STAT(averageMisses,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Second),
+               "Average number misses per second"),
+      ADD_STAT(totalMisses, UNIT_COUNT, "Total number of misses"),
+      ADD_STAT(averageUpdates,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Second),
+               "Average number updates per second"),
+      ADD_STAT(totalUpdates, UNIT_COUNT, "Total number of updates"),
+      ADD_STAT(averageHitRate, UNIT_RATIO, "Average hit rate"),
+      ADD_STAT(insertions, UNIT_COUNT,
+               "Number of insertions (not replacements)")
 {
     using namespace Stats;
 
index e04cb39faa9164c099ee614f555976775e008b1a..f7b6d82e73b746261f5800210962fe2a163d78ff 100644 (file)
@@ -756,35 +756,56 @@ UFSHostDevice::UFSHostDevice(const UFSHostDeviceParams &p) :
 UFSHostDevice::
 UFSHostDeviceStats::UFSHostDeviceStats(UFSHostDevice *parent)
     : Stats::Group(parent, "UFSDiskHost"),
-      ADD_STAT(currentSCSIQueue,
+      ADD_STAT(currentSCSIQueue, UNIT_COUNT,
                "Most up to date length of the command queue"),
-      ADD_STAT(currentReadSSDQueue,
+      ADD_STAT(currentReadSSDQueue, UNIT_COUNT,
                "Most up to date length of the read SSD queue"),
-      ADD_STAT(currentWriteSSDQueue,
+      ADD_STAT(currentWriteSSDQueue, UNIT_COUNT,
                "Most up to date length of the write SSD queue"),
       /** Amount of data read/written */
-      ADD_STAT(totalReadSSD, "Number of bytes read from SSD"),
-      ADD_STAT(totalWrittenSSD, "Number of bytes written to SSD"),
-      ADD_STAT(totalReadDiskTransactions,"Number of transactions from disk"),
-      ADD_STAT(totalWriteDiskTransactions, "Number of transactions to disk"),
-      ADD_STAT(totalReadUFSTransactions, "Number of transactions from device"),
-      ADD_STAT(totalWriteUFSTransactions, "Number of transactions to device"),
+      ADD_STAT(totalReadSSD, UNIT_BYTE,
+               "Number of bytes read from SSD"),
+      ADD_STAT(totalWrittenSSD, UNIT_BYTE,
+               "Number of bytes written to SSD"),
+      ADD_STAT(totalReadDiskTransactions, UNIT_COUNT,
+               "Number of transactions from disk"),
+      ADD_STAT(totalWriteDiskTransactions, UNIT_COUNT,
+               "Number of transactions to disk"),
+      ADD_STAT(totalReadUFSTransactions, UNIT_COUNT,
+               "Number of transactions from device"),
+      ADD_STAT(totalWriteUFSTransactions, UNIT_COUNT,
+               "Number of transactions to device"),
       /** Average bandwidth for reads and writes */
-      ADD_STAT(averageReadSSDBW, "Average read bandwidth (bytes/s)",
+      ADD_STAT(averageReadSSDBW,
+               UNIT_RATE(Stats::Units::Byte, Stats::Units::Second),
+               "Average read bandwidth (bytes/s)",
                totalReadSSD / simSeconds),
-      ADD_STAT(averageWriteSSDBW, "Average write bandwidth (bytes/s)",
+      ADD_STAT(averageWriteSSDBW,
+               UNIT_RATE(Stats::Units::Byte, Stats::Units::Second),
+               "Average write bandwidth (bytes/s)",
                totalWrittenSSD / simSeconds),
-      ADD_STAT(averageSCSIQueue, "Average command queue length"),
-      ADD_STAT(averageReadSSDQueue, "Average read queue length"),
-      ADD_STAT(averageWriteSSDQueue, "Average write queue length"),
+      ADD_STAT(averageSCSIQueue,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Tick),
+               "Average command queue length"),
+      ADD_STAT(averageReadSSDQueue,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Tick),
+               "Average read queue length"),
+      ADD_STAT(averageWriteSSDQueue,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Tick),
+               "Average write queue length"),
       /** Number of doorbells rung*/
-      ADD_STAT(curDoorbell, "Most up to date number of doorbells used",
+      ADD_STAT(curDoorbell, UNIT_COUNT,
+               "Most up to date number of doorbells used",
                parent->activeDoorbells),
-      ADD_STAT(maxDoorbell, "Maximum number of doorbells utilized"),
-      ADD_STAT(averageDoorbell, "Average number of Doorbells used"),
+      ADD_STAT(maxDoorbell, UNIT_COUNT,
+               "Maximum number of doorbells utilized"),
+      ADD_STAT(averageDoorbell,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Tick),
+               "Average number of Doorbells used"),
       /** Latency*/
-      ADD_STAT(transactionLatency, "Histogram of transaction times"),
-      ADD_STAT(idleTimes, "Histogram of idle times")
+      ADD_STAT(transactionLatency, UNIT_TICK,
+               "Histogram of transaction times"),
+      ADD_STAT(idleTimes, UNIT_TICK, "Histogram of idle times")
 {
     using namespace Stats;
 
index e279a9cba9b43f134e137796164334e6f2c25d7f..7c817f4fa55df53c2155bf86028778f0c8861b3d 100644 (file)
 
 EtherDevice::EtherDeviceStats::EtherDeviceStats(Stats::Group *parent)
     : Stats::Group(parent, "EtherDevice"),
-      ADD_STAT(postedInterrupts, "Number of posts to CPU"),
-      ADD_STAT(txBytes, "Bytes Transmitted"),
-      ADD_STAT(rxBytes, "Bytes Received"),
-      ADD_STAT(txPackets, "Number of Packets Transmitted"),
-      ADD_STAT(rxPackets, "Number of Packets Received"),
-      ADD_STAT(txBandwidth, "Transmit Bandwidth (bits/s)",
+      ADD_STAT(postedInterrupts, UNIT_COUNT, "Number of posts to CPU"),
+      ADD_STAT(txBytes, UNIT_BYTE, "Bytes Transmitted"),
+      ADD_STAT(rxBytes, UNIT_BYTE, "Bytes Received"),
+      ADD_STAT(txPackets, UNIT_COUNT, "Number of Packets Transmitted"),
+      ADD_STAT(rxPackets, UNIT_COUNT, "Number of Packets Received"),
+      ADD_STAT(txBandwidth, UNIT_RATE(Stats::Units::Bit, Stats::Units::Second),
+               "Transmit Bandwidth (bits/s)",
                txBytes * Stats::constant(8) / simSeconds),
-      ADD_STAT(rxBandwidth, "Receive Bandwidth (bits/s)",
+      ADD_STAT(rxBandwidth, UNIT_RATE(Stats::Units::Bit, Stats::Units::Second),
+               "Receive Bandwidth (bits/s)",
                rxBytes * Stats::constant(8) / simSeconds),
-      ADD_STAT(txIpChecksums, "Number of tx IP Checksums done by device"),
-      ADD_STAT(rxIpChecksums, "Number of rx IP Checksums done by device"),
-      ADD_STAT(txTcpChecksums, "Number of tx TCP Checksums done by device"),
-      ADD_STAT(rxTcpChecksums, "Number of rx TCP Checksums done by device"),
-      ADD_STAT(txUdpChecksums, "Number of tx UDP Checksums done by device"),
-      ADD_STAT(rxUdpChecksums, "Number of rx UDP Checksums done by device"),
-      ADD_STAT(descDmaReads, "Number of descriptors the device read w/ DMA"),
-      ADD_STAT(descDmaWrites, "Number of descriptors the device wrote w/ DMA"),
-      ADD_STAT(descDmaRdBytes, "Number of descriptor bytes read w/ DMA"),
-      ADD_STAT(descDmaWrBytes, "Number of descriptor bytes write w/ DMA"),
-      ADD_STAT(totBandwidth, "Total Bandwidth (bits/s)",
+      ADD_STAT(txIpChecksums, UNIT_COUNT,
+               "Number of tx IP Checksums done by device"),
+      ADD_STAT(rxIpChecksums, UNIT_COUNT,
+               "Number of rx IP Checksums done by device"),
+      ADD_STAT(txTcpChecksums, UNIT_COUNT,
+               "Number of tx TCP Checksums done by device"),
+      ADD_STAT(rxTcpChecksums, UNIT_COUNT,
+               "Number of rx TCP Checksums done by device"),
+      ADD_STAT(txUdpChecksums, UNIT_COUNT,
+               "Number of tx UDP Checksums done by device"),
+      ADD_STAT(rxUdpChecksums, UNIT_COUNT,
+               "Number of rx UDP Checksums done by device"),
+      ADD_STAT(descDmaReads, UNIT_COUNT,
+               "Number of descriptors the device read w/ DMA"),
+      ADD_STAT(descDmaWrites, UNIT_COUNT,
+               "Number of descriptors the device wrote w/ DMA"),
+      ADD_STAT(descDmaRdBytes, UNIT_COUNT,
+               "Number of descriptor bytes read w/ DMA"),
+      ADD_STAT(descDmaWrBytes, UNIT_COUNT,
+               "Number of descriptor bytes write w/ DMA"),
+      ADD_STAT(totBandwidth,
+               UNIT_RATE(Stats::Units::Bit, Stats::Units::Second),
+               "Total Bandwidth (bits/s)",
                txBandwidth + rxBandwidth),
-      ADD_STAT(totPackets, "Total Packets", txPackets + rxPackets),
-      ADD_STAT(totBytes, "Total Bytes", txBytes + rxBytes),
-      ADD_STAT(totPacketRate, "Total Tranmission Rate (packets/s)",
+      ADD_STAT(totPackets, UNIT_COUNT, "Total Packets", txPackets + rxPackets),
+      ADD_STAT(totBytes, UNIT_BYTE, "Total Bytes", txBytes + rxBytes),
+      ADD_STAT(totPacketRate,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Second),
+               "Total Packet Tranmission Rate",
                totPackets / simSeconds),
-      ADD_STAT(txPacketRate, "Packet Tranmission Rate (packets/s)",
+      ADD_STAT(txPacketRate,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Second),
+               "Packet Tranmission Rate",
                txPackets / simSeconds),
-      ADD_STAT(rxPacketRate, "Packet Reception Rate (packets/s)",
+      ADD_STAT(rxPacketRate,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Second),
+               "Packet Reception Rate",
                rxPackets / simSeconds),
-      ADD_STAT(postedSwi, "Number of software interrupts posted to CPU"),
-      ADD_STAT(totalSwi, "Total number of Swi written to ISR"),
+      ADD_STAT(postedSwi, UNIT_COUNT,
+               "Number of software interrupts posted to CPU"),
+      ADD_STAT(totalSwi, UNIT_COUNT, "Total number of Swi written to ISR"),
       ADD_STAT(coalescedSwi,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of Swi's coalesced into each post",
                totalSwi / postedInterrupts),
-      ADD_STAT(postedRxIdle,"Number of rxIdle interrupts posted to CPU"),
-      ADD_STAT(totalRxIdle, "Total number of RxIdle written to ISR"),
+      ADD_STAT(postedRxIdle, UNIT_COUNT,
+               "Number of rxIdle interrupts posted to CPU"),
+      ADD_STAT(totalRxIdle, UNIT_COUNT,
+               "Total number of RxIdle written to ISR"),
       ADD_STAT(coalescedRxIdle,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of RxIdle's coalesced into each post",
                totalRxIdle / postedInterrupts),
-      ADD_STAT(postedRxOk, "Number of RxOk interrupts posted to CPU"),
-      ADD_STAT(totalRxOk, "Total number of RxOk written to ISR"),
+      ADD_STAT(postedRxOk, UNIT_COUNT,
+               "Number of RxOk interrupts posted to CPU"),
+      ADD_STAT(totalRxOk, UNIT_COUNT, "Total number of RxOk written to ISR"),
       ADD_STAT(coalescedRxOk,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of RxOk's coalesced into each post",
                totalRxOk / postedInterrupts),
-      ADD_STAT(postedRxDesc, "Number of RxDesc interrupts posted to CPU"),
-      ADD_STAT(totalRxDesc, "Total number of RxDesc written to ISR"),
+      ADD_STAT(postedRxDesc, UNIT_COUNT,
+               "Number of RxDesc interrupts posted to CPU"),
+      ADD_STAT(totalRxDesc, UNIT_COUNT,
+               "Total number of RxDesc written to ISR"),
       ADD_STAT(coalescedRxDesc,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of RxDesc's coalesced into each post",
                totalRxDesc / postedInterrupts),
-      ADD_STAT(postedTxOk, "Number of TxOk interrupts posted to CPU"),
-      ADD_STAT(totalTxOk, "Total number of TxOk written to ISR"),
+      ADD_STAT(postedTxOk, UNIT_COUNT,
+               "Number of TxOk interrupts posted to CPU"),
+      ADD_STAT(totalTxOk, UNIT_COUNT,
+               "Total number of TxOk written to ISR"),
       ADD_STAT(coalescedTxOk,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of TxOk's coalesced into each post",
                totalTxOk / postedInterrupts),
-      ADD_STAT(postedTxIdle, "Number of TxIdle interrupts posted to CPU"),
-      ADD_STAT(totalTxIdle, "Total number of TxIdle written to ISR"),
+      ADD_STAT(postedTxIdle, UNIT_COUNT,
+               "Number of TxIdle interrupts posted to CPU"),
+      ADD_STAT(totalTxIdle, UNIT_COUNT,
+               "Total number of TxIdle written to ISR"),
       ADD_STAT(coalescedTxIdle,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of TxIdle's coalesced into each post",
                totalTxIdle / postedInterrupts),
-      ADD_STAT(postedTxDesc, "Number of TxDesc interrupts posted to CPU"),
-      ADD_STAT(totalTxDesc, "Total number of TxDesc written to ISR"),
+      ADD_STAT(postedTxDesc, UNIT_COUNT,
+               "Number of TxDesc interrupts posted to CPU"),
+      ADD_STAT(totalTxDesc, UNIT_COUNT,
+               "Total number of TxDesc written to ISR"),
       ADD_STAT(coalescedTxDesc,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of TxDesc's coalesced into each post",
                totalTxDesc / postedInterrupts),
-      ADD_STAT(postedRxOrn, "Number of RxOrn posted to CPU"),
-      ADD_STAT(totalRxOrn, "Total number of RxOrn written to ISR"),
+      ADD_STAT(postedRxOrn, UNIT_COUNT,
+               "Number of RxOrn posted to CPU"),
+      ADD_STAT(totalRxOrn, UNIT_COUNT,
+               "Total number of RxOrn written to ISR"),
       ADD_STAT(coalescedRxOrn,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of RxOrn's coalesced into each post",
                totalRxOrn / postedInterrupts),
       ADD_STAT(coalescedTotal,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
                "Average number of interrupts coalesced into each post"),
-      ADD_STAT(droppedPackets, "Number of packets dropped")
+      ADD_STAT(droppedPackets, UNIT_COUNT, "Number of packets dropped")
 {
 
     postedInterrupts
index f270487c480869ee33d9cc27fe3a1a983edb919e..0607d26864b6446a6952c57d2770dd187e3d7f9d 100644 (file)
@@ -98,11 +98,14 @@ Device::~Device()
 
 Device::DeviceStats::DeviceStats(Stats::Group *parent)
     : Stats::Group(parent, "SinicDevice"),
-      ADD_STAT(totalVnicDistance, "Total vnic distance"),
-      ADD_STAT(numVnicDistance, "Number of vnic distance measurements"),
-      ADD_STAT(maxVnicDistance, "Maximum vnic distance"),
-      ADD_STAT(avgVnicDistance, "Average vnic distance",
-               totalVnicDistance / numVnicDistance),
+      ADD_STAT(totalVnicDistance, UNIT_COUNT,
+               "Total vnic distance"),
+      ADD_STAT(numVnicDistance, UNIT_COUNT,
+               "Number of vnic distance measurements"),
+      ADD_STAT(maxVnicDistance, UNIT_COUNT, "Maximum vnic distance"),
+      ADD_STAT(avgVnicDistance,
+               UNIT_RATE(Stats::Units::Count, Stats::Units::Count),
+               "Average vnic distance", totalVnicDistance / numVnicDistance),
       _maxVnicDistance(0)
 {
 }
index 02d3d8670cdd94594987d3f7c40b275181d34563..48326cf2c2b66ed15e3e257096eb44452da2060a 100644 (file)
@@ -430,8 +430,10 @@ CopyEngine::
 CopyEngineStats::CopyEngineStats(Stats::Group *parent,
                                  const uint8_t &channel_count)
     : Stats::Group(parent, "CopyEngine"),
-      ADD_STAT(bytesCopied, "Number of bytes copied by each engine"),
-      ADD_STAT(copiesProcessed, "Number of copies processed by each engine")
+      ADD_STAT(bytesCopied, UNIT_BYTE,
+               "Number of bytes copied by each engine"),
+      ADD_STAT(copiesProcessed, UNIT_COUNT,
+               "Number of copies processed by each engine")
 {
     bytesCopied
         .init(channel_count)
index 808c70586386e7c64c548c0b964892762bcce637..63742b48e87e90f96c83383a9ff6dda4a5147430 100644 (file)
@@ -390,14 +390,17 @@ IdeDisk::doDmaDataRead()
 IdeDisk::
 IdeDiskStats::IdeDiskStats(Stats::Group *parent)
     : Stats::Group(parent, "IdeDisk"),
-      ADD_STAT(dmaReadFullPages,
+      ADD_STAT(dmaReadFullPages, UNIT_COUNT,
                "Number of full page size DMA reads (not PRD)."),
-      ADD_STAT(dmaReadBytes,
+      ADD_STAT(dmaReadBytes, UNIT_BYTE,
                "Number of bytes transfered via DMA reads (not PRD)."),
-      ADD_STAT(dmaReadTxs, "Number of DMA read transactions (not PRD)."),
-      ADD_STAT(dmaWriteFullPages, "Number of full page size DMA writes."),
-      ADD_STAT(dmaWriteBytes, "Number of bytes transfered via DMA writes."),
-      ADD_STAT(dmaWriteTxs, "Number of DMA write transactions.")
+      ADD_STAT(dmaReadTxs, UNIT_COUNT,
+               "Number of DMA read transactions (not PRD)."),
+      ADD_STAT(dmaWriteFullPages, UNIT_COUNT,
+               "Number of full page size DMA writes."),
+      ADD_STAT(dmaWriteBytes, UNIT_BYTE,
+               "Number of bytes transfered via DMA writes."),
+      ADD_STAT(dmaWriteTxs, UNIT_COUNT, "Number of DMA write transactions.")
 {
 }