VirtualBox

Changeset 9935 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Jun 25, 2008 4:49:24 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
32357
Message:

r=bird: Review comments, work to be done. Marked the RTSystemProcessorGetCount/ActiveMask as retired by the RTMp stuff (partly a todo).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/system-posix.cpp

    r9904 r9935  
    9494/**
    9595 * Gets the current figures of overall system processor usage.
    96  * 
    97  * @remarks To get meaningful stats this function has to be 
     96 *
     97 * @remarks To get meaningful stats this function has to be
    9898 *          called twice with a bit of delay between calls. This
    9999 *          is due to the fact that at least two samples of
    100100 *          system usage stats are needed to calculate the load.
    101  * 
     101 *
    102102 * @returns None.
    103103 */
    104104RTDECL(int) RTSystemProcessorGetUsageStats(PRTCPUUSAGESTATS pStats)
    105105{
     106/** @todo r=bird: This is Linux specific and doesn't belong here. Move this to r3/linux/RTSystemGetCpuLoadStats-linux.cpp. */
    106107    int rc = VINF_SUCCESS;
    107108    uint32_t u32UserNow, u32NiceNow, u32SystemNow, u32IdleNow;
     
    139140/**
    140141 * Gets the current processor usage for a partucilar process.
    141  * 
    142  * @remarks To get meaningful stats this function has to be 
     142 *
     143 * @remarks To get meaningful stats this function has to be
    143144 *          called twice with a bit of delay between calls. This
    144145 *          is due to the fact that at least two samples of
    145146 *          system usage stats are needed to calculate the load.
    146  * 
     147 *
    147148 * @returns None.
    148149 */
     
    153154    uint32_t u32UserDelta, u32SystemDelta;
    154155    uint64_t u64TotalNow, u64TotalDelta;
     156
     157/** @todo r=bird: This is Linux specific and doesn't belong here. Move this to r3/linux/RTSystemGetCpuLoadStats-linux.cpp. */
    155158    FILE *f = fopen("/proc/stat", "r");
    156159
    157160    if (f)
    158161    {
    159         if (fscanf(f, "cpu %u %u %u %u", &u32UserNow, &u32NiceNow, &u32SystemNow, &u32IdleNow) == 4)
     162        if (fscanf(f, "cpu %u %u %u %u", &u32UserNow, &u32NiceNow, &u32SystemNow, &u32IdleNow) == 4) /** @todo 'uint32_t' is not necessarily the same as 'unsigned int'. */
    160163        {
    161164            char *pszName;
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