VirtualBox

Changeset 11498 in vbox for trunk/src/VBox/Main/linux


Ignore:
Timestamp:
Aug 19, 2008 6:50:33 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34999
Message:

PerfAPI: Moved linux implementation of CPU/MHz to CollectorHAL since it is generic. Windows implementation needs to be moved to RTMpGetCurFrequency.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/linux/PerformanceLinux.cpp

    r11483 r11498  
    2525#include <iprt/alloc.h>
    2626#include <iprt/err.h>
    27 #include <iprt/mp.h>
    2827#include <iprt/param.h>
    2928#include <iprt/string.h>
     
    3534{
    3635public:
    37     virtual int getHostCpuMHz(ULONG *mhz);
    3836    virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available);
    3937    virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used);
     
    9391
    9492    return rc;
    95 }
    96 
    97 int CollectorLinux::getHostCpuMHz(ULONG *mhz)
    98 {
    99     RTCPUID nProcessors = RTMpGetCount();
    100     uint64_t uTotalMHz  = 0;
    101 
    102     for (RTCPUID i = 0; i < nProcessors; ++i)
    103         uTotalMHz += RTMpGetCurFrequency(RTMpCpuIdFromSetIndex(i));
    104 
    105     *mhz = (ULONG)(uTotalMHz / nProcessors);
    106     return VINF_SUCCESS;
    10793}
    10894
Note: See TracChangeset for help on using the changeset viewer.

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