home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / PVWXPORT.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  14KB  |  349 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /*static char *SCCSID = "@(#)pvwxport.h 6.2 92/02/05";*/
  13. /*      SCCSID = "@(#)pvwxport.h        6.2 92/02/05"       */
  14.  
  15. /****************************** Module Header ******************************\
  16. *
  17. * Module Name: PVWXPORT.H
  18. *
  19. * OS/2 Perfview (PVW) Definitions File
  20. *
  21. *
  22. * ===========================================================================
  23. *
  24. *  This include file contains the definitions and constants for the
  25. *  registration of a performance counter group. This header file should be
  26. *  included when DosRegisterPerfCtrs(), dh_RegisterPerfCtrs(),
  27. *  fsh_RegisterPerfCtrs() are needed.
  28. *
  29. *
  30. \***************************************************************************/
  31.  
  32. /* Miscellaneous constants */
  33.  
  34. /* Types */
  35.  
  36. /*** Quad-Word (qw) definitions */
  37.  
  38. struct qw_s {
  39.         ULONG   qw_ulLo;
  40.         ULONG   qw_ulHi;
  41. };
  42.  
  43. typedef struct  qw_s QWRD;      /* qw  */
  44. typedef QWRD    FAR *PQWRD;     /* pqw */
  45.  
  46. #define QW_MAX_HI       0x7fffffff
  47. #define QW_MAX_LO       0xffffffff
  48. #define QW_MIN_HI       0x80000000
  49. #define QW_MIN_LO       0x00000000
  50.  
  51. typedef ULONG CNT;              /* ct                   */
  52. typedef struct  qw_s TIMR;      /* tm                   */
  53. typedef struct  qw_s SUMSQ;     /* ss -- Sum of Squares */
  54. typedef struct  qw_s BULKCNT;   /* bc -- Bulk Count     */
  55. typedef ULONG QCT;              /* qct that can go up or down */
  56.  
  57. typedef CNT     FAR * PCNT;     /* pct                  */
  58. typedef TIMR    FAR * PTIMR;    /* ptm                  */
  59. typedef SUMSQ   FAR * PSUMSQ;   /* pss                  */
  60. typedef BULKCNT FAR * PBULKCNT; /* pbc                  */
  61. typedef QCT     FAR * PQCT;     /* pqct                 */
  62.  
  63.  
  64. /*** Queue Length (ql) definitions */
  65.  
  66. struct qlen_s {
  67.         TIMR    ql_tm;
  68.         CNT     ql_ct;
  69. };
  70.  
  71. typedef struct  qlen_s qlen_t;  /* ql  */
  72. typedef struct  qlen_s QLEN;
  73. typedef QLEN    FAR *  PQLEN;   /* pql */
  74.  
  75. /* This definition satisfies MASM happy when it sees the results of H2INC; it
  76.  * provides a convenient way to define a pointer size.
  77.  */
  78.  
  79. struct ul_s {                   /* ul */
  80.         ULONG   ul_ul;
  81. };
  82.  
  83. /**************************************************************************/
  84.  
  85. /* RegisterPerfCtrs (RPC) definitions
  86.  *
  87.  *      For DosRegisterPerfCtrs(), dh_RegisterPerfCtrs(),
  88.  *      fsh_RegisterPerfCtrs(), vdh_RegisterPerfCtrs().
  89.  */
  90.  
  91. /*      FLAGS   RegisterPerfCtrs Flags -- valid values for 'flFlags' of Data
  92.  *              block are:
  93.  *
  94.  *              {RPC_FL_16BIT | RPC_FL_32BIT} |
  95.  *              {RPC_FL_PERS | RPC_FL_TRAN} |
  96.  *              {RPC_FL_KRNL | RPC_FL_DD | RPC_FL_FSD | RPC_FL_VDD | RPC_FL_APP} |
  97.  *              RPC_FL_TMR_INIT |
  98.  *              RPC_FL_DEREG
  99.  */
  100.  
  101. #define RPC_FL_16BIT      0x0000        /* 16-bit interface             */
  102. #define RPC_FL_32BIT      0x0001        /* 32-bit interface             */
  103.  
  104. #define RPC_FL_PERS       0x0002        /* Persistent entity type       */
  105. #define RPC_FL_TRAN       0x0004        /* Transient entity type        */
  106.  
  107. #define RPC_FL_KRNL       0x0008
  108. #define RPC_FL_DD         0x0010        /* Device driver entity type    */
  109. #define RPC_FL_FSD        0x0020        /* FSD entity type              */
  110. #define RPC_FL_VDD        0x0040        /* VDD entity type              */
  111. #define RPC_FL_APP        0x0080        /* Application entity type      */
  112.  
  113. #define RPC_FL_TMR_INIT   0x0100        /* Init Tmr function ptrs at
  114.                                          * registration time.
  115.                                          */
  116.  
  117. #define RPC_FL_DEREG      0x0200        /* Deregister entity            */
  118.  
  119. /*      The following flags are reserved for private use by the kernel; they
  120.  *      are cleared at registration time.
  121.  */
  122.  
  123. #define RPC_FL_CONFIG     0x0400        /* Configured                   */
  124.  
  125. /*              Flag Masks
  126.  */
  127.  
  128. #define RPC_FLM_KRNL_PERS (RPC_FL_KRNL | RPC_FL_PERS)
  129. #define RPC_FLM_KRNL_TRAN (RPC_FL_KRNL | RPC_FL_TRAN)
  130.  
  131. #define RPC_FLM_DRV (RPC_FL_DD | RPC_FL_FSD | RPC_FL_VDD) /* Driver entities */
  132.  
  133. #define RPC_FLM_PRIVATE (RPC_FL_CONFIG) /* Private flags for kernel use */
  134.  
  135. #define RPC_FLM_ET (RPC_FL_KRNL | RPC_FL_DD | RPC_FL_FSD | RPC_FL_VDD | RPC_FL_APP) /* Entity Type */
  136.  
  137.  
  138.  
  139. /*      Perfview Block IDentifier (bid)
  140.  */
  141.  
  142. struct pvbid_s {
  143.         USHORT  bid_usInstance; /* Block Instance ID                    */
  144.         USHORT  bid_usGroup;    /* Block Group ID                       */
  145. };
  146.  
  147. typedef struct pvbid_s  pvbid_t;        /* Block ID                     */
  148. typedef struct pvbid_s  BID;
  149.  
  150. typedef pvbid_t FAR *   ppvbid_t;       /* Ptr to Block ID              */
  151. typedef pvbid_t FAR *   PBID;
  152.  
  153. #define RPC_MAX_ID      0xffff          /* Maximum ID must fit in USHORT */
  154.  
  155.  
  156.  
  157. /*      PerfView Text Block Name (tbn)
  158.  *
  159.  *      FLAGS   Valid values for 'tbn_ulFlags' are:
  160.  *
  161.  *              for Counter Names:
  162.  *
  163.  *              {TBN_FL_CT_UNKNOWN | TBN_FL_CT_CNT | TBN_FL_CT_TIMR |
  164.  *              TBN_FL_CT_QLEN | TBN_FL_CT_SUMSQ | TBN_FL_BULKCT | TBN_FL_CT_QCT}
  165.  *              TBN_FL_CT_QCT
  166.  *              for Group and Instance Names:
  167.  *
  168.  *              {TBN_FL_PERS | TBN_FL_TRAN} |
  169.  *              {TBN_FL_KRNL} |
  170.  *              {TBN_FL_MULTIPROC}
  171.  *
  172.  *      NOTES   The structure members take on slightly different meanings
  173.  *              when they are used to describe a Transient Entity Instance.
  174.  *              In this case, the tbh_atbnName member of the Text Block
  175.  *              Header (TBH) serves as a pointer to an array of instance
  176.  *              descriptor blocks which have the same form as pvtbName_s, but
  177.  *              rather than describing counters in a separate Data Block,
  178.  *              they are self-describing:  tbn_pszName describes the contents
  179.  *              of tbn_ulFlags, tbn_usMsgID would retain its usual meaning,
  180.  *              and tbn_usSize would be unused.
  181.  *
  182.  *              For example, if tbn_pszName = "PID", then tbn_ulFlags will
  183.  *              contain the pid of the process which created this instance.
  184.  *              Typical descriptors for kernel transient instances would be
  185.  *              "PID", "TID", and "SLOT #".  By convention, the first TBN
  186.  *              block of the tbh_atbnName array will contain the name of the
  187.  *              creating process in tbn_pszName; in this case, tbn_ulFlags
  188.  *              will be unused.
  189.  */
  190.  
  191. struct pvtbName_s {
  192.         ULONG   tbn_ulFlags;    /* Flags, see TBN_FL_***                */
  193.         USHORT  tbn_usSize;     /* Counter Size                         */
  194.         USHORT  tbn_usMsgID;    /* Message ID                           */
  195.         PSZ     tbn_pszName;    /* Name (default message)               */
  196. };
  197.  
  198. typedef struct pvtbName_s       pvtbName_t;  /* Text Block Name         */
  199. typedef struct pvtbName_s       TBN;
  200.  
  201. typedef pvtbName_t FAR *        ppvtbName_t; /* Ptr to Text Block Name  */
  202. typedef pvtbName_t FAR *        PTBN;        /* Ptr to Text Block Name  */
  203.  
  204.  
  205. #define _PVWNAME                pvtbName_s
  206. typedef struct pvtbName_s       PVWNAME;
  207.  
  208.  
  209. /*      Flags values (tbn_ulFlags)
  210.  */
  211.  
  212. #define TBN_FLM_CT          0x000F /* Counter Flag Mask (values 0 -> 0xF)*/
  213. #define TBN_FL_CT_CNT       0x0000 /*   Count                            */
  214. #define TBN_FL_CT_TIMR      0x0001 /*   Timer                            */
  215. #define TBN_FL_CT_QLEN      0x0002 /*   Queue length                     */
  216. #define TBN_FL_CT_SUMSQ     0x0003 /*   Sum of Squares                   */
  217. #define TBN_FL_CT_BULKCT    0x0004 /*   Bulk Counter                     */
  218. #define TBN_FL_CT_UNKNOWN   0x0005 /*   Unknown type                     */
  219. #define TBN_FL_CT_QCT       0x0006 /*   Count that increases or decreases */
  220.  
  221.                                    /* These are used in the tbh_tbnGroup and
  222.                                     * tbh_tbnInstance Name blocks (see pvtbh_s).
  223.                                     */
  224. #define TBN_FL_PERS         0x0010 /* Persistent Entity                  */
  225. #define TBN_FL_TRAN         0x0020 /* Transient Entity                   */
  226. #define TBN_FL_KRNL         0x0040 /* Kernel Entity                      */
  227. #define TBN_FL_MULTIPROC    0x0080 /* Multiple Processor Entity          */
  228.  
  229.                                    /* General purpose (per counter) flags*/
  230. #define TBN_FL_ADVANCED     0x0100 /* Advanced property                  */
  231. #define TBN_FL_HISTOGRAM    0x0200 /* Start/End histogram counters       */
  232.  
  233. #define TBN_FLM_UNKNOWN     0xF000 /* For Unknown counter types
  234.                                     * (TBN_FL_CT_UNKNOWN), these flags are
  235.                                     * reserved for use by the Registrant.
  236.                                     */
  237.  
  238.  
  239. /*      PerfView Text Block Header (tbh)
  240.  *
  241.  *      NOTES   Values for the version number, tbh_ulVersion, are defined
  242.  *              below (TBH_VER_...).
  243.  *
  244.  *              See NOTES for Perfview Text Block Name (tbn) concerning
  245.  *              the tbh_atbnName member.
  246.  */
  247.  
  248. struct pvtbh_s {
  249.         ULONG   tbh_ulVersion;  /* Version number (MUST BE FIRST MEMBER)   */
  250.         BID     tbh_bidID;      /* Block IDentifier                        */
  251.         TBN     tbh_tbnGroup;   /* Text block Group name                   */
  252.         TBN     tbh_tbnInstance; /* Text block Instance name               */
  253.         PSZ     tbh_pszMsgFile; /* Message File name                       */
  254.         PSZ     tbh_pszHelpFile; /* Help File name                         */
  255.         ULONG   tbh_culName;    /* Number of counters Names                */
  256.         PTBN    tbh_atbnName;   /* Pointer to array of counter Name blocks */
  257. };
  258.  
  259. typedef struct pvtbh_s  pvtbh_t;        /* Text Block Header            */
  260. typedef struct pvtbh_s  TBH;
  261.  
  262. #define _PVWFSDTEXTH    pvtbh_s         /* for File System Driver (FSD) */
  263. typedef struct pvtbh_s  PVWFSDTEXTH;
  264.  
  265. typedef pvtbh_t FAR *   ppvtbh_t;       /* Pointer to Text Block Header */
  266. typedef pvtbh_t FAR *   PTBH;
  267.  
  268. #define NUM_TBH_PSZ     4               /* Number of ASCIIZ ptrs in TBH */
  269.  
  270.  
  271. /*      Version number values (tbh_ulVersion)
  272.  *
  273.  *      Format: A.B.C.D where   A = Major version #
  274.  *                              B = Major release #
  275.  *                              C = Minor release #
  276.  *                              D = Development revision #
  277.  */
  278.  
  279. #define TBH_VER_2_0_0_0 0x02000000              /* 2.0.0.0 */
  280.  
  281. /* XLATOFF */
  282. #define TBH_VER_CURRENT TBH_VER_2_0_0_0         /* Currently supported  */
  283. /* XLATON */
  284.  
  285.  
  286.  
  287. /*      PerfView Data Block Header (dbh)
  288.  *
  289.  *      FLAGS   Valid values for 'dbh_ulFlags' are:
  290.  *
  291.  *              {RPC_FL_16BIT | RPC_FL_32BIT} |
  292.  *              {RPC_FL_PERS | RPC_FL_TRAN} |
  293.  *              {RPC_FL_KRNL | RPC_FL_DD | RPC_FL_FSD | RPC_FL_VDD | RPC_FL_APP} |
  294.  *
  295.  *      NOTES   If modifying pvdbh_s, be sure to change both the 'C' AND
  296.  *              MASM definitions below.  They are separated because h2inc.exe
  297.  *              doesn't handle the pfnTmr declaration conversion properly.
  298.  *
  299.  *              Semaphore:  Kernel counters and Drivers use 'dbh_ulSem' as a
  300.  *              "data modified" flag (increment each time block modified).
  301.  *              Applications use 'dbh_ulSem' as a semaphore handle
  302.  *              (semaphore is created by the Application).
  303.  */
  304.  
  305. /* XLATOFF */ /* pfnTmr members are treated as INT rather than PFN by h2inc */
  306. struct pvdbh_s {
  307.         ULONG   dbh_ulTotLen;   /* Total Length of data block (including hdr)*/
  308.         BID     dbh_bidID;      /* Block IDentifier                          */
  309.         ULONG   dbh_flFlags;    /* Flags                                     */
  310.         ULONG   dbh_ulSem;      /* Semaphore or Semaphore handle             */
  311.         INT     (FAR *dbh_pfnTmrAdd)(PTIMR); /* Ptr to timer Addition function */
  312.         INT     (FAR *dbh_pfnTmrSub)(PTIMR); /* Ptr to timer Subtract function */
  313. };
  314. /* XLATON */
  315.  
  316. /*ASM
  317. pvdbh_s STRUC
  318. dbh_ulTotLen    DD      ?       ;  Total Length of data block (including hdr)
  319. dbh_bidID       DB SIZE BID DUP (?) ;  IDentifier (Block ID)
  320. dbh_flFlags     DD      ?       ;  Flags
  321. dbh_ulSem       DD      ?       ;  Semaphore or Semaphore handle
  322. dbh_pfnTmrAdd   DD      ?       ;  Ptr to timer Addition function
  323. dbh_pfnTmrSub   DD      ?       ;  Ptr to timer Subtract function
  324. pvdbh_s ENDS
  325. */
  326.  
  327. typedef struct pvdbh_s  pvdbh_t;        /* Data Block Header            */
  328. typedef struct pvdbh_s  DBH;
  329.  
  330. #define _PVWFSDDATAH    pvdbh_s         /* for File System Driver (FSD) */
  331. typedef struct pvdbh_s  PVWFSDDATAH;
  332.  
  333. typedef pvdbh_t FAR *   ppvdbh_t;       /* Pointer to Data Block Header */
  334. typedef pvdbh_t FAR *   PDBH;
  335.  
  336.  
  337. /***************************************************************************/
  338.  
  339. /*      Counter Types (CT) (************ -- USE TBN_FL_... ***)
  340.  */
  341.  
  342. #define PVW_CT_UNKNOWN    TBN_FL_CT_UNKNOWN
  343. #define PVW_CT_CNT        TBN_FL_CT_CNT
  344. #define PVW_CT_TIMR       TBN_FL_CT_TIMR
  345. #define PVW_CT_QLEN       TBN_FL_CT_QLEN
  346. #define PVW_CT_SUMSQ      TBN_FL_CT_SUMSQ
  347. #define PVW_CT_BULKCT     TBN_FL_CT_BULKCT
  348. #define PVW_CT_QCT        TBN_FL_CT_QCT
  349.