Changeset 43456 in vbox for trunk/src/VBox/Main
- Timestamp:
- Sep 28, 2012 6:36:09 AM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/Performance.h
r43453 r43456 497 497 public: 498 498 HostNetworkLoadRaw(CollectorHAL *hal, ComPtr<IUnknown> object, com::Utf8Str name, com::Utf8Str ifname, SubMetric *rx, SubMetric *tx) 499 : BaseMetric(hal, name, object), mInterfaceName(ifname), mRx(rx), mTx(tx), mRxPrev(0), mTxPrev(0) {};499 : BaseMetric(hal, name, object), mInterfaceName(ifname), mRx(rx), mTx(tx), mRxPrev(0), mTxPrev(0), mRc(VINF_SUCCESS) {}; 500 500 ~HostNetworkLoadRaw() { delete mRx; delete mTx; }; 501 501 … … 515 515 uint64_t mRxPrev; 516 516 uint64_t mTxPrev; 517 int mRc; 517 518 }; 518 519 -
trunk/src/VBox/Main/src-server/Performance.cpp
r43453 r43456 663 663 void HostNetworkLoadRaw::preCollect(CollectorHints& /* hints */, uint64_t /* iTick */) 664 664 { 665 if (RT_FAILURE(mRc)) 666 { 667 ComPtr<IHostNetworkInterface> networkInterface; 668 ComPtr<IHost> host = getObject(); 669 HRESULT hrc = host->FindHostNetworkInterfaceByName(com::Bstr(mInterfaceName).raw(), networkInterface.asOutParam()); 670 if (SUCCEEDED(hrc)) 671 { 672 LogRel(("Failed to collect network metrics for %s: %Rrc (%d).", mInterfaceName.c_str(), mRc, mRc)); 673 mRc = VINF_SUCCESS; 674 } 675 } 665 676 } 666 677 … … 669 680 uint64_t rx, tx, speed; 670 681 671 int rc = mHAL->getRawHostNetworkLoad(mInterfaceName.c_str(), &rx, &tx, &speed);672 if (RT_SUCCESS( rc))682 mRc = mHAL->getRawHostNetworkLoad(mInterfaceName.c_str(), &rx, &tx, &speed); 683 if (RT_SUCCESS(mRc)) 673 684 { 674 685 uint64_t rxDiff = rx - mRxPrev; … … 691 702 mTxPrev = tx; 692 703 } 704 else 705 LogFlowThisFunc(("Failed to collect data: %Rrc (%d)." 706 " Will update the list of interfaces...\n", mRc,mRc)); 693 707 } 694 708 … … 1279 1293 if (patternMatch((*it).second.c_str(), name.c_str())) 1280 1294 { 1281 LogFlowThisFunc(("...found!\n"));1295 //LogFlowThisFunc(("...found!\n")); 1282 1296 return true; 1283 1297 } -
trunk/src/VBox/Main/src-server/PerformanceImpl.cpp
r43453 r43456 616 616 ++n; 617 617 } 618 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p, marked %d metrics\n",619 this, __PRETTY_FUNCTION__, (void *)aObject, n ));618 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p, name=%s, marked %d metrics\n", 619 this, __PRETTY_FUNCTION__, (void *)aObject, name.c_str(), n)); 620 620 //LogFlowThisFuncLeave(); 621 621 } … … 630 630 631 631 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 632 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p\n", this, __PRETTY_FUNCTION__, (void *)aObject)); 632 LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p, name=%s\n", this, 633 __PRETTY_FUNCTION__, (void *)aObject, name.c_str())); 633 634 MetricList::iterator it; 634 635 for (it = m.metrics.begin(); it != m.metrics.end();)
Note:
See TracChangeset
for help on using the changeset viewer.