Changeset 80114 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 2, 2019 9:04:00 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132555
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r80074 r80114 19807 19807 <interface 19808 19808 name="IMachineDebugger" extends="$unknown" 19809 uuid=" e91bb944-f211-4bd5-b44c-8f1d0beafa13"19809 uuid="00ae6af4-00a7-4104-0009-49bc00b2da80" 19810 19810 wsmap="managed" 19811 19811 reservedMethods="16" reservedAttributes="16" … … 20173 20173 <param name="stats" type="wstring" dir="return"> 20174 20174 <desc>The XML document containing the statistics.</desc> 20175 </param> 20176 </method> 20177 20178 <method name="getCPULoad"> 20179 <desc> 20180 Get the load percentages (as observed by the VMM) for all virtual CPUs 20181 or a specific one. 20182 </desc> 20183 <param name="cpuId" type="unsigned long" dir="in"> 20184 <desc>The ID of the virtual CPU to retrieve stats for, pass 0x7fffffff 20185 or higher for the average accross all CPUs.</desc> 20186 </param> 20187 <param name="pctExecuting" type="unsigned long" dir="out"> 20188 <desc>Percentage of the interval that the CPU(s) spend executing guest code.</desc> 20189 </param> 20190 <param name="pctHalted" type="unsigned long" dir="out"> 20191 <desc>Percentage of the interval that the CPU(s) spend halted.</desc> 20192 </param> 20193 <param name="pctOther" type="unsigned long" dir="out"> 20194 <desc>Percentage of the interval that the CPU(s) preempted by the host 20195 scheduler, on virtualization overhead and on other tasks.</desc> 20196 </param> 20197 <param name="msInterval" type="long long" dir="return"> 20198 <desc>The interval the percentage was calculated over in milliseconds</desc> 20175 20199 </param> 20176 20200 </method> -
trunk/src/VBox/Main/include/MachineDebuggerImpl.h
r76562 r80114 133 133 BOOL aWithDescriptions, 134 134 com::Utf8Str &aStats); 135 HRESULT getCPULoad(ULONG aCpuId, ULONG *aPctExecuting, ULONG *aPctHalted, ULONG *aPctOther, LONG64 *aMsInterval) RT_OVERRIDE; 135 136 136 137 // private methods -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r80074 r80114 1541 1541 { 1542 1542 Console::SafeVMPtrQuiet ptrVM(mParent); 1543 1544 1543 if (!ptrVM.isOk()) 1545 1544 return setError(VBOX_E_INVALID_VM_STATE, "Machine is not running"); … … 1562 1561 1563 1562 1563 /** Wrapper around TMR3GetCpuLoadPercents. */ 1564 HRESULT MachineDebugger::getCPULoad(ULONG aCpuId, ULONG *aPctExecuting, ULONG *aPctHalted, ULONG *aPctOther, LONG64 *aMsInterval) 1565 { 1566 HRESULT hrc; 1567 Console::SafeVMPtrQuiet ptrVM(mParent); 1568 if (ptrVM.isOk()) 1569 { 1570 uint8_t uPctExecuting = 0; 1571 uint8_t uPctHalted = 0; 1572 uint8_t uPctOther = 0; 1573 uint64_t msInterval = 0; 1574 int vrc = TMR3GetCpuLoadPercents(ptrVM.rawUVM(), aCpuId >= UINT32_MAX / 2 ? VMCPUID_ALL : aCpuId, 1575 &msInterval, &uPctExecuting, &uPctHalted, &uPctOther); 1576 if (RT_SUCCESS(vrc)) 1577 { 1578 *aPctExecuting = uPctExecuting; 1579 *aPctHalted = uPctHalted; 1580 *aPctOther = uPctOther; 1581 *aMsInterval = msInterval; 1582 hrc = S_OK; 1583 } 1584 else 1585 hrc = setErrorVrc(vrc); 1586 } 1587 else 1588 hrc = setError(VBOX_E_INVALID_VM_STATE, "Machine is not running"); 1589 return hrc; 1590 } 1591 1592 1564 1593 // public methods only for internal purposes 1565 1594 /////////////////////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.