VirtualBox

source: vbox/trunk/include/VBox/stam.h@ 16065

Last change on this file since 16065 was 13598, checked in by vboxsync, 16 years ago

#1865: STAM - minor cleanups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 38.3 KB
Line 
1/** @file
2 * STAM - Statistics Manager.
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef ___VBox_stam_h
31#define ___VBox_stam_h
32
33#include <VBox/cdefs.h>
34#include <VBox/types.h>
35#include <iprt/stdarg.h>
36#ifdef _MSC_VER
37# if _MSC_VER >= 1400
38# include <intrin.h>
39# endif
40#endif
41
42__BEGIN_DECLS
43
44/** @defgroup grp_stam The Statistics Manager API
45 * @{
46 */
47
48#if defined(VBOX_WITHOUT_RELEASE_STATISTICS) && defined(VBOX_WITH_STATISTICS)
49# error "Both VBOX_WITHOUT_RELEASE_STATISTICS and VBOX_WITH_STATISTICS are defined! Make up your mind!"
50#endif
51
52
53/** @def STAM_GET_TS
54 * Gets the CPU timestamp counter.
55 *
56 * @param u64 The 64-bit variable which the timestamp shall be saved in.
57 */
58#ifdef __GNUC__
59# if defined(RT_ARCH_X86)
60 /* This produces optimal assembler code for x86 but does not work for AMD64 ('A' means 'either rax or rdx') */
61# define STAM_GET_TS(u64) __asm__ __volatile__ ("rdtsc\n\t" : "=A" (u64));
62# elif defined(RT_ARCH_AMD64)
63# define STAM_GET_TS(u64) \
64 do { uint64_t low; uint64_t high; \
65 __asm__ __volatile__ ("rdtsc\n\t" : "=a"(low), "=d"(high)); \
66 (u64) = ((high << 32) | low); \
67 } while (0)
68# endif
69#elif _MSC_VER >= 1400
70# pragma intrinsic(__rdtsc)
71# define STAM_GET_TS(u64) \
72 do { (u64) = __rdtsc(); } while (0)
73#else
74# define STAM_GET_TS(u64) \
75 do { \
76 uint64_t u64Tmp; \
77 __asm { \
78 __asm rdtsc \
79 __asm mov dword ptr [u64Tmp], eax \
80 __asm mov dword ptr [u64Tmp + 4], edx \
81 } \
82 (u64) = u64Tmp; \
83 } while (0)
84#endif
85
86
87/** @def STAM_REL_STATS
88 * Code for inclusion only when VBOX_WITH_STATISTICS is defined.
89 * @param code A code block enclosed in {}.
90 */
91#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
92# define STAM_REL_STATS(code) do code while(0)
93#else
94# define STAM_REL_STATS(code) do {} while(0)
95#endif
96/** @def STAM_STATS
97 * Code for inclusion only when VBOX_WITH_STATISTICS is defined.
98 * @param code A code block enclosed in {}.
99 */
100#ifdef VBOX_WITH_STATISTICS
101# define STAM_STATS(code) STAM_REL_STATS(code)
102#else
103# define STAM_STATS(code) do {} while(0)
104#endif
105
106
107/**
108 * Sample type.
109 */
110typedef enum STAMTYPE
111{
112 /** Invalid entry. */
113 STAMTYPE_INVALID = 0,
114 /** Generic counter. */
115 STAMTYPE_COUNTER,
116 /** Profiling of an function. */
117 STAMTYPE_PROFILE,
118 /** Profiling of an operation. */
119 STAMTYPE_PROFILE_ADV,
120 /** Ratio of A to B, uint32_t types. Not reset. */
121 STAMTYPE_RATIO_U32,
122 /** Ratio of A to B, uint32_t types. Reset both to 0. */
123 STAMTYPE_RATIO_U32_RESET,
124 /** Callback. */
125 STAMTYPE_CALLBACK,
126 /** Generic unsigned 8-bit value. Not reset. */
127 STAMTYPE_U8,
128 /** Generic unsigned 8-bit value. Reset to 0. */
129 STAMTYPE_U8_RESET,
130 /** Generic hexadecimal unsigned 8-bit value. Not reset. */
131 STAMTYPE_X8,
132 /** Generic hexadecimal unsigned 8-bit value. Reset to 0. */
133 STAMTYPE_X8_RESET,
134 /** Generic unsigned 16-bit value. Not reset. */
135 STAMTYPE_U16,
136 /** Generic unsigned 16-bit value. Reset to 0. */
137 STAMTYPE_U16_RESET,
138 /** Generic hexadecimal unsigned 16-bit value. Not reset. */
139 STAMTYPE_X16,
140 /** Generic hexadecimal unsigned 16-bit value. Reset to 0. */
141 STAMTYPE_X16_RESET,
142 /** Generic unsigned 32-bit value. Not reset. */
143 STAMTYPE_U32,
144 /** Generic unsigned 32-bit value. Reset to 0. */
145 STAMTYPE_U32_RESET,
146 /** Generic hexadecimal unsigned 32-bit value. Not reset. */
147 STAMTYPE_X32,
148 /** Generic hexadecimal unsigned 32-bit value. Reset to 0. */
149 STAMTYPE_X32_RESET,
150 /** Generic unsigned 64-bit value. Not reset. */
151 STAMTYPE_U64,
152 /** Generic unsigned 64-bit value. Reset to 0. */
153 STAMTYPE_U64_RESET,
154 /** Generic hexadecimal unsigned 64-bit value. Not reset. */
155 STAMTYPE_X64,
156 /** Generic hexadecimal unsigned 64-bit value. Reset to 0. */
157 STAMTYPE_X64_RESET,
158 /** The end (exclusive). */
159 STAMTYPE_END
160} STAMTYPE;
161
162/**
163 * Sample visibility type.
164 */
165typedef enum STAMVISIBILITY
166{
167 /** Invalid entry. */
168 STAMVISIBILITY_INVALID = 0,
169 /** Always visible. */
170 STAMVISIBILITY_ALWAYS,
171 /** Only visible when used (/hit). */
172 STAMVISIBILITY_USED,
173 /** Not visible in the GUI. */
174 STAMVISIBILITY_NOT_GUI,
175 /** The end (exclusive). */
176 STAMVISIBILITY_END
177} STAMVISIBILITY;
178
179/**
180 * Sample unit.
181 */
182typedef enum STAMUNIT
183{
184 /** Invalid entry .*/
185 STAMUNIT_INVALID = 0,
186 /** No unit. */
187 STAMUNIT_NONE,
188 /** Number of calls. */
189 STAMUNIT_CALLS,
190 /** Count of whatever. */
191 STAMUNIT_COUNT,
192 /** Count of bytes. */
193 STAMUNIT_BYTES,
194 /** Count of bytes. */
195 STAMUNIT_PAGES,
196 /** Error count. */
197 STAMUNIT_ERRORS,
198 /** Number of occurences. */
199 STAMUNIT_OCCURENCES,
200 /** Ticks per call. */
201 STAMUNIT_TICKS_PER_CALL,
202 /** Ticks per occurence. */
203 STAMUNIT_TICKS_PER_OCCURENCE,
204 /** Ratio of good vs. bad. */
205 STAMUNIT_GOOD_BAD,
206 /** Megabytes. */
207 STAMUNIT_MEGABYTES,
208 /** Kilobytes. */
209 STAMUNIT_KILOBYTES,
210 /** Nano seconds. */
211 STAMUNIT_NS,
212 /** Nanoseconds per call. */
213 STAMUNIT_NS_PER_CALL,
214 /** Nanoseconds per call. */
215 STAMUNIT_NS_PER_OCCURENCE,
216 /** Percentage. */
217 STAMUNIT_PCT,
218 /** The end (exclusive). */
219 STAMUNIT_END
220} STAMUNIT;
221
222
223/** @def STAM_REL_U8_INC
224 * Increments a uint8_t sample by one.
225 *
226 * @param pCounter Pointer to the uint8_t variable to operate on.
227 */
228#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
229# define STAM_REL_U8_INC(pCounter) \
230 do { ++*(pCounter); } while (0)
231#else
232# define STAM_REL_U8_INC(pCounter) do { } while (0)
233#endif
234/** @def STAM_U8_INC
235 * Increments a uint8_t sample by one.
236 *
237 * @param pCounter Pointer to the uint8_t variable to operate on.
238 */
239#ifdef VBOX_WITH_STATISTICS
240# define STAM_U8_INC(pCounter) STAM_REL_U8_INC(pCounter)
241#else
242# define STAM_U8_INC(pCounter) do { } while (0)
243#endif
244
245
246/** @def STAM_REL_U8_DEC
247 * Decrements a uint8_t sample by one.
248 *
249 * @param pCounter Pointer to the uint8_t variable to operate on.
250 */
251#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
252# define STAM_REL_U8_DEC(pCounter) \
253 do { --*(pCounter); } while (0)
254#else
255# define STAM_REL_U8_DEC(pCounter) do { } while (0)
256#endif
257/** @def STAM_U8_DEC
258 * Decrements a uint8_t sample by one.
259 *
260 * @param pCounter Pointer to the uint8_t variable to operate on.
261 */
262#ifdef VBOX_WITH_STATISTICS
263# define STAM_U8_DEC(pCounter) STAM_REL_U8_DEC(pCounter)
264#else
265# define STAM_U8_DEC(pCounter) do { } while (0)
266#endif
267
268
269/** @def STAM_REL_U8_ADD
270 * Increments a uint8_t sample by a value.
271 *
272 * @param pCounter Pointer to the uint8_t variable to operate on.
273 * @param Addend The value to add.
274 */
275#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
276# define STAM_REL_U8_ADD(pCounter, Addend) \
277 do { *(pCounter) += (Addend); } while (0)
278#else
279# define STAM_REL_U8_ADD(pCounter, Addend) do { } while (0)
280#endif
281/** @def STAM_U8_ADD
282 * Increments a uint8_t sample by a value.
283 *
284 * @param pCounter Pointer to the uint8_t variable to operate on.
285 * @param Addend The value to add.
286 */
287#ifdef VBOX_WITH_STATISTICS
288# define STAM_U8_ADD(pCounter, Addend) STAM_REL_U8_ADD(pCounter, Addend
289#else
290# define STAM_U8_ADD(pCounter, Addend) do { } while (0)
291#endif
292
293
294/** @def STAM_REL_U16_INC
295 * Increments a uint16_t sample by one.
296 *
297 * @param pCounter Pointer to the uint16_t variable to operate on.
298 */
299#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
300# define STAM_REL_U16_INC(pCounter) \
301 do { ++*(pCounter); } while (0)
302#else
303# define STAM_REL_U16_INC(pCounter) do { } while (0)
304#endif
305/** @def STAM_U16_INC
306 * Increments a uint16_t sample by one.
307 *
308 * @param pCounter Pointer to the uint16_t variable to operate on.
309 */
310#ifdef VBOX_WITH_STATISTICS
311# define STAM_U16_INC(pCounter) STAM_REL_U16_INC(pCounter)
312#else
313# define STAM_U16_INC(pCounter) do { } while (0)
314#endif
315
316
317/** @def STAM_REL_U16_DEC
318 * Decrements a uint16_t sample by one.
319 *
320 * @param pCounter Pointer to the uint16_t variable to operate on.
321 */
322#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
323# define STAM_REL_U16_DEC(pCounter) \
324 do { --*(pCounter); } while (0)
325#else
326# define STAM_REL_U16_DEC(pCounter) do { } while (0)
327#endif
328/** @def STAM_U16_DEC
329 * Decrements a uint16_t sample by one.
330 *
331 * @param pCounter Pointer to the uint16_t variable to operate on.
332 */
333#ifdef VBOX_WITH_STATISTICS
334# define STAM_U16_DEC(pCounter) STAM_REL_U16_DEC(pCounter)
335#else
336# define STAM_U16_DEC(pCounter) do { } while (0)
337#endif
338
339
340/** @def STAM_REL_U16_INC
341 * Increments a uint16_t sample by a value.
342 *
343 * @param pCounter Pointer to the uint16_t variable to operate on.
344 * @param Addend The value to add.
345 */
346#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
347# define STAM_REL_U16_ADD(pCounter, Addend) \
348 do { *(pCounter) += (Addend); } while (0)
349#else
350# define STAM_REL_U16_ADD(pCounter, Addend) do { } while (0)
351#endif
352/** @def STAM_U16_INC
353 * Increments a uint16_t sample by a value.
354 *
355 * @param pCounter Pointer to the uint16_t variable to operate on.
356 * @param Addend The value to add.
357 */
358#ifdef VBOX_WITH_STATISTICS
359# define STAM_U16_ADD(pCounter, Addend) STAM_REL_U16_ADD(pCounter, Addend)
360#else
361# define STAM_U16_ADD(pCounter, Addend) do { } while (0)
362#endif
363
364
365/** @def STAM_REL_U32_INC
366 * Increments a uint32_t sample by one.
367 *
368 * @param pCounter Pointer to the uint32_t variable to operate on.
369 */
370#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
371# define STAM_REL_U32_INC(pCounter) \
372 do { ++*(pCounter); } while (0)
373#else
374# define STAM_REL_U32_INC(pCounter) do { } while (0)
375#endif
376/** @def STAM_U32_INC
377 * Increments a uint32_t sample by one.
378 *
379 * @param pCounter Pointer to the uint32_t variable to operate on.
380 */
381#ifdef VBOX_WITH_STATISTICS
382# define STAM_U32_INC(pCounter) STAM_REL_U32_INC(pCounter)
383#else
384# define STAM_U32_INC(pCounter) do { } while (0)
385#endif
386
387
388/** @def STAM_REL_U32_DEC
389 * Decrements a uint32_t sample by one.
390 *
391 * @param pCounter Pointer to the uint32_t variable to operate on.
392 */
393#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
394# define STAM_REL_U32_DEC(pCounter) \
395 do { --*(pCounter); } while (0)
396#else
397# define STAM_REL_U32_DEC(pCounter) do { } while (0)
398#endif
399/** @def STAM_U32_DEC
400 * Decrements a uint32_t sample by one.
401 *
402 * @param pCounter Pointer to the uint32_t variable to operate on.
403 */
404#ifdef VBOX_WITH_STATISTICS
405# define STAM_U32_DEC(pCounter) STAM_REL_U32_DEC(pCounter)
406#else
407# define STAM_U32_DEC(pCounter) do { } while (0)
408#endif
409
410
411/** @def STAM_REL_U32_ADD
412 * Increments a uint32_t sample by value.
413 *
414 * @param pCounter Pointer to the uint32_t variable to operate on.
415 * @param Addend The value to add.
416 */
417#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
418# define STAM_REL_U32_ADD(pCounter, Addend) \
419 do { *(pCounter) += (Addend); } while (0)
420#else
421# define STAM_REL_U32_ADD(pCounter, Addend) do { } while (0)
422#endif
423/** @def STAM_U32_ADD
424 * Increments a uint32_t sample by value.
425 *
426 * @param pCounter Pointer to the uint32_t variable to operate on.
427 * @param Addend The value to add.
428 */
429#ifdef VBOX_WITH_STATISTICS
430# define STAM_U32_ADD(pCounter, Addend) STAM_REL_U32_ADD(pCounter, Addend)
431#else
432# define STAM_U32_ADD(pCounter, Addend) do { } while (0)
433#endif
434
435
436/** @def STAM_REL_U64_INC
437 * Increments a uint64_t sample by one.
438 *
439 * @param pCounter Pointer to the uint64_t variable to operate on.
440 */
441#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
442# define STAM_REL_U64_INC(pCounter) \
443 do { ++*(pCounter); } while (0)
444#else
445# define STAM_REL_U64_INC(pCounter) do { } while (0)
446#endif
447/** @def STAM_U64_INC
448 * Increments a uint64_t sample by one.
449 *
450 * @param pCounter Pointer to the uint64_t variable to operate on.
451 */
452#ifdef VBOX_WITH_STATISTICS
453# define STAM_U64_INC(pCounter) STAM_REL_U64_INC(pCounter)
454#else
455# define STAM_U64_INC(pCounter) do { } while (0)
456#endif
457
458
459/** @def STAM_REL_U64_DEC
460 * Decrements a uint64_t sample by one.
461 *
462 * @param pCounter Pointer to the uint64_t variable to operate on.
463 */
464#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
465# define STAM_REL_U64_DEC(pCounter) \
466 do { --*(pCounter); } while (0)
467#else
468# define STAM_REL_U64_DEC(pCounter) do { } while (0)
469#endif
470/** @def STAM_U64_DEC
471 * Decrements a uint64_t sample by one.
472 *
473 * @param pCounter Pointer to the uint64_t variable to operate on.
474 */
475#ifdef VBOX_WITH_STATISTICS
476# define STAM_U64_DEC(pCounter) STAM_REL_U64_DEC(pCounter)
477#else
478# define STAM_U64_DEC(pCounter) do { } while (0)
479#endif
480
481
482/** @def STAM_REL_U64_ADD
483 * Increments a uint64_t sample by a value.
484 *
485 * @param pCounter Pointer to the uint64_t variable to operate on.
486 * @param Addend The value to add.
487 */
488#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
489# define STAM_REL_U64_ADD(pCounter, Addend) \
490 do { *(pCounter) += (Addend); } while (0)
491#else
492# define STAM_REL_U64_ADD(pCounter, Addend) do { } while (0)
493#endif
494/** @def STAM_U64_ADD
495 * Increments a uint64_t sample by a value.
496 *
497 * @param pCounter Pointer to the uint64_t variable to operate on.
498 * @param Addend The value to add.
499 */
500#ifdef VBOX_WITH_STATISTICS
501# define STAM_U64_ADD(pCounter, Addend) STAM_REL_U64_ADD(pCounter, Addend)
502#else
503# define STAM_U64_ADD(pCounter, Addend) do { } while (0)
504#endif
505
506
507/**
508 * Counter sample - STAMTYPE_COUNTER.
509 */
510typedef struct STAMCOUNTER
511{
512 /** The current count. */
513 volatile uint64_t c;
514} STAMCOUNTER;
515/** Pointer to a counter. */
516typedef STAMCOUNTER *PSTAMCOUNTER;
517/** Pointer to a const counter. */
518typedef const STAMCOUNTER *PCSTAMCOUNTER;
519
520
521/** @def STAM_REL_COUNTER_INC
522 * Increments a counter sample by one.
523 *
524 * @param pCounter Pointer to the STAMCOUNTER structure to operate on.
525 */
526#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
527# define STAM_REL_COUNTER_INC(pCounter) \
528 do { (pCounter)->c++; } while (0)
529#else
530# define STAM_REL_COUNTER_INC(pCounter) do { } while (0)
531#endif
532/** @def STAM_COUNTER_INC
533 * Increments a counter sample by one.
534 *
535 * @param pCounter Pointer to the STAMCOUNTER structure to operate on.
536 */
537#ifdef VBOX_WITH_STATISTICS
538# define STAM_COUNTER_INC(pCounter) STAM_REL_COUNTER_INC(pCounter)
539#else
540# define STAM_COUNTER_INC(pCounter) do { } while (0)
541#endif
542
543
544/** @def STAM_REL_COUNTER_DEC
545 * Decrements a counter sample by one.
546 *
547 * @param pCounter Pointer to the STAMCOUNTER structure to operate on.
548 */
549#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
550# define STAM_REL_COUNTER_DEC(pCounter) \
551 do { (pCounter)->c--; } while (0)
552#else
553# define STAM_REL_COUNTER_DEC(pCounter) do { } while (0)
554#endif
555/** @def STAM_COUNTER_DEC
556 * Decrements a counter sample by one.
557 *
558 * @param pCounter Pointer to the STAMCOUNTER structure to operate on.
559 */
560#ifdef VBOX_WITH_STATISTICS
561# define STAM_COUNTER_DEC(pCounter) STAM_REL_COUNTER_DEC(pCounter)
562#else
563# define STAM_COUNTER_DEC(pCounter) do { } while (0)
564#endif
565
566
567/** @def STAM_REL_COUNTER_ADD
568 * Increments a counter sample by a value.
569 *
570 * @param pCounter Pointer to the STAMCOUNTER structure to operate on.
571 * @param Addend The value to add to the counter.
572 */
573#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
574# define STAM_REL_COUNTER_ADD(pCounter, Addend) \
575 do { (pCounter)->c += (Addend); } while (0)
576#else
577# define STAM_REL_COUNTER_ADD(pCounter, Addend) do { } while (0)
578#endif
579/** @def STAM_COUNTER_ADD
580 * Increments a counter sample by a value.
581 *
582 * @param pCounter Pointer to the STAMCOUNTER structure to operate on.
583 * @param Addend The value to add to the counter.
584 */
585#ifdef VBOX_WITH_STATISTICS
586# define STAM_COUNTER_ADD(pCounter, Addend) STAM_REL_COUNTER_ADD(pCounter, Addend)
587#else
588# define STAM_COUNTER_ADD(pCounter, Addend) do { } while (0)
589#endif
590
591
592/** @def STAM_REL_COUNTER_RESET
593 * Resets the statistics sample.
594 */
595#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
596# define STAM_REL_COUNTER_RESET(pCounter) do { (pCounter)->c = 0; } while (0)
597#else
598# define STAM_REL_COUNTER_RESET(pCounter) do { } while (0)
599#endif
600/** @def STAM_COUNTER_RESET
601 * Resets the statistics sample.
602 */
603#ifndef VBOX_WITH_STATISTICS
604# define STAM_COUNTER_RESET(pCounter) STAM_REL_COUNTER_RESET(pCounter)
605#else
606# define STAM_COUNTER_RESET(pCounter) do { } while (0)
607#endif
608
609
610
611/**
612 * Profiling sample - STAMTYPE_PROFILE.
613 */
614typedef struct STAMPROFILE
615{
616 /** Number of periods. */
617 volatile uint64_t cPeriods;
618 /** Total count of ticks. */
619 volatile uint64_t cTicks;
620 /** Maximum tick count during a sampling. */
621 volatile uint64_t cTicksMax;
622 /** Minimum tick count during a sampling. */
623 volatile uint64_t cTicksMin;
624} STAMPROFILE;
625/** Pointer to a profile sample. */
626typedef STAMPROFILE *PSTAMPROFILE;
627/** Pointer to a const profile sample. */
628typedef const STAMPROFILE *PCSTAMPROFILE;
629
630
631/** @def STAM_REL_PROFILE_START
632 * Samples the start time of a profiling period.
633 *
634 * @param pProfile Pointer to the STAMPROFILE structure to operate on.
635 * @param Prefix Identifier prefix used to internal variables.
636 */
637#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
638# define STAM_REL_PROFILE_START(pProfile, Prefix) \
639 uint64_t Prefix##_tsStart; \
640 STAM_GET_TS(Prefix##_tsStart)
641#else
642# define STAM_REL_PROFILE_START(pProfile, Prefix) do { } while (0)
643#endif
644/** @def STAM_PROFILE_START
645 * Samples the start time of a profiling period.
646 *
647 * @param pProfile Pointer to the STAMPROFILE structure to operate on.
648 * @param Prefix Identifier prefix used to internal variables.
649 */
650#ifdef VBOX_WITH_STATISTICS
651# define STAM_PROFILE_START(pProfile, Prefix) STAM_REL_PROFILE_START(pProfile, Prefix)
652#else
653# define STAM_PROFILE_START(pProfile, Prefix) do { } while (0)
654#endif
655
656/** @def STAM_REL_PROFILE_STOP
657 * Samples the stop time of a profiling period and updates the sample.
658 *
659 * @param pProfile Pointer to the STAMPROFILE structure to operate on.
660 * @param Prefix Identifier prefix used to internal variables.
661 */
662#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
663# define STAM_REL_PROFILE_STOP(pProfile, Prefix) \
664 do { \
665 uint64_t Prefix##_cTicks; \
666 uint64_t Prefix##_tsStop; \
667 STAM_GET_TS(Prefix##_tsStop); \
668 Prefix##_cTicks = Prefix##_tsStop - Prefix##_tsStart; \
669 (pProfile)->cTicks += Prefix##_cTicks; \
670 (pProfile)->cPeriods++; \
671 if ((pProfile)->cTicksMax < Prefix##_cTicks) \
672 (pProfile)->cTicksMax = Prefix##_cTicks; \
673 if ((pProfile)->cTicksMin > Prefix##_cTicks) \
674 (pProfile)->cTicksMin = Prefix##_cTicks; \
675 } while (0)
676#else
677# define STAM_REL_PROFILE_STOP(pProfile, Prefix) do { } while (0)
678#endif
679/** @def STAM_PROFILE_STOP
680 * Samples the stop time of a profiling period and updates the sample.
681 *
682 * @param pProfile Pointer to the STAMPROFILE structure to operate on.
683 * @param Prefix Identifier prefix used to internal variables.
684 */
685#ifdef VBOX_WITH_STATISTICS
686# define STAM_PROFILE_STOP(pProfile, Prefix) STAM_REL_PROFILE_STOP(pProfile, Prefix)
687#else
688# define STAM_PROFILE_STOP(pProfile, Prefix) do { } while (0)
689#endif
690
691
692/** @def STAM_REL_PROFILE_STOP_EX
693 * Samples the stop time of a profiling period and updates both the sample
694 * and an attribution sample.
695 *
696 * @param pProfile Pointer to the STAMPROFILE structure to operate on.
697 * @param pProfile2 Pointer to the STAMPROFILE structure which this
698 * interval should be attributed to as well. This may be NULL.
699 * @param Prefix Identifier prefix used to internal variables.
700 */
701#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
702# define STAM_REL_PROFILE_STOP_EX(pProfile, pProfile2, Prefix) \
703 do { \
704 uint64_t Prefix##_cTicks; \
705 uint64_t Prefix##_tsStop; \
706 STAM_GET_TS(Prefix##_tsStop); \
707 Prefix##_cTicks = Prefix##_tsStop - Prefix##_tsStart; \
708 (pProfile)->cTicks += Prefix##_cTicks; \
709 (pProfile)->cPeriods++; \
710 if ((pProfile)->cTicksMax < Prefix##_cTicks) \
711 (pProfile)->cTicksMax = Prefix##_cTicks; \
712 if ((pProfile)->cTicksMin > Prefix##_cTicks) \
713 (pProfile)->cTicksMin = Prefix##_cTicks; \
714 \
715 if ((pProfile2)) \
716 { \
717 (pProfile2)->cTicks += Prefix##_cTicks; \
718 (pProfile2)->cPeriods++; \
719 if ((pProfile2)->cTicksMax < Prefix##_cTicks) \
720 (pProfile2)->cTicksMax = Prefix##_cTicks; \
721 if ((pProfile2)->cTicksMin > Prefix##_cTicks) \
722 (pProfile2)->cTicksMin = Prefix##_cTicks; \
723 } \
724 } while (0)
725#else
726# define STAM_REL_PROFILE_STOP_EX(pProfile, pProfile2, Prefix) do { } while (0)
727#endif
728/** @def STAM_PROFILE_STOP_EX
729 * Samples the stop time of a profiling period and updates both the sample
730 * and an attribution sample.
731 *
732 * @param pProfile Pointer to the STAMPROFILE structure to operate on.
733 * @param pProfile2 Pointer to the STAMPROFILE structure which this
734 * interval should be attributed to as well. This may be NULL.
735 * @param Prefix Identifier prefix used to internal variables.
736 */
737#ifdef VBOX_WITH_STATISTICS
738# define STAM_PROFILE_STOP_EX(pProfile, pProfile2, Prefix) STAM_REL_PROFILE_STOP_EX(pProfile, pProfile2, Prefix)
739#else
740# define STAM_PROFILE_STOP_EX(pProfile, pProfile2, Prefix) do { } while (0)
741#endif
742
743
744/**
745 * Advanced profiling sample - STAMTYPE_PROFILE_ADV.
746 *
747 * Identical to a STAMPROFILE sample, but the start timestamp
748 * is stored after the STAMPROFILE structure so the sampling
749 * can start and stop in different functions.
750 */
751typedef struct STAMPROFILEADV
752{
753 /** The STAMPROFILE core. */
754 STAMPROFILE Core;
755 /** The start timestamp. */
756 volatile uint64_t tsStart;
757} STAMPROFILEADV;
758/** Pointer to a advanced profile sample. */
759typedef STAMPROFILEADV *PSTAMPROFILEADV;
760/** Pointer to a const advanced profile sample. */
761typedef const STAMPROFILEADV *PCSTAMPROFILEADV;
762
763
764/** @def STAM_REL_PROFILE_ADV_START
765 * Samples the start time of a profiling period.
766 *
767 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
768 * @param Prefix Identifier prefix used to internal variables.
769 */
770#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
771# define STAM_REL_PROFILE_ADV_START(pProfileAdv, Prefix) \
772 STAM_GET_TS((pProfileAdv)->tsStart)
773#else
774# define STAM_REL_PROFILE_ADV_START(pProfileAdv, Prefix) do { } while (0)
775#endif
776/** @def STAM_PROFILE_ADV_START
777 * Samples the start time of a profiling period.
778 *
779 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
780 * @param Prefix Identifier prefix used to internal variables.
781 */
782#ifdef VBOX_WITH_STATISTICS
783# define STAM_PROFILE_ADV_START(pProfileAdv, Prefix) STAM_REL_PROFILE_ADV_START(pProfileAdv, Prefix)
784#else
785# define STAM_PROFILE_ADV_START(pProfileAdv, Prefix) do { } while (0)
786#endif
787
788
789/** @def STAM_REL_PROFILE_ADV_STOP
790 * Samples the stop time of a profiling period and updates the sample.
791 *
792 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
793 * @param Prefix Identifier prefix used to internal variables.
794 */
795#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
796# define STAM_REL_PROFILE_ADV_STOP(pProfileAdv, Prefix) \
797 do { \
798 uint64_t Prefix##_tsStop; \
799 STAM_GET_TS(Prefix##_tsStop); \
800 if ((pProfileAdv)->tsStart) \
801 { \
802 uint64_t Prefix##_cTicks = Prefix##_tsStop - (pProfileAdv)->tsStart; \
803 (pProfileAdv)->tsStart = 0; \
804 (pProfileAdv)->Core.cTicks += Prefix##_cTicks; \
805 (pProfileAdv)->Core.cPeriods++; \
806 if ((pProfileAdv)->Core.cTicksMax < Prefix##_cTicks) \
807 (pProfileAdv)->Core.cTicksMax = Prefix##_cTicks; \
808 if ((pProfileAdv)->Core.cTicksMin > Prefix##_cTicks) \
809 (pProfileAdv)->Core.cTicksMin = Prefix##_cTicks; \
810 } \
811 } while (0)
812#else
813# define STAM_REL_PROFILE_ADV_STOP(pProfileAdv, Prefix) do { } while (0)
814#endif
815/** @def STAM_PROFILE_ADV_STOP
816 * Samples the stop time of a profiling period and updates the sample.
817 *
818 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
819 * @param Prefix Identifier prefix used to internal variables.
820 */
821#ifdef VBOX_WITH_STATISTICS
822# define STAM_PROFILE_ADV_STOP(pProfileAdv, Prefix) STAM_REL_PROFILE_ADV_STOP(pProfileAdv, Prefix)
823#else
824# define STAM_PROFILE_ADV_STOP(pProfileAdv, Prefix) do { } while (0)
825#endif
826
827
828/** @def STAM_REL_PROFILE_ADV_SUSPEND
829 * Suspends the sampling for a while. This can be useful to exclude parts
830 * covered by other samples without screwing up the count, and average+min times.
831 *
832 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
833 * @param Prefix Identifier prefix used to internal variables. The prefix
834 * must match that of the resume one since it stores the
835 * suspend time in a stack variable.
836 */
837#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
838# define STAM_REL_PROFILE_ADV_SUSPEND(pProfileAdv, Prefix) \
839 uint64_t Prefix##_tsSuspend; \
840 STAM_GET_TS(Prefix##_tsSuspend)
841#else
842# define STAM_REL_PROFILE_ADV_SUSPEND(pProfileAdv, Prefix) do { } while (0)
843#endif
844/** @def STAM_PROFILE_ADV_SUSPEND
845 * Suspends the sampling for a while. This can be useful to exclude parts
846 * covered by other samples without screwing up the count, and average+min times.
847 *
848 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
849 * @param Prefix Identifier prefix used to internal variables. The prefix
850 * must match that of the resume one since it stores the
851 * suspend time in a stack variable.
852 */
853#ifdef VBOX_WITH_STATISTICS
854# define STAM_PROFILE_ADV_SUSPEND(pProfileAdv, Prefix) STAM_REL_PROFILE_ADV_SUSPEND(pProfileAdv, Prefix)
855#else
856# define STAM_PROFILE_ADV_SUSPEND(pProfileAdv, Prefix) do { } while (0)
857#endif
858
859
860/** @def STAM_REL_PROFILE_ADV_RESUME
861 * Counter to STAM_REL_PROFILE_ADV_SUSPEND.
862 *
863 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
864 * @param Prefix Identifier prefix used to internal variables. This must
865 * match the one used with the SUSPEND!
866 */
867#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
868# define STAM_REL_PROFILE_ADV_RESUME(pProfileAdv, Prefix) \
869 do { \
870 uint64_t Prefix##_tsNow; \
871 STAM_GET_TS(Prefix##_tsNow); \
872 (pProfileAdv)->tsStart += Prefix##_tsNow - Prefix##_tsSuspend; \
873 } while (0)
874#else
875# define STAM_REL_PROFILE_ADV_RESUME(pProfileAdv, Prefix) do { } while (0)
876#endif
877/** @def STAM_PROFILE_ADV_RESUME
878 * Counter to STAM_PROFILE_ADV_SUSPEND.
879 *
880 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
881 * @param Prefix Identifier prefix used to internal variables. This must
882 * match the one used with the SUSPEND!
883 */
884#ifdef VBOX_WITH_STATISTICS
885# define STAM_PROFILE_ADV_RESUME(pProfileAdv, Prefix) STAM_REL_PROFILE_ADV_RESUME(pProfileAdv, Prefix)
886#else
887# define STAM_PROFILE_ADV_RESUME(pProfileAdv, Prefix) do { } while (0)
888#endif
889
890
891/** @def STAM_REL_PROFILE_ADV_STOP_EX
892 * Samples the stop time of a profiling period and updates both the sample
893 * and an attribution sample.
894 *
895 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
896 * @param pProfile2 Pointer to the STAMPROFILE structure which this
897 * interval should be attributed to as well. This may be NULL.
898 * @param Prefix Identifier prefix used to internal variables.
899 */
900#ifndef VBOX_WITHOUT_RELEASE_STATISTICS
901# define STAM_REL_PROFILE_ADV_STOP_EX(pProfileAdv, pProfile2, Prefix) \
902 do { \
903 uint64_t Prefix##_tsStop; \
904 STAM_GET_TS(Prefix##_tsStop); \
905 if ((pProfileAdv)->tsStart) \
906 { \
907 uint64_t Prefix##_cTicks = Prefix##_tsStop - (pProfileAdv)->tsStart; \
908 (pProfileAdv)->tsStart = 0; \
909 (pProfileAdv)->Core.cTicks += Prefix##_cTicks; \
910 (pProfileAdv)->Core.cPeriods++; \
911 if ((pProfileAdv)->Core.cTicksMax < Prefix##_cTicks) \
912 (pProfileAdv)->Core.cTicksMax = Prefix##_cTicks; \
913 if ((pProfileAdv)->Core.cTicksMin > Prefix##_cTicks) \
914 (pProfileAdv)->Core.cTicksMin = Prefix##_cTicks; \
915 if ((pProfile2)) \
916 { \
917 (pProfile2)->cTicks += Prefix##_cTicks; \
918 (pProfile2)->cPeriods++; \
919 if ((pProfile2)->cTicksMax < Prefix##_cTicks) \
920 (pProfile2)->cTicksMax = Prefix##_cTicks; \
921 if ((pProfile2)->cTicksMin > Prefix##_cTicks) \
922 (pProfile2)->cTicksMin = Prefix##_cTicks; \
923 } \
924 } \
925 } while (0)
926#else
927# define STAM_REL_PROFILE_ADV_STOP_EX(pProfileAdv, pProfile2, Prefix) do { } while (0)
928#endif
929/** @def STAM_PROFILE_ADV_STOP_EX
930 * Samples the stop time of a profiling period and updates both the sample
931 * and an attribution sample.
932 *
933 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on.
934 * @param pProfile2 Pointer to the STAMPROFILE structure which this
935 * interval should be attributed to as well. This may be NULL.
936 * @param Prefix Identifier prefix used to internal variables.
937 */
938#ifdef VBOX_WITH_STATISTICS
939# define STAM_PROFILE_ADV_STOP_EX(pProfileAdv, pProfile2, Prefix) STAM_REL_PROFILE_ADV_STOP_EX(pProfileAdv, pProfile2, Prefix)
940#else
941# define STAM_PROFILE_ADV_STOP_EX(pProfileAdv, pProfile2, Prefix) do { } while (0)
942#endif
943
944
945/**
946 * Ratio of A to B, uint32_t types.
947 * @remark Use STAM_STATS or STAM_REL_STATS for modifying A & B values.
948 */
949typedef struct STAMRATIOU32
950{
951 /** Sample A. */
952 uint32_t volatile u32A;
953 /** Sample B. */
954 uint32_t volatile u32B;
955} STAMRATIOU32;
956/** Pointer to a uint32_t ratio. */
957typedef STAMRATIOU32 *PSTAMRATIOU32;
958/** Pointer to const a uint32_t ratio. */
959typedef const STAMRATIOU32 *PCSTAMRATIOU32;
960
961
962
963
964/** @defgroup grp_stam_r3 The STAM Host Context Ring 3 API
965 * @ingroup grp_stam
966 * @{
967 */
968
969VMMR3DECL(int) STAMR3InitUVM(PUVM pUVM);
970VMMR3DECL(void) STAMR3TermUVM(PUVM pUVM);
971VMMR3DECL(int) STAMR3RegisterU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
972 const char *pszName, STAMUNIT enmUnit, const char *pszDesc);
973VMMR3DECL(int) STAMR3Register(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
974 const char *pszName, STAMUNIT enmUnit, const char *pszDesc);
975
976/** @def STAM_REL_REG
977 * Registers a statistics sample.
978 *
979 * @param pVM VM Handle.
980 * @param pvSample Pointer to the sample.
981 * @param enmType Sample type. This indicates what pvSample is pointing at.
982 * @param pszName Sample name. The name is on this form "/<component>/<sample>".
983 * Further nesting is possible.
984 * @param enmUnit Sample unit.
985 * @param pszDesc Sample description.
986 */
987#define STAM_REL_REG(pVM, pvSample, enmType, pszName, enmUnit, pszDesc) \
988 STAM_REL_STATS({ int rcStam = STAMR3Register(pVM, pvSample, enmType, STAMVISIBILITY_ALWAYS, pszName, enmUnit, pszDesc); \
989 AssertRC(rcStam); })
990/** @def STAM_REG
991 * Registers a statistics sample if statistics are enabled.
992 *
993 * @param pVM VM Handle.
994 * @param pvSample Pointer to the sample.
995 * @param enmType Sample type. This indicates what pvSample is pointing at.
996 * @param pszName Sample name. The name is on this form "/<component>/<sample>".
997 * Further nesting is possible.
998 * @param enmUnit Sample unit.
999 * @param pszDesc Sample description.
1000 */
1001#define STAM_REG(pVM, pvSample, enmType, pszName, enmUnit, pszDesc) \
1002 STAM_STATS({STAM_REL_REG(pVM, pvSample, enmType, pszName, enmUnit, pszDesc);})
1003
1004/** @def STAM_REL_REG_USED
1005 * Registers a statistics sample which only shows when used.
1006 *
1007 * @param pVM VM Handle.
1008 * @param pvSample Pointer to the sample.
1009 * @param enmType Sample type. This indicates what pvSample is pointing at.
1010 * @param pszName Sample name. The name is on this form "/<component>/<sample>".
1011 * Further nesting is possible.
1012 * @param enmUnit Sample unit.
1013 * @param pszDesc Sample description.
1014 */
1015#define STAM_REL_REG_USED(pVM, pvSample, enmType, pszName, enmUnit, pszDesc) \
1016 STAM_REL_STATS({ int rcStam = STAMR3Register(pVM, pvSample, enmType, STAMVISIBILITY_USED, pszName, enmUnit, pszDesc); \
1017 AssertRC(rcStam);})
1018/** @def STAM_REG_USED
1019 * Registers a statistics sample which only shows when used, if statistics are enabled.
1020 *
1021 * @param pVM VM Handle.
1022 * @param pvSample Pointer to the sample.
1023 * @param enmType Sample type. This indicates what pvSample is pointing at.
1024 * @param pszName Sample name. The name is on this form "/<component>/<sample>".
1025 * Further nesting is possible.
1026 * @param enmUnit Sample unit.
1027 * @param pszDesc Sample description.
1028 */
1029#define STAM_REG_USED(pVM, pvSample, enmType, pszName, enmUnit, pszDesc) \
1030 STAM_STATS({ STAM_REL_REG_USED(pVM, pvSample, enmType, pszName, enmUnit, pszDesc); })
1031
1032VMMR3DECL(int) STAMR3RegisterFU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
1033 const char *pszDesc, const char *pszName, ...);
1034VMMR3DECL(int) STAMR3RegisterF(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
1035 const char *pszDesc, const char *pszName, ...);
1036VMMR3DECL(int) STAMR3RegisterVU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
1037 const char *pszDesc, const char *pszName, va_list args);
1038VMMR3DECL(int) STAMR3RegisterV(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
1039 const char *pszDesc, const char *pszName, va_list args);
1040
1041/**
1042 * Resets the sample.
1043 * @param pVM The VM handle.
1044 * @param pvSample The sample registered using STAMR3RegisterCallback.
1045 */
1046typedef void FNSTAMR3CALLBACKRESET(PVM pVM, void *pvSample);
1047/** Pointer to a STAM sample reset callback. */
1048typedef FNSTAMR3CALLBACKRESET *PFNSTAMR3CALLBACKRESET;
1049
1050/**
1051 * Prints the sample into the buffer.
1052 *
1053 * @param pVM The VM handle.
1054 * @param pvSample The sample registered using STAMR3RegisterCallback.
1055 * @param pszBuf The buffer to print into.
1056 * @param cchBuf The size of the buffer.
1057 */
1058typedef void FNSTAMR3CALLBACKPRINT(PVM pVM, void *pvSample, char *pszBuf, size_t cchBuf);
1059/** Pointer to a STAM sample print callback. */
1060typedef FNSTAMR3CALLBACKPRINT *PFNSTAMR3CALLBACKPRINT;
1061
1062VMMR3DECL(int) STAMR3RegisterCallback(PVM pVM, void *pvSample, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
1063 PFNSTAMR3CALLBACKRESET pfnReset, PFNSTAMR3CALLBACKPRINT pfnPrint,
1064 const char *pszDesc, const char *pszName, ...);
1065VMMR3DECL(int) STAMR3RegisterCallbackV(PVM pVM, void *pvSample, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
1066 PFNSTAMR3CALLBACKRESET pfnReset, PFNSTAMR3CALLBACKPRINT pfnPrint,
1067 const char *pszDesc, const char *pszName, va_list args);
1068VMMR3DECL(int) STAMR3DeregisterU(PUVM pUVM, void *pvSample);
1069VMMR3DECL(int) STAMR3Deregister(PVM pVM, void *pvSample);
1070
1071/** @def STAM_REL_DEREG
1072 * Deregisters a statistics sample if statistics are enabled.
1073 *
1074 * @param pVM VM Handle.
1075 * @param pvSample Pointer to the sample.
1076 */
1077#define STAM_REL_DEREG(pVM, pvSample) \
1078 STAM_REL_STATS({ int rcStam = STAMR3Deregister(pVM, pvSample); AssertRC(rcStam); })
1079/** @def STAM_DEREG
1080 * Deregisters a statistics sample if statistics are enabled.
1081 *
1082 * @param pVM VM Handle.
1083 * @param pvSample Pointer to the sample.
1084 */
1085#define STAM_DEREG(pVM, pvSample) \
1086 STAM_STATS({ STAM_REL_DEREG(pVM, pvSample); })
1087
1088VMMR3DECL(int) STAMR3ResetU(PUVM pUVM, const char *pszPat);
1089VMMR3DECL(int) STAMR3Reset(PVM pVM, const char *pszPat);
1090VMMR3DECL(int) STAMR3SnapshotU(PUVM pUVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc);
1091VMMR3DECL(int) STAMR3Snapshot(PVM pVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc);
1092VMMR3DECL(int) STAMR3SnapshotFreeU(PUVM pUVM, char *pszSnapshot);
1093VMMR3DECL(int) STAMR3SnapshotFree(PVM pVM, char *pszSnapshot);
1094VMMR3DECL(int) STAMR3DumpU(PUVM pUVM, const char *pszPat);
1095VMMR3DECL(int) STAMR3Dump(PVM pVM, const char *pszPat);
1096VMMR3DECL(int) STAMR3DumpToReleaseLogU(PUVM pUVM, const char *pszPat);
1097VMMR3DECL(int) STAMR3DumpToReleaseLog(PVM pVM, const char *pszPat);
1098VMMR3DECL(int) STAMR3PrintU(PUVM pUVM, const char *pszPat);
1099VMMR3DECL(int) STAMR3Print(PVM pVM, const char *pszPat);
1100
1101/**
1102 * Callback function for STAMR3Enum().
1103 *
1104 * @returns non-zero to halt the enumeration.
1105 *
1106 * @param pszName The name of the sample.
1107 * @param enmType The type.
1108 * @param pvSample Pointer to the data. enmType indicates the format of this data.
1109 * @param enmUnit The unit.
1110 * @param enmVisibility The visibility.
1111 * @param pszDesc The description.
1112 * @param pvUser The pvUser argument given to STAMR3Enum().
1113 */
1114typedef DECLCALLBACK(int) FNSTAMR3ENUM(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
1115 STAMVISIBILITY enmVisiblity, const char *pszDesc, void *pvUser);
1116/** Pointer to a FNSTAMR3ENUM(). */
1117typedef FNSTAMR3ENUM *PFNSTAMR3ENUM;
1118
1119VMMR3DECL(int) STAMR3EnumU(PUVM pUVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser);
1120VMMR3DECL(int) STAMR3Enum(PVM pVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser);
1121VMMR3DECL(const char *) STAMR3GetUnit(STAMUNIT enmUnit);
1122
1123/** @} */
1124
1125/** @} */
1126
1127__END_DECLS
1128
1129#endif
1130
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette