VirtualBox

Changeset 5190 in vbox


Ignore:
Timestamp:
Oct 8, 2007 6:27:49 PM (17 years ago)
Author:
vboxsync
Message:

Added MachineDebugger::getStats.

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

Legend:

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

    r4071 r5190  
    131131
    132132/**
    133  * Resets VM statistics
    134  *
    135  * @returns COM status code
     133 * Resets VM statistics.
     134 *
     135 * @returns COM status code.
    136136 */
    137137STDMETHODIMP MachineDebugger::ResetStats()
     
    144144
    145145/**
    146  * Dumps VM statistics to the log
    147  *
    148  * @returns COM status code
     146 * Dumps VM statistics to the log.
     147 *
     148 * @returns COM status code.
    149149 */
    150150STDMETHODIMP MachineDebugger::DumpStats()
     
    153153    if (pVM.isOk())
    154154        STAMR3Dump(pVM, NULL);
     155    return S_OK;
     156}
     157
     158/**
     159 * Get the VM statistics in an XML format.
     160 *
     161 * @returns COM status code.
     162 * @param   aPattern            The selection pattern. A bit similar to filename globbing.
     163 * @param   aWithDescriptions   Whether to include the descriptions.
     164 * @param   aStats              The XML document containing the statistics.
     165 */
     166STDMETHODIMP MachineDebugger::GetStats(INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats)
     167{
     168    Console::SafeVMPtrQuiet pVM (mParent);
     169    if (!pVM.isOk())
     170        return E_FAIL;
     171
     172    char *pszSnapshot;
     173    int vrc = STAMR3Snapshot(pVM, Utf8Str(aPattern).raw(), &pszSnapshot, NULL, aWithDescriptions);
     174    if (RT_FAILURE(vrc))
     175        return vrc == VERR_NO_MEMORY ? E_OUTOFMEMORY : E_FAIL;
     176
     177    /** @todo this is horribly inefficient! And it's kinda difficult to tell whether it failed...
     178     * Must use UTF-8 or ASCII here and completely avoid these two extra copy operations.
     179     * Until that's done, this method is kind of useless for debugger statistics GUI because
     180     * of the amount statistics in a debug build. */
     181    Bstr(pszSnapshot).cloneTo(aStats);
     182
    155183    return S_OK;
    156184}
     
    480508/**
    481509 * Returns the current virtual time rate.
    482  * 
     510 *
    483511 * @returns COM status code.
    484512 * @param   pct     Where to store the rate.
     
    502530/**
    503531 * Returns the current virtual time rate.
    504  * 
     532 *
    505533 * @returns COM status code.
    506534 * @param   pct     Where to store the rate.
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r5171 r5190  
    1818 *    out/<platform>/bin/sdk/idl/VirtualBox.idl
    1919 *    (MS COM interface definition file for Main API)
    20  * 
     20 *
    2121 * 2. src/VBox/Main/idl/xpidl.xsl =>
    2222 *    out/<platform>/bin/sdk/idl/VirtualBox_XPCOM.idl
     
    4242 *
    4343     Copyright (C) 2006-2007 innotek GmbH
    44    
     44
    4545     This file is part of VirtualBox Open Source Edition (OSE), as
    4646     available from http://www.virtualbox.org. This file is free software;
     
    398398    <desc>
    399399      Scope of the operation.
    400      
     400
    401401      A generic enumeration used in various methods to define the action or
    402402      argument scope.
     
    498498    <const name="MaxVal"               value="17"/>
    499499  </enum>
    500  
     500
    501501  <!--
    502502  // IVirtualBoxErrorInfo
     
    16171617        space of the session object. There can be only one direct
    16181618        session open at a time for every virtual machine.
    1619      
     1619
    16201620        Upon successful return, the session object can be used to
    16211621        get access to the machine and to the VM console.
     
    16471647        caller (using the IConsole interface); however, within the remote
    16481648        session context, not all VM settings are available for modification.
    1649        
     1649
    16501650        This operation can take some time, so the progress object
    16511651        is returned to let the caller be informed when the session is
     
    50605060        <li>
    50615061          <i>Custom HardDisk</i>, a disk accessed via a plugin which is loaded
    5062           when the disk is accessed (represented by the 
     5062          when the disk is accessed (represented by the
    50635063          <link to="ICustomHardDisk"/> interface).
    50645064        </li>
     
    66236623      to="IFramebuffer::requestResize()"/>.
    66246624
    6625       See also www.fourcc.org for more informantion about FOURCC pixel formats. 
     6625      See also www.fourcc.org for more informantion about FOURCC pixel formats.
    66266626    </desc>
    66276627    <const name="PixelFormatOpaque"       value="0xFFFFFFFF">
     
    66796679          This attribute must never return <link
    66806680          to="PixelFormat::PixelFormatOpaque"/> -- the format of the buffer
    6681           <link to="#address"/> points to must be always known. 
     6681          <link to="#address"/> points to must be always known.
    66826682        </note>
    66836683      </desc>
     
    66886688        Defines whether this framebuffer uses the virtual video card's memory
    66896689        buffer (guest VRAM) directly or not. See <link
    6690         to="IFramebuffer::requestResize()"/> for more information. 
     6690        to="IFramebuffer::requestResize()"/> for more information.
    66916691      </desc>
    66926692    </attribute>
     
    70987098        should issue the request and wait for a resolution change and
    70997099        after a timeout retry.
    7100        
     7100
    71017101        Specifying <tt>0</tt> for either @a width, @a height or @a bitsPerPixel
    71027102        parameters means that the corresponding values should be taken from the
     
    74467446  <interface
    74477447     name="IMachineDebugger" extends="$unknown"
    7448      uuid="358b05cd-6d43-42b9-9c2b-75d466a58cfc"
     7448     uuid="aabb012b-36c7-4d31-89fd-313f7d056034"
    74497449     wsmap="suppress"
    74507450     >
     
    74597459        Dumps VM statistics.
    74607460      </desc>
     7461    </method>
     7462
     7463    <method name="getStats">
     7464      <desc>
     7465        Get the VM statistics in a XMLish format.
     7466      </desc>
     7467      <param name="pattern" type="wstring" dir="in">
     7468        <desc>The selection pattern. A bit similar to filename globbing.</desc>
     7469      </param>
     7470      <param name="withDescriptions" type="boolean" dir="in">
     7471        <desc>Whether to include the descriptions.</desc>
     7472      </param>
     7473      <param name="stats" type="wstring" dir="out">
     7474        <desc>The XML document containing the statistics.</desc>
     7475      </param>
    74617476    </method>
    74627477
     
    83148329        <li>Global definitions</li>
    83158330      </ol>
    8316      
     8331
    83178332      For example, if MyMachine has a shared folder named
    83188333      <tt>C_DRIVE</tt> (that points to <tt>C:\\</tt>), then cretaing a
     
    83258340      the prevoious (permanent) definition of <tt>C_DRIVE</tt> that points
    83268341      to <tt>C:\\</tt> if it still exists.
    8327      
     8342
    83288343      Note that permanent and transient shared folders of different machines
    83298344      are in different name spaces, so they don't overlap and don't need to
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r4071 r5190  
    7070    STDMETHOD(ResetStats());
    7171    STDMETHOD(DumpStats());
     72    STDMETHOD(GetStats(INPTR BSTR aPattern, BOOL aWithDescriptions, BSTR *aStats));
     73
    7274
    7375    // "public-private methods"
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