VirtualBox

Changeset 6652 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jan 31, 2008 11:49:09 AM (17 years ago)
Author:
vboxsync
Message:

prelimiary network statistics (to be improved)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r6548 r6652  
    239239    bool                                afAlignment[1];
    240240    uint32_t                            u32LinkSpeed;
     241
     242    STAMCOUNTER                         StatReceiveBytes;
     243    STAMCOUNTER                         StatTransmitBytes;
    241244
    242245#ifdef VBOX_WITH_STATISTICS
     
    17431746                rmd.rmd1.bam  = !CSR_PROM(pData) && is_bcast;
    17441747                rmd.rmd2.mcnt = pkt_size;
     1748
     1749                STAM_REL_COUNTER_ADD(&pData->StatReceiveBytes, pkt_size);
    17451750            }
    17461751            else
     
    17521757                rmd.rmd1.err  = 1;
    17531758            }
     1759
    17541760            /* write back, clear the own bit */
    17551761            pcnetRmdStorePassHost(pData, &rmd, PHYSADDR(pData, crda));
     
    18791885        pData->Led.Asserted.s.fWriting = pData->Led.Actual.s.fWriting = 1;
    18801886    pData->pDrv->pfnSend(pData->pDrv, pData->SendFrame.pvBuf, pData->SendFrame.cb);
     1887    STAM_REL_COUNTER_ADD(&pData->StatTransmitBytes, pData->SendFrame.cb);
    18811888    pData->Led.Actual.s.fWriting = 0;
    18821889    STAM_PROFILE_ADV_STOP(&pData->StatTransmitSend, a);
     
    44914498    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTimer,              STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet Timer",              "/Devices/PCNet%d/Timer", iInstance);
    44924499    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatReceive,            STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet receive",            "/Devices/PCNet%d/Receive", iInstance);
     4500#endif
     4501    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",            "/Devices/PCNet%d/ReceiveBytes", iInstance);
     4502#ifdef VBOX_WITH_STATISTICS
    44934503    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTransmit,           STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet transmit in HC",     "/Devices/PCNet%d/Transmit/Total", iInstance);
    4494     PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTransmitSend,       STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet send transmit in HC",     "/Devices/PCNet%d/Transmit/Send", iInstance);
     4504#endif
     4505    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTransmitBytes,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data transmitted",         "/Devices/PCNet%d/TransmitBytes", iInstance);
     4506#ifdef VBOX_WITH_STATISTICS
     4507    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTransmitSend,       STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet send transmit in HC","/Devices/PCNet%d/Transmit/Send", iInstance);
    44954508    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTdtePollGC,         STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet TdtePoll in GC",     "/Devices/PCNet%d/TdtePollGC", iInstance);
    44964509    PDMDevHlpSTAMRegisterF(pDevIns, &pData->StatTdtePollHC,         STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling PCNet TdtePoll in HC",     "/Devices/PCNet%d/TdtePollHC", iInstance);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette