VirtualBox

Ignore:
Timestamp:
Oct 2, 2012 1:22:31 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81089
Message:

Main/Metrics: Alternative way to get link speed for old kernels (#6345)

File:
1 edited

Legend:

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

    r43445 r43507  
    4040
    4141    virtual int getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle);
    42     virtual int getRawHostNetworkLoad(const char *name, uint64_t *rx, uint64_t *tx, uint64_t *speed);
     42    virtual int getRawHostNetworkLoad(const char *name, uint64_t *rx, uint64_t *tx);
    4343    virtual int getRawProcessCpuLoad(RTPROCESS process, uint64_t *user, uint64_t *kernel, uint64_t *total);
    4444private:
     
    218218}
    219219
    220 int CollectorLinux::getRawHostNetworkLoad(const char *name, uint64_t *rx, uint64_t *tx, uint64_t *speed)
     220int CollectorLinux::getRawHostNetworkLoad(const char *name, uint64_t *rx, uint64_t *tx)
    221221{
    222222    int rc = VINF_SUCCESS;
     
    242242                rc = VERR_FILE_IO_ERROR;
    243243            fclose(f);
    244             RTStrPrintf(szIfName, sizeof(szIfName), "/sys/class/net/%s/speed", name);
    245             f = fopen(szIfName, "r");
    246             if (f)
    247             {
    248                 if (fscanf(f, "%llu", &u64Speed) == 1)
    249                     *speed = u64Speed * (1000000/8); /* Convert to bytes/sec */
    250                 else
    251                     rc = VERR_FILE_IO_ERROR;
    252                 fclose(f);
    253             }
    254             else
    255                 rc = VERR_ACCESS_DENIED;
    256244        }
    257245        else
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