DosPerfSysCall is a general purpose performance function. This function accepts four parameters. The first parameter is the command requested. The other three parameters are command specific. DosPerfSysCall is intended to be extended by IBM in the future for other performance related functions.

Some functions of DosPerfSysCall may have a dependency on Intel Pentium or Pentium-Pro support. If a function cannot be provided because OS/2 is not running on an processor with the required features, a return code will indicate an attempt to use an unsupported function.

The perfutil.h file referenced in the example code may or may not be shipped as part of the Toolkit. In the event that it is not, its contents are:

#ifdef __cplusplus
  extern "C" {
#endif

#ifndef  PERFCALL_INCLUDED
#define  PERFCALL_INCLUDED

/*
   DosPerfSysCall Function Prototype
*/

/* The  ordinal for DosPerfSysCall (in BSEORD.H) */
/* is defined as ORD_DOS32PERFSYSCALL         */

APIRET APIENTRY DosPerfSysCall(ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3);

/***
 *
 * CPU Utilization
 * ---------------
 *
 **/

#define   CMD_KI_RDCNT    (0x63)

 typedef struct _CPUUTIL {
   ULONG ulTimeLow;     /* Low 32 bits of time stamp      */
   ULONG ulTimeHigh;    /* High 32 bits of time stamp     */
   ULONG ulIdleLow;     /* Low 32 bits of idle time       */
   ULONG ulIdleHigh;    /* High 32 bits of idle time      */
   ULONG ulBusyLow;     /* Low 32 bits of busy time       */
   ULONG ulBusyHigh;    /* High 32 bits of busy time      */
   ULONG ulIntrLow;     /* Low 32 bits of interrupt time  */
   ULONG ulIntrHigh;    /* High 32 bits of interrupt time */
  } CPUUTIL;

 typedef CPUUTIL *PCPUUTIL;

#ifdef __cplusplus
  }
#endif

It may also be necessary to define the ordinal for this function:

#define ORD_DOS32PERFSYSCALL            976


[Back] [Next]