VirtualBox

Changeset 11180 in vbox for trunk/src/VBox


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.

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

Legend:

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

    r10873 r11180  
    7575// Stubs for non-pure virtual methods
    7676
    77 int CollectorHAL::getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle)
     77int CollectorHAL::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle)
    7878{
    7979    return E_NOTIMPL;
    8080}
    8181
    82 int CollectorHAL::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel)
     82int CollectorHAL::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel)
    8383{
    8484    return E_NOTIMPL;
     
    114114}*/
    115115
    116 void HostCpuLoad::init(unsigned long period, unsigned long length)
     116void HostCpuLoad::init(ULONG period, ULONG length)
    117117{
    118118    mPeriod = period;
     
    125125void HostCpuLoad::collect()
    126126{
    127     unsigned long user, kernel, idle;
     127    ULONG user, kernel, idle;
    128128    int rc = mHAL->getHostCpuLoad(&user, &kernel, &idle);
    129129    if (RT_SUCCESS(rc))
     
    159159        else
    160160        {
    161             mUser->put((unsigned long)(PM_CPU_LOAD_MULTIPLIER * userDiff / totalDiff));
    162             mKernel->put((unsigned long)(PM_CPU_LOAD_MULTIPLIER * kernelDiff / totalDiff));
    163             mIdle->put((unsigned long)(PM_CPU_LOAD_MULTIPLIER * idleDiff / totalDiff));
     161            mUser->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * userDiff / totalDiff));
     162            mKernel->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * kernelDiff / totalDiff));
     163            mIdle->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * idleDiff / totalDiff));
    164164        }
    165165   
     
    170170}
    171171
    172 void HostCpuMhz::init(unsigned long period, unsigned long length)
     172void HostCpuMhz::init(ULONG period, ULONG length)
    173173{
    174174    mPeriod = period;
     
    179179void HostCpuMhz::collect()
    180180{
    181     unsigned long mhz;
     181    ULONG mhz;
    182182    int rc = mHAL->getHostCpuMHz(&mhz);
    183183    if (RT_SUCCESS(rc))
     
    185185}
    186186
    187 void HostRamUsage::init(unsigned long period, unsigned long length)
     187void HostRamUsage::init(ULONG period, ULONG length)
    188188{
    189189    mPeriod = period;
     
    196196void HostRamUsage::collect()
    197197{
    198     unsigned long total, used, available;
     198    ULONG total, used, available;
    199199    int rc = mHAL->getHostMemoryUsage(&total, &used, &available);
    200200    if (RT_SUCCESS(rc))
     
    208208
    209209
    210 void MachineCpuLoad::init(unsigned long period, unsigned long length)
     210void MachineCpuLoad::init(ULONG period, ULONG length)
    211211{
    212212    mPeriod = period;
     
    218218void MachineCpuLoad::collect()
    219219{
    220     unsigned long user, kernel;
     220    ULONG user, kernel;
    221221    int rc = mHAL->getProcessCpuLoad(mProcess, &user, &kernel);
    222222    if (RT_SUCCESS(rc))
     
    242242        else
    243243        {
    244             mUser->put((unsigned long)(PM_CPU_LOAD_MULTIPLIER * (processUser - mProcessUserPrev) / (hostTotal - mHostTotalPrev)));
    245             mKernel->put((unsigned long)(PM_CPU_LOAD_MULTIPLIER * (processKernel - mProcessKernelPrev ) / (hostTotal - mHostTotalPrev)));
     244            mUser->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * (processUser - mProcessUserPrev) / (hostTotal - mHostTotalPrev)));
     245            mKernel->put((ULONG)(PM_CPU_LOAD_MULTIPLIER * (processKernel - mProcessKernelPrev ) / (hostTotal - mHostTotalPrev)));
    246246        }
    247247   
     
    252252}
    253253
    254 void MachineRamUsage::init(unsigned long period, unsigned long length)
     254void MachineRamUsage::init(ULONG period, ULONG length)
    255255{
    256256    mPeriod = period;
     
    261261void MachineRamUsage::collect()
    262262{
    263     unsigned long used;
     263    ULONG used;
    264264    int rc = mHAL->getProcessMemoryUsage(mProcess, &used);
    265265    if (RT_SUCCESS(rc))
     
    267267}
    268268
    269 void CircularBuffer::init(unsigned long length)
     269void CircularBuffer::init(ULONG length)
    270270{
    271271    if (mData)
    272272        RTMemFree(mData);
    273273    mLength = length;
    274     mData = (unsigned long *)RTMemAllocZ(length * sizeof(unsigned long));
     274    mData = (ULONG *)RTMemAllocZ(length * sizeof(ULONG));
    275275    mWrapped = false;
    276276    mEnd = 0;
    277277}
    278278
    279 unsigned long CircularBuffer::length()
     279ULONG CircularBuffer::length()
    280280{
    281281    return mWrapped ? mLength : mEnd;
    282282}
    283283
    284 void CircularBuffer::put(unsigned long value)
     284void CircularBuffer::put(ULONG value)
    285285{
    286286    if (mData)
     
    295295}
    296296
    297 void CircularBuffer::copyTo(unsigned long *data)
     297void CircularBuffer::copyTo(ULONG *data)
    298298{
    299299    if (mWrapped)
    300300    {
    301         memcpy(data, mData + mEnd, (mLength - mEnd) * sizeof(unsigned long));
     301        memcpy(data, mData + mEnd, (mLength - mEnd) * sizeof(ULONG));
    302302        // Copy the wrapped part
    303303        if (mEnd)
    304             memcpy(data + (mLength - mEnd), mData, mEnd * sizeof(unsigned long));
     304            memcpy(data + (mLength - mEnd), mData, mEnd * sizeof(ULONG));
    305305    }
    306306    else
    307         memcpy(data, mData, mEnd * sizeof(unsigned long));
    308 }
    309 
    310 void SubMetric::query(unsigned long *data)
     307        memcpy(data, mData, mEnd * sizeof(ULONG));
     308}
     309
     310void SubMetric::query(ULONG *data)
    311311{
    312312    copyTo(data);
    313313}
    314314   
    315 void Metric::query(unsigned long **data, unsigned long *count)
    316 {
    317     unsigned long length;
    318     unsigned long *tmpData;
     315void Metric::query(ULONG **data, ULONG *count)
     316{
     317    ULONG length;
     318    ULONG *tmpData;
    319319
    320320    length = mSubMetric->length();
    321321    if (length)
    322322    {
    323         tmpData = (unsigned long*)RTMemAlloc(sizeof(*tmpData)*length);
     323        tmpData = (ULONG*)RTMemAlloc(sizeof(*tmpData)*length);
    324324        mSubMetric->query(tmpData);
    325325        if (mAggregate)
    326326        {
    327327            *count = 1;
    328             *data  = (unsigned long*)RTMemAlloc(sizeof(**data));
     328            *data  = (ULONG*)RTMemAlloc(sizeof(**data));
    329329            **data = mAggregate->compute(tmpData, length);
    330330            RTMemFree(tmpData);
     
    343343}
    344344
    345 unsigned long AggregateAvg::compute(unsigned long *data, unsigned long length)
     345ULONG AggregateAvg::compute(ULONG *data, ULONG length)
    346346{
    347347    uint64_t tmp = 0;
    348     for (unsigned long i = 0; i < length; ++i)
     348    for (ULONG i = 0; i < length; ++i)
    349349        tmp += data[i];
    350     return (unsigned long)(tmp / length);
     350    return (ULONG)(tmp / length);
    351351}
    352352
     
    356356}
    357357
    358 unsigned long AggregateMin::compute(unsigned long *data, unsigned long length)
    359 {
    360     unsigned long tmp = *data;
    361     for (unsigned long i = 0; i < length; ++i)
     358ULONG AggregateMin::compute(ULONG *data, ULONG length)
     359{
     360    ULONG tmp = *data;
     361    for (ULONG i = 0; i < length; ++i)
    362362        if (data[i] < tmp)
    363363            tmp = data[i];
     
    370370}
    371371
    372 unsigned long AggregateMax::compute(unsigned long *data, unsigned long length)
    373 {
    374     unsigned long tmp = *data;
    375     for (unsigned long i = 0; i < length; ++i)
     372ULONG AggregateMax::compute(ULONG *data, ULONG length)
     373{
     374    ULONG tmp = *data;
     375    for (ULONG i = 0; i < length; ++i)
    376376        if (data[i] > tmp)
    377377            tmp = data[i];
  • trunk/src/VBox/Main/PerformanceImpl.cpp

    r10959 r11180  
    347347    {
    348348        /* @todo Filtering goes here! */
    349         unsigned long *values, length;
     349        ULONG *values, length;
    350350        /* @todo We may want to revise the query method to get rid of excessive alloc/memcpy calls. */
    351351        (*it)->query(&values, &length);
  • trunk/src/VBox/Main/darwin/PerformanceDarwin.cpp

    r10753 r11180  
    2929{
    3030public:
    31     virtual int getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle);
    32     virtual int getHostCpuMHz(unsigned long *mhz);
    33     virtual int getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available);
    34     virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel);
    35     virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long *used);
     31    virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle);
     32    virtual int getHostCpuMHz(ULONG *mhz);
     33    virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available);
     34    virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel);
     35    virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used);
    3636};
    3737
     
    4242}
    4343
    44 int CollectorDarwin::getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle)
     44int CollectorDarwin::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle)
    4545{
    4646    return E_NOTIMPL;
    4747}
    4848
    49 int CollectorDarwin::getHostCpuMHz(unsigned long *mhz)
     49int CollectorDarwin::getHostCpuMHz(ULONG *mhz)
    5050{
    5151    return E_NOTIMPL;
    5252}
    5353
    54 int CollectorDarwin::getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available)
     54int CollectorDarwin::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available)
    5555{
    5656    return E_NOTIMPL;
    5757}
    5858
    59 int CollectorDarwin::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel)
     59int CollectorDarwin::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel)
    6060{
    6161    return E_NOTIMPL;
    6262}
    6363
    64 int CollectorDarwin::getProcessMemoryUsage(RTPROCESS process, unsigned long *used)
     64int CollectorDarwin::getProcessMemoryUsage(RTPROCESS process, ULONG *used)
    6565{
    6666    return E_NOTIMPL;
  • trunk/src/VBox/Main/include/Performance.h

    r10870 r11180  
    3939    public:
    4040        CircularBuffer() : mData(0), mLength(0), mEnd(0), mWrapped(false) {};
    41         void init(unsigned long length);
    42         unsigned long length();
    43         void put(unsigned long value);
    44         void copyTo(unsigned long *data);
    45     private:
    46         unsigned long *mData;
    47         unsigned long  mLength;
    48         unsigned long  mEnd;
     41        void init(ULONG length);
     42        ULONG length();
     43        void put(ULONG value);
     44        void copyTo(ULONG *data);
     45    private:
     46        ULONG *mData;
     47        ULONG  mLength;
     48        ULONG  mEnd;
    4949        bool           mWrapped;
    5050    };
     
    5555        SubMetric(const char *name)
    5656        : mName(name) {};
    57         void query(unsigned long *data);
     57        void query(ULONG *data);
    5858        const char *getName() { return mName; };
    5959    private:
     
    6666    {
    6767    public:
    68         virtual int getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle);
    69         virtual int getHostCpuMHz(unsigned long *mhz) = 0;
    70         virtual int getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available) = 0;
    71         virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel);
    72         virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long *used) = 0;
     68        virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle);
     69        virtual int getHostCpuMHz(ULONG *mhz) = 0;
     70        virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available) = 0;
     71        virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel);
     72        virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used) = 0;
    7373
    7474        virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle);
     
    8383            : mHAL(hal), mLength(0), mName(name), mObject(object), mLastSampleTaken(0), mEnabled(false) {};
    8484
    85         virtual void init(unsigned long period, unsigned long length) = 0;
     85        virtual void init(ULONG period, ULONG length) = 0;
    8686        virtual void collect() = 0;
    8787        virtual const char *getUnit() = 0;
    88         virtual unsigned long getMinValue() = 0;
    89         virtual unsigned long getMaxValue() = 0;
     88        virtual ULONG getMinValue() = 0;
     89        virtual ULONG getMaxValue() = 0;
    9090
    9191        void collectorBeat(uint64_t nowAt);
     
    9595
    9696        bool isEnabled() { return mEnabled; };
    97         unsigned long getPeriod() { return mPeriod; };
    98         unsigned long getLength() { return mLength; };
     97        ULONG getPeriod() { return mPeriod; };
     98        ULONG getLength() { return mLength; };
    9999        const char *getName() { return mName; };
    100100        ComPtr<IUnknown> getObject() { return mObject; };
     
    103103    protected:
    104104        CollectorHAL    *mHAL;
    105         unsigned long    mPeriod;
    106         unsigned long    mLength;
     105        ULONG    mPeriod;
     106        ULONG    mLength;
    107107        const char      *mName;
    108108        ComPtr<IUnknown> mObject;
     
    116116        HostCpuLoad(CollectorHAL *hal, ComPtr<IUnknown> object, SubMetric *user, SubMetric *kernel, SubMetric *idle)
    117117        : BaseMetric(hal, "CPU/Load", object), mUser(user), mKernel(kernel), mIdle(idle) {};
    118         void init(unsigned long period, unsigned long length);
     118        void init(ULONG period, ULONG length);
    119119
    120120        void collect();
    121121        const char *getUnit() { return "%"; };
    122         unsigned long getMinValue() { return 0; };
    123         unsigned long getMaxValue() { return PM_CPU_LOAD_MULTIPLIER; };
     122        ULONG getMinValue() { return 0; };
     123        ULONG getMaxValue() { return PM_CPU_LOAD_MULTIPLIER; };
    124124
    125125    protected:
     
    148148        : BaseMetric(hal, "CPU/MHz", object), mMHz(mhz) {};
    149149
    150         void init(unsigned long period, unsigned long length);
     150        void init(ULONG period, ULONG length);
    151151        void collect();
    152152        const char *getUnit() { return "MHz"; };
    153         unsigned long getMinValue() { return 0; };
    154         unsigned long getMaxValue() { return UINT32_MAX; };
     153        ULONG getMinValue() { return 0; };
     154        ULONG getMaxValue() { return UINT32_MAX; };
    155155    private:
    156156        SubMetric *mMHz;
     
    163163        : BaseMetric(hal, "RAM/Usage", object), mTotal(total), mUsed(used), mAvailable(available) {};
    164164
    165         void init(unsigned long period, unsigned long length);
     165        void init(ULONG period, ULONG length);
    166166        void collect();
    167167        const char *getUnit() { return "kB"; };
    168         unsigned long getMinValue() { return 0; };
    169         unsigned long getMaxValue() { return UINT32_MAX; };
     168        ULONG getMinValue() { return 0; };
     169        ULONG getMaxValue() { return UINT32_MAX; };
    170170    private:
    171171        SubMetric *mTotal;
     
    180180        : BaseMetric(hal, "CPU/Load", object), mProcess(process), mUser(user), mKernel(kernel) {};
    181181
    182         void init(unsigned long period, unsigned long length);
     182        void init(ULONG period, ULONG length);
    183183        void collect();
    184184        const char *getUnit() { return "%"; };
    185         unsigned long getMinValue() { return 0; };
    186         unsigned long getMaxValue() { return PM_CPU_LOAD_MULTIPLIER; };
     185        ULONG getMinValue() { return 0; };
     186        ULONG getMaxValue() { return PM_CPU_LOAD_MULTIPLIER; };
    187187    protected:
    188188        RTPROCESS  mProcess;
     
    210210        : BaseMetric(hal, "RAM/Usage", object), mProcess(process), mUsed(used) {};
    211211
    212         void init(unsigned long period, unsigned long length);
     212        void init(ULONG period, ULONG length);
    213213        void collect();
    214214        const char *getUnit() { return "kB"; };
    215         unsigned long getMinValue() { return 0; };
    216         unsigned long getMaxValue() { return UINT32_MAX; };
     215        ULONG getMinValue() { return 0; };
     216        ULONG getMaxValue() { return UINT32_MAX; };
    217217    private:
    218218        RTPROCESS  mProcess;
     
    224224    {
    225225    public:
    226         virtual unsigned long compute(unsigned long *data, unsigned long length) = 0;
     226        virtual ULONG compute(ULONG *data, ULONG length) = 0;
    227227        virtual const char *getName() = 0;
    228228    };
     
    231231    {
    232232    public:
    233         virtual unsigned long compute(unsigned long *data, unsigned long length);
     233        virtual ULONG compute(ULONG *data, ULONG length);
    234234        virtual const char *getName();
    235235    };
     
    238238    {
    239239    public:
    240         virtual unsigned long compute(unsigned long *data, unsigned long length);
     240        virtual ULONG compute(ULONG *data, ULONG length);
    241241        virtual const char *getName();
    242242    };
     
    245245    {
    246246    public:
    247         virtual unsigned long compute(unsigned long *data, unsigned long length);
     247        virtual ULONG compute(ULONG *data, ULONG length);
    248248        virtual const char *getName();
    249249    };
     
    272272        ComPtr<IUnknown> getObject() { return mBaseMetric->getObject(); };
    273273        const char *getUnit() { return mBaseMetric->getUnit(); };
    274         unsigned long getMinValue() { return mBaseMetric->getMinValue(); };
    275         unsigned long getMaxValue() { return mBaseMetric->getMaxValue(); };
    276         unsigned long getPeriod() { return mBaseMetric->getPeriod(); };
    277         unsigned long getLength() { return mAggregate ? 1 : mBaseMetric->getLength(); };
    278         void query(unsigned long **data, unsigned long *count);
     274        ULONG getMinValue() { return mBaseMetric->getMinValue(); };
     275        ULONG getMaxValue() { return mBaseMetric->getMaxValue(); };
     276        ULONG getPeriod() { return mBaseMetric->getPeriod(); };
     277        ULONG getLength() { return mAggregate ? 1 : mBaseMetric->getLength(); };
     278        void query(ULONG **data, ULONG *count);
    279279
    280280    private:
  • 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
  • trunk/src/VBox/Main/os2/PerformanceOs2.cpp

    r10993 r11180  
    2929{
    3030public:
    31     virtual int getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle);
    32     virtual int getHostCpuMHz(unsigned long *mhz);
    33     virtual int getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available);
    34     virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel);
    35     virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long *used);
     31    virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle);
     32    virtual int getHostCpuMHz(ULONG *mhz);
     33    virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available);
     34    virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel);
     35    virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used);
    3636};
    3737
     
    4343}
    4444
    45 int CollectorOS2::getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle)
     45int CollectorOS2::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle)
    4646{
    4747    return E_NOTIMPL;
    4848}
    4949
    50 int CollectorOS2::getHostCpuMHz(unsigned long *mhz)
     50int CollectorOS2::getHostCpuMHz(ULONG *mhz)
    5151{
    5252    return E_NOTIMPL;
    5353}
    5454
    55 int CollectorOS2::getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available)
     55int CollectorOS2::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available)
    5656{
    5757    return E_NOTIMPL;
    5858}
    5959
    60 int CollectorOS2::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel)
     60int CollectorOS2::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel)
    6161{
    6262    return E_NOTIMPL;
    6363}
    6464
    65 int CollectorOS2::getProcessMemoryUsage(RTPROCESS process, unsigned long *used)
     65int CollectorOS2::getProcessMemoryUsage(RTPROCESS process, ULONG *used)
    6666{
    6767    return E_NOTIMPL;
  • trunk/src/VBox/Main/solaris/PerformanceSolaris.cpp

    r11099 r11180  
    4545    CollectorSolaris();
    4646    ~CollectorSolaris();
    47     virtual int getHostCpuMHz(unsigned long *mhz);
    48     virtual int getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available);
    49     virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long *used);
     47    virtual int getHostCpuMHz(ULONG *mhz);
     48    virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available);
     49    virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used);
    5050
    5151    virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle);
     
    164164}
    165165
    166 int CollectorSolaris::getHostCpuMHz(unsigned long *mhz)
     166int CollectorSolaris::getHostCpuMHz(ULONG *mhz)
    167167{
    168168    return VERR_NOT_IMPLEMENTED;
    169169}
    170170
    171 int CollectorSolaris::getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available)
     171int CollectorSolaris::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available)
    172172{
    173173    int rc = VINF_SUCCESS;
     
    199199    return rc;
    200200}
    201 int CollectorSolaris::getProcessMemoryUsage(RTPROCESS process, unsigned long *used)
     201int CollectorSolaris::getProcessMemoryUsage(RTPROCESS process, ULONG *used)
    202202{
    203203    int rc = VINF_SUCCESS;
  • trunk/src/VBox/Main/win/PerformanceWin.cpp

    r10868 r11180  
    3636    ~CollectorWin();
    3737
    38     virtual int getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle);
    39     virtual int getHostCpuMHz(unsigned long *mhz);
    40     virtual int getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available);
    41     virtual int getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel);
    42     virtual int getProcessMemoryUsage(RTPROCESS process, unsigned long *used);
     38    virtual int getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle);
     39    virtual int getHostCpuMHz(ULONG *mhz);
     40    virtual int getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available);
     41    virtual int getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel);
     42    virtual int getProcessMemoryUsage(RTPROCESS process, ULONG *used);
    4343
    4444    virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle);
     
    261261}
    262262
    263 int CollectorWin::getHostCpuLoad(unsigned long *user, unsigned long *kernel, unsigned long *idle)
     263int CollectorWin::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle)
    264264{
    265265    return VERR_NOT_IMPLEMENTED;
     
    334334}
    335335
    336 int CollectorWin::getHostCpuMHz(unsigned long *mhz)
     336int CollectorWin::getHostCpuMHz(ULONG *mhz)
    337337{
    338338    return VERR_NOT_IMPLEMENTED;
    339339}
    340340
    341 int CollectorWin::getHostMemoryUsage(unsigned long *total, unsigned long *used, unsigned long *available)
     341int CollectorWin::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *available)
    342342{
    343343    MEMORYSTATUSEX mstat;
     
    346346    if (GlobalMemoryStatusEx(&mstat))
    347347    {
    348         *total = (unsigned long)( mstat.ullTotalPhys / 1000 );
    349         *available = (unsigned long)( mstat.ullAvailPhys / 1000 );
     348        *total = (ULONG)( mstat.ullTotalPhys / 1000 );
     349        *available = (ULONG)( mstat.ullAvailPhys / 1000 );
    350350        *used = *total - *available;
    351351    }
     
    356356}
    357357
    358 int CollectorWin::getProcessCpuLoad(RTPROCESS process, unsigned long *user, unsigned long *kernel)
     358int CollectorWin::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel)
    359359{
    360360    return VERR_NOT_IMPLEMENTED;
     
    430430}
    431431
    432 int CollectorWin::getProcessMemoryUsage(RTPROCESS process, unsigned long *used)
     432int CollectorWin::getProcessMemoryUsage(RTPROCESS process, ULONG *used)
    433433{
    434434    HRESULT hr;
     
    472472                return VERR_INTERNAL_ERROR;
    473473            }
    474             *used = (unsigned long)(u64used / 1024);
     474            *used = (ULONG)(u64used / 1024);
    475475            rc = VINF_SUCCESS;
    476476        }
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