source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/winperf.h@ 1181

Last change on this file since 1181 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 9.3 KB
Line 
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef _WINPERF_
7#define _WINPERF_
8
9#include <pshpack8.h>
10
11#define PERF_DATA_VERSION 1
12#define PERF_DATA_REVISION 1
13
14typedef struct _PERF_DATA_BLOCK {
15 WCHAR Signature[4];
16 DWORD LittleEndian;
17 DWORD Version;
18 DWORD Revision;
19 DWORD TotalByteLength;
20 DWORD HeaderLength;
21 DWORD NumObjectTypes;
22 LONG DefaultObject;
23 SYSTEMTIME SystemTime;
24 LARGE_INTEGER PerfTime;
25 LARGE_INTEGER PerfFreq;
26 LARGE_INTEGER PerfTime100nSec;
27 DWORD SystemNameLength;
28 DWORD SystemNameOffset;
29} PERF_DATA_BLOCK,*PPERF_DATA_BLOCK;
30
31typedef struct _PERF_OBJECT_TYPE {
32 DWORD TotalByteLength;
33 DWORD DefinitionLength;
34 DWORD HeaderLength;
35 DWORD ObjectNameTitleIndex;
36#ifdef _WIN64
37 DWORD ObjectNameTitle;
38#else
39 LPWSTR ObjectNameTitle;
40#endif
41 DWORD ObjectHelpTitleIndex;
42#ifdef _WIN64
43 DWORD ObjectHelpTitle;
44#else
45 LPWSTR ObjectHelpTitle;
46#endif
47 DWORD DetailLevel;
48 DWORD NumCounters;
49 LONG DefaultCounter;
50 LONG NumInstances;
51 DWORD CodePage;
52 LARGE_INTEGER PerfTime;
53 LARGE_INTEGER PerfFreq;
54} PERF_OBJECT_TYPE,*PPERF_OBJECT_TYPE;
55
56#define PERF_NO_INSTANCES -1
57#define PERF_SIZE_DWORD 0x00000000
58#define PERF_SIZE_LARGE 0x00000100
59#define PERF_SIZE_ZERO 0x00000200
60#define PERF_SIZE_VARIABLE_LEN 0x00000300
61#define PERF_TYPE_NUMBER 0x00000000
62#define PERF_TYPE_COUNTER 0x00000400
63#define PERF_TYPE_TEXT 0x00000800
64#define PERF_TYPE_ZERO 0x00000C00
65#define PERF_NUMBER_HEX 0x00000000
66#define PERF_NUMBER_DECIMAL 0x00010000
67#define PERF_NUMBER_DEC_1000 0x00020000
68#define PERF_COUNTER_VALUE 0x00000000
69#define PERF_COUNTER_RATE 0x00010000
70#define PERF_COUNTER_FRACTION 0x00020000
71#define PERF_COUNTER_BASE 0x00030000
72#define PERF_COUNTER_ELAPSED 0x00040000
73#define PERF_COUNTER_QUEUELEN 0x00050000
74#define PERF_COUNTER_HISTOGRAM 0x00060000
75#define PERF_COUNTER_PRECISION 0x00070000
76#define PERF_TEXT_UNICODE 0x00000000
77#define PERF_TEXT_ASCII 0x00010000
78#define PERF_TIMER_TICK 0x00000000
79#define PERF_TIMER_100NS 0x00100000
80#define PERF_OBJECT_TIMER 0x00200000
81#define PERF_DELTA_COUNTER 0x00400000
82#define PERF_DELTA_BASE 0x00800000
83#define PERF_INVERSE_COUNTER 0x01000000
84#define PERF_MULTI_COUNTER 0x02000000
85
86#define PERF_DISPLAY_NO_SUFFIX 0x00000000
87#define PERF_DISPLAY_PER_SEC 0x10000000
88#define PERF_DISPLAY_PERCENT 0x20000000
89#define PERF_DISPLAY_SECONDS 0x30000000
90#define PERF_DISPLAY_NOSHOW 0x40000000
91
92#define PERF_COUNTER_COUNTER (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
93#define PERF_COUNTER_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
94#define PERF_COUNTER_QUEUELEN_TYPE (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
95#define PERF_COUNTER_LARGE_QUEUELEN_TYPE (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
96#define PERF_COUNTER_100NS_QUEUELEN_TYPE (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
97#define PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN | PERF_OBJECT_TIMER | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
98#define PERF_COUNTER_BULK_COUNT (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
99#define PERF_COUNTER_TEXT (PERF_SIZE_VARIABLE_LEN | PERF_TYPE_TEXT | PERF_TEXT_UNICODE | PERF_DISPLAY_NO_SUFFIX)
100#define PERF_COUNTER_RAWCOUNT (PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL | PERF_DISPLAY_NO_SUFFIX)
101#define PERF_COUNTER_LARGE_RAWCOUNT (PERF_SIZE_LARGE | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL | PERF_DISPLAY_NO_SUFFIX)
102#define PERF_COUNTER_RAWCOUNT_HEX (PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_HEX | PERF_DISPLAY_NO_SUFFIX)
103#define PERF_COUNTER_LARGE_RAWCOUNT_HEX (PERF_SIZE_LARGE | PERF_TYPE_NUMBER | PERF_NUMBER_HEX | PERF_DISPLAY_NO_SUFFIX)
104#define PERF_SAMPLE_FRACTION (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DELTA_COUNTER | PERF_DELTA_BASE | PERF_DISPLAY_PERCENT)
105#define PERF_SAMPLE_COUNTER (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
106#define PERF_COUNTER_NODATA (PERF_SIZE_ZERO | PERF_DISPLAY_NOSHOW)
107#define PERF_COUNTER_TIMER_INV (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
108#define PERF_SAMPLE_BASE (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_DISPLAY_NOSHOW | 0x00000001)
109#define PERF_AVERAGE_TIMER (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DISPLAY_SECONDS)
110#define PERF_AVERAGE_BASE (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_DISPLAY_NOSHOW | 0x00000002)
111#define PERF_AVERAGE_BULK (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DISPLAY_NOSHOW)
112#define PERF_OBJ_TIME_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_OBJECT_TIMER | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
113#define PERF_100NSEC_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
114#define PERF_100NSEC_TIMER_INV (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
115#define PERF_COUNTER_MULTI_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_DELTA_COUNTER | PERF_TIMER_TICK | PERF_MULTI_COUNTER | PERF_DISPLAY_PERCENT)
116#define PERF_COUNTER_MULTI_TIMER_INV (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE | PERF_DELTA_COUNTER | PERF_MULTI_COUNTER | PERF_TIMER_TICK | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
117#define PERF_COUNTER_MULTI_BASE (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_MULTI_COUNTER | PERF_DISPLAY_NOSHOW)
118#define PERF_100NSEC_MULTI_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER | PERF_DISPLAY_PERCENT)
119#define PERF_100NSEC_MULTI_TIMER_INV (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER | PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER | PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
120#define PERF_RAW_FRACTION (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DISPLAY_PERCENT)
121#define PERF_LARGE_RAW_FRACTION (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION | PERF_DISPLAY_PERCENT)
122#define PERF_RAW_BASE (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_DISPLAY_NOSHOW | 0x00000003)
123#define PERF_LARGE_RAW_BASE (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_BASE | PERF_DISPLAY_NOSHOW)
124#define PERF_ELAPSED_TIME (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED | PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS)
125#define PERF_COUNTER_HISTOGRAM_TYPE 0x80000000
126#define PERF_COUNTER_DELTA (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_VALUE | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
127#define PERF_COUNTER_LARGE_DELTA (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_VALUE | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
128#define PERF_PRECISION_SYSTEM_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_PRECISION | PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
129#define PERF_PRECISION_100NS_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_PRECISION | PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
130#define PERF_PRECISION_OBJECT_TIMER (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_PRECISION | PERF_OBJECT_TIMER | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
131
132#define PERF_PRECISION_TIMESTAMP PERF_LARGE_RAW_BASE
133
134#define PERF_DETAIL_NOVICE 100
135#define PERF_DETAIL_ADVANCED 200
136#define PERF_DETAIL_EXPERT 300
137#define PERF_DETAIL_WIZARD 400
138
139typedef struct _PERF_COUNTER_DEFINITION {
140 DWORD ByteLength;
141 DWORD CounterNameTitleIndex;
142#ifdef _WIN64
143 DWORD CounterNameTitle;
144#else
145 LPWSTR CounterNameTitle;
146#endif
147 DWORD CounterHelpTitleIndex;
148#ifdef _WIN64
149 DWORD CounterHelpTitle;
150#else
151 LPWSTR CounterHelpTitle;
152#endif
153 LONG DefaultScale;
154 DWORD DetailLevel;
155 DWORD CounterType;
156 DWORD CounterSize;
157 DWORD CounterOffset;
158} PERF_COUNTER_DEFINITION,*PPERF_COUNTER_DEFINITION;
159
160#define PERF_NO_UNIQUE_ID -1
161
162typedef struct _PERF_INSTANCE_DEFINITION {
163 DWORD ByteLength;
164 DWORD ParentObjectTitleIndex;
165 DWORD ParentObjectInstance;
166 LONG UniqueID;
167 DWORD NameOffset;
168 DWORD NameLength;
169} PERF_INSTANCE_DEFINITION,*PPERF_INSTANCE_DEFINITION;
170
171typedef struct _PERF_COUNTER_BLOCK {
172 DWORD ByteLength;
173
174} PERF_COUNTER_BLOCK,*PPERF_COUNTER_BLOCK;
175
176#define PERF_QUERY_OBJECTS ((LONG)0x80000000)
177#define PERF_QUERY_GLOBAL ((LONG)0x80000001)
178#define PERF_QUERY_COSTLY ((LONG)0x80000002)
179
180typedef DWORD (WINAPI PM_OPEN_PROC)(LPWSTR);
181typedef DWORD (WINAPI PM_COLLECT_PROC)(LPWSTR,LPVOID *,LPDWORD,LPDWORD);
182typedef DWORD (WINAPI PM_CLOSE_PROC)(void);
183typedef DWORD (WINAPI PM_QUERY_PROC)(LPDWORD,LPVOID *,LPDWORD,LPDWORD);
184
185#define MAX_PERF_OBJECTS_IN_QUERY_FUNCTION (__MSABI_LONG(64))
186
187#define WINPERF_LOG_NONE 0
188#define WINPERF_LOG_USER 1
189#define WINPERF_LOG_DEBUG 2
190#define WINPERF_LOG_VERBOSE 3
191
192#include <poppack.h>
193#endif
Note: See TracBrowser for help on using the repository browser.