DosQueryPerformance() dynalink library, public release 1.0.0

Copyright 2001 January June / Yotogi-Hime / Beliefia Productions.


0. Table of Contents



1. Welcome

This software is a dynalink library that queries performance activity ratios (busy, idle and interrupt one) of overall system and each CPUs on 32bit OS/2 process.
This function is derived from DosPerfSysCall() API, but it is slightly complicated to issue this API directly: This DLL internally does such complex handlings of all above, thus you can simply call one: DosQueryPerformance() :)

It can be used any 32bit development suites that can issue OS/2 APIs such as emx/gcc, VisualAge C/C++ or Watcom C/C++, and REXX external function interface is also supplied.
Free to use, under the GNU LGPL.

1.1. Copyright and Disclaimer

  1. 'THIS SOFTWARE AND WHOLE SET OF DOCUMENTS' (CALLED 'THE PACKAGE') ARE ENTIRELY COPYRIGHTED BY TAKAYUKI 'JANUARY JUNE' SUWA/BELIEFIA PRODUCTIONS, AUTHOR/HOLDER OF THE PRODUCT.
  2. THIS PACKAGE IS DISTRIBUTED UNDER THE "GNU LESSER PUBLIC LICENSE" (LGPL). IT CLAIMS: SEE "COPYING" FOR DETAIL.
  3. THE PACKAGE IS PROVIDED 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  4. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES, WHETHER IN CONTRACT OR TORT (INCLUDED NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE PRODUCT, EVEN THOUGH SUCH HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF ANY DAMAGE.

1.2. System Requirements

This program will be functioned in environment such as:

1.3. Contact Author

Email to Takayuki 'January June' Suwa:

1.4. Revision History



2. Reference


2.1. PERFDLL.DLL, C/C++ API


2.1.1. DosQueryPerformance()

Syntax Queries performance information.
#define INCL_BASE
#include <os2.h>
#include "PERFDLL.h"
 
APIRET ulrc = DosQueryPerformance(PPERFORMANCE pxPerfInfo);
Parameters
pxPerfInfo (PPERFORMANCE) - output
Pointer to structure that performance information will be set to.
Returns
ulrc (APIRET) - return
Return codes.
ERROR_INVALID_FUNCTION
Error. (either DosPerfSysCall() API or RDTSC instruction are not capable, nor both)
NO_ERROR
Successful completion.
Remarks

This function queries performance information. Queried information will be stored into *pxPerfInfo.
Structure PERFORMANCE is defined as follows:
/* performance information structure */
typedef struct _PERFORMANCE
{
    ULONG ulNumCPUs;             /* # of available CPUs */
    struct
    {
        FIXED fxIdleRatio;       /* idle ratio in FIXED percentage (65536 means 1.0) */
        FIXED fxBusyRatio;       /* busy ratio in FIXED percentage (65536 means 1.0) */
        FIXED fxInterruptRatio;  /* interrupt ratio in FIXED percentage (65536 means 1.0) */
    } Overall, ByCPU[64];        /* performance informations, by overall, and by each CPUs */
} PERFORMANCE, * PPERFORMANCE;
Fixed-pointed FIXED seems too coarse, but enough to hold "nn.nnnn%" format :)


2.2. RXPERFDL.DLL, REXX External Function Interface


2.2.1. RxQpLoadFuncs

Syntax Loads all RXPERFDL.DLL functions.
call RxFuncAdd 'RxQpLoadFuncs', 'RXPERFDL', 'RxQpLoadFuncs'
call RxQpLoadFuncs
Parameters None.
Returns None.
Remarks

This function loads all RXPERFDL.DLL functions, as same as RexxUtil SysLoadFuncs.


2.2.2. RxQpDropFuncs

Syntax Drops all RXPERFDL.DLL functions.
call RxQpDropFuncs
Parameters None.
Returns None.
Remarks

This function drops all RXPERFDL.DLL functions, as same as RexxUtil SysDropFuncs.


2.2.3. RxQueryPerformance

Syntax Queries performance information.
rc = RxQueryPerformance(stem)
Parameters
stem
name of stem variable that performance information will be set to.
Returns
rc
Return codes.
1
Error. (either DosPerfSysCall() API or RDTSC instruction are not capable, nor both)
0
Successful completion.
Remarks

This function queries performance information using PERFDLL.DLL DosQueryPerformance(). Queried information will be stored into stem variable stem.

stem.ulNumCPUs
# of available CPUs.
stem.Overall.fxIdleRatio
Overall performance information, idle ratio in FIXED percentage (65536 means 1.0).
stem.Overall.fxBusyRatio
Overall performance information, busy ratio in FIXED percentage.
stem.Overall.fxInterruptRatio
Overall performance information, interrupt ratio in FIXED percentage.
stem.ByCPU.n.fxIdleRatio (n : CPU index, 0 - stem.ulNumCPUs-1)
Individual CPU performance information, idle ratio in FIXED percentage.
stem.ByCPU.n.fxBusyRatio
Individual CPU performance information, busy ratio in FIXED percentage.
stem.ByCPU.n.fxInterruptRatio
Individual CPU performance information, interrupt ratio in FIXED percentage.



Copyright 2001 January June / Yotogi-Hime / Beliefia Productions. All rights reserved.
Beliefia Productions and its logo design are trademarks of Beliefia Productions. All rights reserved.
Other copyrighted works(images, musics, programs, and so on), trademarks and servicemarks in this document are owned by their respective owners.

[This document is HTML3.2(Wilbur)-compliant.]