VirtualBox

Changeset 11481 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 19, 2008 12:13:53 PM (16 years ago)
Author:
vboxsync
Message:

PerfAPI: CPU/MHz counter name fix, proper handling of zero periods and counts

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HostImpl.cpp

    r11467 r11481  
    27392739    pm::SubMetric *cpuLoadKernel = new pm::SubMetric ("CPU/Load/Kernel");
    27402740    pm::SubMetric *cpuLoadIdle   = new pm::SubMetric ("CPU/Load/Idle");
    2741     pm::SubMetric *cpuMhzSM      = new pm::SubMetric ("CPU/MHZ");
     2741    pm::SubMetric *cpuMhzSM      = new pm::SubMetric ("CPU/MHz");
    27422742    pm::SubMetric *ramUsageTotal = new pm::SubMetric ("RAM/Usage/Total");
    27432743    pm::SubMetric *ramUsageUsed  = new pm::SubMetric ("RAM/Usage/Used");
  • trunk/src/VBox/Main/Performance.cpp

    r11391 r11481  
    272272        RTMemFree(mData);
    273273    mLength = length;
    274     mData = (ULONG *)RTMemAllocZ(length * sizeof(ULONG));
     274    if (mLength)
     275        mData = (ULONG *)RTMemAllocZ(length * sizeof(ULONG));
     276    else
     277        mData = NULL;
    275278    mWrapped = false;
    276279    mEnd = 0;
  • trunk/src/VBox/Main/PerformanceImpl.cpp

    r11391 r11481  
    266266                      " count to %u for %s\n", aPeriod, aCount, (*it)->getName()));
    267267            (*it)->init(aPeriod, aCount);
    268             LogFlow (("PerformanceCollector::SetupMetrics() enabling %s\n",
    269                       aPeriod, aCount, (*it)->getName()));
    270             (*it)->enable();
     268            if (aPeriod == 0 || aCount == 0)
     269            {
     270                LogFlow (("PerformanceCollector::SetupMetrics() disabling %s\n",
     271                          (*it)->getName()));
     272                (*it)->disable();
     273            }
     274            else
     275            {
     276                LogFlow (("PerformanceCollector::SetupMetrics() enabling %s\n",
     277                          (*it)->getName()));
     278                (*it)->enable();
     279            }
    271280        }
    272281
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