Changeset 43507 in vbox for trunk/src/VBox/Main/src-server/Performance.cpp
- Timestamp:
- Oct 2, 2012 1:22:31 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 81089
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/Performance.cpp
r43456 r43507 59 59 } 60 60 61 int CollectorHAL::getRawHostNetworkLoad(const char * /* name */, uint64_t * /* rx */, uint64_t * /* tx */ , uint64_t */* speed */)61 int CollectorHAL::getRawHostNetworkLoad(const char * /* name */, uint64_t * /* rx */, uint64_t * /* tx */) 62 62 { 63 63 return E_NOTIMPL; … … 656 656 mRx->init(mLength); 657 657 mTx->init(mLength); 658 uint64_t speed; 659 int rc = mHAL->getRawHostNetworkLoad(mInterfaceName.c_str(), &mRxPrev, &mTxPrev, &speed); 658 int rc = mHAL->getRawHostNetworkLoad(mInterfaceName.c_str(), &mRxPrev, &mTxPrev); 660 659 AssertRC(rc); 661 660 } … … 670 669 if (SUCCEEDED(hrc)) 671 670 { 672 LogRel(("Failed to collect network metrics for %s: %Rrc (%d). ", mInterfaceName.c_str(), mRc, mRc));671 LogRel(("Failed to collect network metrics for %s: %Rrc (%d).\n", mInterfaceName.c_str(), mRc, mRc)); 673 672 mRc = VINF_SUCCESS; 674 673 } … … 678 677 void HostNetworkLoadRaw::collect() 679 678 { 680 uint64_t rx, tx , speed;681 682 mRc = mHAL->getRawHostNetworkLoad(mInterfaceName.c_str(), &rx, &tx , &speed);679 uint64_t rx, tx; 680 681 mRc = mHAL->getRawHostNetworkLoad(mInterfaceName.c_str(), &rx, &tx); 683 682 if (RT_SUCCESS(mRc)) 684 683 { … … 686 685 uint64_t txDiff = tx - mTxPrev; 687 686 688 if (RT_UNLIKELY( speed * getPeriod() == 0))689 { 690 Assert( speed * getPeriod());691 LogFlowThisFunc(("Impossible! speed=%llu period=%d.\n", speed, getPeriod()));687 if (RT_UNLIKELY(mSpeed * getPeriod() == 0)) 688 { 689 Assert(mSpeed * getPeriod()); 690 LogFlowThisFunc(("Impossible! speed=%llu period=%d.\n", mSpeed, getPeriod())); 692 691 mRx->put(0); 693 692 mTx->put(0); … … 695 694 else 696 695 { 697 mRx->put((ULONG)(PM_NETWORK_LOAD_MULTIPLIER * rxDiff / ( speed * getPeriod())));698 mTx->put((ULONG)(PM_NETWORK_LOAD_MULTIPLIER * txDiff / ( speed * getPeriod())));696 mRx->put((ULONG)(PM_NETWORK_LOAD_MULTIPLIER * rxDiff / (mSpeed * getPeriod()))); 697 mTx->put((ULONG)(PM_NETWORK_LOAD_MULTIPLIER * txDiff / (mSpeed * getPeriod()))); 699 698 } 700 699
Note:
See TracChangeset
for help on using the changeset viewer.