Changeset 13598 in vbox
- Timestamp:
- Oct 27, 2008 7:36:49 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/stam.h
r12989 r13598 967 967 */ 968 968 969 VMMR3DECL(int) STAMR3InitUVM(PUVM pUVM);969 VMMR3DECL(int) STAMR3InitUVM(PUVM pUVM); 970 970 VMMR3DECL(void) STAMR3TermUVM(PUVM pUVM); 971 VMMR3DECL(int) STAMR3RegisterU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,971 VMMR3DECL(int) STAMR3RegisterU(PUVM pUVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, 972 972 const char *pszName, STAMUNIT enmUnit, const char *pszDesc); 973 VMMR3DECL(int) STAMR3Register(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,973 VMMR3DECL(int) STAMR3Register(PVM pVM, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, 974 974 const char *pszName, STAMUNIT enmUnit, const char *pszDesc); 975 975 … … 1086 1086 STAM_STATS({ STAM_REL_DEREG(pVM, pvSample); }) 1087 1087 1088 VMMR3DECL(int) STAMR3ResetU(PUVM pUVM, const char *pszPat);1089 VMMR3DECL(int) STAMR3Reset(PVM pVM, const char *pszPat);1090 VMMR3DECL(int) STAMR3SnapshotU(PUVM pUVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc);1091 VMMR3DECL(int) STAMR3Snapshot(PVM pVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc);1092 VMMR3DECL(int) STAMR3SnapshotFreeU(PUVM pUVM, char *pszSnapshot);1093 VMMR3DECL(int) STAMR3SnapshotFree(PVM pVM, char *pszSnapshot);1094 VMMR3DECL(int) STAMR3DumpU(PUVM pUVM, const char *pszPat);1095 VMMR3DECL(int) STAMR3Dump(PVM pVM, const char *pszPat);1096 VMMR3DECL(int) STAMR3DumpToReleaseLogU(PUVM pUVM, const char *pszPat);1097 VMMR3DECL(int) STAMR3DumpToReleaseLog(PVM pVM, const char *pszPat);1098 VMMR3DECL(int) STAMR3PrintU(PUVM pUVM, const char *pszPat);1099 VMMR3DECL(int) STAMR3Print(PVM pVM, const char *pszPat);1088 VMMR3DECL(int) STAMR3ResetU(PUVM pUVM, const char *pszPat); 1089 VMMR3DECL(int) STAMR3Reset(PVM pVM, const char *pszPat); 1090 VMMR3DECL(int) STAMR3SnapshotU(PUVM pUVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc); 1091 VMMR3DECL(int) STAMR3Snapshot(PVM pVM, const char *pszPat, char **ppszSnapshot, size_t *pcchSnapshot, bool fWithDesc); 1092 VMMR3DECL(int) STAMR3SnapshotFreeU(PUVM pUVM, char *pszSnapshot); 1093 VMMR3DECL(int) STAMR3SnapshotFree(PVM pVM, char *pszSnapshot); 1094 VMMR3DECL(int) STAMR3DumpU(PUVM pUVM, const char *pszPat); 1095 VMMR3DECL(int) STAMR3Dump(PVM pVM, const char *pszPat); 1096 VMMR3DECL(int) STAMR3DumpToReleaseLogU(PUVM pUVM, const char *pszPat); 1097 VMMR3DECL(int) STAMR3DumpToReleaseLog(PVM pVM, const char *pszPat); 1098 VMMR3DECL(int) STAMR3PrintU(PUVM pUVM, const char *pszPat); 1099 VMMR3DECL(int) STAMR3Print(PVM pVM, const char *pszPat); 1100 1100 1101 1101 /** … … 1117 1117 typedef FNSTAMR3ENUM *PFNSTAMR3ENUM; 1118 1118 1119 VMMR3DECL(int) STAMR3EnumU(PUVM pUVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser);1120 VMMR3DECL(int) STAMR3Enum(PVM pVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser);1119 VMMR3DECL(int) STAMR3EnumU(PUVM pUVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser); 1120 VMMR3DECL(int) STAMR3Enum(PVM pVM, const char *pszPat, PFNSTAMR3ENUM pfnEnum, void *pvUser); 1121 1121 VMMR3DECL(const char *) STAMR3GetUnit(STAMUNIT enmUnit); 1122 1122 … … 1128 1128 1129 1129 #endif 1130 -
trunk/src/VBox/VMM/STAM.cpp
r13477 r13598 23 23 * 24 24 * The purpose for the statistics manager is to present the rest of the system 25 * with a somewhat uniform way of accessing VMM statistics. STAM sports a couple26 * of different APIs for accessing them: STAMR3EnumU, STAMR3SnapshotU,27 * STAMR3DumpU, STAMR3DumpToReleaseLogU . Main is exposing the XML based one,28 * STAMR3SnapshotU.25 * with a somewhat uniform way of accessing VMM statistics. STAM sports a 26 * couple of different APIs for accessing them: STAMR3EnumU, STAMR3SnapshotU, 27 * STAMR3DumpU, STAMR3DumpToReleaseLogU and the debugger. Main is exposing the 28 * XML based one, STAMR3SnapshotU. 29 29 * 30 30 * The rest of the VMM together with the devices and drivers registers their 31 * statistics with STAM giving them a name. The name is like hierarchical, the 32 * components separated by slashes ('/'). 31 * statistics with STAM giving them a name. The name is hierarchical, the 32 * components separated by slashes ('/') and must start with a slash. 33 * 34 * Each item registered with STAM - also, half incorrectly, called a sample - 35 * has a type, unit, visibility, data pointer and description associated with it 36 * in addition to the name (described above). The type tells STAM what kind of 37 * structure the pointer is pointing to. The visibility allows unused 38 * statistics from cluttering the output or showing up in the GUI. All the bits 39 * together makes STAM able to present the items in a sensible way to the user. 40 * Some types also allows STAM to reset the data, which is very convenient when 41 * digging into specific operations and such. 42 * 43 * PS. The VirtualBox Debugger GUI has a viewer for inspecting the statistics 44 * STAM provides. You will also find statistics in the release and debug logs. 45 * And as mentioned in the introduction, the debugger console features a couple 46 * of command: .stats and .statsreset. 33 47 * 34 48 * @see grp_stam … … 123 137 * Internal Functions * 124 138 *******************************************************************************/ 125 static int stamR3RegisterU(PUVM pUVM, void *pvSample, PFNSTAMR3CALLBACKRESET pfnReset, PFNSTAMR3CALLBACKPRINT pfnPrint,126 STAMTYPE enmType, STAMVISIBILITY enmVisibility, const char *pszName, STAMUNIT enmUnit, const char *pszDesc);127 static int stamR3ResetOne(PSTAMDESC pDesc, void *pvArg);128 static DECLCALLBACK(void) stamR3EnumLogPrintf(PSTAMR3PRINTONEARGS pvArg, const char *pszFormat, ...);129 static DECLCALLBACK(void) stamR3EnumRelLogPrintf(PSTAMR3PRINTONEARGS pvArg, const char *pszFormat, ...);130 static DECLCALLBACK(void) stamR3EnumPrintf(PSTAMR3PRINTONEARGS pvArg, const char *pszFormat, ...);131 static int stamR3SnapshotOne(PSTAMDESC pDesc, void *pvArg);132 static int stamR3SnapshotPrintf(PSTAMR3SNAPSHOTONE pThis, const char *pszFormat, ...);133 static int stamR3PrintOne(PSTAMDESC pDesc, void *pvArg);134 static int stamR3EnumOne(PSTAMDESC pDesc, void *pvArg);135 static bool stamR3MultiMatch(const char * const *papszExpressions, unsigned cExpressions, unsigned *piExpression, const char *pszName);136 static char ** stamR3SplitPattern(const char *pszPat, unsigned *pcExpressions, char **ppszCopy);137 static int stamR3EnumU(PUVM pUVM, const char *pszPat, bool fUpdateRing0, int (pfnCallback)(PSTAMDESC pDesc, void *pvArg), void *pvArg);138 static void stamR3Ring0StatsRegisterU(PUVM pUVM);139 static void stamR3Ring0StatsUpdateU(PUVM pUVM, const char *pszPat);140 static void stamR3Ring0StatsUpdateMultiU(PUVM pUVM, const char * const *papszExpressions, unsigned cExpressions);139 static int stamR3RegisterU(PUVM pUVM, void *pvSample, PFNSTAMR3CALLBACKRESET pfnReset, PFNSTAMR3CALLBACKPRINT pfnPrint, 140 STAMTYPE enmType, STAMVISIBILITY enmVisibility, const char *pszName, STAMUNIT enmUnit, const char *pszDesc); 141 static int stamR3ResetOne(PSTAMDESC pDesc, void *pvArg); 142 static DECLCALLBACK(void) stamR3EnumLogPrintf(PSTAMR3PRINTONEARGS pvArg, const char *pszFormat, ...); 143 static DECLCALLBACK(void) stamR3EnumRelLogPrintf(PSTAMR3PRINTONEARGS pvArg, const char *pszFormat, ...); 144 static DECLCALLBACK(void) stamR3EnumPrintf(PSTAMR3PRINTONEARGS pvArg, const char *pszFormat, ...); 145 static int stamR3SnapshotOne(PSTAMDESC pDesc, void *pvArg); 146 static int stamR3SnapshotPrintf(PSTAMR3SNAPSHOTONE pThis, const char *pszFormat, ...); 147 static int stamR3PrintOne(PSTAMDESC pDesc, void *pvArg); 148 static int stamR3EnumOne(PSTAMDESC pDesc, void *pvArg); 149 static bool stamR3MultiMatch(const char * const *papszExpressions, unsigned cExpressions, unsigned *piExpression, const char *pszName); 150 static char ** stamR3SplitPattern(const char *pszPat, unsigned *pcExpressions, char **ppszCopy); 151 static int stamR3EnumU(PUVM pUVM, const char *pszPat, bool fUpdateRing0, int (pfnCallback)(PSTAMDESC pDesc, void *pvArg), void *pvArg); 152 static void stamR3Ring0StatsRegisterU(PUVM pUVM); 153 static void stamR3Ring0StatsUpdateU(PUVM pUVM, const char *pszPat); 154 static void stamR3Ring0StatsUpdateMultiU(PUVM pUVM, const char * const *papszExpressions, unsigned cExpressions); 141 155 142 156 #ifdef VBOX_WITH_DEBUGGER 143 static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);144 static DECLCALLBACK(void) stamR3EnumDbgfPrintf(PSTAMR3PRINTONEARGS pArgs, const char *pszFormat, ...);145 static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);157 static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 158 static DECLCALLBACK(void) stamR3EnumDbgfPrintf(PSTAMR3PRINTONEARGS pArgs, const char *pszFormat, ...); 159 static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 146 160 #endif 147 161 … … 773 787 return STAMR3ResetU(pVM->pUVM, pszPat); 774 788 } 775 776 789 777 790 … … 1793 1806 } 1794 1807 1795 1796 1808 #ifdef VBOX_WITH_DEBUGGER 1809 1797 1810 /** 1798 1811 * The '.stats' command. … … 1881 1894 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Restting statistics.\n"); 1882 1895 } 1883 #endif 1884 1896 1897 #endif /* VBOX_WITH_DEBUGGER */ 1898
Note:
See TracChangeset
for help on using the changeset viewer.