Annotation of mstools/h/winperf.h, revision 1.1.1.3

1.1.1.3 ! root        1: /*++
        !             2: 
        !             3: Copyright (c) 1993 Microsoft Corporation
        !             4: 
        !             5: Module Name:
        !             6: 
        !             7:     winperf.h
1.1       root        8: 
1.1.1.3 ! root        9: Abstract:
        !            10: 
        !            11:     Header file for the Performance Monitor data.
        !            12: 
        !            13:     This file contains the definitions of the data structures returned
        !            14:     by the Configuration Registry in response to a request for
        !            15:     performance data.  This file is used by both the Configuration
        !            16:     Registry and the Performance Monitor to define their interface.
        !            17:     The complete interface is described here, except for the name
        !            18:     of the node to query in the registry.  It is
        !            19: 
        !            20:                    HKEY_PERFORMANCE_DATA.
        !            21: 
        !            22:     By querying that node with a subkey of "Global" the caller will
        !            23:     retrieve the structures described here.
        !            24: 
        !            25:     There is no need to RegOpenKey() the reserved handle HKEY_PERFORMANCE_DATA,
        !            26:     but the caller should RegCloseKey() the handle so that network transports
        !            27:     and drivers can be removed or installed (which cannot happen while
        !            28:     they are open for monitoring.)  Remote requests must first
        !            29:     RegConnectRegistry().
        !            30: 
        !            31: --*/
        !            32: 
        !            33: #ifndef _WINPERF_
        !            34: #define _WINPERF_
1.1       root       35: 
                     36: //  Data structure definitions.
                     37: 
                     38: //  In order for data to be returned through the Configuration Registry
                     39: //  in a system-independent fashion, it must be self-describing.
                     40: 
                     41: //  In the following, all offsets are in bytes.
                     42: 
                     43: //
                     44: //  Data is returned through the Configuration Registry in a
                     45: //  a data block which begins with a _PERF_DATA_BLOCK structure.
                     46: //
                     47: 
                     48: #define PERF_DATA_VERSION   1
1.1.1.3 ! root       49: #define PERF_DATA_REVISION  1
1.1       root       50: 
                     51: 
                     52: typedef struct _PERF_DATA_BLOCK {
                     53:     WCHAR           Signature[4];       // Signature: Unicode "PERF"
                     54:     DWORD           LittleEndian;       // 0 = Big Endian, 1 = Little Endian
                     55:     DWORD           Version;            // Version of these data structures
                     56:                                         // starting at 1
                     57:     DWORD           Revision;           // Revision of these data structures
                     58:                                         // starting at 0 for each Version
1.1.1.3 ! root       59:     DWORD           TotalByteLength;    // Total length of data block
        !            60:     DWORD           HeaderLength;       // Length of this structure
        !            61:     DWORD           NumObjectTypes;     // Number of types of objects
        !            62:                                         // being reported
        !            63:     LONG            DefaultObject;      // Object Title Index of default
        !            64:                                         // object to display when data from
        !            65:                                         // this system is retrieved (-1 =
        !            66:                                         // none, but this is not expected to
        !            67:                                         // be used)
        !            68:     SYSTEMTIME      SystemTime;         // Time at the system under
        !            69:                                         // measurement
        !            70:     LARGE_INTEGER   PerfTime;           // Performance counter value
        !            71:                                         // at the system under measurement
        !            72:     LARGE_INTEGER   PerfFreq;           // Performance counter frequency
        !            73:                                         // at the system under measurement
1.1       root       74:     LARGE_INTEGER   PerfTime100nSec;    // Performance counter time in 100 nsec
                     75:                                         // units at the system under measurement
1.1.1.3 ! root       76:     DWORD           SystemNameLength;   // Length of the system name
        !            77:     DWORD           SystemNameOffset;   // Offset, from beginning of this
        !            78:                                         // structure, to name of system
        !            79:                                         // being measured
1.1       root       80: } PERF_DATA_BLOCK, *PPERF_DATA_BLOCK;
                     81: 
                     82: 
                     83: //
                     84: //  The _PERF_DATA_BLOCK structure is followed by NumObjectTypes of
                     85: //  data sections, one for each type of object measured.  Each object
                     86: //  type section begins with a _PERF_OBJECT_TYPE structure.
                     87: //
                     88: 
                     89: 
                     90: typedef struct _PERF_OBJECT_TYPE {
1.1.1.3 ! root       91:     DWORD           TotalByteLength;    // Length of this object definition
        !            92:                                         // including this structure, the
        !            93:                                         // counter definitions, and the
        !            94:                                         // instance definitions and the
        !            95:                                         // counter blocks for each instance:
        !            96:                                         // This is the offset from this
        !            97:                                         // structure to the next object, if
        !            98:                                         // any
        !            99:     DWORD           DefinitionLength;   // Length of object definition,
        !           100:                                         // which includes this structure
        !           101:                                         // and the counter definition
        !           102:                                         // structures for this object: this
        !           103:                                         // is the offset of the first
        !           104:                                         // instance or of the counters
        !           105:                                         // for this object if there is
        !           106:                                         // no instance
        !           107:     DWORD           HeaderLength;       // Length of this structure: this
        !           108:                                         // is the offset to the first
        !           109:                                         // counter definition for this
        !           110:                                         // object
        !           111:     DWORD           ObjectNameTitleIndex;
1.1       root      112:                                         // Index to name in Title Database
                    113:     LPWSTR          ObjectNameTitle;    // Initially NULL, for use by
                    114:                                         // analysis program to point to
                    115:                                         // retrieved title string
1.1.1.3 ! root      116:     DWORD           ObjectHelpTitleIndex;
        !           117:                                         // Index to Help in Title Database
1.1       root      118:     LPWSTR          ObjectHelpTitle;    // Initially NULL, for use by
                    119:                                         // analysis program to point to
                    120:                                         // retrieved title string
1.1.1.3 ! root      121:     DWORD           DetailLevel;        // Object level of detail (for
        !           122:                                         // controlling display complexity);
        !           123:                                         // will be min of detail levels
        !           124:                                         // for all this object's counters
        !           125:     DWORD           NumCounters;        // Number of counters in each
        !           126:                                         // counter block (one counter
        !           127:                                         // block per instance)
        !           128:     LONG            DefaultCounter;     // Default counter to display when
        !           129:                                         // this object is selected, index
        !           130:                                         // starting at 0 (-1 = none, but
        !           131:                                         // this is not expected to be used)
        !           132:     LONG            NumInstances;       // Number of object instances
        !           133:                                         // for which counters are being
        !           134:                                         // returned from the system under
        !           135:                                         // measurement. If the object defined
        !           136:                                         // will never have any instance data
        !           137:                                         // structures (PERF_INSTANCE_DEFINITION)
        !           138:                                         // then this value should be -1, if the
        !           139:                                         // object can have 0 or more instances,
        !           140:                                         // but has none present, then this
        !           141:                                         // should be 0, otherwise this field
        !           142:                                         // contains the number of instances of
        !           143:                                         // this counter.
        !           144:     DWORD           CodePage;           // 0 if instance strings are in
        !           145:                                         // UNICODE, else the Code Page of
        !           146:                                         // the instance names
        !           147:     LARGE_INTEGER   PerfTime;           // Sample Time in "Object" units
        !           148:                                         //
        !           149:     LARGE_INTEGER   PerfFreq;           // Frequency of "Object" units in 
        !           150:                                         // counts per second.
1.1       root      151: } PERF_OBJECT_TYPE, *PPERF_OBJECT_TYPE;
                    152: 
1.1.1.3 ! root      153: #define PERF_NO_INSTANCES           -1  // no instances (see NumInstances above)
1.1       root      154: //
1.1.1.3 ! root      155: // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1.1       root      156: //
1.1.1.3 ! root      157: //  PERF_COUNTER_DEFINITION.CounterType field values
        !           158: //
        !           159: //
        !           160: //        Counter ID Field Definition:
        !           161: //
        !           162: //   3      2        2    2    2        1        1    1
        !           163: //   1      8        4    2    0        6        2    0    8                0
        !           164: //  +--------+--------+----+----+--------+--------+----+----+----------------+
        !           165: //  |Display |Calculation  |Time|Counter |        |Ctr |Size|                |
        !           166: //  |Flags   |Modifiers    |Base|SubType |Reserved|Type|Fld |   Reserved     |
        !           167: //  +--------+--------+----+----+--------+--------+----+----+----------------+
        !           168: //
        !           169: //
        !           170: //  The counter type is the "or" of the following values as described below
        !           171: //
        !           172: //  select one of the following to indicate the counter's data size
        !           173: //
        !           174: #define PERF_SIZE_DWORD         0x00000000
        !           175: #define PERF_SIZE_LARGE         0x00000100
        !           176: #define PERF_SIZE_ZERO          0x00000200  // for Zero Length fields
        !           177: #define PERF_SIZE_VARIABLE_LEN  0x00000300  // length is in CounterLength field
        !           178:                                             //  of Counter Definition struct
        !           179: //
        !           180: //  select one of the following values to indicate the counter field usage
        !           181: //
        !           182: #define PERF_TYPE_NUMBER        0x00000000  // a number (not a counter)
        !           183: #define PERF_TYPE_COUNTER       0x00000400  // an increasing numeric value
        !           184: #define PERF_TYPE_TEXT          0x00000800  // a text field
        !           185: #define PERF_TYPE_ZERO          0x00000C00  // displays a zero
        !           186: //
        !           187: //  If the PERF_TYPE_NUMBER field was selected, then select one of the 
        !           188: //  following to describe the Number
        !           189: //
        !           190: #define PERF_NUMBER_HEX         0x00000000  // display as HEX value
        !           191: #define PERF_NUMBER_DECIMAL     0x00010000  // display as a decimal integer
        !           192: #define PERF_NUMBER_DEC_1000    0x00020000  // display as a decimal/1000
        !           193: //
        !           194: //  If the PERF_TYPE_COUNTER value was selected then select one of the
        !           195: //  following to indicate the type of counter
        !           196: //
        !           197: #define PERF_COUNTER_VALUE      0x00000000  // display counter value
        !           198: #define PERF_COUNTER_RATE       0x00010000  // divide ctr / delta time
        !           199: #define PERF_COUNTER_FRACTION   0x00020000  // divide ctr / base
        !           200: #define PERF_COUNTER_BASE       0x00030000  // base value used in fractions
        !           201: #define PERF_COUNTER_ELAPSED    0x00040000  // subtract counter from current time 
        !           202: #define PERF_COUNTER_QUEUELEN   0x00050000  // Use Queuelen processing func.
        !           203: #define PERF_COUNTER_HISTOGRAM  0x00060000  // Counter begins or ends a histogram
        !           204: //
        !           205: //  If the PERF_TYPE_TEXT value was selected, then select one of the 
        !           206: //  following to indicate the type of TEXT data.
        !           207: //
        !           208: #define PERF_TEXT_UNICODE       0x00000000  // type of text in text field
        !           209: #define PERF_TEXT_ASCII         0x00010000  // ASCII using the CodePage field
        !           210: //
        !           211: //  Timer SubTypes
        !           212: //
        !           213: #define PERF_TIMER_TICK         0x00000000  // use system perf. freq for base
        !           214: #define PERF_TIMER_100NS        0x00100000  // use 100 NS timer time base units
        !           215: #define PERF_OBJECT_TIMER       0x00200000  // use the object timer freq
        !           216: //
        !           217: //  Any types that have calculations performed can use one or more of 
        !           218: //  the following calculation modification flags listed here
        !           219: //
        !           220: #define PERF_DELTA_COUNTER      0x00400000  // compute difference first
        !           221: #define PERF_DELTA_BASE         0x00800000  // compute base diff as well
        !           222: #define PERF_INVERSE_COUNTER    0x01000000  // show as 1.00-value (assumes:
        !           223: #define PERF_MULTI_COUNTER      0x02000000  // sum of multiple instances
        !           224: //
        !           225: //  Select one of the following values to indicate the display suffix (if any)
        !           226: //
        !           227: #define PERF_DISPLAY_NO_SUFFIX  0x00000000  // no suffix
        !           228: #define PERF_DISPLAY_PER_SEC    0x10000000  // "/sec"
        !           229: #define PERF_DISPLAY_PERCENT    0x20000000  // "%"
        !           230: #define PERF_DISPLAY_SECONDS    0x30000000  // "secs"
        !           231: #define PERF_DISPLAY_NOSHOW     0x40000000  // value is not displayed
        !           232: //
        !           233: //  Predefined counter types 
        !           234: //
        !           235: 
        !           236: // 32-bit Counter.  Divide delta by delta time.  Display suffix: "/sec"
        !           237: #define PERF_COUNTER_COUNTER        \
        !           238:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           239:             PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
        !           240:                      
        !           241:                                                        
        !           242: // 64-bit Timer.  Divide delta by delta time.  Display suffix: "%"
        !           243: #define PERF_COUNTER_TIMER          \
        !           244:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           245:             PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
        !           246: 
        !           247: // Queue Length Space-Time Product. Divide delta by delta time. No Display Suffix.
        !           248: #define PERF_COUNTER_QUEUELEN_TYPE  \
        !           249:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_QUEUELEN |\
        !           250:             PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
        !           251: 
        !           252: // 64-bit Counter.  Divide delta by delta time. Display Suffix: "/sec"
        !           253: #define PERF_COUNTER_BULK_COUNT     \
        !           254:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           255:             PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_PER_SEC)
        !           256: 
        !           257: // Indicates the counter is not a  counter but rather Unicode text Display as text.
        !           258: #define PERF_COUNTER_TEXT           \
        !           259:             (PERF_SIZE_VARIABLE_LEN | PERF_TYPE_TEXT | PERF_TEXT_UNICODE |\
        !           260:             PERF_DISPLAY_NO_SUFFIX)
        !           261: 
        !           262: // Indicates the data is a counter  which should not be
        !           263: // time averaged on display (such as an error counter on a serial line)
        !           264: // Display as is.  No Display Suffix.
        !           265: #define PERF_COUNTER_RAWCOUNT       \
        !           266:             (PERF_SIZE_DWORD | PERF_TYPE_NUMBER | PERF_NUMBER_DECIMAL |\
        !           267:             PERF_DISPLAY_NO_SUFFIX)
        !           268: 
        !           269: // A count which is either 1 or 0 on each sampling interrupt (% busy)
        !           270: // Divide delta by delta base. Display Suffix: "%"
        !           271: #define PERF_SAMPLE_FRACTION        \
        !           272:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
        !           273:             PERF_DELTA_COUNTER | PERF_DELTA_BASE | PERF_DISPLAY_PERCENT)
        !           274: 
        !           275: // A count which is sampled on each sampling interrupt (queue length)
        !           276: // Divide delta by delta time. No Display Suffix.
        !           277: #define PERF_SAMPLE_COUNTER         \
        !           278:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           279:             PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_DISPLAY_NO_SUFFIX)
        !           280: 
        !           281: // A label: no data is associated with this counter (it has 0 length)
        !           282: // Do not display.
        !           283: #define PERF_COUNTER_NODATA         \
        !           284:             (PERF_SIZE_ZERO | PERF_DISPLAY_NOSHOW)
        !           285: 
        !           286: // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
        !           287: // Display 100 - delta divided by delta time.  Display suffix: "%"
        !           288: #define PERF_COUNTER_TIMER_INV      \
        !           289:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           290:             PERF_TIMER_TICK | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER | \
        !           291:             PERF_DISPLAY_PERCENT)
        !           292: 
        !           293: // The divisor for a sample, used with the previous counter to form a
        !           294: // sampled %.  You must check for >0 before dividing by this!  This
        !           295: // counter will directly follow the  numerator counter.  It should not
        !           296: // be displayed to the user.
        !           297: #define PERF_SAMPLE_BASE            \
        !           298:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
        !           299:             PERF_DISPLAY_NOSHOW |\
        !           300:             0x00000001)  // for compatibility with pre-beta versions
        !           301: 
        !           302: // A timer which, when divided by an average base, produces a time
        !           303: // in seconds which is the average time of some operation.  This
        !           304: // timer times total operations, and  the base is the number of opera-
        !           305: // tions.  Display Suffix: "sec"
        !           306: #define PERF_AVERAGE_TIMER          \
        !           307:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
        !           308:             PERF_DISPLAY_SECONDS)
        !           309: 
        !           310: // Used as the denominator in the computation of time or count
        !           311: // averages.  Must directly follow the numerator counter.  Not dis-
        !           312: // played to the user.
        !           313: #define PERF_AVERAGE_BASE           \
        !           314:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
        !           315:             PERF_DISPLAY_NOSHOW |\
        !           316:             0x00000002)  // for compatibility with pre-beta versions
        !           317: 
        !           318: 
        !           319: // A bulk count which, when divided (typically) by the number of
        !           320: // operations, gives (typically) the number of bytes per operation.
        !           321: // No Display Suffix.
        !           322: #define PERF_AVERAGE_BULK           \
        !           323:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION  |\
        !           324:             PERF_DISPLAY_NOSHOW)
        !           325: 
        !           326: // 64-bit Timer in 100 nsec units. Display delta divided by
        !           327: // delta time.  Display suffix: "%"
        !           328: #define PERF_100NSEC_TIMER          \
        !           329:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           330:             PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_DISPLAY_PERCENT)
        !           331: 
        !           332: // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
        !           333: // Display 100 - delta divided by delta time.  Display suffix: "%"
        !           334: #define PERF_100NSEC_TIMER_INV      \
        !           335:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           336:             PERF_TIMER_100NS | PERF_DELTA_COUNTER | PERF_INVERSE_COUNTER  |\
        !           337:             PERF_DISPLAY_PERCENT)
        !           338:      
        !           339: // 64-bit Timer.  Divide delta by delta time.  Display suffix: "%"
        !           340: // Timer for multiple instances, so result can exceed 100%.
        !           341: #define PERF_COUNTER_MULTI_TIMER    \
        !           342:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           343:             PERF_DELTA_COUNTER | PERF_TIMER_TICK | PERF_MULTI_COUNTER |\
        !           344:             PERF_DISPLAY_PERCENT)
        !           345:   
        !           346: // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
        !           347: // Display 100 * _MULTI_BASE - delta divided by delta time.
        !           348: // Display suffix: "%" Timer for multiple instances, so result
        !           349: // can exceed 100%.  Followed by a counter of type _MULTI_BASE.
1.1       root      350: #define PERF_COUNTER_MULTI_TIMER_INV \
1.1.1.3 ! root      351:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_RATE |\
        !           352:             PERF_DELTA_COUNTER | PERF_MULTI_COUNTER | PERF_TIMER_TICK |\
        !           353:             PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
        !           354:     
        !           355: // Number of instances to which the preceding _MULTI_..._INV counter
        !           356: // applies.  Used as a factor to get the percentage.
        !           357: #define PERF_COUNTER_MULTI_BASE     \
        !           358:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
        !           359:             PERF_MULTI_COUNTER | PERF_DISPLAY_NOSHOW)
        !           360: 
        !           361: // 64-bit Timer in 100 nsec units. Display delta divided by delta time.  
        !           362: // Display suffix: "%" Timer for multiple instances, so result can exceed 100%.
        !           363: #define PERF_100NSEC_MULTI_TIMER   \
        !           364:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER  |\
        !           365:             PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER |\
        !           366:             PERF_DISPLAY_PERCENT)
        !           367:             
        !           368: // 64-bit Timer inverse (e.g., idle is measured, but display busy %)
        !           369: // Display 100 * _MULTI_BASE - delta divided by delta time.
        !           370: // Display suffix: "%" Timer for multiple instances, so result
        !           371: // can exceed 100%.  Followed by a counter of type _MULTI_BASE.
1.1       root      372: #define PERF_100NSEC_MULTI_TIMER_INV \
1.1.1.3 ! root      373:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_DELTA_COUNTER  |\
        !           374:             PERF_COUNTER_RATE | PERF_TIMER_100NS | PERF_MULTI_COUNTER |\
        !           375:             PERF_INVERSE_COUNTER | PERF_DISPLAY_PERCENT)
        !           376:             
        !           377: // Indicates the data is a fraction of the following counter  which 
        !           378: // should not be time averaged on display (such as free space over 
        !           379: // total space.) Display as is.  Display the quotient as "%".
        !           380: #define PERF_RAW_FRACTION           \
        !           381:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
        !           382:             PERF_DISPLAY_PERCENT)
        !           383:                                     
        !           384: // Indicates the data is a base for the preceding counter which should
        !           385: // not be time averaged on display (such as free space over total space.)
        !           386: #define PERF_RAW_BASE               \
        !           387:             (PERF_SIZE_DWORD | PERF_TYPE_COUNTER | PERF_COUNTER_BASE |\
        !           388:             PERF_DISPLAY_NOSHOW |\
        !           389:             0x00000003)  // for compatibility with pre-beta versions
        !           390: 
        !           391: // The data collected in this counter is actually the start time of the
        !           392: // item being measured. For display, this data is subtracted from the 
        !           393: // sample time to yield the elapsed time as the difference between the two.
        !           394: // In the definition below, the PerfTime field of the Object contains
        !           395: // the sample time as indicated by the PERF_OBJECT_TIMER bit and the 
        !           396: // difference is scaled by the PerfFreq of the Object to convert the time
        !           397: // units into seconds.
        !           398: #define PERF_ELAPSED_TIME           \
        !           399:             (PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED |\
        !           400:             PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS)
1.1       root      401: //
1.1.1.3 ! root      402: //  The following counter type can be used with the preceding types to
        !           403: //  define a range of values to be displayed in a histogram.
1.1       root      404: //
                    405: 
1.1.1.3 ! root      406: #define PERF_COUNTER_HISTOGRAM_TYPE   0x80000000
        !           407:                                         // Counter begins or ends a histogram
1.1       root      408: 
                    409: //
                    410: //  The following are used to determine the level of detail associated
                    411: //  with the counter.  The user will be setting the level of detail
                    412: //  that should be displayed at any given time.
                    413: //
                    414: 
1.1.1.3 ! root      415: #define PERF_DETAIL_NOVICE          100 // The uninformed can understand it
        !           416: #define PERF_DETAIL_ADVANCED        200 // For the advanced user
        !           417: #define PERF_DETAIL_EXPERT          300 // For the expert user
        !           418: #define PERF_DETAIL_WIZARD          400 // For the system designer
1.1       root      419: 
                    420: 
                    421: //
                    422: //  There is one of the following for each of the
                    423: //  PERF_OBJECT_TYPE.NumCounters.  The Unicode names in this structure MUST
                    424: //  come from a message file.
                    425: //
                    426: 
                    427: typedef struct _PERF_COUNTER_DEFINITION {
                    428:     DWORD           ByteLength;         // Length in bytes of this structure
1.1.1.3 ! root      429:     DWORD           CounterNameTitleIndex;
        !           430:                                         // Index of Counter name into
        !           431:                                         // Title Database
1.1       root      432:     LPWSTR          CounterNameTitle;   // Initially NULL, for use by
                    433:                                         // analysis program to point to
                    434:                                         // retrieved title string
1.1.1.3 ! root      435:     DWORD           CounterHelpTitleIndex;
        !           436:                                         // Index of Counter Help into
        !           437:                                         // Title Database
1.1       root      438:     LPWSTR          CounterHelpTitle;   // Initially NULL, for use by
                    439:                                         // analysis program to point to
                    440:                                         // retrieved title string
1.1.1.3 ! root      441:     LONG            DefaultScale;       // Power of 10 by which to scale
1.1       root      442:                                         // chart line if vertical axis is 100
                    443:                                         // 0 ==> 1, 1 ==> 10, -1 ==>1/10, etc.
1.1.1.3 ! root      444:     DWORD           DetailLevel;        // Counter level of detail (for
        !           445:                                         // controlling display complexity)
        !           446:     DWORD           CounterType;        // Type of counter
        !           447:     DWORD           CounterSize;        // Size of counter in bytes
        !           448:     DWORD           CounterOffset;      // Offset from the start of the
        !           449:                                         // PERF_COUNTER_BLOCK to the first
        !           450:                                         // byte of this counter
1.1       root      451: } PERF_COUNTER_DEFINITION, *PPERF_COUNTER_DEFINITION;
                    452: 
                    453: //
1.1.1.3 ! root      454: //  If (PERF_DATA_BLOCK.NumInstances >= 0) then there will be
        !           455: //  PERF_DATA_BLOCK.NumInstances of a (PERF_INSTANCE_DEFINITION
        !           456: //  followed by a PERF_COUNTER_BLOCK followed by the counter data fields)
        !           457: //  for each instance.
        !           458: //
        !           459: //  If (PERF_DATA_BLOCK.NumInstances < 0) then the counter definition
        !           460: //  strucutre above will be followed by only a PERF_COUNTER_BLOCK and the
        !           461: //  counter data for that COUNTER.
1.1       root      462: //
                    463: 
                    464: #define PERF_NO_UNIQUE_ID -1
                    465: 
                    466: typedef struct _PERF_INSTANCE_DEFINITION {
1.1.1.3 ! root      467:     DWORD           ByteLength;         // Length in bytes of this structure,
        !           468:                                         // including the subsequent name
1.1       root      469:     DWORD           ParentObjectTitleIndex;
                    470:                                         // Title Index to name of "parent"
1.1.1.3 ! root      471:                                         // object (e.g., if thread, then
1.1       root      472:                                         // process is parent object type);
                    473:                                         // if logical drive, the physical
                    474:                                         // drive is parent object type
1.1.1.3 ! root      475:     DWORD           ParentObjectInstance;
        !           476:                                         // Index to instance of parent object
        !           477:                                         // type which is the parent of this
        !           478:                                         // instance.
        !           479:     LONG            UniqueID;           // A unique ID used instead of
        !           480:                                         // matching the name to identify
        !           481:                                         // this instance, -1 = none
        !           482:     DWORD           NameOffset;         // Offset from beginning of
        !           483:                                         // this struct to the Unicode name
        !           484:                                         // of this instance
        !           485:     DWORD           NameLength;         // Length in bytes of name; 0 = none
1.1       root      486: 
                    487: } PERF_INSTANCE_DEFINITION, *PPERF_INSTANCE_DEFINITION;
                    488: //
                    489: //  If .ParentObjectName is 0, there
1.1.1.3 ! root      490: //  is no parent-child hierarchy for this object type.  Otherwise,
1.1       root      491: //   the .ParentObjectInstance is an index, starting at 0, into the
                    492: //  instances reported for the parent object type.  It is only
                    493: //  meaningful if .ParentObjectName is not 0.  The purpose of all this
                    494: //  is to permit reporting/summation of object instances like threads
                    495: //  within processes, and logical drives within physical drives.
                    496: //
                    497: //
                    498: //  The PERF_INSTANCE_DEFINITION will be followed by a PERF_COUNTER_BLOCK.
                    499: //
                    500: 
                    501: typedef struct _PERF_COUNTER_BLOCK {
1.1.1.3 ! root      502:     DWORD           ByteLength;         // Length in bytes of this structure,
        !           503:                                         // including the following counters
1.1       root      504: } PERF_COUNTER_BLOCK, *PPERF_COUNTER_BLOCK;
                    505: 
                    506: //
                    507: //  The PERF_COUNTER_BLOCK is followed by PERF_OBJECT_TYPE.NumCounters
                    508: //  number of counters.
                    509: //
1.1.1.2   root      510: 
1.1.1.3 ! root      511: //
        !           512: //  function typedefs for extensible counter function prototypes
        !           513: //
        !           514: typedef DWORD (PM_OPEN_PROC) (LPWSTR);
        !           515: typedef DWORD (PM_COLLECT_PROC) (LPWSTR, LPVOID *, LPDWORD, LPDWORD);
        !           516: typedef DWORD (PM_CLOSE_PROC) ();
        !           517: 
        !           518: #endif // _WINPERF_
        !           519: 
        !           520: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.