[ Previous | Next | Table of Contents | Index | Legal | ]

Performance Toolbox Version 2 and 3 Guide and Reference


Appendix E. SPMI Subroutines

The SPMI subroutines constitute the application programming interface (API) to the SPMI.


SpmiAddSetHot Subroutine

Purpose

Adds a set of peer statistics values to a hotset.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiHotVals *SpmiAddSetHot(HotSet, StatName,
GrandParent, maxresp,
                                  threshold, frequency, feed_type,
                                  except_type, severity, trap_no)
struct SpmiHotSet *HotSet;
char *StatName;
SpmiCxHdl GrandParent;
int maxresp;
int threshold;
int frequency;
int feed_type;
int excp_type;
int severity;
int trap_no;

Description

The SpmiAddSetHot subroutine adds a set of peer statistics to a hotset. The SpmiHotSet (SpmiHotSet Structure) structure that provides the anchor point to the set must exist before the SpmiAddSetHot subroutine call can succeed.

Parameters

HotSet

Specifies a pointer to a valid structure of type SpmiHotSet as created by the SpmiCreateHotSet (SpmiCreateHotSet) subroutine call.

StatName

Specifies the name of the statistic within the subcontexts (peer contexts) of the context identified by the GrandParent parameter.

GrandParent

Specifies a valid SpmiCxHdl (SpmiCxHdl Handle) handle as obtained by another subroutine call. The handle must identify a context with at least one subcontext, which contains the statistic identified by the StatName parameter. If the context specified is one of the RTime contexts, no subcontext need to exist at the time the SpmiAddSetHot subroutine call is issued; the presence of the metric identified by the StatName parameter is checked against the context class description.

If the context specified has or may have multiple levels of instantiable context below it (such as the FS and RTime/ARM contexts), the metric is only searched for at the lowest context level. The SpmiHotSet created is a pseudo hotvals structure used to link together a peer group of SpmiHotValsstructures, which are created under the covers, one for each subcontext of the GrandParent context. In the case of RTime/ARM, if additional contexts are later added under the GrandParent contexts, additional hotsets are added to the peer group. This is transparent to the application program, except that the SpmiFirstHot, SpmiNextHot, and SpmiNextHotItem subroutine calls will return the peer group SpmiHotVals pointer rather than the pointer to the pseudo structure.

Note that specifying a specific volume group context (such as FS/rootvg) or a specific application context (such as RTime/ARN/armpeek) is still valid and won't involve creation of pseudo SpmiHotVals structures.

maxresp

Must be non-zero if excp_type specifies that exceptions or SNMP traps must be generated. If specified as zero, indicates that all SpmiHotItems that meet the criteria specified by threshold must be returned, up-to a maximum of maxresp items. If both exceptions/traps and feeds are requested, the maxresp value is used to cap the number of exceptions/alerts as well as the number of items returned. If feed_type is specified as SiHotAlways, the maxresp parameter is still used to return at most maxresp items.

Where the GrandParent argument specifies a context that has multiple levels of instantiable contexts below it, the maxresp is applied to each of the lowest level contexts above the the actual peer contexts at a time. For example, if the GrandParent context is FS (file systems) and the system has three volume groups, then a maxresp value of 2 could cause up to a maximum of 2 x 3 = 6 responses to be generated.

threshold

Must be non-zero if excp_type specifies that exceptions or SNMP traps must be generated. If specified as zero, indicates that all values read qualify to be returned in feeds. The value specified is compared to the data value read for each peer statistic. If the data value exceeds the threshold, it qualifies to be returned as an SpmiHotItems element in the SpmiHotVals (SpmiHotVals Structure) structure. If the threshold is specified as a negative value, the value qualifies if it is lower than the numeric value of threshold. If feed_type is specified as SiHotAlways, the threshold value is ignored for feeds. For peer statistics of type SiCounter, the threshold must be specified as a rate per second; for SiQuantity statistics the threshold is specified as a level.

frequency

Must be non-zero if excp_type specifies that exceptions or SNMP traps must be generated. Ignored for feeds. Specifies the minimum number of minutes that must expire between any two exceptions/traps generated from this SpmiHotVals structure. This value must be specified as no less than 5 minutes.

feed_type

Specifies if feeds of SpmiHotItems should be returned for this SpmiHotVals structure. The following values are valid:

SiHotNoFeed
No feeds should be generated
SiHotThreshold
Feeds are controlled by threshold.
SiHotAlways
All values, up-to a maximum of maxresp must be returned as feeds.

excp_type

Controls the generation of exception data packets and/or the generation of SNMP Traps from xmservd. Note that these types of packets and traps can only actually be sent if xmservd is running. Because of this, exception packets and SNMP traps are only generated as long as xmservd is active. Traps can only be generated on AIX systems. The conditions for generating exceptions and traps are controlled by the threshold and frequency parameters. The following values are valid for excp_type:

SiNoHotException
Generate neither exceptions not traps.

SiHotException
Generate exceptions but not traps.

SiHotTrap
Generate SNMP traps but not exceptions.

SiHotBoth
Generate both exceptions and SNMP traps.

severity

Required to be positive and greater than zero if exceptions are generated, otherwise specify as zero. Used to assign a severity code to the exception for display by exmon.

trap_no

Required to be positive and greater than zero if SNMP traps are generated, otherwise specify as zero. Used to assign the trap number in the generated SNMP trap.

Return Values

The SpmiAddSetHot subroutine returns a pointer to a structure of type SpmiHotVals (SpmiHotVals Structure) if successful. If unsuccessful, the subroutine returns a NULL value.

Programming Notes

The SpmiAddSetHot functions in a straight forward manner and as described previously in all cases where the GrandParent context is a context that has only one level of instantiable contexts below it. This covers most context types such as CPU, Disk, LAN, etc. In a few cases, currently only the FS (file system) and RTime/ARM (application response) contexts, the SPMI works by creating pseudo-hotvals structures that effectively expand the hotset. These pseudo-hotvals structures are created either at the time the SpmiAddSetHot call is issued or when new subcontexts are created for a context that's already the GrandParent of a hotvals peer set. For example:

When a peer set is created for RTime/ARM, maybe only a few or no subcontexts of this context exists. If two applications were defined at this point, say checking and savings, one valsset would be created for the RTime/ARM context and a pseudo-valsset for each of RTime/ARM/checking and RTime/ARM/savings. As new applications are added to the RTime/ARM contexts, new pseudo-valssets are automatically added to the hotset.

Pseudo-valssets represent an implementation convenience and also helps minimize the impact of retrieving and presenting data for hotsets. As far as the caller of the RSiGetHotItem subroutine call is concerned, it is completely transparent. All this caller will ever see is the real hotvals structure. That is not the case for callers of SpmiFirstHot, SpmiNextHot, and SpmiNextHotItem. All of these subroutines will return pseudo-valssets and the calling program should be prepared to handle this.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

SpmiCreateHotSet

Purpose

Creates an empty hotset.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiHotSet *SpmiCreateHotSet()

Description

The SpmiCreateHotSet subroutine creates an empty hotset and returns a pointer to an SpmiHotSet (SpmiHotSet Structure) structure.This structure provides the anchor point for a hotset and must exist before the SpmiAddSetHot (SpmiAddSetHot Subroutine) subroutine can be successfully called.

Return Values

The SpmiCreateHotSet subroutine returns a pointer to a structure of type SpmiHotSet if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiCreateStatSet Subroutine

Purpose

Creates an empty set of statistics.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStatSet *SpmiCreateStatSet()

Description

The SpmiCreateStatSet subroutine creates an empty set of statistics and returns a pointer to an SpmiStatSet (SpmiStatSet Structure) structure.

The SpmiStatSet structure provides the anchor point to a set of statistics and must exist before the SpmiPathAddSetStat (SpmiPathAddSetStat Subroutine) subroutine can be successfully called.

Return Values

The SpmiCreateStatSet subroutine returns a pointer to a structure of type SpmiStatSet if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiDdsAddCx Subroutine

Purpose

Adds a volatile context to the contexts defined by an application.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

char *SpmiDdsAddCx(Ix, Path, Descr, Asnno)
ushort Ix;
char *Path, *Descr;
int Asnno;

Description

The SpmiDdsAddCx subroutine uses the shared memory area to inform the SPMI that a context is available to be added to the context hierarchy, moves a copy of the context to shared memory, and allocates memory for the data area.

Parameters

Ix

Specifies the element number of the added context in the table of dynamic contexts. No context can be added if the table of dynamic contexts has not been defined in the SpmiDdsInit, see SpmiDdsInit Subroutine subroutine call. The first element of the table is element number 0.

Path

Specifies the full path name of the context to be added. If the context is not at the top-level, the parent context must already exist.

Descr

Provides the description of the context to be added as it will be presented to data consumers.

Asnno

Specifies the ASN.1 number to be assigned to the new context. All subcontexts on the same level as the new context must have unique ASN.1 numbers. Typically, each time the SpmiDdsAddCx subroutine adds a subcontext to the same parent context, the Asnno parameter is incremented. See Making Dynamic Data-Supplier Statistics Unique for more information about ASN.1 numbers.

Return Values

If successful, the SpmiDdsAddCx subroutine returns the address of the shared memory data area. If an error occurs, an error text is placed in the external SpmiErrmsg character array, and the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiDdsDelCx Subroutine

Purpose

Deletes a volatile context.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiDdsDelCx(Area)
char *Area;

Description

The SpmiDdsDelCx subroutine informs the SPMI that a previously added, volatile context should be deleted.

If the SPMI has not detected that the context to delete was previously added dynamically, the SpmiDdsDelCx subroutine removes the context from the list of to-be-added contexts and returns the allocated shared memory to the free list. Otherwise, the SpmiDdsDelCx subroutine indicates to the SPMI that a context and its associated statistics must be removed from the context hierarchy and any allocated shared memory must be returned to the free list.

Parameters

Area

Specifies the address of the previously allocated shared memory data area as returned by an SpmiDdsAddCx subroutine call.

Return Values

If successful, the SpmiDdsDelCx subroutine returns a value of 0. If an error occurs, an error text is placed in the external SpmiErrmsg character array, and the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiDdsInit Subroutine

Purpose

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

SpmiShare *SpmiDdsInit(CxTab, CxCnt, IxTab, IxCnt,
FileName)
cx_create *CxTab, *IxTab;
int CxCnt, IxCnt;
char *FileName;

Description

The SpmiDdsInit subroutine establishes a program as a dynamic data-supplier (DDS) program. To do so, the SpmiDdsInit subroutine:

  1. Determines the size of the shared memory required and creates a shared memory segment of that size.
  2. Moves all static contexts and all statistics referenced by those contexts to the shared memory.
  3. Calls the SPMI and requests it to add all of the DDS static contexts to the context tree.

Notes:
  1. The SpmiDdsInit subroutine issues an SpmiInit subroutine call if the application program has not issued one.
  2. If the calling program uses shared memory for other purposes, including memory mapping of files, the SpmiDdsInit or the SpmiInit (SpmiInit Subroutine) subroutine call must be issued before access is established to other shared memory areas.

Parameters

CxTab

Specifies a pointer to the table of nonvolatile contexts to be added.

CxCnt

Specifies the number of elements in the table of nonvolatile contexts. Use the CX_L macro to find this value.

IxTab

Specifies a pointer to the table of volatile contexts the program may want to add later. If no contexts are defined, specify NULL.

IxCnt

Specifies the number of elements in the table of volatile contexts. Use the CX_L macro to find this value. If no contexts are defined, specify 0.

FileName

Specifies the fully qualified path and file name to use when creating the shared memory segment. At execution time, if the file exists, the process running the DDS must be able to write to the file. Otherwise, the SpmiDdsInit subroutine call does not succeed. If the file does not exist, it is created. If the file cannot be created, the subroutine returns an error. If the file name includes directories that do not exist, the subroutine returns an error.

For non-AIX systems, a sixth argument is required to inform the SPMI how much memory to allocate in the DDS shared memory segment. This is not required for AIX systems because facilities exist to expand a memory allocation in shared memory. The sixth argument is:

size

Size in bytes of the shared memory area to allocate for the DDS program. This parameter is of type int.

Return Values

If successful, the SpmiDdsInit subroutine returns the address of the shared memory control area. If an error occurs, an error text is placed in the external SpmiErrmsg character array, and the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiDelSetHot Subroutine

Purpose

Removes a single set of peer statistics from a hotset.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiDelSetHot(HotSet, HotVal)
struct SpmiHotSet *HotSet;
struct SpmiHotVals *HotVal;

Description

The SpmiDelSetHot subroutine removes a single set of peer statistics, identified by the HotVal parameter, from a hotset, identified by the HotSet parameter.

Parameters

HotSet

Specifies a pointer to a valid structure of type SpmiHotSet, SpmiHotSet Structure, as created by the SpmiCreateHotSet subroutine call.

HotVal

Specifies a pointer to a valid structure of type SpmiHotVals, seeSpmiHotVals Structure, as created by the SpmiAddSetHot, see SpmiAddSetHot Subroutine subroutine call. You cannot specify an SpmiHotVals that was internally generated by the SPMI library code as described under the GrandParent parameter to SpmiAddSetHot (SpmiAddSetHot Subroutine).

Return Values

The SpmiDelSetHot subroutine returns a value of 0 if successful. If unsuccessful, the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiDelSetStat Subroutine

Purpose

Removes a single statistic from a set of statistics.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiDelSetStat(StatSet, StatVal)
struct SpmiStatSet *StatSet;
struct SpmiStatVals *StatVal;

Description

The SpmiDelSetStat subroutine removes a single statistic, identified by the StatVal parameter, from a set of statistics, identified by the StatSet parameter.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet, SpmiStatSet Structure, as created by the SpmiCreateStatSet SpmiCreateStatSet Subroutine) subroutine call.

StatVal

Specifies a pointer to a valid structure of type SpmiStatVals, SpmiStatVals Structure) as created by the SpmiPathAddSetStat, SpmiPathAddSetStat Subroutine) subroutine call.

Return Values

The SpmiDelSetStat subroutine returns a value of 0 if successful. If unsuccessful, the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiExit Subroutine

Purpose

Terminates a dynamic data supplier (DDS) or local data consumer program's association with the SPMI, and releases allocated memory.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

void SpmiExit()

Description

A successful SpmiInit (SpmiInit Subroutine) or SpmiDdsInit (SpmiDdsInit Subroutine) subroutine call allocates shared memory. Therefore, a Dynamic Data Supplier (DDS) program that has issued a successful SpmiInit or SpmiDdsInit subroutine call should issue an SpmiExit subroutine call before the program exits the SPMI. Allocated memory is not released until the program issues an SpmiExit subroutine call.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiFirstCx Subroutine

Purpose

Locates the first subcontext of a context.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiCxLink *SpmiFirstCx(CxHandle)
SpmiCxHdl CxHandle;

Description

The SpmiFirstCx subroutine locates the first subcontext of a context. The subroutine returns a NULL value if no subcontexts are found.

The structure pointed to by the returned pointer contains a handle to access the contents of the corresponding SpmiCx (SpmiCx Structure) structure through the SpmiGetCx (SpmiGetCx Subroutine) subroutine call.

Parameters

CxHandle

Specifies a valid SpmiCxHdl, see SpmiCxHdl Handle handle as obtained by another subroutine call.

Return Values

The SpmiFirstCx subroutine returns a pointer to an SpmiCxLink (SpmiCxLink Structure) structure if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiFirstHot Subroutine

Purpose

Locates the first of the sets of peer statistics belonging to a hotset.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiHotVals *SpmiFirstHot(HotSet)
struct SpmiHotSet HotSet;

Description

The SpmiFirstHot subroutine locates the first of the SpmiHotVals (SpmiHotVals Structure) structures belonging to the specified SpmiHotSet (SpmiHotSet Structure). Using the returned pointer, the SpmiHotSet can then either be decoded directly by the calling program, or it can be used to specify the starting point for a subsequent SpmiNextHotItem (SpmiNextHotItem Subroutine) subroutine call. The SpmiFirstHot subroutine should only be executed after a successful call to the SpmiGetHotSet (SpmiGetHotSet Subroutine) subroutine.

Parameters

HotSet

Specifies a valid SpmiHotSet structure as obtained by another subroutine call.

Return Values

The SpmiFirstHot subroutine returns a pointer to a structure of type SpmiHotVals structure if successful. If unsuccessful, the subroutine returns a NULL value. A returned pointer may refer to a pseudo-hotvals structure as described in Programming Notes for the SpmiAddSetHot (SpmiAddSetHot Subroutine) subroutine.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiFirstStat Subroutine

Purpose

Locates the first of the statistics belonging to a context.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStatLink *SpmiFirstStat(CxHandle)
SpmiCxHdl CxHandle;

Description

The SpmiFirstStat subroutine locates the first of the statistics belonging to a context. The subroutine returns a NULL value if no statistics are found.

The structure pointed to by the returned pointer contains a handle to access the contents of the corresponding SpmiStat (SpmiStat Structure) structure through the SpmiGetStat (SpmiGetStat Subroutine) subroutine call.

Parameters

CxHandle

Specifies a valid SpmiCxHdl, SpmiCxHdl Handle, handle as obtained by another subroutine call.

Return Values

The SpmiFirstStat subroutine returns a pointer to a structure of type SpmiStatLink (SpmiStatLink Structure) if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiFirstVals Subroutine

Purpose

Returns a pointer to the first SpmiStatVals structure belonging to a set of statistics.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStatVals *SpmiFirstVals(StatSet)
struct SpmiStatSet *StatSet;

Description

The SpmiFirstVals subroutine returns a pointer to the first SpmiStatVals (SpmiStatVals Structure) structure belonging to the set of statistics identified by the StatSet parameter. SpmiStatVals structures are accessed in reverse order so the last statistic added to the set of statistics is the first one returned. This subroutine call should only be issued after an SpmiGetStatSet (SpmiGetStatSet Subroutine) subroutine has been issued against the statset.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet as created by the SpmiCreateStatSet subroutine call.

Return Values

The SpmiFirstVals subroutine returns a pointer to an SpmiStatVals structure if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiFreeHotSet Subroutine

Purpose

Erases a hotset.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiFreeHotSet(HotSet)
struct SpmiHotSet *HotSet;

Description

The SpmiFreeHotSet subroutine erases the hotset identified by the HotSet parameter. All SpmiHotVals (SpmiHotVals Structure) structures chained off the SpmiHotSet (SpmiHotSet Structure) structure are deleted before the set itself is deleted.

Parameters

HotSet

Specifies a pointer to a valid structure of type SpmiHotSet as created by the SpmiCreateHotSet subroutine call.

Return Values

The SpmiFreeHotSet subroutine returns a value of 0 if successful. If unsuccessful, the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiFreeStatSet Subroutine

Purpose

Erases a set of statistics.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiFreeStatSet(StatSet)
struct SpmiStatSet *StatSet;

Description

The SpmiFreeStatSet subroutine erases the set of statistics identified by the StatSet parameter. All SpmiStatVals (SpmiStatVals Structure) structures chained off the SpmiStatSet (SpmiStatSet Structure) structure are deleted before the set itself is deleted.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet as created by the SpmiCreateStatSet, see SpmiCreateStatSet Subroutine, subroutine call.

Return Values

The SpmiFreeStatSet subroutine returns a value of 0 if successful. If unsuccessful, the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiGetCx Subroutine

Purpose

Returns a pointer to the SpmiCx (SpmiCx Structure) structure corresponding to a specified context handle.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiCx *SpmiGetCx(CxHandle)
SpmiCxHdl CxHandle;

Description

The SpmiGetCx subroutine returns a pointer to the SpmiCx structure corresponding to the context handle identified by the CxHandle parameter.

Parameters

CxHandle

Specifies a valid SpmiCxHdl, see SpmiCxHdl Handle, handle as obtained by another subroutine call.

Return Values

The SpmiGetCx subroutine returns a a pointer to an SpmiCx data structure if successful. If unsuccessful, the subroutine returns NULL.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiGetHotSet Subroutine

Purpose

Requests the SPMI to read the data values for all sets of peer statistics belonging to a specified SpmiHotSet (SpmiHotSet Structure).

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiGetHotSet(HotSet, Force);
struct SpmiHotSet *HotSet;
boolean Force;

Description

The SpmiGetHotSet subroutine requests the SPMI to read the data values for all peer sets of statistics belonging to the SpmiHotSet identified by the HotSet parameter. The Force parameter is used to force the data values to be refreshed from their source.

The Force parameter works by resetting a switch held internally in the SPMI for all SpmiStatVals (SpmiStatVals Structure) and SpmiHotVals (SpmiHotVals Structure) structures, regardless of the SpmiStatSets (SpmiStatSet Structure) and SpmiHotSets to which they belong. Whenever the data value for a peer statistic is requested, this switch is checked. If the switch is set, the SPMI reads the latest data value from the original data source. If the switch is not set, the SPMI reads the data value stored in the SpmiHotVals structure. This mechanism allows a program to synchronize and minimize the number of times values are retrieved from the source. One method programs can use is to ensure the force request is not issued more than once per elapsed amount of time.

Parameters

HotSet

Specifies a pointer to a valid structure of type SpmiHotSet as created by the SpmiCreateHotSet subroutine call.

Force

If set to true, forces a refresh from the original source before the SPMI reads the data values for the set. If set to false, causes the SPMI to read the data values as they were previously retrieved from the data source.

When the force argument is set true, the effect is that of marking all statistics known by the SPMI as obsolete, which causes the SPMI to refresh all requested statistics from kernel memory or other sources. As each statistic is refreshed, the obsolete mark is reset. Statistics that are not part of the HotSet specified in the subroutine call remain marked as obsolete. Therefore, if an application repetitively issues a series of, SpmiGetHotSet and SpmiGetStatSet SpmiGetStatSet Subroutine, subroutine calls for multiple hotsets and statsets, each time, only the first such call need set the force argument to true.

Return Values

The SpmiGetHotSet subroutine returns a value of 0 if successful. If unsuccessful, the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiGetStat Subroutine

Purpose

Returns a pointer to the SpmiStat (SpmiStat Structure) structure corresponding to a specified statistic handle.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStat *SpmiGetStat(StatHandle)
SpmiStatHdl StatHandle;

Description

The SpmiGetStat subroutine returns a pointer to the SpmiStat structure corresponding to the statistic handle identified by the StatHandle parameter.

Parameters

StatHandle

Specifies a valid SpmiStatHdl. see SpmiStatHdl Handle handle as obtained by another subroutine call.

Return Values

The SpmiGetStat subroutine returns a pointer to a structure of type SpmiStat if successful. If unsuccessful, the subroutine returns a NULL value.

Return Values

The SpmiGetStat subroutine returns a pointer to a structure of type SpmiStat if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiGetStatSet Subroutine

Purpose

Requests the SPMI to read the data values for all statistics belonging to a specified set.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiGetStatSet(StatSet, Force);
struct SpmiStatSet *StatSet;
boolean Force;

Description

The SpmiGetStatSet subroutine requests the SPMI to read the data values for all statistics belonging to the SpmiStatSet (SpmiStatSet Structure) identified by the StatSet parameter. The Force parameter is used to force the data values to be refreshed from their source.

The Force parameter works by resetting a switch held internally in the SPMI for all SpmiStatVals (SpmiStatVals Structure) and SpmiHotVals (SpmiHotVals Structure) structures, regardless of the SpmiStatSets and SpmiHotSets (SpmiHotSet Structure) to which they belong. Whenever the data value for a statistic is requested, this switch is checked. If the switch is set, the SPMI reads the latest data value from the original data source. If the switch is not set, the SPMI reads the data value stored for the SpmiStatVals structure. This mechanism allows a program to synchronize and minimize the number of times values are retrieved from the source. One method is to ensure the force request is not issued more than once per elapsed amount of time.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet as created by the SpmiCreateStatSet (SpmiCreateStatSet Subroutine) subroutine call.

Force

If set to true, forces a refresh from the original source before the SPMI reads the data values for the set. If set to false, causes the SPMI to read the data values as they were previously retrieved from the data source.

When the force argument is set true, the effect is that of marking all statistics known by the SPMI as obsolete, which causes the SPMI to refresh all requested statistics from kernel memory or other sources. As each statistic is refreshed, the obsolete mark is reset. Statistics that are not part of the StatSet specified in the subroutine call remain marked as obsolete. Therefore, if an application repetitively issues the SpmiGetStatSet and SpmiGetHotSet (SpmiGetHotSet Subroutine) subroutine calls for multiple statsets and hotsets, each time, only the first such call need set the force argument to true.

Return Values

The SpmiGetStatSet subroutine returns a value of 0 if successful. If unsuccessful, the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiGetValue Subroutine

Purpose

Returns a decoded value based on the type of data value extracted from the data field of an SpmiStatVals (SpmiStatVals Structure) structure.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

float SpmiGetValue(StatSet, StatVal)
struct SpmiStatSet *StatSet;
struct SpmiStatVals *StatVal;

Description

The SpmiGetValue subroutine performs the following steps:

  1. Verifies that an SpmiStatVals structure exists in the set of statistics identified by the StatSet parameter.
  2. Determines the format of the data field as being either SiFloat or SiLong and extracts the data value for further processing.
  3. Determines the data value as being of either type SiQuantity or type SiCounter.
  4. If the data value is of type SiQuantity, returns the val field of the SpmiStatVals structure.
  5. If the data value is of type SiCounter, returns the value of the val_change field of the SpmiStatVals structure divided by the elapsed number of seconds since the previous time a data value was requested for this set of statistics.

This subroutine call should only be issued after an SpmiGetStatSet (SpmiGetStatSet Subroutine) subroutine has been issued against the statset.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet, SpmiStatSet Structure, as created by the SpmiCreateStatSet, see SpmiCreateStatSet Subroutine, subroutine call.

StatVal

Specifies a pointer to a valid structure of type SpmiStatVals as created by the SpmiPathAddSetStat, SpmiPathAddSetStat Subroutine, subroutine call or returned by the SpmiFirstVals (SpmiFirstVals Subroutine) or SpmiNextVals (SpmiNextVals Subroutine) subroutine calls.

Return Values

The SpmiGetValue subroutine returns the decoded value if successful. If unsuccessful, the subroutine returns a negative value that has a numerical value of at least 1.1.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiInit Subroutine

Purpose

Initializes the SPMI for a local data consumer program.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiInit (TimeOut)
int TimeOut;

Description

The SpmiInit subroutine initializes the SPMI. During SPMI initialization, a memory segment is allocated and the application program obtains basic addressability to that segment. An application program must issue the SpmiInit subroutine call before issuing any other subroutine calls to the SPMI.

Note: The SpmiInit subroutine is automatically issued by the SpmiDdsInit (SpmiDdsInit Subroutine) subroutine call. Successive SpmiInit subroutine calls are ignored.

Note: If the calling program uses shared memory for other purposes, including memory mapping of files, the SpmiInit subroutine call must be issued before access is established to other shared memory areas.

The SPMI entry point called by the SpmiInit subroutine assigns a segment register to be used by the SPMI subroutines (and the application program) for accessing common shared memory and establishes the access mode to the common shared memory segment. After SPMI initialization, the SPMI subroutines are able to access the common shared memory segment in read-only mode.

Parameters

TimeOut

Specifies the number of seconds the SPMI waits for a Dynamic Data Supplier (DDS) program to update its shared memory segment. If a DDS program does not update its shared memory segment in the time specified, the SPMI assumes that the DDS program has terminated or disconnected from shared memory and removes all contexts and statistics added by the DDS program.

The SPMI saves the largest TimeOut value received from the programs that invoke the SPMI. The TimeOut value must be zero or must be greater than or equal to 15 seconds and less than or equal to 600 seconds. A value of zero overrides any other value from any other program that invokes the SPMI and disables the checking for terminated DDS programs.

Return Values

The SpmiInit subroutine returns a value of 0 if successful. If unsuccessful, the subroutine returns a nonzero value. If a nonzero value is returned, the application program should not attempt to issue additional SPMI subroutine calls.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiInstantiate Subroutine

Purpose

Explicitly instantiates the subcontexts of an instantiable context.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

int SpmiInstantiate(CxHandle)
SpmiCxHdl CxHandle;

Description

The SpmiInstantiate subroutine explicitly instantiates the subcontexts of an instantiable context. If the context is not instantiable, do not call the SpmiInstantiate subroutine.

An instantiation is done implicitly by the SpmiPathGetCx (SpmiPathGetCx Subroutine) and SpmiFirstCx (SpmiFirstCx Subroutine) subroutine calls. Therefore, application programs usually do not need to instantiate explicitly.

Parameters

CxHandle

Specifies a valid context handle SpmiCxHdl, see SpmiCxHdl Handle, as obtained by another subroutine call.

Return Values

The SpmiInstantiate subroutine returns a value of 0 if successful. If the context is not instantiable, the subroutine returns a nonzero value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiNextCx Subroutine

Purpose

Locates the next subcontext of a context.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiCxLink *SpmiNextCx(CxLink )struct SpmiCxLink *CxLink;

Description

The SpmiNextCx subroutine locates the next subcontext of a context, taking the context identified by the CxLink parameter as the current subcontext. The subroutine returns a NULL value if no further subcontexts are found.

The structure pointed to by the returned pointer contains an SpmiCxHdl (SpmiCxHdl Handle) handle to access the contents of the corresponding SpmiCx (SpmiCx Structure) structure through the SpmiGetCx (SpmiGetCx Subroutine) subroutine call.

Parameters

CxLink

Specifies a pointer to a valid SpmiCxLink, SpmiCxLink Structure, structure as obtained by a previous SpmiFirstCx, see SpmiFirstCx Subroutine, subroutine call.

Return Values

The SpmiNextCx subroutine returns a pointer to a structure of type SpmiCxLink if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiNextHot Subroutine

Purpose

Locates the next set of peer statistics (SpmiHotVals (SpmiHotVals Structure) structure) belonging to an SpmiHotSet (SpmiHotSet Structure).

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiHotVals *SpmiNextHot(HotSet, HotVals)
struct SpmiHotSet *HotSet;
struct SpmiHotVals *HotVals;

Description

The SpmiNextHot subroutine locates the next SpmiHotVals structure belonging to an SpmiHotSet, taking the set of peer statistics identified by the HotVals parameter as the current one. The subroutine returns a NULL value if no further SpmiHotVals structures are found. The SpmiNextHot subroutine should only be executed after a successful call to the SpmiGetHotSet (SpmiGetHotSet Subroutine) subroutine and (usually, but not necessarily) a call to the SpmiFirstHot (SpmiFirstHot Subroutine) subroutine and one or more subsequent calls to SpmiNextHot.

The subroutine allows the application programmer to position at the next set of peer statistics in preparation for using the SpmiNextHotItem (SpmiNextHotItem Subroutine) subroutine call to traverse this peer set's array of SpmiHotItems elements. Use of this subroutine is only necessary if it is desired to skip over some SpmiHotVals structures in an SpmiHotSet. Under most circumstances, the SpmiNextHotItem will be the sole means of accessing all elements of the SpmiHotItems arrays of all peer sets belonging to an SpmiHotSet.

Parameters

HotSet

Specifies a valid pointer to an SpmiHotSet, SpmiHotSet Structure, structure as obtained by a previous SpmiCreateHotSet subroutine call.

HotVals

Specifies a pointer to an SpmiHotVals, SpmiHotVals Structure, structure as returned by a previous SpmiFirstHot or SpmiNextHot subroutine call or as returned by an SpmiAddSetHot, see SpmiAddSetHot Subroutine, subroutine call.

Return Values

The SpmiNextHot subroutine returns a pointer to the next SpmiHotVals structure within the hotset. If no more SpmiHotVals structures are available, the subroutine returns a NULL value. A returned pointer may refer to a pseudo-hotvals structure as described in Programming Notes for the SpmiAddSetHot (SpmiAddSetHot Subroutine) subroutine.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For more information, see:


SpmiNextHotItem Subroutine

Purpose

Locates and decodes the next SpmiHotItems element at the current position in an SpmiHotSet (SpmiHotSet Structure).

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiHotVals *SpmiNextHotItem(HotSet, HotVals, index,
value, name)
struct SpmiHotSet *HotSet;
struct SpmiHotVals *HotVals;
int *index;
float *value;
char **name;

Description

The SpmiNextHotItem subroutine locates the next SpmiHotItems structure belonging to an SpmiHotSet, taking the element identified by the HotVals and index parameters as the current one. The subroutine returns a NULL value if no further SpmiHotItems structures are found. The SpmiNextHotItem subroutine should only be executed after a successful call to the SpmiGetHotSet (SpmiGetHotSet Subroutine) subroutine.

The SpmiNextHotItem subroutine is designed to be used for walking all SpmiHotItems elements returned by a call to the SpmiGetHotSet subroutine, visiting the SpmiHotVals (SpmiHotVals Structure) structures one by one. By feeding the returned value and the updated integer pointed to by index back to the next call, this can be done in a tight loop. Successful calls to SpmiNextHotItem will decode each SpmiHotItems element and return the data value in value and the name of the peer context that owns the corresponding statistic in name.

Parameters

HotSet

Specifies a valid pointer to an SpmiHotSet, SpmiHotSet Structure, structure as obtained by a previous SpmiCreateHotSet subroutine call.

HotVals

Specifies a pointer to an SpmiHotVals, SpmiHotVals Structure, structure as returned by a previousSpmiNextHotItem, SpmiFirstHot, or SpmiNextHot subroutine call or as returned by an SpmiAddSetHot (SpmiAddSetHot Subroutine) subroutine call. If this parameter is specified as NULL, the first SpmiHotVals structure of the SpmiHotSet is used and the index parameter is assumed to be set to zero, regardless of its actual value.

index

A pointer to an integer that contains the desired element number in the SpmiHotItems array of the SpmiHotVals structure specified by HotVals. A value of zero points to the first element. When the SpmiNextHotItem subroutine returns, the integer contain the index of the next SpmiHotItems element within the returned SpmiHotVals structure. If the last element of the array is decoded, the value in the integer will point beyond the end of the array, and the SpmiHotVals pointer returned will point to the peer set, which has now been completely decoded. By passing the returned SpmiHotVals pointer and the index parameter to the next call to SpmiNextHotItem, the subroutine will detect this and proceed to the first SpmiHotItems element of the next SpmiHotVals structure if one exists.

value

A pointer to a float variable. A successful call will return the decoded data value for the statistic. Before the value is returned, the SpmiNextHotItem function:

name

A pointer to a character pointer. A successful call will return a pointer to the name of the peer context for which the data value was read.

Return Values

The SpmiNextHotItem subroutine returns a pointer to the current SpmiHotVals structure within the hotset. If no more SpmiHotVals structures are available, the subroutine returns a NULL value. The structure returned contains the data, such as threshold, which may be relevant for presentation of the results of an SpmiGetHotSet subroutine call to end-users. A returned pointer may refer to a pseudo-hotvals structure as described in Programming Notes for the SpmiAddSetHot (SpmiAddSetHot Subroutine) subroutine.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For more information, see:


SpmiNextStat Subroutine

Purpose

Locates the next statistic belonging to a context.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStatLink *SpmiNextStat(StatLink)
struct SpmiStatLink *StatLink;

Description

The SpmiNextStat subroutine locates the next statistic belonging to a context, taking the statistic identified by the StatLink parameter as the current statistic. The subroutine returns a NULL value if no further statistics are found.

The structure pointed to by the returned pointer contains an SpmiStatHdl (SpmiStatHdl Handle) handle to access the contents of the corresponding SpmiStat (SpmiStat Structure) structure through the SpmiGetStat (SpmiGetStat Subroutine) subroutine call.

Parameters

StatLink

Specifies a valid pointer to a SpmiStatLink, SpmiStatLink Structure, structure as obtained by a previous SpmiFirstStat, see SpmiFirstStat Subroutine, subroutine call.

Return Values

The SpmiNextStat subroutine returns a pointer to a structure of type SpmiStatLink if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiNextVals Subroutine

Purpose

Returns a pointer to the next SpmiStatVals (SpmiStatVals Structure) structure in a set of statistics.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStatVals *SpmiNextVals(StatSet, StatVal)
struct SpmiStatSet *StatSet;
struct SpmiStatVals *StatVal;

Description

The SpmiNextVals subroutine returns a pointer to the next SpmiStatVals structure in a set of statistics, taking the structure identified by the StatVal parameter as the current structure. The SpmiStatVals structures are accessed in reverse order so the statistic added before the current one is returned. This subroutine call should only be issued after an SpmiGetStatSet (SpmiGetStatSet Subroutine) subroutine has been issued against the statset.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet, SpmiStatSet Structure, as created by the SpmiCreateStatSet, see SpmiCreateStatSet Subroutine, subroutine call.

StatVal

Specifies a pointer to a valid structure of type SpmiStatVals as created by the SpmiPathAddSetStat, SpmiPathAddSetStat Subroutine, subroutine call or returned by a previous SpmiFirstVals, SpmiFirstVals Subroutine, or SpmiNextVals, SpmiNextVals Subroutine, subroutine call.

Return Values

The SpmiNextVals subroutine returns a pointer to a SpmiStatVals structure if successful. If unsuccessful, the subroutine returns a NULL value.


Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiNextValue Subroutine

Purpose

Returns either the first SpmiStatVals (SpmiStatVals Structure) structure in a set of statistics or the next SpmiStatVals structure in a set of statistics and a decoded value based on the type of data value extracted from the data field of an SpmiStatVals structure.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStatVals*SpmiNextValue( StatSet, StatVal, value)
struct SpmiStatSet *StatSet;
struct SpmiStatVals *StatVal;
float *value;

Description

Instead of issuing subroutine calls to SpmiFirstVals (SpmiFirstVals Subroutine)/ SpmiNextVals (SpmiNextVals Subroutine) (to get the first or next SpmiStatVals structure) followed by calls to SpmiGetValue (SpmiGetValue Subroutine) (to get the decoded value from the SpmiStatVals structure), the SpmiNextValue subroutine returns both in one call. This subroutine call returns a pointer to the first SpmiStatVals structure belonging to the StatSet parameter if the StatVal parameter is NULL. If the StatVal parameter is not NULL, the next SpmiStatVals structure is returned, taking the structure identified by the StatVal parameter as the current structure. The data value corresponding to the returned SpmiStatVals structure is decoded and returned in the field pointed to by the value argument. In decoding the data value, the subroutine does the following:

Note: This subroutine call should only be issued after an SpmiGetStatSet (SpmiGetStatSet Subroutine) subroutine has been issued against the statset.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet as created by the SpmiCreateStatSet, see SpmiCreateStatSet Subroutine, subroutine call.

StatVal

Specifies either a NULL pointer or a pointer to a valid structure of type SpmiStatVals as created by the SpmiPathAddSetStat, see SpmiPathAddSetStat Subroutine, subroutine call or returned by a previous SpmiNextValue subroutine call. If StatVal is NULL, then the first SpmiStatVals pointer belonging to the set of statistics pointed to by StatSet is returned.

valueA pointer used to return a decoded value based on the type of data value extracted from the data field of the returned SpmiStatVals structure.

Return Value

The SpmiNextValue subroutine returns a pointer to a SpmiStatVals structure if successful. If unsuccessful, the subroutine returns a NULL value.

If the StatVal parameter is:

NULL
The first SpmiStatVals structure belonging to the StatSet parameter is returned.

not NULL
The next SpmiStatVals structure after the structure identified by the StatVal parameter is returned and the value parameter is used to return a decoded value based on the type of data value extracted from the data field of the returned SpmiStatVals structure.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Programming Notes

The SpmiNextValue subroutine maintains internal state information so that retrieval of the next data value from a statset can be done without traversing linked lists of data structures. The stats information is kept separate for each process, but is shared by all threads of a process.

If the subroutine is accessed from multiple threads, the state information is useless and the performance advantage is lost. The same is true if the program is simultaneously accessing two or more statsets. To benefit from the performance advantage of the SpmiNextValue subroutine, a program should retrieve all values in order from one stat set before retrieving values from the next statset.

The implementation of the subroutine allows a program to retrieve data values beginning at any point in the statset if the SpmiStatVals pointer is known. Doing so will cause a linked list traversal. If subsequent invocations of SpmiNextValue uses the value returned from the first and following invocation as their second argument, the traversal of the link list can be avoided.

It should be noted that the value returned by a successful SpmiNextValue invocation is always the pointer to the SpmiStatVals structure whose data value is decoded and returned in the value argument.

Implementation Specifics

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiPathAddSetStat Subroutine

Purpose

Adds a statistics value to a set of statistics.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

struct SpmiStatVals *SpmiPathAddSetStat(StatSet, StatName,
Parent)
struct SpmiStatSet *StatSet;
char *StatName;
SpmiCxHdl Parent;

Description

The SpmiPathAddSetStat subroutine adds a statistics value to a set of statistics. The SpmiStatSet (SpmiStatSet Structure) structure that provides the anchor point to the set must exist before the SpmiPathAddSetStat subroutine call can succeed.

Parameters

StatSet

Specifies a pointer to a valid structure of type SpmiStatSet as created by the SpmiCreateStatSet, see SpmiCreateStatSet Subroutine, subroutine call.

StatName

Specifies the name of the statistic within the context identified by the Parent parameter.If the Parent parameter is NULL, you must specify the fully qualified path name of the statistic in the StatName parameter.

Parent

Specifies either a valid SpmiCxHdl, SpmiCxHdl Handle, handle as obtained by another subroutine call or a NULL value.

Return Values

The SpmiPathAddSetStat subroutine returns a pointer to a structure of type SpmiStatVals (SpmiStatVals Structure) if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiPathGetCx Subroutine

Purpose

Returns a handle to use when referencing a context.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h

SpmiCxHdl SpmiPathGetCx(CxPath, Parent)
char *CxPath;
SpmiCxHdl Parent;

Description

The SpmiPathGetCx subroutine searches the context hierarchy for a given path name of a context and returns a handle to use when subsequently referencing the context.

Parameters

CxPath

Specifies the path name of the context to find. If you specify the fully qualified path name in the CxPath parameter, you must set the Parent parameter to NULL. If the path name is not qualified or is only partly qualified (that is, if it does not include the names of all contexts higher in the data hierarchy), the SpmiPathGetCx subroutine begins searching the hierarchy at the context identified by the Parent parameter. If the CxPath parameter is either NULL or an empty string, the subroutine returns a handle identifying the Top context.

Parent

Specifies the anchor context that fully qualifies the CxPath parameter. If you specify a fully qualified path name in the CxPath parameter, you must set the Parent parameter to NULL.

Return Values

The SpmiPathGetCx subroutine returns a handle to a context if successful. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


SpmiStatGetPath Subroutine

Purpose

Returns the full path name of a statistic.

Library

SPMI Library (libSpmi.a)

Syntax

#include sys/Spmidef.h>

char *miStatGetPath(Parent, StatHandle, MaxLevels)
SpmiCxHdlSp Parent;
SpmiStatHdl StatHandle;
int  MaxLevels;

Description

The SpmiStatGetPath subroutine returns the full path name of a statistic, given a parent context SpmiCxHdl (SpmiCxHdl Handle) handle and a statistics SpmiStatHdl (SpmiStatHdl Handle) handle. The MaxLevels parameter can limit the number of levels in the hierarchy that must be searched to generate the path name of the statistic.

The memory area pointed to by the returned pointer is freed when the SpmiStatGetPath subroutine call is repeated. For each invocation of the subroutine, a new memory area is allocated and its address returned.If the calling program needs the returned character string after issuing the SpmiStatGetPath subroutine call, the program must copy the returned string to locally allocated memory before reissuing the subroutine call.

Parameters

Parent

Specifies a valid SpmiCxHdl handle as obtained by another subroutine call.

StatHandle

Specifies a valid SpmiStatHdl handle as obtained by another subroutine call. This handle must point to a statistic belonging to the context identified by the Parent parameter.

MaxLevels

Limits the number of levels in the hierarchy that must be searched to generate the path name. If this parameter is set to 0, no limit is imposed.

Return Values

If successful, the SpmiStatGetPath subroutine returns a pointer to a character array containing the full path name of the statistic. If unsuccessful, the subroutine returns a NULL value.

Error Codes

All SPMI subroutines use external variables to provide error information. To access these variables, an application program must define the following external variables:

If the subroutine returns without an error, the SpmiErrno variable is set to 0 and the SpmiErrmsg character array is empty. If an error is detected, the SpmiErrno variable returns an error code, as defined in the sys/Spmidef.h file, and the SpmiErrmsg variable contains text, in English, explaining the cause of the error. See the List of SPMI Error Codes for more information.

Implementation Specifics

This subroutine is part of the server option of the Performance Aide for AIX licensed product and is also included in the Performance Toolbox for AIX licensed product.

Files


/usr/include/sys/Spmidef.h Declares the subroutines, data structures, handles, and macros that an application program can use to access the SPMI.

Related Information

For related information, see:


[ Previous | Next | Table of Contents | Index | Library Home | Legal | ]