VirtualBox

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


Ignore:
Timestamp:
Aug 6, 2008 3:34:11 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34200
Message:

PerfAPI: replaced unsigned long with ULONG to get rid of solaris 64-bit issue.

File:
1 edited

Legend:

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

    r10938 r11180  
    3434{
    3535public:
    36     virtual int getHostCpuMHz(unsigned long *mhz);
    37     virtual int getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available);
    38     virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long *used);
     36    virtual int getHostCpuMHz(ULONG *mhz);
     37    virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available);
     38    virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used);
    3939
    4040    virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle);
    4141    virtual int getRawProcessCpuLoad(RTPROCESS process, uint64_t *user, uint64_t *kernel, uint64_t *total);
    4242private:
    43     int getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, unsigned long *memPagesUsed);
     43    int getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, ULONG *memPagesUsed);
    4444};
    4545
     
    5757{
    5858    int rc = VINF_SUCCESS;
    59     unsigned long u32user, u32nice, u32kernel, u32idle;
     59    ULONG u32user, u32nice, u32kernel, u32idle;
    6060    FILE *f = fopen("/proc/stat", "r");
    6161
     
    8686    if (RT_SUCCESS(rc))
    8787    {
    88         unsigned long ulTmp;
     88        ULONG ulTmp;
    8989        *total = (uint64_t)uHostUser + uHostKernel + uHostIdle;
    9090        rc = getRawProcessStats(process, user, kernel, &ulTmp);
     
    9494}
    9595
    96 int CollectorLinux::getHostCpuMHz(unsigned long *mhz)
     96int CollectorLinux::getHostCpuMHz(ULONG *mhz)
    9797{
    9898    return E_NOTIMPL;
    9999}
    100100
    101 int CollectorLinux::getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available)
     101int CollectorLinux::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available)
    102102{
    103103    int rc = VINF_SUCCESS;
    104     unsigned long buffers, cached;
     104    ULONG buffers, cached;
    105105    FILE *f = fopen("/proc/meminfo", "r");
    106106
     
    126126}
    127127
    128 int CollectorLinux::getProcessMemoryUsage(RTPROCESS process, unsigned long *used)
     128int CollectorLinux::getProcessMemoryUsage(RTPROCESS process, ULONG *used)
    129129{
    130130    uint64_t u64Tmp;
    131     unsigned long nPagesUsed;
     131    ULONG nPagesUsed;
    132132    int rc = getRawProcessStats(process, &u64Tmp, &u64Tmp, &nPagesUsed);
    133133    if (RT_SUCCESS(rc))
     
    139139}
    140140
    141 int CollectorLinux::getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, unsigned long *memPagesUsed)
     141int CollectorLinux::getRawProcessStats(RTPROCESS process, uint64_t *cpuUser, uint64_t *cpuKernel, ULONG *memPagesUsed)
    142142{
    143143    int rc = VINF_SUCCESS;
     
    148148    uint64_t u64Tmp;
    149149    unsigned uTmp;
    150     unsigned long ulTmp, u32user, u32kernel;
     150    ULONG ulTmp, u32user, u32kernel;
    151151    char buf[80]; /* @todo: this should be tied to max allowed proc name. */
    152152
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