VirtualBox

Ignore:
Timestamp:
Jun 25, 2008 11:03:03 AM (16 years ago)
Author:
vboxsync
Message:

Global and per-VM CPU usage API added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MachineImpl.h

    r9883 r9904  
    4848#include <iprt/thread.h>
    4949#include <iprt/time.h>
     50#ifdef VBOX_WITH_RESOURCE_USAGE_API
     51#include <iprt/system.h>
     52#include <iprt/timer.h>
     53#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    5054
    5155#include <list>
     
    519523    STDMETHOD(SetConfigRegistryValue) (INPTR BSTR aKey, INPTR BSTR aValue);
    520524
     525    STDMETHOD(GetProcessorUsage) (ULONG *user, ULONG *system);
     526
    521527    // public methods only for internal purposes
    522528
     
    739745    friend class SessionMachine;
    740746    friend class SnapshotMachine;
     747
     748#ifdef VBOX_WITH_RESOURCE_USAGE_API
     749    /** Static timer callback. */
     750    static void staticSamplerCallback(PRTTIMER pTimer, void *pvUser, uint64_t iTick);
     751    /** Member timer callback. */
     752    void usageSamplerCallback();
     753    /** Pointer to the usage sampling timer. */
     754    PRTTIMER m_pUsageSampler;
     755    /** Structure to hold processor usage stats. */
     756    RTPROCCPUUSAGESTATS m_CpuStats;
     757#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    741758};
    742759
     
    809826        IConsole *aInitiator, MachineState_T *aMachineState, IProgress **aProgress);
    810827
     828    /* We need to override and call real Machine's method. */
     829    STDMETHOD(GetProcessorUsage) (ULONG *user, ULONG *system);
     830
    811831    // public methods only for internal purposes
    812832
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