Changeset 9904 in vbox for trunk/include/iprt/system.h
- Timestamp:
- Jun 25, 2008 11:03:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/system.h
r8245 r9904 34 34 #include <iprt/types.h> 35 35 36 #define IPRT_USAGE_MULTIPLIER UINT64_C(1000000000) 37 38 /* This structure holds both computed and raw values of overall CPU load counters. */ 39 typedef struct 40 { 41 uint32_t u32User; 42 uint32_t u32System; 43 uint32_t u32Idle; 44 /* Internal raw counter values. */ 45 uint32_t u32RawUser; 46 uint32_t u32RawNice; 47 uint32_t u32RawSystem; 48 uint32_t u32RawIdle; 49 } RTCPUUSAGESTATS; 50 typedef RTCPUUSAGESTATS *PRTCPUUSAGESTATS; 51 52 /* This structure holds both computed and raw values of per-VM CPU load counters. */ 53 typedef struct 54 { 55 uint32_t u32User; 56 uint32_t u32System; 57 /* Internal raw counter values. */ 58 uint64_t u64RawTotal; 59 uint32_t u32RawProcUser; 60 uint32_t u32RawProcSystem; 61 } RTPROCCPUUSAGESTATS; 62 typedef RTPROCCPUUSAGESTATS *PRTPROCCPUUSAGESTATS; 63 36 64 37 65 __BEGIN_DECLS … … 56 84 RTDECL(uint64_t) RTSystemProcessorGetActiveMask(void); 57 85 86 /** 87 * Gets the current figures of overall system processor usage. 88 * 89 * @remarks To get meaningful stats this function has to be 90 * called twice with a bit of delay between calls. This 91 * is due to the fact that at least two samples of 92 * system usage stats are needed to calculate the load. 93 * 94 * @returns IPRT status code. 95 * @param pStats Pointer to the structure that contains the 96 * results. Note that this structure is 97 * modified with each call to this function and 98 * is used to provide both in and out values. 99 */ 100 RTDECL(int) RTSystemProcessorGetUsageStats(PRTCPUUSAGESTATS pStats); 101 102 /** 103 * Gets the current processor usage for a partucilar process. 104 * 105 * @remarks To get meaningful stats this function has to be 106 * called twice with a bit of delay between calls. This 107 * is due to the fact that at least two samples of 108 * system usage stats are needed to calculate the load. 109 * 110 * @returns IPRT status code. 111 * @param pid VM process id. 112 * @param pStats Pointer to the structure that contains the 113 * results. Note that this structure is 114 * modified with each call to this function and 115 * is used to provide both in and out values. 116 * 117 * @todo Perharps this function should be moved somewhere 118 * else. 119 */ 120 RTDECL(int) RTProcessGetProcessorUsageStats(RTPROCESS pid, PRTPROCCPUUSAGESTATS pStats); 58 121 59 122 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.