00001 #ifndef _RPC_PERFCOUNT_H 00002 #define _RPC_PERFCOUNT_H 00003 /* 00004 * Unix SMB/CIFS implementation. 00005 * Virtual Windows Registry Layer 00006 * 00007 * Copyright (C) Marcin Krzysztof Porwit 2005, 00008 * Copyright (C) Gerald (Jerry) Carter 2005. 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00023 */ 00024 00025 typedef struct perf_counter_definition 00026 { 00027 /* sizeof(PERF_COUNTER_DEFINITION) */ 00028 uint32 ByteLength; 00029 uint32 CounterNameTitleIndex; 00030 uint32 CounterNameTitlePointer; 00031 uint32 CounterHelpTitleIndex; 00032 uint32 CounterHelpTitlePointer; 00033 uint32 DefaultScale; 00034 uint32 DetailLevel; 00035 uint32 CounterType; 00036 uint32 CounterSize; 00037 uint32 CounterOffset; 00038 } 00039 PERF_COUNTER_DEFINITION; 00040 00041 typedef struct perf_counter_block 00042 { 00043 /* Total size of the data block, including all data plus this header */ 00044 uint32 ByteLength; 00045 uint8 *data; 00046 } 00047 PERF_COUNTER_BLOCK; 00048 00049 typedef struct perf_instance_definition 00050 { 00051 /* Total size of the instance definition, including the length of the terminated Name string */ 00052 uint32 ByteLength; 00053 uint32 ParentObjectTitleIndex; 00054 uint32 ParentObjectTitlePointer; 00055 uint32 UniqueID; 00056 /* From the start of the PERF_INSTANCE_DEFINITION, the byte offset to the start of the Name string */ 00057 uint32 NameOffset; 00058 uint32 NameLength; 00059 /* Unicode string containing the name for the instance */ 00060 uint8 *data; 00061 PERF_COUNTER_BLOCK counter_data; 00062 } 00063 PERF_INSTANCE_DEFINITION; 00064 00065 typedef struct perf_object_type 00066 { 00067 /* Total size of the object block, including all PERF_INSTANCE_DEFINITIONs, 00068 PERF_COUNTER_DEFINITIONs and PERF_COUNTER_BLOCKs in bytes */ 00069 uint32 TotalByteLength; 00070 /* Size of this PERF_OBJECT_TYPE plus all PERF_COUNTER_DEFINITIONs in bytes */ 00071 uint32 DefinitionLength; 00072 /* Size of this PERF_OBJECT_TYPE */ 00073 uint32 HeaderLength; 00074 uint32 ObjectNameTitleIndex; 00075 uint32 ObjectNameTitlePointer; 00076 uint32 ObjectHelpTitleIndex; 00077 uint32 ObjectHelpTitlePointer; 00078 uint32 DetailLevel; 00079 uint32 NumCounters; 00080 uint32 DefaultCounter; 00081 uint32 NumInstances; 00082 uint32 CodePage; 00083 uint64 PerfTime; 00084 uint64 PerfFreq; 00085 PERF_COUNTER_DEFINITION *counters; 00086 PERF_INSTANCE_DEFINITION *instances; 00087 PERF_COUNTER_BLOCK counter_data; 00088 } 00089 PERF_OBJECT_TYPE; 00090 00091 /* PerfCounter Inner Buffer structs */ 00092 typedef struct perf_data_block 00093 { 00094 /* hardcoded to read "P.E.R.F" */ 00095 uint16 Signature[4]; 00096 uint32 LittleEndian; 00097 /* both currently hardcoded to 1 */ 00098 uint32 Version; 00099 uint32 Revision; 00100 /* bytes of PERF_OBJECT_TYPE data, does NOT include the PERF_DATA_BLOCK */ 00101 uint32 TotalByteLength; 00102 /* size of PERF_DATA_BLOCK including the uint8 *data */ 00103 uint32 HeaderLength; 00104 /* number of PERF_OBJECT_TYPE structures encoded */ 00105 uint32 NumObjectTypes; 00106 uint32 DefaultObject; 00107 SYSTEMTIME SystemTime; 00108 /* This will guarantee that we're on a 64-bit boundary before we encode 00109 PerfTime, and having it there will make my offset math much easier. */ 00110 uint32 Padding; 00111 /* Now when I'm marshalling this, I'll need to call prs_align_uint64() 00112 before I start encodint the uint64 structs */ 00113 /* clock rate * seconds uptime */ 00114 uint64 PerfTime; 00115 /* The clock rate of the CPU */ 00116 uint64 PerfFreq; 00117 /* used for high-res timers -- for now PerfTime * 10e7 */ 00118 uint64 PerfTime100nSec; 00119 uint32 SystemNameLength; 00120 uint32 SystemNameOffset; 00121 /* The SystemName, in unicode, terminated */ 00122 uint8* data; 00123 PERF_OBJECT_TYPE *objects; 00124 } 00125 PERF_DATA_BLOCK; 00126 00127 #endif /* _RPC_PERFCOUNT_H */