perfstat_hfistat Subroutine
Purpose
Retrieves the Host Fabric Interface (HFI) performance statistics.
Library
Perfstat Library (libperfstat.a)
Syntax
#include <libperfstat.h>
int perfstat_hfistat (name,userbuff,sizeof_userbuff,desired_number )
perfstat_id_t* name;
perfstat_hfistat_t* userbuff;
int sizeof_userbuff;
int desired_number;
Description
The perfstat_hfistat subroutine returns the HFI performance statistics that correspond to a specified Host Fabric Interface.
To get the number of available HFI in the system, the name parameter and the userbuff parameter must be specified as NULL, sizeof_userbuff must equal the sizeof (perfstat_hfistat_t) subroutine and the value of the desired_number parameter must be set to zero.
To get one or more sets of HFI performance metrics, set the name parameter to the name of the first HFI for which the statistics is desired, and set the desired_number parameter. The userbuff parameter must be allocated.
Parameters
Item | Description |
---|---|
name | Contains either FIRST_HFI, or a name that identified the first HFI for which statistics is desired. For example: hfi0 and hfi1. |
userbuff | Points to the memory area to be filled with one or more perfstat_hfistat_t structures. |
sizeof_userbuff | Specifies the size of the perfstat_hfistat_t structure (sizeof (perfstat_hfistat_t)). |
desired_number | Specifies the number of perfstat_hfistat_t structures to copy to the userbuff. |
Return Values
Unless the subroutine is used to retrieve the number of available structures, the number of structures filled is returned upon successful completion. If unsuccessful, a value of -1 is returned and the errno global variable is set.
Error Codes
The subroutine is unsuccessful if the following is true:
Item | Description |
---|---|
EINVAL | One of the parameters is not valid. |
ENOENT | HFI statistics collection is currently not available. |
Files
The libperfstat.h file defines standard macros, data types, and subroutines.