VirtualBox

Changeset 62598 in vbox


Ignore:
Timestamp:
Jul 27, 2016 2:42:21 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
109167
Message:

Main/MachineDebugger: add method for getting the VM uptime

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r62300 r62598  
    1759917599    uuid="9c0f5269-47ae-ee34-c2fe-53a16e388925"
    1760017600    wsmap="managed"
    17601     reservedMethods="16" reservedAttributes="16"
     17601    reservedMethods="16" reservedAttributes="15"
    1760217602    >
    1760317603    <method name="dumpGuestCore">
     
    1807918079        the details of this interface.
    1808018080      </desc>
     18081    </attribute>
     18082
     18083    <attribute name="uptime" type="long long" readonly="yes">
     18084      <desc>VM uptime in milliseconds, i.e. time in which it could have been
     18085        executing guest code. Excludes the time when the VM was paused.</desc>
    1808118086    </attribute>
    1808218087
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r62485 r62598  
    7676    HRESULT setVirtualTimeRate(ULONG aVirtualTimeRate);
    7777    HRESULT getVM(LONG64 *aVM);
     78    HRESULT getUptime(LONG64 *aUptime);
    7879
    7980    // wrapped IMachineDeugger properties
     
    130131
    131132    // private methods
     133    static DECLCALLBACK(int) i_getUptime(MachineDebugger *, PUVM pUVM, LONG64 *pUptime);
    132134    bool i_queueSettings() const;
    133135    HRESULT i_getEmExecPolicyProperty(EMEXECPOLICY enmPolicy, BOOL *pfEnforced);
  • trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp

    r62485 r62598  
    7171 * @param aParent handle of our parent object
    7272 */
    73 HRESULT MachineDebugger::init (Console *aParent)
     73HRESULT MachineDebugger::init(Console *aParent)
    7474{
    7575    LogFlowThisFunc(("aParent=%p\n", aParent));
     
    302302    Console::SafeVMPtrQuiet ptrVM(mParent);
    303303    if (ptrVM.isOk())
    304         *aPATMEnabled = PATMR3IsEnabled (ptrVM.rawUVM());
     304        *aPATMEnabled = PATMR3IsEnabled(ptrVM.rawUVM());
    305305    else
    306306#endif
     
    750750 *
    751751 * @returns COM status code
    752  * @param   a_u64Vm     Where to store the vm handle. Since there is no
     752 * @param   aVM         Where to store the vm handle. Since there is no
    753753 *                      uintptr_t in COM, we're using the max integer.
    754754 *                      (No, ULONG is not pointer sized!)
     
    772772     *       after we return from this method.
    773773     */
     774    return hrc;
     775}
     776
     777/**
     778 * Get the VM uptime in milliseconds.
     779 *
     780 * @returns COM status code
     781 * @param   aUptime     Where to store the uptime.
     782 */
     783HRESULT MachineDebugger::getUptime(LONG64 *aUptime)
     784{
     785    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     786
     787    Console::SafeVMPtr ptrVM(mParent);
     788    HRESULT hrc = ptrVM.rc();
     789    if (SUCCEEDED(hrc))
     790        *aUptime = (int64_t)TMR3TimeVirtGetMilli(ptrVM.rawUVM());
     791
    774792    return hrc;
    775793}
     
    15371555HRESULT MachineDebugger::getStats(const com::Utf8Str &aPattern, BOOL aWithDescriptions, com::Utf8Str &aStats)
    15381556{
    1539     Console::SafeVMPtrQuiet ptrVM (mParent);
     1557    Console::SafeVMPtrQuiet ptrVM(mParent);
    15401558
    15411559    if (!ptrVM.isOk())
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